New answers tagged

0 votes

How to construct deployable bytecode from runtime bytecode?

Using modern web3.js const bytecode = await web3.eth.getCode(contract) const creationCode = new web3.eth.Contract([]).deploy({ data: bytecode })._deployData
user avatar
1 vote
Accepted

How to write struct with solidity assembly ( understand assembly )

First example If you intend to update both fields, there is no need to do an sstore just after updating the first field, it's better to do all the required updates locally (in stack / memory) and ...
user avatar
  • 5,399
0 votes
Accepted

Return bytes from inline assembly

Your data should be returned abi.encoded. In your case, since you are dealing with a dynamic type, you must include the offset data start (see this answer) Modify your function for this, and it should ...
user avatar
  • 5,399
0 votes

What exactly is each parameter for assembly delegatecall?

take a look at the EIP-7: DELEGATECALL and EVM Opcodes gas: the amount of gas the code may use in order to execute; to: the destination address whose code is to be executed; in_offset: the offset into ...
user avatar
0 votes

What does dataoffset do?

Take the following dummy smart contract written in Yul : object "ExampleContract" { code { datacopy(0, dataoffset("Runtime"), datasize("Runtime")) return(0, ...
user avatar
  • 5,399

Top 50 recent answers are included