I cannot find a proper option to compile assembly code that I generated from Solidity code (via solc --asm
) into EVM bytecode. There is the flag --assemble
for solc
which I assumed to be the correct way to convert either the assembly code or the opcodes of my Solidity code into bytecode, but none of it worked. Unfortunately, I could not find much documentation on the --assemble
mode either.
Does anybody know how to do this or where to find proper documentation on the topic?
The question says “to compile assembly code into EVM bytecode”.
you’re right, sorry for the confusion
There you go: GitHub - sebastiandine/evm-asm: EVM assembler compatible with solc output
I found a proper project and forked and extended it a little. It now even supports a “helper opcode” to peek for stack items.
Converting Solidity assembly code to binary code requires a compiler like solc. It’s a crucial step in deploying and executing smart contracts on the Ethereum blockchain. The transition from human-readable code to machine-executable binary is where the magic happens.