Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6b46c8ba
Commit
6b46c8ba
authored
May 19, 2021
by
Karl Floersch
Committed by
Kelvin Fichter
May 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: disable upgradability from ECDSA Account (#885)
parent
07a6d3e1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
13 deletions
+33
-13
sharp-roses-admire.md
.changeset/sharp-roses-admire.md
+5
-0
OVM_ECDSAContractAccount.sol
...mistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol
+8
-0
OVM_ProxyEOA.sol
...ntracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol
+6
-10
OVM_ECDSAContractAccount.spec.ts
...t/contracts/OVM/accounts/OVM_ECDSAContractAccount.spec.ts
+13
-0
OVM_ProxyEOA.spec.ts
...ontracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts
+1
-3
No files found.
.changeset/sharp-roses-admire.md
0 → 100644
View file @
6b46c8ba
---
'
@eth-optimism/contracts'
:
patch
---
Disable upgradability from the ECDSA account instead of the EOA proxy.
packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ECDSAContractAccount.sol
View file @
6b46c8ba
...
@@ -140,6 +140,14 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
...
@@ -140,6 +140,14 @@ contract OVM_ECDSAContractAccount is iOVM_ECDSAContractAccount {
return (true, bytes(""));
return (true, bytes(""));
} else {
} else {
// 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(
transaction.to != Lib_ExecutionManagerWrapper.ovmADDRESS(),
"Calls to self are disabled until upgradability is re-enabled."
);
return transaction.to.call(transaction.data);
return transaction.to.call(transaction.data);
}
}
}
}
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/accounts/OVM_ProxyEOA.sol
View file @
6b46c8ba
...
@@ -71,17 +71,13 @@ contract OVM_ProxyEOA {
...
@@ -71,17 +71,13 @@ contract OVM_ProxyEOA {
)
)
external
external
{
{
// NOTE: Upgrades are temporarily disabled because users can, in theory, modify their EOA
require(
// so that they don't have to pay any fees to the sequencer. Function will remain disabled
msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(),
// until a robust solution is in place.
"EOAs can only upgrade their own EOA implementation."
);
// require(
_setImplementation(_implementation);
// msg.sender == Lib_ExecutionManagerWrapper.ovmADDRESS(),
emit Upgraded(_implementation);
// "EOAs can only upgrade their own EOA implementation"
// );
// _setImplementation(_implementation);
// emit Upgraded(_implementation);
}
}
/**
/**
...
...
packages/contracts/test/contracts/OVM/accounts/OVM_ECDSAContractAccount.spec.ts
View file @
6b46c8ba
...
@@ -176,5 +176,18 @@ describe('OVM_ECDSAContractAccount', () => {
...
@@ -176,5 +176,18 @@ describe('OVM_ECDSAContractAccount', () => {
OVM_ECDSAContractAccount
.
execute
(
encodedTransaction
)
OVM_ECDSAContractAccount
.
execute
(
encodedTransaction
)
).
to
.
be
.
revertedWith
(
'
Value is nonzero but input data was provided.
'
)
).
to
.
be
.
revertedWith
(
'
Value is nonzero but input data was provided.
'
)
})
})
// NOTE: Upgrades are disabled for now but will be re-enabled at a later point in time. See
// comment in OVM_ECDSAContractAccount.sol for additional information.
it
(
`should revert if trying call itself`
,
async
()
=>
{
const
transaction
=
{
...
DEFAULT_EIP155_TX
,
to
:
wallet
.
address
}
const
encodedTransaction
=
await
wallet
.
signTransaction
(
transaction
)
await
expect
(
OVM_ECDSAContractAccount
.
execute
(
encodedTransaction
)
).
to
.
be
.
revertedWith
(
'
Calls to self are disabled until upgradability is re-enabled.
'
)
})
})
})
})
})
packages/contracts/test/contracts/OVM/accounts/OVM_ProxyEOA.spec.ts
View file @
6b46c8ba
...
@@ -44,9 +44,7 @@ describe('OVM_ProxyEOA', () => {
...
@@ -44,9 +44,7 @@ describe('OVM_ProxyEOA', () => {
})
})
})
})
// NOTE: Upgrades are disabled for now but will be re-enabled at a later point in time. See
describe
(
'
upgrade()
'
,
()
=>
{
// comment in OVM_ProxyEOA.sol for additional information.
describe
.
skip
(
'
upgrade()
'
,
()
=>
{
it
(
`should upgrade the proxy implementation`
,
async
()
=>
{
it
(
`should upgrade the proxy implementation`
,
async
()
=>
{
const
newImpl
=
`0x
${
'
81
'
.
repeat
(
20
)}
`
const
newImpl
=
`0x
${
'
81
'
.
repeat
(
20
)}
`
Mock__OVM_ExecutionManager
.
smocked
.
ovmADDRESS
.
will
.
return
.
with
(
Mock__OVM_ExecutionManager
.
smocked
.
ovmADDRESS
.
will
.
return
.
with
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment