Commit d877b333 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: portal guardian config

parent 7cd75583
...@@ -49,7 +49,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -49,7 +49,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
L2OutputOracle public immutable L2_ORACLE; L2OutputOracle public immutable L2_ORACLE;
/** /**
* @notice Address that has the ability to pause and unpause deposits and withdrawals. * @notice Address that has the ability to pause and unpause withdrawals.
*/ */
address public immutable GUARDIAN; address public immutable GUARDIAN;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", "sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a",
"proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "proxyAdminOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"finalSystemOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096", "finalSystemOwner": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"portalGuardian": "0xBcd4042DE499D14e55001CcbB24a551F3b954096",
"controller": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", "controller": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"deploymentWaitConfirmations": 1, "deploymentWaitConfirmations": 1,
......
{ {
"finalSystemOwner": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807", "finalSystemOwner": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807",
"portalGuardian": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807",
"controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675", "controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675",
"l1StartingBlockTag": "0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83", "l1StartingBlockTag": "0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"numDeployConfirmations": 1, "numDeployConfirmations": 1,
"finalSystemOwner": "ADMIN", "finalSystemOwner": "ADMIN",
"portalGuardian": "ADMIN",
"controller": "ADMIN", "controller": "ADMIN",
"l1StartingBlockTag": "BLOCKHASH", "l1StartingBlockTag": "BLOCKHASH",
......
{ {
"finalSystemOwner": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807", "finalSystemOwner": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807",
"portalGuardian": "0x62790eFcB3a5f3A5D398F95B47930A9Addd83807",
"controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675", "controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675",
"l1StartingBlockTag": "0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83", "l1StartingBlockTag": "0x4104895a540d87127ff11eef0d51d8f63ce00a6fc211db751a45a4b3a61a9c83",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"numDeployConfirmations": 1, "numDeployConfirmations": 1,
"finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "finalSystemOwner": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"portalGuardian": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"controller": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f", "controller": "0xBc1233d0C3e6B5d53Ab455cF65A6623F6dCd7e4f",
"l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7", "l1StartingBlockTag": "0x6ffc1bf3754c01f6bb9fe057c1578b87a8571ce2e9be5ca14bace6eccfd336c7",
......
{ {
"finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"portalGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"controller": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", "controller": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
......
{ {
"finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF", "finalSystemOwner": "0x858F0751ef8B4067f0d2668C076BDB50a8549fbF",
"finalSystemOwner": "portalGuardian",
"controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675", "controller": "0x2d30335B0b807bBa1682C487BaAFD2Ad6da5D675",
"l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e", "l1StartingBlockTag": "0x19c7e6b18fe156e45f4cfef707294fd8f079fa9c30a7b7cd6ec1ce3682ec6a2e",
......
...@@ -17,13 +17,11 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -17,13 +17,11 @@ const deployFn: DeployFunction = async (hre) => {
'L2OutputOracleProxy' 'L2OutputOracleProxy'
) )
const finalSystemOwner = hre.deployConfig.finalSystemOwner const portalGuardian = hre.deployConfig.portalGuardian
const finalSystemOwnerCode = await hre.ethers.provider.getCode( const portalGuardianCode = await hre.ethers.provider.getCode(portalGuardian)
finalSystemOwner if (portalGuardianCode === '0x') {
)
if (finalSystemOwnerCode === '0x') {
console.log( console.log(
`WARNING: setting OptimismPortal.GUARDIAN to ${finalSystemOwner} and it has no code` `WARNING: setting OptimismPortal.GUARDIAN to ${portalGuardian} and it has no code`
) )
if (!isLiveDeployer) { if (!isLiveDeployer) {
throw new Error( throw new Error(
...@@ -35,13 +33,13 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -35,13 +33,13 @@ const deployFn: DeployFunction = async (hre) => {
// Deploy the OptimismPortal implementation as paused to // Deploy the OptimismPortal implementation as paused to
// ensure that users do not interact with it and instead // ensure that users do not interact with it and instead
// interact with the proxied contract. // interact with the proxied contract.
// The `finalSystemOwner` is set at the GUARDIAN. // The `portalGuardian` is set at the GUARDIAN.
await deploy({ await deploy({
hre, hre,
name: 'OptimismPortal', name: 'OptimismPortal',
args: [ args: [
L2OutputOracleProxy.address, L2OutputOracleProxy.address,
finalSystemOwner, portalGuardian,
true, // paused true, // paused
], ],
postDeployAction: async (contract) => { postDeployAction: async (contract) => {
...@@ -53,7 +51,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -53,7 +51,7 @@ const deployFn: DeployFunction = async (hre) => {
await assertContractVariable( await assertContractVariable(
contract, contract,
'GUARDIAN', 'GUARDIAN',
hre.deployConfig.finalSystemOwner hre.deployConfig.portalGuardian
) )
}, },
}) })
......
...@@ -14,6 +14,12 @@ interface RequiredDeployConfig { ...@@ -14,6 +14,12 @@ interface RequiredDeployConfig {
*/ */
finalSystemOwner?: string finalSystemOwner?: string
/**
* Address that is deployed as the GUARDIAN in the OptimismPortal. Has the
* ability to pause withdrawals.
*/
portalGuardian: string
/** /**
* Address that will own the entire system on L1 during the deployment process. This address will * Address that will own the entire system on L1 during the deployment process. This address will
* not own the system after the deployment is complete, ownership will be transferred to the * not own the system after the deployment is complete, ownership will be transferred to the
...@@ -181,6 +187,9 @@ export const deployConfigSpec: { ...@@ -181,6 +187,9 @@ export const deployConfigSpec: {
finalSystemOwner: { finalSystemOwner: {
type: 'address', type: 'address',
}, },
portalGuardian: {
type: 'address',
},
controller: { controller: {
type: 'address', type: '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