How does one determine a given method id from a compiled contract?

motoaddictmotoaddict Fort Myers, FloridaMember Posts: 52
I posted this question earlier and received no response. Maybe if I ask it differently?

Given the following compiled contract how would one determine the hex value of the "multiply" method id? I want to use the JSON "eth_call" method to execute a contract. Thanks in advance.

{
"test": {
"info": {
"developerDoc": {
"methods": {}
},
"languageVersion": "0",
"source": "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }",
"userDoc": {
"methods": {}
},
"language": "Solidity",
"compilerVersion": "0.9.27",
"abiDefinition": [
{
"constant": false,
"inputs": [
{
"type": "uint256",
"name": "a"
}
],
"outputs": [
{
"type": "uint256",
"name": "d"
}
],
"type": "function",
"name": "multiply"
}
]
},
"code": "0x6060604052606d8060116000396000f30060606040526000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa1146037576035565b005b6046600480359060200150605c565b6040518082815260200191505060405180910390f35b60006007820290506068565b91905056"
}
}

Best Answer

Sign In or Register to comment.