Simulate Transaction - cgp_simulateTransaction
Prepare to embark on an expedition into the heart of blockchain transactions with the cgp_simulateTransaction
method—an extraordinary tool that empowers you to decode the cryptic language of the blockchain.
Method Payload Signature:
[
// Either raw tx or unsigned TransactionArgs message
{
"from":"0x9718eCd4E97f4332F9652D0Ba224f228B55ec543",
"to":"0x3a220f351252089d385b29beca14e27f204c296a",
"gas":"0x393870",
"maxFeePerGas":null,
"maxPriorityFeePerGas":null,
"value":null,
"nonce":null,
"data":"0xa9059cbb0000000000000000000000005b9ca044794b2752a12c67d280c70ef595ce57fe00000000000000000000000000000000000000000000000000000000000f4240",
"input":null
},
// Block Estimation State
"pending",
// Geth Tracer
{
"tracer": "callTracer"
}
]
Request Example:
curl --location 'https://dev1.cgp.xyz/rpc/mainnet/eth-reth' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "cgp_simulateTransaction",
"params": [
{
"accessList": [],
"from": "0x3718ecd4e97f4332f9652d0ba224f228b55ec543",
"gasLimit": "0x092a1b00000000",
"maxFeePerGas":null,
"maxPriorityFeePerGas":null,
"to": null,
"value": "0x0",
"data": "0x60806040523480156200001157600080fd5b5060405162000f6438038062000f648339818101604052810190620000379190620002f2565b80600090816200004891906200058e565b506001808190555073390d81d6262c6d9080b180408a621715a83a417273ffffffffffffffffffffffffffffffffffffffff167fb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d05329764136e720741604051620000b19190620006b8565b60405180910390a273390d81d6262c6d9080b180408a621715a83a417273ffffffffffffffffffffffffffffffffffffffff167fb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d05329761882560405162000117919062000718565b60405180910390a27fa95e6e2a182411e7a6f9ed114a85c3761d87f9b8f453d842c71235aa64fff99f8160405162000150919062000787565b60405180910390a150620007ab565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620001c8826200017d565b810181811067ffffffffffffffff82111715620001ea57620001e96200018e565b5b80604052505050565b6000620001ff6200015f565b90506200020d8282620001bd565b919050565b600067ffffffffffffffff82111562000230576200022f6200018e565b5b6200023b826200017d565b9050602081019050919050565b60005b83811015620002685780820151818401526020810190506200024b565b60008484015250505050565b60006200028b620002858462000212565b620001f3565b905082815260208101848484011115620002aa57620002a962000178565b5b620002b784828562000248565b509392505050565b600082601f830112620002d757620002d662000173565b5b8151620002e984826020860162000274565b91505092915050565b6000602082840312156200030b576200030a62000169565b5b600082015167ffffffffffffffff8111156200032c576200032b6200016e565b5b6200033a84828501620002bf565b91505092915050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200039657607f821691505b602082108103620003ac57620003ab6200034e565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620003d7565b620004228683620003d7565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200046f6200046962000463846200043a565b62000444565b6200043a565b9050919050565b6000819050919050565b6200048b836200044e565b620004a36200049a8262000476565b848454620003e4565b825550505050565b600090565b620004ba620004ab565b620004c781848462000480565b505050565b5b81811015620004ef57620004e3600082620004b0565b600181019050620004cd565b5050565b601f8211156200053e576200050881620003b2565b6200051384620003c7565b8101602085101562000523578190505b6200053b6200053285620003c7565b830182620004cc565b50505b505050565b600082821c905092915050565b6000620005636000198460080262000543565b1980831691505092915050565b60006200057e838362000550565b9150826002028217905092915050565b620005998262000343565b67ffffffffffffffff811115620005b557620005b46200018e565b5b620005c182546200037d565b620005ce828285620004f3565b600060209050601f831160018114620006065760008415620005f1578287015190505b620005fd858262000570565b8655506200066d565b601f1984166200061686620003b2565b60005b82811015620006405784890151825560018201915060208501945060208101905062000619565b868310156200066057848901516200065c601f89168262000550565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b6000620006a06200069a620006948462000675565b62000444565b6200043a565b9050919050565b620006b2816200067f565b82525050565b6000602082019050620006cf6000830184620006a7565b92915050565b6000819050919050565b600062000700620006fa620006f484620006d5565b62000444565b6200043a565b9050919050565b6200071281620006df565b82525050565b60006020820190506200072f600083018462000707565b92915050565b600082825260208201905092915050565b6000620007538262000343565b6200075f818562000735565b93506200077181856020860162000248565b6200077c816200017d565b840191505092915050565b60006020820190508181036000830152620007a3818462000746565b905092915050565b6107a980620007bb6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80636a59694614610046578063a413686214610064578063cfae321714610080575b600080fd5b61004e61009e565b60405161005b919061024a565b60405180910390f35b61007e600480360381019061007991906103b5565b610115565b005b610088610128565b604051610095919061024a565b60405180910390f35b60606100a8610128565b503373ffffffffffffffffffffffffffffffffffffffff167fb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d0532976001546040516100f19190610417565b60405180910390a2600180600082825461010b9190610461565b9250508190555090565b806000908161012491906106a1565b5050565b606060008054610137906104c4565b80601f0160208091040260200160405190810160405280929190818152602001828054610163906104c4565b80156101b05780601f10610185576101008083540402835291602001916101b0565b820191906000526020600020905b81548152906001019060200180831161019357829003601f168201915b5050505050905090565b600081519050919050565b600082825260208201905092915050565b60005b838110156101f45780820151818401526020810190506101d9565b60008484015250505050565b6000601f19601f8301169050919050565b600061021c826101ba565b61022681856101c5565b93506102368185602086016101d6565b61023f81610200565b840191505092915050565b600060208201905081810360008301526102648184610211565b905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6102c282610200565b810181811067ffffffffffffffff821117156102e1576102e061028a565b5b80604052505050565b60006102f461026c565b905061030082826102b9565b919050565b600067ffffffffffffffff8211156103205761031f61028a565b5b61032982610200565b9050602081019050919050565b82818337600083830152505050565b600061035861035384610305565b6102ea565b90508281526020810184848401111561037457610373610285565b5b61037f848285610336565b509392505050565b600082601f83011261039c5761039b610280565b5b81356103ac848260208601610345565b91505092915050565b6000602082840312156103cb576103ca610276565b5b600082013567ffffffffffffffff8111156103e9576103e861027b565b5b6103f584828501610387565b91505092915050565b6000819050919050565b610411816103fe565b82525050565b600060208201905061042c6000830184610408565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061046c826103fe565b9150610477836103fe565b925082820190508082111561048f5761048e610432565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806104dc57607f821691505b6020821081036104ef576104ee610495565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026105577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261051a565b610561868361051a565b95508019841693508086168417925050509392505050565b6000819050919050565b600061059e610599610594846103fe565b610579565b6103fe565b9050919050565b6000819050919050565b6105b883610583565b6105cc6105c4826105a5565b848454610527565b825550505050565b600090565b6105e16105d4565b6105ec8184846105af565b505050565b5b81811015610610576106056000826105d9565b6001810190506105f2565b5050565b601f82111561065557610626816104f5565b61062f8461050a565b8101602085101561063e578190505b61065261064a8561050a565b8301826105f1565b50505b505050565b600082821c905092915050565b60006106786000198460080261065a565b1980831691505092915050565b60006106918383610667565b9150826002028217905092915050565b6106aa826101ba565b67ffffffffffffffff8111156106c3576106c261028a565b5b6106cd82546104c4565b6106d8828285610614565b600060209050601f83116001811461070b57600084156106f9578287015190505b6107038582610685565b86555061076b565b601f198416610719866104f5565b60005b828110156107415784890151825560018201915060208501945060208101905061071c565b8683101561075e578489015161075a601f891682610667565b8355505b6001600288020188555050505b50505050505056fea2646970667358221220d457475b933f5e68a3579e1dac3c6f734b0b7c37bae05b70eec618cb32e0df0864736f6c634300081100330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a30783366633931613361666437303339356364343936633634376435613663633964346232623766616400000000000000000000000000000000000000000000"
},
"pending",
null,
{
"0x3718ecd4e97f4332f9652d0ba224f228b55ec543": {
"balance": "0x5af3107a400fff0",
"state": {
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000000002"
}
}
},
{
"tracer": "callTracer"
}
],
"id": 0
}'
Response Example:
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"totalGasUsed": 600603,
"traceDebugInfo": [
{
"from": "0x0000000000000000000000000000000000000000",
"gas": "0x0",
"gasUsed": "0x0",
"input": "0x",
"type": "STOP"
}
],
"trieHashAfter": "0x",
"trieHashBefore": "0x",
"txLogs": {},
"txReceipts": [
{
"blockHash": "0x025b4e54163d833fc4bc83ae06cf4d70d383c37314866e0fbc864f647dd97d41",
"blockNumber": "0x824c34",
"cumulativeGasUsed": "0x92a1b",
"from": "0x3718ecd4e97f4332f9652d0ba224f228b55ec543",
"gasUsed": "0x92a1b",
"isSuccessful": true,
"logs": [
{
"address": "0xa98b3745d77d886185eed558f3b23145e077cd9c",
"topics": [
"0xb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d053297",
"0x000000000000000000000000390d81d6262c6d9080b180408a621715a83a4172"
],
"data": "0x000000000000000000000000000000000000000000000000000000136e720741",
"blockNumber": "0x824c35",
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0",
"blockHash": "0xa6c88ec2bffd62a4ef13eeb4c2233a616df921a93adcf9be03d036bfb887202c",
"logIndex": "0x0",
"removed": false
},
{
"address": "0xa98b3745d77d886185eed558f3b23145e077cd9c",
"topics": [
"0xb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d053297",
"0x000000000000000000000000390d81d6262c6d9080b180408a621715a83a4172"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000008825",
"blockNumber": "0x824c35",
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0",
"blockHash": "0xa6c88ec2bffd62a4ef13eeb4c2233a616df921a93adcf9be03d036bfb887202c",
"logIndex": "0x1",
"removed": false
},
{
"address": "0xa98b3745d77d886185eed558f3b23145e077cd9c",
"topics": [
"0xa95e6e2a182411e7a6f9ed114a85c3761d87f9b8f453d842c71235aa64fff99f"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a30783366633931613361666437303339356364343936633634376435613663633964346232623766616400000000000000000000000000000000000000000000",
"blockNumber": "0x824c35",
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0",
"blockHash": "0xa6c88ec2bffd62a4ef13eeb4c2233a616df921a93adcf9be03d036bfb887202c",
"logIndex": "0x2",
"removed": false
}
],
"logsBloom": "0x00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000010000000000020000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000020000080000000000000000000000000000000000001000000000000000000000000000010000000000000000000000",
"status": "0x1",
"to": null,
"transactionHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": 0,
"txLogs": {
"0": {
"contractAddress": "0xa98B3745d77d886185EED558F3B23145e077Cd9c",
"data": "000000000000000000000000000000000000000000000000000000136e720741",
"topics": [
"0xb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d053297",
"0x000000000000000000000000390d81d6262c6d9080b180408a621715a83a4172"
],
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"1": {
"contractAddress": "0xa98B3745d77d886185EED558F3B23145e077Cd9c",
"data": "0000000000000000000000000000000000000000000000000000000000008825",
"topics": [
"0xb44a177f4cc6099a375ea1187f4bab9c40dc670fdcd35d6d09b357525d053297",
"0x000000000000000000000000390d81d6262c6d9080b180408a621715a83a4172"
],
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"2": {
"contractAddress": "0xa98B3745d77d886185EED558F3B23145e077Cd9c",
"data": "0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a30783366633931613361666437303339356364343936633634376435613663633964346232623766616400000000000000000000000000000000000000000000",
"topics": [
"0xa95e6e2a182411e7a6f9ed114a85c3761d87f9b8f453d842c71235aa64fff99f"
],
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"type": "0xff"
}
]
}
}
Last updated