From fba87f47b902d3927ba9b1faf9a64f78c1e340f0 Mon Sep 17 00:00:00 2001 From: smartcontracts Date: Thu, 13 May 2021 17:10:50 -0400 Subject: [PATCH] feat[contracts]: temporarily disable EOA upgrades (#857) * feat[contracts]: disable eoa upgrades temporarily * chore: add changeset * Update OVM_ProxyEOA.sol * fix: turn upgrade into a noop * lint: fix --- .changeset/chatty-walls-rescue.md | 5 +++++ .../OVM/accounts/OVM_ProxyEOA.sol | 18 +++++++++++------- .../OVM/accounts/OVM_ProxyEOA.spec.ts | 4 +++- 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 .changeset/chatty-walls-rescue.md diff --git a/.changeset/chatty-walls-rescue.md b/.changeset/chatty-walls-rescue.md new file mode 100644 index 000000000000..6bd374c21536 --- /dev/null +++ b/.changeset/chatty-walls-rescue.md @@ -0,0 +1,5 @@ +--- +'@eth-optimism/contracts': minor +--- + +Disables EOA contract upgrades until further notice 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 785b92b872a5..a8dbc6c38c0f 100644 --- a/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol +++ b/packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol @@ -19,7 +19,7 @@ contract OVM_ProxyEOA { /********** * Events * **********/ - + event Upgraded( address indexed implementation ); @@ -71,13 +71,17 @@ contract OVM_ProxyEOA { ) external { - require( - msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(), - "EOAs can only upgrade their own EOA implementation" - ); + // NOTE: Upgrades are temporarily disabled because users can, in theory, modify their EOA + // so that they don't have to pay any fees to the sequencer. Function will remain disabled + // until a robust solution is in place. + + // require( + // msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(), + // "EOAs can only upgrade their own EOA implementation" + // ); - _setImplementation(_implementation); - emit Upgraded(_implementation); + // _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 a80e97a48cdc..a5a6f35f736a 100644 --- a/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts +++ b/packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts @@ -44,7 +44,9 @@ describe('OVM_ProxyEOA', () => { }) }) - describe('upgrade()', () => { + // NOTE: Upgrades are disabled for now but will be re-enabled at a later point in time. See + // comment in OVM_ProxyEOA.sol for additional information. + describe.skip('upgrade()', () => { it(`should upgrade the proxy implementation`, async () => { const newImpl = `0x${'81'.repeat(20)}` Mock__OVM_ExecutionManager.smocked.ovmADDRESS.will.return.with(