Skip to content

Commit

Permalink
Update EIP-7873: Creator Contract - revert reason & magic value
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobacz committed Feb 20, 2025
1 parent 1226427 commit a00a86a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions EIPS/eip-7873.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,20 @@ At the start of the block in which [EIP-3540](./eip-3540.md) activates, set the
let size := calldatasize()
if lt(size, 64) { revert(0, 0) }
let tx_initcode_hash := calldataload(0)
let salt := calldataload(32)
mstore8(0, 0xff) // a magic value to ensure a specific preimage space
calldatacopy(1, 0, size) // copy tx_initcode_hash, salt and init_data to memory to hash
let commitment_size := add(size, 1)
let final_salt := keccak256(0, commitment_size)
calldatacopy(0, 0, size) // copy tx_initcode_hash, salt and init_data to memory to hash
let final_salt := keccak256(0, size)
let tx_initcode_hash := calldataload(0)
let init_data_size := sub(size, 64)
calldatacopy(0, 64, init_data_size)
let ret := txcreate(tx_initcode_hash, callvalue(), final_salt, 0, init_data_size)
if iszero(ret) { revert(0, 0) }
// reuse init_data which has been already copied to memory above
let ret := txcreate(tx_initcode_hash, callvalue(), final_salt, 64, init_data_size)
if iszero(ret) {
let ret_data_size := returndatasize()
returndatacopy(0, ret_data_size)
revert(0, ret_data_size)
}
mstore(0, ret)
return(0, 32)
Expand Down

0 comments on commit a00a86a

Please sign in to comment.