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
2d2aed15
Unverified
Commit
2d2aed15
authored
Oct 26, 2021
by
Maurelian
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(contracts): Address review feedback on ts files
parent
b3b97959
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
86 additions
and
53 deletions
+86
-53
001-OVM_ChainStorageContainer_ctc_batches.deploy.ts
...eploy/001-OVM_ChainStorageContainer_ctc_batches.deploy.ts
+4
-1
002-OVM_ChainStorageContainer_scc_batches.deploy.ts
...eploy/002-OVM_ChainStorageContainer_scc_batches.deploy.ts
+4
-1
003-OVM_CanonicalTransactionChain.deploy.ts
...tracts/deploy/003-OVM_CanonicalTransactionChain.deploy.ts
+4
-1
004-OVM_StateCommitmentChain.deploy.ts
...s/contracts/deploy/004-OVM_StateCommitmentChain.deploy.ts
+4
-1
005-OVM_BondManager.deploy.ts
packages/contracts/deploy/005-OVM_BondManager.deploy.ts
+4
-1
006-OVM_L1CrossDomainMessenger.deploy.ts
...contracts/deploy/006-OVM_L1CrossDomainMessenger.deploy.ts
+4
-1
007-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
...ts/deploy/007-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
+4
-1
009-OVM_L1StandardBridge.deploy.ts
packages/contracts/deploy/009-OVM_L1StandardBridge.deploy.ts
+8
-4
010-AddressSetter.deploy.ts
packages/contracts/deploy/010-AddressSetter.deploy.ts
+4
-3
011-set-addresses.ts
packages/contracts/deploy/011-set-addresses.ts
+27
-14
012-initialize-Proxy__L1CrossDomainMessenger.ts
...ts/deploy/012-initialize-Proxy__L1CrossDomainMessenger.ts
+8
-2
013-finalize.ts
packages/contracts/deploy/013-finalize.ts
+11
-4
deploy.ts
packages/contracts/tasks/deploy.ts
+0
-19
No files found.
packages/contracts/deploy/001-OVM_ChainStorageContainer_ctc_batches.deploy.ts
View file @
2d2aed15
...
...
@@ -8,7 +8,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/002-OVM_ChainStorageContainer_scc_batches.deploy.ts
View file @
2d2aed15
...
...
@@ -8,7 +8,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/003-OVM_CanonicalTransactionChain.deploy.ts
View file @
2d2aed15
...
...
@@ -8,7 +8,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/004-OVM_StateCommitmentChain.deploy.ts
View file @
2d2aed15
...
...
@@ -8,7 +8,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/005-OVM_BondManager.deploy.ts
View file @
2d2aed15
...
...
@@ -8,7 +8,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/006-OVM_L1CrossDomainMessenger.deploy.ts
View file @
2d2aed15
...
...
@@ -10,7 +10,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
deployAndPostDeploy
({
hre
,
...
...
packages/contracts/deploy/007-Proxy__OVM_L1CrossDomainMessenger.deploy.ts
View file @
2d2aed15
...
...
@@ -10,7 +10,10 @@ import {
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
// todo: this fails when trying to do a fresh deploy, because Lib_ResolvedDelegateProxy
// requires that the implementation has already been set in the Address Manager.
...
...
packages/contracts/deploy/009-OVM_L1StandardBridge.deploy.ts
View file @
2d2aed15
...
...
@@ -20,10 +20,14 @@ const deployFn: DeployFunction = async (hre) => {
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
// Set up a reference to the proxy as if it were the L1StandardBridge contract.
const
contract
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
,
{
iface
:
'
L1StandardBridge
'
,
signerOrProvider
:
deployer
,
})
const
contract
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
,
{
iface
:
'
L1StandardBridge
'
,
signerOrProvider
:
deployer
,
}
)
// Because of the `iface` parameter supplied to the deployment function above, the `contract`
// variable that we here will have the interface of the L1StandardBridge contract. However,
...
...
packages/contracts/deploy/010-AddressSetter.deploy.ts
View file @
2d2aed15
...
...
@@ -10,10 +10,11 @@ import {
import
{
predeploys
}
from
'
../src/predeploys
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
// ToDo: Clean up the method of mapping names to addresses esp.
// There's probably a more functional way to generate an object or something.
const
allContractNames
=
[
'
ChainStorageContainer-CTC-batches
'
,
'
ChainStorageContainer-SCC-batches
'
,
...
...
packages/contracts/deploy/011-set-addresses.ts
View file @
2d2aed15
...
...
@@ -4,14 +4,24 @@ import { ethers } from 'hardhat'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
/* Imports: Internal */
import
{
getContractFromArtifact
,
waitUntilTrue
}
from
'
../src/hardhat-deploy-ethers
'
import
{
getContractFromArtifact
,
waitUntilTrue
,
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
addressDictator
=
await
getContractFromArtifact
(
hre
,
'
AddressDictator
'
,
{
signerOrProvider
:
deployer
,
})
const
libAddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
addressDictator
=
await
getContractFromArtifact
(
hre
,
'
AddressDictator
'
,
{
signerOrProvider
:
deployer
,
}
)
const
libAddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
namedAddresses
=
await
addressDictator
.
getNamedAddresses
()
const
finalOwner
=
await
addressDictator
.
finalOwner
()
let
currentOwner
=
await
libAddressManager
.
owner
()
...
...
@@ -72,15 +82,18 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
'
Ownership successfully transferred. Invoking setAddresses...
'
)
await
addressDictator
.
setAddresses
()
currentOwner
=
await
libAddressManager
.
owner
()
console
.
log
(
'
Verifying final ownership of Lib_AddressManager
'
)
if
(
!
hexStringEquals
(
finalOwner
,
currentOwner
))
{
throw
new
Error
(
`The current address manager owner
${
currentOwner
}
, \nis not equal to the expected owner:
${
finalOwner
}
`
)
}
else
{
console
.
log
(
`Address Manager ownership was returned to
${
finalOwner
}
.`
)
}
await
waitUntilTrue
(
async
()
=>
{
console
.
log
(
'
Verifying final ownership of Lib_AddressManager
'
)
currentOwner
=
await
libAddressManager
.
owner
()
return
hexStringEquals
(
currentOwner
,
finalOwner
)
},
{
// Try every 10 seconds
delay
:
10
_000
,
retries
:
1000
,
}
)
}
deployFn
.
tags
=
[
'
upgrade
'
,
'
set-addresses
'
]
...
...
packages/contracts/deploy/012-initialize-Proxy__L1CrossDomainMessenger.ts
View file @
2d2aed15
...
...
@@ -3,7 +3,10 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
{
getContractFromArtifact
,
waitUntilTrue
}
from
'
../src/hardhat-deploy-ethers
'
import
{
getContractFromArtifact
,
waitUntilTrue
,
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
...
...
@@ -19,7 +22,10 @@ const deployFn: DeployFunction = async (hre) => {
signerOrProvider
:
deployer
,
}
)
const
libAddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
const
libAddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
)
await
proxy
.
initialize
(
libAddressManager
.
address
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
...
...
packages/contracts/deploy/013-finalize.ts
View file @
2d2aed15
...
...
@@ -3,13 +3,20 @@ import { DeployFunction } from 'hardhat-deploy/dist/types'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
{
getContractFromArtifact
,
waitUntilTrue
}
from
'
../src/hardhat-deploy-ethers
'
import
{
getContractFromArtifact
,
waitUntilTrue
,
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
,
{
signerOrProvider
:
deployer
,
})
const
Lib_AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
,
{
signerOrProvider
:
deployer
,
}
)
const
owner
=
(
hre
as
any
).
deployConfig
.
ovmAddressManagerOwner
const
remoteOwner
=
await
Lib_AddressManager
.
owner
()
...
...
packages/contracts/tasks/deploy.ts
View file @
2d2aed15
...
...
@@ -68,25 +68,6 @@ task('deploy')
undefined
,
types
.
string
)
// Reusable address options
.
addOptionalParam
(
'
proxyL1CrossDomainMessenger
'
,
'
Address of the L1CrossDomainMessenger Proxy, for use in a deployment which is keeping the existing contract.
'
,
undefined
,
types
.
string
)
.
addOptionalParam
(
'
proxyL1StandardBridge
'
,
'
Address of the L1StandardBridge Proxy, for use in a deployment which is keeping the existing contract.
'
,
undefined
,
types
.
string
)
.
addOptionalParam
(
'
libAddressManager
'
,
'
Address of the Lib_AddressManager, for use in a deployment which is keeping the existing contract.
'
,
undefined
,
types
.
string
)
.
addOptionalParam
(
'
numDeployConfirmations
'
,
'
Number of confirmations to wait for each transaction in the deployment. More is safer.
'
,
...
...
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