Skip to content

Commit d33e0b1

Browse files
committed
Fixup: TXCREATE uses tx_initcode_hash not index
1 parent 8c69fb9 commit d33e0b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/eof.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,20 +385,20 @@ Annotated examples of EOF formatted containers demonstrating several key feature
385385

386386
```solidity
387387
{
388-
/// Takes [index][salt][init_data] as input,
388+
/// Takes [tx_initcode_hash][salt][init_data] as input,
389389
/// creates contract and returns the address or failure otherwise
390390
391391
// init_data.length can be 0, but the first 2 words are mandatory
392392
let size := calldatasize()
393393
if lt(size, 64) { revert(0, 0) }
394394
395-
let tx_initcode_index := calldataload(0)
395+
let tx_initcode_hash := calldataload(0)
396396
let salt := calldataload(32)
397397
398398
let init_data_size := sub(size, 64)
399399
calldatacopy(0, 64, init_data_size)
400400
401-
let ret := txcreate(tx_initcode_index, callvalue(), salt, 0, init_data_size)
401+
let ret := txcreate(tx_initcode_hash, callvalue(), salt, 0, init_data_size)
402402
if iszero(ret) { revert(0, 0) }
403403
404404
mstore(0, ret)

0 commit comments

Comments
 (0)