-
Notifications
You must be signed in to change notification settings - Fork 3.9k
refactor[contracts]: Port OVM_DeployerWhitelist to use ovm-solc #548
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@eth-optimism/contracts": patch | ||
| --- | ||
|
|
||
| Port OVM_DeployerWhitelist to use optimistic-solc. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,14 +24,21 @@ const DUMMY_REVERT_DATA = | |
| '0xdeadbeef1e5420deadbeef1e5420deadbeef1e5420deadbeef1e5420deadbeef1e5420' | ||
|
|
||
| const NON_WHITELISTED_DEPLOYER = '0x1234123412341234123412341234123412341234' | ||
| const NON_WHITELISTED_DEPLOYER_KEY = | ||
| '0x0000000000000000000000001234123412341234123412341234123412341234' | ||
| const NON_WHITELISTED_DEPLOYER_KEY = ethers.utils.keccak256( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming that this can't be easily done because it lives in smock right now, but this should really be a call to a utility function. Took me a sec to realize this was here to handle the new solidity storage layout.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, very true! |
||
| '0x' + | ||
| '0000000000000000000000001234123412341234123412341234123412341234' + | ||
| '0000000000000000000000000000000000000000000000000000000000000001' | ||
| ) | ||
| const CREATED_BY_NON_WHITELISTED_DEPLOYER = | ||
| '0x794e4aa3be128b0fc01ba12543b70bf9d77072fc' | ||
|
|
||
| const WHITELISTED_DEPLOYER = '0x3456345634563456345634563456345634563456' | ||
| const WHITELISTED_DEPLOYER_KEY = | ||
| '0x0000000000000000000000003456345634563456345634563456345634563456' | ||
| const WHITELISTED_DEPLOYER_KEY = ethers.utils.keccak256( | ||
| '0x' + | ||
| '0000000000000000000000003456345634563456345634563456345634563456' + | ||
| '0000000000000000000000000000000000000000000000000000000000000001' | ||
| ) | ||
|
|
||
| const CREATED_BY_WHITELISTED_DEPLOYER = | ||
| '0x9f397a91ccb7cc924d1585f1053bc697d30f343f' | ||
|
|
||
|
|
@@ -766,13 +773,9 @@ const test_ovmCREATE: TestDefinition = { | |
| }, | ||
| contractStorage: { | ||
| ['0x4200000000000000000000000000000000000002']: { | ||
| // initialized? true | ||
| '0x0000000000000000000000000000000000000000000000000000000000000010': getStorageXOR( | ||
| '0x' + '00'.repeat(31) + '01' | ||
| ), | ||
| // allowArbitraryDeployment? false | ||
| '0x0000000000000000000000000000000000000000000000000000000000000012': getStorageXOR( | ||
| ethers.constants.HashZero | ||
| // initialized? true, allowArbitraryDeployment? false | ||
| '0x0000000000000000000000000000000000000000000000000000000000000000': getStorageXOR( | ||
| '0x0000000000000000000000000000000000000000000000000000000000000001' | ||
| ), | ||
| // non-whitelisted deployer is whitelisted? false | ||
| [NON_WHITELISTED_DEPLOYER_KEY]: getStorageXOR( | ||
|
|
@@ -786,8 +789,7 @@ const test_ovmCREATE: TestDefinition = { | |
| }, | ||
| verifiedContractStorage: { | ||
| ['0x4200000000000000000000000000000000000002']: { | ||
| '0x0000000000000000000000000000000000000000000000000000000000000010': 1, | ||
| '0x0000000000000000000000000000000000000000000000000000000000000012': 1, | ||
| '0x0000000000000000000000000000000000000000000000000000000000000000': 1, | ||
| [NON_WHITELISTED_DEPLOYER_KEY]: 1, | ||
| [WHITELISTED_DEPLOYER_KEY]: 1, | ||
| }, | ||
|
|
@@ -901,13 +903,9 @@ const test_ovmCREATE: TestDefinition = { | |
| }, | ||
| contractStorage: { | ||
| ['0x4200000000000000000000000000000000000002']: { | ||
| // initialized? true | ||
| '0x0000000000000000000000000000000000000000000000000000000000000010': getStorageXOR( | ||
| '0x' + '00'.repeat(31) + '01' | ||
| ), | ||
| // allowArbitraryDeployment? true | ||
| '0x0000000000000000000000000000000000000000000000000000000000000012': getStorageXOR( | ||
| '0x' + '00'.repeat(31) + '01' | ||
| // initialized? true, allowArbitraryDeployment? true | ||
| '0x0000000000000000000000000000000000000000000000000000000000000000': getStorageXOR( | ||
| '0x0000000000000000000000000000000000000000000000000000000000000101' | ||
| ), | ||
| // non-whitelisted deployer is whitelisted? false | ||
| [NON_WHITELISTED_DEPLOYER_KEY]: getStorageXOR( | ||
|
|
@@ -921,8 +919,7 @@ const test_ovmCREATE: TestDefinition = { | |
| }, | ||
| verifiedContractStorage: { | ||
| ['0x4200000000000000000000000000000000000002']: { | ||
| '0x0000000000000000000000000000000000000000000000000000000000000010': 1, | ||
| '0x0000000000000000000000000000000000000000000000000000000000000012': 1, | ||
| '0x0000000000000000000000000000000000000000000000000000000000000000': 1, | ||
| [NON_WHITELISTED_DEPLOYER_KEY]: 1, | ||
| [WHITELISTED_DEPLOYER_KEY]: 1, | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.