mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 16:53:07 +00:00
EIP-3541: Reject new contract code starting with the 0xEF byte (#1003)
* EIP-3541: Reject new contract code starting with the 0xEF byte * Panic instead * PR feedback
This commit is contained in:
parent
472face2a5
commit
a4b714e64d
@ -137,9 +137,11 @@ after_constructor:
|
|||||||
// stack: new_ctx, leftover_gas, success, address, kexit_info
|
// stack: new_ctx, leftover_gas, success, address, kexit_info
|
||||||
POP
|
POP
|
||||||
|
|
||||||
// TODO: EIP-3541: Reject new contract code starting with the 0xEF byte
|
|
||||||
|
|
||||||
// TODO: Skip blocks below if success is false.
|
// TODO: Skip blocks below if success is false.
|
||||||
|
// EIP-3541: Reject new contract code starting with the 0xEF byte
|
||||||
|
PUSH 0 %mload_current(@SEGMENT_RETURNDATA) %eq_const(0xEF) %jumpi(fault_exception)
|
||||||
|
|
||||||
// Charge gas for the code size.
|
// Charge gas for the code size.
|
||||||
SWAP3
|
SWAP3
|
||||||
// stack: kexit_info, success, address, leftover_gas
|
// stack: kexit_info, success, address, leftover_gas
|
||||||
|
|||||||
@ -144,6 +144,10 @@ process_contract_creation_txn_after_code_loaded:
|
|||||||
global process_contract_creation_txn_after_constructor:
|
global process_contract_creation_txn_after_constructor:
|
||||||
// stack: success, leftover_gas, new_ctx, address, retdest
|
// stack: success, leftover_gas, new_ctx, address, retdest
|
||||||
POP // TODO: Success will go into the receipt when we support that.
|
POP // TODO: Success will go into the receipt when we support that.
|
||||||
|
|
||||||
|
// EIP-3541: Reject new contract code starting with the 0xEF byte
|
||||||
|
PUSH 0 %mload_current(@SEGMENT_RETURNDATA) %eq_const(0xEF) %assert_zero // TODO: need to revert changes here.
|
||||||
|
|
||||||
// stack: leftover_gas, new_ctx, address, retdest
|
// stack: leftover_gas, new_ctx, address, retdest
|
||||||
%returndatasize // Size of the code.
|
%returndatasize // Size of the code.
|
||||||
// stack: code_size, leftover_gas, new_ctx, address, retdest
|
// stack: code_size, leftover_gas, new_ctx, address, retdest
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user