Commit a76cde5c authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix[contracts]: Remove some old ovmEXTCODECOPY logic (#634)

* fix[contracts]: Remove unnecessary EXTCODECOPY logic

* chore[contracts]: Add changeset

* Update OVM_ExecutionManager.sol
parent 01a2e7d2
---
"@eth-optimism/contracts": patch
---
Remove unused logic in ovmEXTCODECOPY
...@@ -747,17 +747,10 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver { ...@@ -747,17 +747,10 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager, Lib_AddressResolver {
bytes memory _code bytes memory _code
) )
{ {
// `ovmEXTCODECOPY` is the only overridden opcode capable of producing exactly one byte of
// return data. By blocking reads of one byte, we're able to use the condition that an
// OVM_ExecutionManager function return value having a length of exactly one byte indicates
// an error without an explicit revert. If users were able to read a single byte, they
// could forcibly trigger behavior that should only be available to this contract.
uint256 length = _length == 1 ? 2 : _length;
return Lib_EthUtils.getCode( return Lib_EthUtils.getCode(
_getAccountEthAddress(_contract), _getAccountEthAddress(_contract),
_offset, _offset,
length _length
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment