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
57b7e708
Unverified
Commit
57b7e708
authored
Oct 07, 2022
by
mergify[bot]
Committed by
GitHub
Oct 07, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3561 from ethereum-optimism/feat/mint-manager-deploy
contracts-governance: mint manager deploy
parents
0f5260dc
7fc76e55
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
0 deletions
+109
-0
optimism-goerli.json
...s/contracts-governance/deploy-config/optimism-goerli.json
+3
-0
optimism-mainnet.json
.../contracts-governance/deploy-config/optimism-mainnet.json
+3
-0
000-mint-manager-impl.ts
...ages/contracts-governance/deploy/000-mint-manager-impl.ts
+92
-0
hardhat.config.ts
packages/contracts-governance/hardhat.config.ts
+9
-0
package.json
packages/contracts-governance/package.json
+2
-0
No files found.
packages/contracts-governance/deploy-config/optimism-goerli.json
0 → 100644
View file @
57b7e708
{
"upgrader"
:
"0xC30276833798867C1dBC5c468bf51cA900b44E4c"
}
packages/contracts-governance/deploy-config/optimism-mainnet.json
0 → 100644
View file @
57b7e708
{
"upgrader"
:
"0x2A82Ae142b2e62Cb7D10b55E323ACB1Cab663a26"
}
packages/contracts-governance/deploy/000-mint-manager-impl.ts
0 → 100644
View file @
57b7e708
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
HardhatRuntimeEnvironment
}
from
'
hardhat/types
'
import
'
hardhat-deploy
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
@nomiclabs/hardhat-ethers
'
import
{
sleep
}
from
'
@eth-optimism/core-utils
'
// $ cast call --rpc-url https://mainnet.optimism.io 0x4200000000000000000000000000000000000042 'owner()(address)'
// 0x724604DB3C8D86c906A27B610703fD0296Eb26D5
// $ cast call --rpc-url https://mainnet.optimism.io 0x724604DB3C8D86c906A27B610703fD0296Eb26D5 'owner()(address)'
// 0x2A82Ae142b2e62Cb7D10b55E323ACB1Cab663a26
//
// $ cast call --rpc-url https://goerli.optimism.io 0x4200000000000000000000000000000000000042 'owner()(address)'
// 0xB2DcB2Df7732030eD99241E5F9aEBB3Fb53eFCb6
// $ cast call --rpc-url https://goerli.optimism.io 0xB2DcB2Df7732030eD99241E5F9aEBB3Fb53eFCb6 'owner()(address)'
// 0xC30276833798867C1dBC5c468bf51cA900b44E4c
// Deployment steps:
// 1 - Deploy new MintManager implementation
// 2 - Multisig transaction calls `upgrade()` on the old MintManager
const
deployFn
:
DeployFunction
=
async
(
hre
:
HardhatRuntimeEnvironment
)
=>
{
const
{
deploy
}
=
hre
.
deployments
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
upgrader
=
hre
.
deployConfig
.
upgrader
const
governanceToken
=
'
0x4200000000000000000000000000000000000042
'
if
(
upgrader
===
''
||
upgrader
===
hre
.
ethers
.
constants
.
AddressZero
)
{
throw
new
Error
(
'
upgrader not set in deploy-config
'
)
}
// There is no artifact for the originally deployed MintManager
let
oldImpl
:
string
if
(
hre
.
network
.
name
===
'
optimism-mainnet
'
)
{
oldImpl
=
'
0x724604DB3C8D86c906A27B610703fD0296Eb26D5
'
}
else
if
(
hre
.
network
.
name
===
'
optimism-goerli
'
)
{
oldImpl
=
'
0xB2DcB2Df7732030eD99241E5F9aEBB3Fb53eFCb6
'
}
else
{
throw
new
Error
(
`unknown network
${
hre
.
network
.
name
}
`
)
}
await
deploy
(
'
MintManager
'
,
{
from
:
deployer
,
args
:
[
upgrader
,
governanceToken
],
log
:
true
,
waitConfirmations
:
1
,
})
const
GovernanceToken
=
await
hre
.
ethers
.
getContractAt
(
'
GovernanceToken
'
,
'
0x4200000000000000000000000000000000000042
'
)
const
Old__MintManager
=
await
hre
.
ethers
.
getContractAt
(
'
MintManager
'
,
oldImpl
)
const
oldOwner
=
await
Old__MintManager
.
owner
()
const
getAddress
=
hre
.
ethers
.
utils
.
getAddress
const
Deployment__MintManager
=
await
hre
.
deployments
.
get
(
'
MintManager
'
)
const
newImpl
=
Deployment__MintManager
.
address
console
.
log
()
console
.
log
(
'
Action is required to complete this deployment
'
)
console
.
log
(
'
Ownership of the GovernanceToken should be migrated to the newly deployed MintManager
'
)
console
.
log
(
`MintManager.owner() ->
${
oldOwner
}
`
)
console
.
log
(
`Call MintManager(
${
oldImpl
}
).upgrade(
${
newImpl
}
)`
)
console
.
log
()
while
(
true
)
{
const
owner
=
await
GovernanceToken
.
owner
()
if
(
getAddress
(
owner
)
===
getAddress
(
oldImpl
))
{
console
.
log
(
`GovernanceToken.owner() is still old implementation`
)
}
else
if
(
getAddress
(
owner
)
===
getAddress
(
newImpl
))
{
console
.
log
(
`GovernanceToken.owner() upgraded to new implementation!`
)
break
}
else
{
throw
new
Error
(
`GovernanceToken.owner() upgraded to unknown address
${
owner
}
`
)
}
await
sleep
(
5000
)
}
}
deployFn
.
tags
=
[
'
MintManager
'
]
export
default
deployFn
packages/contracts-governance/hardhat.config.ts
View file @
57b7e708
...
@@ -5,6 +5,7 @@ import '@nomiclabs/hardhat-etherscan'
...
@@ -5,6 +5,7 @@ import '@nomiclabs/hardhat-etherscan'
import
'
@nomiclabs/hardhat-waffle
'
import
'
@nomiclabs/hardhat-waffle
'
import
'
hardhat-gas-reporter
'
import
'
hardhat-gas-reporter
'
import
'
solidity-coverage
'
import
'
solidity-coverage
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
./scripts/deploy-token
'
import
'
./scripts/deploy-token
'
import
'
./scripts/multi-send
'
import
'
./scripts/multi-send
'
...
@@ -60,6 +61,14 @@ const config: HardhatUserConfig = {
...
@@ -60,6 +61,14 @@ const config: HardhatUserConfig = {
url
:
'
http://localhost:8545
'
,
url
:
'
http://localhost:8545
'
,
},
},
},
},
paths
:
{
deployConfig
:
'
deploy-config
'
,
},
deployConfigSpec
:
{
upgrader
:
{
type
:
'
address
'
,
},
},
gasReporter
:
{
gasReporter
:
{
enabled
:
process
.
env
.
REPORT_GAS
!==
undefined
,
enabled
:
process
.
env
.
REPORT_GAS
!==
undefined
,
currency
:
'
USD
'
,
currency
:
'
USD
'
,
...
...
packages/contracts-governance/package.json
View file @
57b7e708
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
"dependencies"
:
{
"dependencies"
:
{
"@eth-optimism/core-utils"
:
"^0.10.1"
,
"@eth-optimism/core-utils"
:
"^0.10.1"
,
"@eth-optimism/sdk"
:
"^1.6.4"
,
"@eth-optimism/sdk"
:
"^1.6.4"
,
"@eth-optimism/hardhat-deploy-config"
:
"^0.2.3"
,
"@ethersproject/hardware-wallets"
:
"^5.7.0"
,
"@ethersproject/hardware-wallets"
:
"^5.7.0"
,
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
"@nomiclabs/hardhat-etherscan"
:
"^3.0.1"
,
"@nomiclabs/hardhat-etherscan"
:
"^3.0.1"
,
...
@@ -50,6 +51,7 @@
...
@@ -50,6 +51,7 @@
"eslint"
:
"^8.9.0"
,
"eslint"
:
"^8.9.0"
,
"ethereum-waffle"
:
"^3.4.0"
,
"ethereum-waffle"
:
"^3.4.0"
,
"hardhat-gas-reporter"
:
"^1.0.7"
,
"hardhat-gas-reporter"
:
"^1.0.7"
,
"hardhat-deploy"
:
"^0.11.4"
,
"prettier"
:
"^2.3.1"
,
"prettier"
:
"^2.3.1"
,
"prettier-plugin-solidity"
:
"^1.0.0-beta.18"
,
"prettier-plugin-solidity"
:
"^1.0.0-beta.18"
,
"solhint"
:
"^3.3.6"
,
"solhint"
:
"^3.3.6"
,
...
...
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