diff --git a/docs/Reference/API-Methods.md b/docs/Reference/API-Methods.md index c08269eadbd..831b70ee055 100644 --- a/docs/Reference/API-Methods.md +++ b/docs/Reference/API-Methods.md @@ -1855,6 +1855,27 @@ the `eth_call` error response includes the [revert reason](../HowTo/Send-Transac } ``` +!!! example "Example of a simulated contract creation" + + The following example creates a simulated contract by not including the `to` parameter from the [transaction call object](API-Objects.md#transaction-call-object) in the `call` parameter. + Besu simulates the data to create the contract. + + === "curl HTTP" + + ```bash + curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "data":"0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b5061021e806100606000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd576146100ae575b600080fd5b61004e6100dc565b6040518082815260200191505060405180910390f35b61006c6100e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610107565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101b76033913960400191505060405180910390fd5b806001819055505056fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582007302f208a10686769509b529e1878bda1859883778d70dedd1844fe790c9bde64736f6c63430005100032","gas":"0x439cf","gasPrice":"0x0"},"latest"],"id":53}' http://127.0.0.1:8545 + ``` + + === "JSON result" + + ```json + { + "jsonrpc": "2.0", + "id": 53, + "result": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd576146100ae575b600080fd5b61004e6100dc565b6040518082815260200191505060405180910390f35b61006c6100e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610107565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101b76033913960400191505060405180910390fd5b806001819055505056fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582007302f208a10686769509b529e1878bda1859883778d70dedd1844fe790c9bde64736f6c63430005100032" + } + ``` + ### `eth_chainId` Returns the [chain ID](../Concepts/NetworkID-And-ChainID.md). diff --git a/docs/Reference/API-Objects.md b/docs/Reference/API-Objects.md index c8fc1e3cdbd..8654229fd25 100644 --- a/docs/Reference/API-Objects.md +++ b/docs/Reference/API-Objects.md @@ -217,10 +217,7 @@ and Parameter for [`eth_call`](API-Methods.md#eth_call) and [`eth_estimateGas`](API-Methods.md#eth_estimategas). -!!! note - - All transaction call object parameters are optional for [`eth_estimateGas`](API-Methods.md#eth_estimategas). - Only the `to` parameter is required for [`eth_call`](API-Methods.md#eth_call). +All transaction call object parameters are optional. | Key | Type | Value | |-----|:----:|-------|