address
, string
, uint32
, address[]
(at the beginning of each 32-byte string, for convenience, its hexadecimal address is relative to the beginning of the block). 000:000000000000000000000000570f5d143ee469d12dc29bf8b3345fa5536476d9 020:0000000000000000000000000000000000000000000000000000000000000080 040:0000000000000000000000000000000000000000000000000000000000001234 060:00000000000000000000000000000000000000000000000000000000000000c0 080:0000000000000000000000000000000000000000000000000000000000000003 0a0:4e65770000000000000000000000000000000000000000000000000000000000 0c0:0000000000000000000000000000000000000000000000000000000000000002 0e0:000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 100:000000000000000000000000bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
0570f5d143ee469d12dc29bf8b3345fa5536476d9
is transmitted.string
- 0x80
bytes from the beginning of the block.01234
.address[]
- 0xc0
bytes from the beginning of the block.string
- 3
is transmitted.string
- the word New
.address[]
- 2
is transmitted.address[]
is 0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- 0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
.address[]
- 0bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
is 0bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
.personal_newAccount
method, as a parameter to which the password is transmitted, which will later be used to unlock the account: {"jsonrpc":"2.0","method":"personal_newAccount","params":["PASSWORD"],"id":1}
0xfbeda9914b78b58a0f0e810298f9d545f8379f8d
. {"jsonrpc":"2.0","id":1,"result":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d"}
0xfbeda9914b78b58a0f0e810298f9d545f8379f8d
. {"jsonrpc":"2.0","method":"personal_unlockAccount","params":["0xfbeda9914b78b58a0f0e810298f9d 545f8379f8d", "PASSWORD", 600],"id":1} {"jsonrpc":"2.0","id":1,"result":true}
6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e657700000 000000000000000000000000000000000000000000000000000008152506000908051906020019061 005b929190610062565b505b610107565b82805460018160011615610100020316600290049060005 2602060002090601f016020900481019282601f106100a357805160ff19168380011785556100d1565b 828001600101855582156100d1579182015b828111156100d05782518255916020019190600101906 100b5565b5b5090506100de91906100e2565b5090565b61010491905b8082111561010057600081600 09055506001016100e8565b5090565b90565b6101b6806101166000396000f30060606040526000357 c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063abd95b 951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b604051808060200182810 3825283818151815260200191508051906020019080838360005b8381101561009257808201518184 01525b602081019050610076565b50505050905090810190601f1680156100bf578082038051600183 6020036101000a031916815260200191505b509250505060405180910390f35b6100d5610176565b60 008054600181600116156101000203166002900480601f016020809104026020016040519081016040 52809291908181526020018280546001816001161561010002031660029004801561016b5780601f10 6101405761010080835404028352916020019161016b565b820191906000526020600020905b81548 152906001019060200180831161014e57829003601f168201915b505050505090505b90565b6020604 051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb543832301a980 e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029
eth_getTransactionByHash
method. In our example, the “cloned” smart contract was created by the transaction 0xc4d20bb8f9eede45968fc6bc850397e92b9f263eeb11200615cc08562d46c2e7
. {"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xc4d20bb8f9eede45968fc6bc850 397e92b9f263eeb11200615cc08562d46c2e7"],"id":1}
input
tag contains the contract bytecode. {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x731f202b0232de8c474c71677b29868f65802c068d0d e31b17bec09f3e31144c", "blockNumber":"0xbad3f", "from":"0x17eafa57fd812968d90aecc5a51e330e2e1c11a3", "gas":"0x31b2e", "gasPrice":"0x9c7652400", "hash":"0xc4d20bb8f9eede45968fc6bc850397e92b9f263eeb11200615cc08562d46c2e7", "input":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e 657700000000000000000000000000000000000000000000000000000000008152506000908051906 020019061005b929190610062565b505b610107565b82805460018160011615610100020316600290 0490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556 100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190 600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b8082111561010057 60008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f30060606040 526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168 063abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b604051808060 2001828103825283818151815260200191508051906020019080838360005b8381101561009257808 20151818401525b602081019050610076565b50505050905090810190601f1680156100bf578082038 0516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d5610 176565b60008054600181600116156101000203166002900480601f016020809104026020016040519 08101604052809291908181526020018280546001816001161561010002031660029004801561016b 5780601f106101405761010080835404028352916020019161016b565b820191906000526020600020 905b81548152906001019060200180831161014e57829003601f168201915b505050505090505b9056 5b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb5438 32301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029", "nonce":"0x30", "to":null, "transactionIndex":"0x2", "value":"0x0", "v":"0x2c", "r":"0x577865931aac644a3eefb83b59344caeab9e2970cfeb1bef02837b1bb4bccca0", "s":"0x48013e0c5ca3bff66fa7e19ebbcd9eaed63bc0a45004041c310f9fc4dfc5e5e8"}}
0x9c7652400 "," hash ":" 0xc4d20bb8f9eede45968fc6bc850397e92b9f263eeb11200615cc08562d46c2e7 "," input ":" 0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x731f202b0232de8c474c71677b29868f65802c068d0d e31b17bec09f3e31144c", "blockNumber":"0xbad3f", "from":"0x17eafa57fd812968d90aecc5a51e330e2e1c11a3", "gas":"0x31b2e", "gasPrice":"0x9c7652400", "hash":"0xc4d20bb8f9eede45968fc6bc850397e92b9f263eeb11200615cc08562d46c2e7", "input":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e 657700000000000000000000000000000000000000000000000000000000008152506000908051906 020019061005b929190610062565b505b610107565b82805460018160011615610100020316600290 0490600052602060002090601f016020900481019282601f106100a357805160ff19168380011785556 100d1565b828001600101855582156100d1579182015b828111156100d05782518255916020019190 600101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b8082111561010057 60008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f30060606040 526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168 063abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b604051808060 2001828103825283818151815260200191508051906020019080838360005b8381101561009257808 20151818401525b602081019050610076565b50505050905090810190601f1680156100bf578082038 0516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d5610 176565b60008054600181600116156101000203166002900480601f016020809104026020016040519 08101604052809291908181526020018280546001816001161561010002031660029004801561016b 5780601f106101405761010080835404028352916020019161016b565b820191906000526020600020 905b81548152906001019060200180831161014e57829003601f168201915b505050505090505b9056 5b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb5438 32301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029", "nonce":"0x30", "to":null, "transactionIndex":"0x2", "value":"0x0", "v":"0x2c", "r":"0x577865931aac644a3eefb83b59344caeab9e2970cfeb1bef02837b1bb4bccca0", "s":"0x48013e0c5ca3bff66fa7e19ebbcd9eaed63bc0a45004041c310f9fc4dfc5e5e8"}}
eth_estimateGas
method is eth_estimateGas
, in the parameters of which you must specify the account number ( from
tag) from which the contract will be created, as well as the contract byte code ( data
tag). The answer will indicate the required number of Gas.data
tag immediately after the bytecode. Otherwise, the calculation of Gas will be incorrect. {"jsonrpc":"2.0","method":"eth_estimateGas","params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "data":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 577000000000000000000000000000000000000000000000000000000000081525060009080519060 20019061005b929190610062565b505b610107565b828054600181600116156101000203166002900 490600052602060002090601f016020900481019282601f106100a357805160ff191683800117855561 00d1565b828001600101855582156100d1579182015b828111156100d057825182559160200191906 00101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b80821115610100576 0008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f300606060405 26000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680 63abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b6040518080602 001828103825283818151815260200191508051906020019080838360005b83811015610092578082 0151818401525b602081019050610076565b50505050905090810190601f1680156100bf5780820380 516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d56101 76565b60008054600181600116156101000203166002900480601f0160208091040260200160405190 8101604052809291908181526020018280546001816001161561010002031660029004801561016b5 780601f106101405761010080835404028352916020019161016b565b8201919060005260206000209 05b81548152906001019060200180831161014e57829003601f168201915b505050505090505b90565 b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb54383 2301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029" }], "id":1} {"jsonrpc":"2.0","id":1,"result":"0x31b2e"}
, "method": "eth_estimateGas", "params": [{ "from": "0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "data": "0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 {"jsonrpc":"2.0","method":"eth_estimateGas","params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "data":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 577000000000000000000000000000000000000000000000000000000000081525060009080519060 20019061005b929190610062565b505b610107565b828054600181600116156101000203166002900 490600052602060002090601f016020900481019282601f106100a357805160ff191683800117855561 00d1565b828001600101855582156100d1579182015b828111156100d057825182559160200191906 00101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b80821115610100576 0008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f300606060405 26000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680 63abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b6040518080602 001828103825283818151815260200191508051906020019080838360005b83811015610092578082 0151818401525b602081019050610076565b50505050905090810190601f1680156100bf5780820380 516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d56101 76565b60008054600181600116156101000203166002900480601f0160208091040260200160405190 8101604052809291908181526020018280546001816001161561010002031660029004801561016b5 780601f106101405761010080835404028352916020019161016b565b8201919060005260206000209 05b81548152906001019060200180831161014e57829003601f168201915b505050505090505b90565 b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb54383 2301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029" }], "id":1} {"jsonrpc":"2.0","id":1,"result":"0x31b2e"}
eth_sendTransaction
method. The following parameters are passed to the method:from
tag);gas
tag, taken from the previous paragraph);data
tag must completely coincide with that used in the previous paragraph). {"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "gas":"0x31b2e", "data":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 577000000000000000000000000000000000000000000000000000000000081525060009080519060 20019061005b929190610062565b505b610107565b828054600181600116156101000203166002900 490600052602060002090601f016020900481019282601f106100a357805160ff191683800117855561 00d1565b828001600101855582156100d1579182015b828111156100d057825182559160200191906 00101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b80821115610100576 0008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f300606060405 26000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680 63abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b6040518080602 001828103825283818151815260200191508051906020019080838360005b83811015610092578082 0151818401525b602081019050610076565b50505050905090810190601f1680156100bf5780820380 516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d56101 76565b60008054600181600116156101000203166002900480601f0160208091040260200160405190 8101604052809291908181526020018280546001816001161561010002031660029004801561016b5 780601f106101405761010080835404028352916020019161016b565b8201919060005260206000209 05b81548152906001019060200180831161014e57829003601f168201915b505050505090505b90565 b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb54383 2301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029" }], "id":1}
, "method": "eth_sendTransaction", "params": [{ "from": "0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "gas": "0x31b2e", "data": "0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 {"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "gas":"0x31b2e", "data":"0x6060604052341561000f57600080fd5b5b6040805190810160405280600381526020017f4e6 577000000000000000000000000000000000000000000000000000000000081525060009080519060 20019061005b929190610062565b505b610107565b828054600181600116156101000203166002900 490600052602060002090601f016020900481019282601f106100a357805160ff191683800117855561 00d1565b828001600101855582156100d1579182015b828111156100d057825182559160200191906 00101906100b5565b5b5090506100de91906100e2565b5090565b61010491905b80821115610100576 0008160009055506001016100e8565b5090565b90565b6101b6806101166000396000f300606060405 26000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680 63abd95b951461003e575b600080fd5b341561004957600080fd5b6100516100cd565b6040518080602 001828103825283818151815260200191508051906020019080838360005b83811015610092578082 0151818401525b602081019050610076565b50505050905090810190601f1680156100bf5780820380 516001836020036101000a031916815260200191505b509250505060405180910390f35b6100d56101 76565b60008054600181600116156101000203166002900480601f0160208091040260200160405190 8101604052809291908181526020018280546001816001161561010002031660029004801561016b5 780601f106101405761010080835404028352916020019161016b565b8201919060005260206000209 05b81548152906001019060200180831161014e57829003601f168201915b505050505090505b90565 b6020604051908101604052806000815250905600a165627a7a723058208ce8782af87268eb0fb54383 2301a980e57bdb35f0a3cdbfe8f2ece20d9a3eaa0029" }], "id":1}
{"jsonrpc":"2.0","id":1,"result":"0x26cd429a43bc2f706f206fa6a536374cc7bf0e5090f0ed9b8f30ded71 73529f5"}
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"authentication needed: password or unlock"}}
eth_getTransactionReceipt
method is used for eth_getTransactionReceipt
: {"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x26cd429a43bc2f706f206fa6a53 6374cc7bf0e5090f0ed9b8f30ded7173529f5"],"id":1}
{"jsonrpc":"2.0","id":1,"result":null}
contractAddress
tag which will contain the address of the created smart contract: {"jsonrpc":"2.0", "id":1, "result":{"blockHash":"0x3afdc600435caebebb91497f01372c3ad6ac712c37fe9b1028445d8b41a58fca" , "blockNumber":"0xc4b16", "contractAddress":"0x2af49c8a413ea4b66ca8fd872befa9d1c8d22562", "cumulativeGasUsed":"0x31b2d", "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "gasUsed":"0x31b2d","logs":[], "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000", "root":"0x47b6297fef6ba21c45ea845a6fba19ddb144d957f600cfe7230e05f0f711ac12", "to":null, "transactionHash":"0x26cd429a43bc2f706f206fa6a536374cc7bf0e5090f0ed9b8f30ded7173529f5", "transactionIndex":"0x0"}}
eth_getCode
method — getting the contract code by its address: {"jsonrpc":"2.0","method":"eth_getCode","params":["0x2af49c8a413ea4b66ca8fd872befa9d1c8d2256 2", "latest" ],"id":1}
{"jsonrpc":"2.0","id":1,"result":"0x"}
0x
, then the contract is created successfully. pragma solidity ^0.4.9; contract Test { address Owner ; address Seller ; address Bank ; address BankCert ; string Status ; function Test(address seller_, address bank_) { Owner=msg.sender ; Seller=seller_ ; Bank=bank_ ; Status="New" ; } // 0xabd95b95 function GetStatus() constant returns (address, address, string retVal) { return(Seller, Bank, Status) ; } // 0x1bb71149 function SetBankCert(address cert) { if(msg.sender!=Bank) return ; BankCert=cert ; Status="Confirmed" ; } }
Test
), the address of the Seller ( seller_
) and the address of the Bank ( bank_
) are bank_
. The GetStatus
method returns the address of the Seller, the Bank and the current status of the contract. The SetBankCert
method SetBankCert
intended to store in the contract some digital identifier with a transfer to the “Confirmed” status. 6060604052341561000f57600080fd5b60405160408061064383398101604052808051906020019091 9080519060200190919050505b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908 373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173fffffffffffffffffffffffffffffffff fffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffff ffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604080519081016040 5280600381526020017f4e657700000000000000000000000000000000000000000000000000000000 008152506004908051906020019061014292919061014b565b505b50506101f0565b82805460018160 0116156101000203166002900490600052602060002090601f016020900481019282601f1061018c57 805160ff19168380011785556101ba565b828001600101855582156101ba579182015b828111156101 b957825182559160200191906001019061019e565b5b5090506101c791906101cb565b5090565b6101 ed91905b808211156101e95760008160009055506001016101d1565b5090565b90565b610444806101 ff6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000 000000000900463ffffffff1680631bb7114914610049578063abd95b9514610082575b600080fd5b34156 1005457600080fd5b610080600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061017 7565b005b341561008d57600080fd5b610095610264565b604051808473ffffffffffffffffffffffffffffffffffffffff1 673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffff fffffffffffffff1681526020018060200182810382528381815181526020019150805190602001908083836 0005b8381101561013a5780820151818401525b60208101905061011e565b505050509050908101906 01f1680156101675780820380516001836020036101000a031916815260200191505b5094505050505 060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffff ffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156101d357610261565b80600360006101 000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506 040805190810160405280600981526020017f436f6e6669726d6564000000000000000000000000000 00000000000000000008152506004908051906020019061025f92919061035f565b505b50565b60008 061026f6103df565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002600090549 06101000a900473ffffffffffffffffffffffffffffffffffffffff16600480805460018160011615610100020316600290 0480601f01602080910402602001604051908101604052809291908181526020018280546001816001 161561010002031660029004801561034c5780601f1061032157610100808354040283529160200191 61034c565b820191906000526020600020905b81548152906001019060200180831161032f57829003 601f168201915b505050505090509250925092505b909192565b828054600181600116156101000203 166002900490600052602060002090601f016020900481019282601f106103a057805160ff191683800 11785556103ce565b828001600101855582156103ce579182015b828111156103cd578251825591602 0019190600101906103b2565b5b5090506103db91906103f3565b5090565b602060405190810160405 280600081525090565b61041591905b808211156104115760008160009055506001016103f9565b509 0565b905600a165627a7a72305820554a2d34ed0a4ad399f7464c8b29ba8c619e7f5de89746021f5aded 9516dd1860029
0x794ce6de39fa2d274438cc1692db04dfb5bea836
and the address of the Bank 0xfbeda9914 b78b58a0f0e810298f9d545f8379f8d
when creating a smart contract will look like this (the contract byte code ends with 0029
): 60606040...94000029000000000000000000000000794ce6de39fa2d274438cc1692db04dfb5bea8360 00000000000000000000000fbeda9914b78b58a0f0e810298f9d545f8379f8d
0x3d20e579f5befdc7d3f589adb6155f684d9a751c
.GetStatus
method of a demo contract, the description will be GetStatus()
, and for the SetBankCert
method - SetBankCert(address)
. Special attention should be paid to the absence of gaps in the description - there were sad precedents: (.web3_sha3
method is web3_sha3
, and the string value should be given in hexadecimal representation (for GetStatus()
this will be 0x4765745374617475732829
): {"jsonrpc":"2.0","method":"web3_sha3","params":["0x4765745374617475732829"],"id":1} {"jsonrpc":"2.0","id":1,"result":"0xabd95b950242a279866243fa2b8fec5adddf6560d4e1b4f8745cfe7b5 7786865"}
GetStatus
method will be 0xabd95b95
, for the SetBankCert
method SetBankCert
identifier is 0x1bb71149
.eth_call
can be used. {"jsonrpc":"2.0","method":"eth_call","params":[{"to":< >, "data":< >},"latest"],"id":1}
< >
is formed as follows:< >< >
< >
are formed as indicated in the “Package of parameters and return data” section.< >
block consists only of the method identifier.GetStatus
method of the GetStatus
Demo Contract, use the query: {"jsonrpc":"2.0", "method":"eth_call", "params":[{"to":"0x3d20e579f5befdc7d3f589adb6155f684d9a751c", "data":"0xabd95b95"}, "latest"],"id":1}
{"jsonrpc":"2.0", "id":1, "result":"0x000000000000000000000000794ce6de39fa2d274438cc1692db04dfb5bea8360000000000 00000000000000fbeda9914b78b58a0f0e810298f9d545f8379f8d000000000000000000000000000000 000000000000000000000000000000006000000000000000000000000000000000000000000000000 000000000000000034e65770000000000000000000000000000000000000000000000000000000000" }
GetStatus
method - function getStatus (), returns (address, address, string retVal). 000:000000000000000000000000794ce6de39fa2d274438cc1692db04dfb5bea836 020:000000000000000000000000fbeda9914b78b58a0f0e810298f9d545f8379f8d 040:0000000000000000000000000000000000000000000000000000000000000060 060:0000000000000000000000000000000000000000000000000000000000000003 080:4e65770000000000000000000000000000000000000000000000000000000000
address
) - 0x794ce6de39fa2d274438cc1692db04dfb5bea836
address
type) - 0xfbeda9914b78b58a0f0e810298f9d545f8379f8d
string
) - the block starts at address 060New
eth_sendTransaction
must be used. {"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{ "from":< >, "to":< >, "gas":< >, "data":< > }], "id":1}
< >
must have a balance sufficient to pay < >
. In addition, it should be borne in mind that the contract may contain internal conditions for controlling the < >
, as, for example, in the SetBankCert
method of our demo contract.< >
is formed as follows:< >< >
< >
are formed as specified in the paragraph “Packing of parameters and returned data”.< >
block consists only of the method identifier.SetBankCert("0f7b0f8870a5596a7b57dd3e035550aeb5af16607")
-, < >
:0x1bb71149000000000000000000000000f7b0f8870a5596a7b57dd3e035550aeb5af16607
.eth_estimateGas
, , eth_sendTransaction
. {"jsonrpc":"2.0","method":"eth_estimateGas","params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "to":"0x3d20e579f5befdc7d3f589adb6155f684d9a751c", "data":"0x1bb71149000000000000000000000000f7b0f8870a5596a7b57dd3e035550aeb5af16607" }],"id":1} {"jsonrpc":"2.0","id":1,"result":"0xd312"}
0200000
.eth_sendTransaction
: {"jsonrpc":"2.0", "method":"eth_sendTransaction", "params":[{ "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "to":"0x3d20e579f5befdc7d3f589adb6155f684d9a751c", "gas":"0xd312", "data":"0x1bb71149000000000000000000000000f7b0f8870a5596a7b57dd3e035550aeb5af16607" }],"id":1}
{"jsonrpc":"2.0","id":1,"result":"0xe55c9fe8f816f5730053fc491ea27acfd83c615b6623d06f25fb281fea 750f3c"}
{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xe55c9fe8f816f5730053fc491ea2 7acfd83c615b6623d06f25fb281fea750f3c"],"id":1}
{"jsonrpc":"2.0", "id":1, "result":{"blockHash":"0xd8bb4a0b0ca3a598a69786f2f40876d547a672044fc8d961ec22da60606fa2fb" , "blockNumber":"0xc4b6f", "contractAddress":null, "cumulativeGasUsed":"0x459e5", "from":"0xfbeda9914b78b58a0f0e810298f9d545f8379f8d", "gasUsed":"0xd311", "logs":[], "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000", "root":"0x75f6823221a4f0e4f80dfa6c7ccfc961c7522833aac959d6a398537730a62041", "to":"0x3d20e579f5befdc7d3f589adb6155f684d9a751c", "transactionHash":"0xe55c9fe8f816f5730053fc491ea27acfd83c615b6623d06f25fb281fea750f3c", "transactionIndex":"0x1"}}
000:000000000000000000000000794ce6de39fa2d274438cc1692db04dfb5bea836 020:000000000000000000000000fbeda9914b78b58a0f0e810298f9d545f8379f8d 040:0000000000000000000000000000000000000000000000000000000000000060 050:0000000000000000000000000000000000000000000000000000000000000009 060:436f6e6669726d65640000000000000000000000000000000000000000000000
Source: https://habr.com/ru/post/338172/
All Articles