3

I have been testing with evm and I am not getting any output.

Code -

pragma solidity ^0.4.18;

contract d8 {

    function myBalance() pure public returns (uint) {
        return 880;
    }

}

My asm is from here -

solc --asm d8.sol > d8.asm

Then I tried -

evm compile d8.asm

Not much happens (output is a blank line).

I tried various options and adding "run" at the end but nothing produced any output.

Has anyone any suggestions?

2 Answers 2

1

Solidity has an own workflow to deal with assembly. Refer to https://solidity.readthedocs.io/en/develop/assembly.html# and check the phases:

  1. Assembly
  2. Desugaring
  3. Opcode Stream
  4. Byte Stream

Output of phase 2 can be generated as follows: solc --asm

However, evm compile expects you to have phase 3.

e.g. check the code: https://github.com/IC3Hydra/Hydra/blob/master/submarine_sends/to_contract/clone_withdraw.easm

0
0

It would help if you used evm in the right way. The compiler option is not for EVM assemble but for easm, the deprecated AST of Solidity. Relevant information is rather limited, and the only one I find is that evmlab mentions a little bit. Refer to my other answer if you want more guides for the evm command shipped with geth.

1
  • Needs to construct a better answer, explaining how things work and refrain from complaining about other users.
    – Kof
    Commented May 3, 2022 at 17:09

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.