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
c73d36f1
Unverified
Commit
c73d36f1
authored
Oct 22, 2021
by
ben-chain
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(contracts): remove no-op address setting from AddressSetter
parent
98f3aa42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
22 deletions
+46
-22
110-AddressSetter.deploy.ts
packages/contracts/deploy/110-AddressSetter.deploy.ts
+46
-22
No files found.
packages/contracts/deploy/110-AddressSetter.deploy.ts
View file @
c73d36f1
/* Imports: External */
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
{
...
...
@@ -13,8 +14,7 @@ const deployFn: DeployFunction = async (hre) => {
// ToDo: Clean up the method of mapping names to addresses esp.
// There's probably a more functional way to generate an object or something.
// ToDo: in the case of an upgrade, only add names of contracts that are new deployed.
const
names
=
[
const
allContractNames
=
[
'
ChainStorageContainer-CTC-batches
'
,
'
ChainStorageContainer-SCC-batches
'
,
'
CanonicalTransactionChain
'
,
...
...
@@ -25,28 +25,48 @@ const deployFn: DeployFunction = async (hre) => {
'
Proxy__OVM_L1StandardBridge
'
,
]
const
addresses
=
await
Promise
.
all
(
names
.
map
(
async
(
n
)
=>
{
return
(
await
getLiveContract
(
hre
,
n
)).
address
let
namesAndAddresses
:
{
name
:
string
address
:
string
}[]
=
await
Promise
.
all
(
allContractNames
.
map
(
async
(
name
)
=>
{
return
{
name
,
address
:
(
await
getLiveContract
(
hre
,
name
)).
address
,
}
})
)
// Add non-deployed addresses to the Address Setter argument arrays
// L2CrossDomainMessenger is the address of the predeploy on L2. We can refactor off-chain
// services such that we can remove the need to set this address, but for now it's easier
// to simply keep setting the address.
names
.
push
(
'
L2CrossDomainMessenger
'
)
addresses
.
push
(
predeploys
.
L2CrossDomainMessenger
)
// OVM_Sequencer is the address allowed to submit "Sequencer" blocks to the
// CanonicalTransactionChain.
names
.
push
(
'
OVM_Sequencer
'
)
addresses
.
push
((
hre
as
any
).
deployConfig
.
ovmSequencerAddress
)
// Add non-deployed addresses to the Address Setter arguments.
namesAndAddresses
=
[
...
namesAndAddresses
,
// L2CrossDomainMessenger is the address of the predeploy on L2. We can refactor off-chain
// services such that we can remove the need to set this address, but for now it's easier
// to simply keep setting the address.
{
name
:
'
L2CrossDomainMessenger
'
,
address
:
predeploys
.
L2CrossDomainMessenger
,
},
// OVM_Sequencer is the address allowed to submit "Sequencer" blocks to the
// CanonicalTransactionChain.
{
name
:
'
OVM_Sequencer
'
,
address
:
(
hre
as
any
).
deployConfig
.
ovmSequencerAddress
,
},
// OVM_Proposer is the address allowed to submit state roots (transaction results) to the
// StateCommitmentChain.
{
name
:
'
OVM_Proposer
'
,
address
:
(
hre
as
any
).
deployConfig
.
ovmProposerAddress
,
},
]
// OVM_Proposer is the address allowed to submit state roots (transaction results) to the
// StateCommitmentChain.
names
.
push
(
'
OVM_Proposer
'
)
addresses
.
push
((
hre
as
any
).
deployConfig
.
ovmProposerAddress
)
// Filter out all addresses that will not change, so that the log statement is maximally
// verifiable and readable.
namesAndAddresses
=
namesAndAddresses
.
filter
(
async
({
name
,
address
})
=>
{
const
existingAddress
=
await
Lib_AddressManager
.
getAddress
(
name
)
return
!
hexStringEquals
(
existingAddress
,
address
)
})
await
deployAndPostDeploy
({
hre
,
...
...
@@ -55,8 +75,12 @@ const deployFn: DeployFunction = async (hre) => {
args
:
[
Lib_AddressManager
.
address
,
(
hre
as
any
).
deployConfig
.
ovmAddressManagerOwner
,
names
,
addresses
,
namesAndAddresses
.
map
((
pair
)
=>
{
return
pair
.
name
}),
namesAndAddresses
.
map
((
pair
)
=>
{
return
pair
.
address
}),
],
})
}
...
...
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