Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[contracts]: temporarily disable EOA upgrades #857

Merged
merged 5 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-walls-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts': minor
---

Disables EOA contract upgrades until further notice
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ contract OVM_ProxyEOA {
* Events *
**********/

event Upgraded(
address indexed implementation
);
// NOTE: See comment below w/r/t/ upgrade() to understand why we've commented this out.
// event Upgraded(
// address indexed implementation
// );


/*************
Expand Down Expand Up @@ -62,23 +63,27 @@ contract OVM_ProxyEOA {
* Public Functions *
********************/

/**
* Changes the implementation address.
* @param _implementation New implementation address.
*/
function upgrade(
address _implementation
)
external
{
require(
msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(),
"EOAs can only upgrade their own EOA implementation"
);

_setImplementation(_implementation);
emit Upgraded(_implementation);
}
// NOTE: Upgrades are temporarily disabled while we construct a whitelist-based system of
// contract accounts that users can use. Without such a system, users could upgrade their
// accounts to a contract that completely avoids paying fees.
//
// /**
// * Changes the implementation address.
// * @param _implementation New implementation address.
// */
// function upgrade(
// address _implementation
// )
// external
// {
// require(
// msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(),
// "EOAs can only upgrade their own EOA implementation"
// );
//
// _setImplementation(_implementation);
// emit Upgraded(_implementation);
// }

/**
* Gets the address of the current implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down