New answers tagged assembly
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
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 ...
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 ...
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 ...
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, ...
Top 50 recent answers are included
Related Tags
assembly × 238solidity × 172
evm × 35
contract-development × 30
contract-design × 18
bytes × 17
contract-deployment × 15
delegatecall × 14
opcode × 13
remix × 12
memory × 10
yul × 10
contract-invocation × 7
storage × 7
solc × 6
calldata × 6
gas × 5
solidity-0.8.x × 5
returndata × 5
go-ethereum × 4
create2 × 4
uniswap × 3
contract-debugging × 3
arrays × 3
abi × 3