diff --git a/.changeset/old-cycles-invite.md b/.changeset/old-cycles-invite.md new file mode 100644 index 0000000000000..d05596e7bedf7 --- /dev/null +++ b/.changeset/old-cycles-invite.md @@ -0,0 +1,5 @@ +--- +"@eth-optimism/contracts": patch +--- + +Makes ProxyEOA compatible with EIP1967, not backwards compatible since the storage slot changes. diff --git a/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol b/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol index 02d809b717a6e..d158d15d5b4e5 100644 --- a/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol +++ b/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol @@ -16,12 +16,21 @@ import { Lib_Bytes32Utils } from "../../libraries/utils/Lib_Bytes32Utils.sol"; */ contract OVM_ProxyEOA { + /********** + * Events * + **********/ + + event Upgraded( + address indexed implementation + ); + + /************* * Constants * *************/ address constant DEFAULT_IMPLEMENTATION = 0x4200000000000000000000000000000000000003; - bytes32 constant IMPLEMENTATION_KEY = 0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead; + bytes32 constant IMPLEMENTATION_KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; //bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1); /********************* @@ -68,6 +77,7 @@ contract OVM_ProxyEOA { ); _setImplementation(_implementation); + emit Upgraded(_implementation); } /** diff --git a/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts b/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts index 2d9f00f9939dc..b292372f50243 100644 --- a/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts +++ b/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts @@ -94,7 +94,7 @@ describe('OVM_ProxyEOA', () => { }) describe('upgrade()', () => { const implSlotKey = - '0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddeaddead' + '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' //bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) it(`should upgrade the proxy implementation`, async () => { const newImpl = `0x${'81'.repeat(20)}` const newImplBytes32 = addrToBytes32(newImpl)