For a project of mine I would like to run a standalone new EVM with precise specifications. After having instantiated and set up the vm, I have a deployed a test contract using the vm « Create » function.

However I don’t understand how to invoke specific methods of the contract using go-ethereum.

I thought I could use the Call and CallCode functions but they don’t indicate any argument concerning the methods except the input byte array.

Any help really appreciated,


1 Answer 1


The method is carried in the input bytes as per this the yellow paper. See here: http://gavwood.com/paper.pdf.

Much more information is here: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI. The thing you're looking for is called the function selector in that page.

  • Hello, thanks for your very useful response. I was able to find an example of your explanation in the runtime_test.go
    – Solerus
    Commented Oct 15, 2018 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.