Commit 7d03c5c0 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: fix proxy admin config

Reduce the amount of config by removing the concept of proxy admin
address because we should be using the address of the deployed
proxy admin contract.
parent 2a45e69e
---
'@eth-optimism/contracts-bedrock': patch
---
Update the L2 genesis hardhat task to use the ProxyAdmin's deployed address as the admin of each predeploy
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"optimismBaseFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "optimismBaseFeeRecipient": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"optimismL1FeeRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", "optimismL1FeeRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788",
"proxyAdmin": "0x829BD824B016326A401d083B33D092293333A830",
"fundDevAccounts": true, "fundDevAccounts": true,
"deploymentWaitConfirmations": 1 "deploymentWaitConfirmations": 1
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
"optimismBaseFeeRecipient": "0xf116a24056b647e3211d095c667e951536cdebaa", "optimismBaseFeeRecipient": "0xf116a24056b647e3211d095c667e951536cdebaa",
"optimismL1FeeRecipient": "0xc731837b696ca3d9720d23336925368ceaa58f83", "optimismL1FeeRecipient": "0xc731837b696ca3d9720d23336925368ceaa58f83",
"proxyAdmin": "0xe584e1b833ca80020130b1b69f84f90479076168",
"fundDevAccounts": true, "fundDevAccounts": true,
"deploymentWaitConfirmations": 1 "deploymentWaitConfirmations": 1
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"l2OutputOracleOwner": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", "l2OutputOracleOwner": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"proxyAdmin": "0x0000000000000000000000000000000000000000",
"fundDevAccounts": true, "fundDevAccounts": true,
"deploymentWaitConfirmations": 1 "deploymentWaitConfirmations": 1
......
...@@ -320,10 +320,6 @@ const config: HardhatUserConfig = { ...@@ -320,10 +320,6 @@ const config: HardhatUserConfig = {
type: 'number', type: 'number',
default: 6, default: 6,
}, },
proxyAdmin: {
type: 'address',
// no default, important to get right.
},
fundDevAccounts: { fundDevAccounts: {
type: 'boolean', type: 'boolean',
default: false, default: false,
......
...@@ -286,13 +286,15 @@ task('genesis-l2', 'create a genesis config') ...@@ -286,13 +286,15 @@ task('genesis-l2', 'create a genesis config')
GovernanceToken: { GovernanceToken: {
name: 'Optimism', name: 'Optimism',
symbol: 'OP', symbol: 'OP',
_owner: deployConfig.proxyAdmin, // TODO: this should be the mint manager
// in practice. Just use a hardhat account
// because this is only used for devnets
_owner: '0x829BD824B016326A401d083B33D092293333A830',
}, },
} }
assertEvenLength(implementationSlot) assertEvenLength(implementationSlot)
assertEvenLength(adminSlot) assertEvenLength(adminSlot)
assertEvenLength(deployConfig.proxyAdmin)
const predeployAddrs = new Set() const predeployAddrs = new Set()
for (const addr of Object.values(predeploys)) { for (const addr of Object.values(predeploys)) {
...@@ -301,6 +303,10 @@ task('genesis-l2', 'create a genesis config') ...@@ -301,6 +303,10 @@ task('genesis-l2', 'create a genesis config')
const alloc: State = {} const alloc: State = {}
// Use the address of the deployed ProxyAdmin as the admin for
// each Proxy
const Deployment__ProxyAdmin = await hre.deployments.get('ProxyAdmin')
// Set a proxy at each predeploy address // Set a proxy at each predeploy address
const proxy = await hre.artifacts.readArtifact('Proxy') const proxy = await hre.artifacts.readArtifact('Proxy')
for (let i = 0; i <= 2048; i++) { for (let i = 0; i <= 2048; i++) {
...@@ -320,7 +326,7 @@ task('genesis-l2', 'create a genesis config') ...@@ -320,7 +326,7 @@ task('genesis-l2', 'create a genesis config')
balance: '0x0', balance: '0x0',
code: proxy.deployedBytecode, code: proxy.deployedBytecode,
storage: { storage: {
[adminSlot]: deployConfig.proxyAdmin, [adminSlot]: Deployment__ProxyAdmin.address,
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment