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
76705dcf
Unverified
Commit
76705dcf
authored
Nov 04, 2022
by
Mark Tyneway
Committed by
GitHub
Nov 04, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3841 from nfl0/develop
Removed unused tasks in contracts-bedrock
parents
2fec1f8f
39c1a09f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
155 deletions
+0
-155
check-l2-config.ts
packages/contracts-bedrock/tasks/check-l2-config.ts
+0
-79
index.ts
packages/contracts-bedrock/tasks/index.ts
+0
-2
rollup-config.ts
packages/contracts-bedrock/tasks/rollup-config.ts
+0
-74
No files found.
packages/contracts-bedrock/tasks/check-l2-config.ts
deleted
100644 → 0
View file @
2fec1f8f
import
{
task
,
types
}
from
'
hardhat/config
'
import
{
providers
,
Contract
}
from
'
ethers
'
import
'
@nomiclabs/hardhat-ethers
'
import
'
hardhat-deploy
'
import
{
predeploys
}
from
'
../src
'
task
(
'
check-l2-config
'
,
'
Validate L2 config
'
)
.
addParam
(
'
l2ProviderUrl
'
,
'
L2 provider URL.
'
,
'
http://localhost:9545
'
,
types
.
string
)
.
setAction
(
async
(
args
,
hre
)
=>
{
const
l2Provider
=
new
providers
.
JsonRpcProvider
(
args
.
l2ProviderUrl
)
const
loadPredeploy
=
async
(
name
:
string
):
Promise
<
Contract
>
=>
{
const
artifact
=
await
hre
.
artifacts
.
readArtifact
(
name
)
return
new
Contract
(
predeploys
[
name
],
artifact
.
abi
,
l2Provider
)
}
const
getContractAddress
=
async
(
name
:
string
):
Promise
<
string
>
=>
{
const
deployment
=
await
hre
.
deployments
.
get
(
name
)
return
deployment
.
address
}
// Verify that all predeploys have code.
// TODO: Actually check that the predeploys have the expected code.
for
(
const
[
name
,
address
]
of
Object
.
entries
(
predeploys
))
{
const
code
=
await
l2Provider
.
getCode
(
address
)
if
(
code
===
'
0x
'
)
{
throw
new
Error
(
`Missing code for
${
name
}
`
)
}
}
// Confirming that L2CrossDomainMessenger.otherMessenger() is set properly.
const
L2CrossDomainMessenger
=
await
loadPredeploy
(
'
L2CrossDomainMessenger
'
)
const
actualOtherMessenger
=
await
getContractAddress
(
'
L1CrossDomainMessengerProxy
'
)
const
expectedOtherMessenger
=
await
L2CrossDomainMessenger
.
otherMessenger
()
if
(
expectedOtherMessenger
!==
actualOtherMessenger
)
{
throw
new
Error
(
`L2CrossDomainMessenger otherMessenger not set correctly. Got
${
actualOtherMessenger
}
, expected
${
actualOtherMessenger
}
`
)
}
// Confirming that L2StandardBridge.messenger() is set properly.
const
L2StandardBridge
=
await
loadPredeploy
(
'
L2StandardBridge
'
)
const
actualMessenger
=
await
L2StandardBridge
.
messenger
()
const
expectedMessenger
=
predeploys
.
L2CrossDomainMessenger
if
(
expectedMessenger
!==
actualMessenger
)
{
throw
new
Error
(
`L2StandardBridge messenger not set correctly. Got
${
actualMessenger
}
, expected
${
expectedMessenger
}
`
)
}
// Confirming that L2StandardBridge.otherBridge() is set properly.
const
actualOtherBridge
=
await
getContractAddress
(
'
L1StandardBridgeProxy
'
)
const
expectedOtherBridge
=
await
L2StandardBridge
.
otherBridge
()
if
(
expectedOtherBridge
!==
actualOtherBridge
)
{
throw
new
Error
(
`L2StandardBridge otherBridge not set correctly. Got
${
actualMessenger
}
, expected
${
expectedOtherBridge
}
`
)
}
// Confirming that OptimismMintableERC20Factory.bridge() is set properly.
const
OptimismMintableERC20Factory
=
await
loadPredeploy
(
'
OptimismMintableERC20Factory
'
)
const
actualBridge
=
await
OptimismMintableERC20Factory
.
bridge
()
const
expectedBridge
=
predeploys
.
L2StandardBridge
if
(
expectedBridge
!==
actualBridge
)
{
throw
new
Error
(
`OptimismMintableERC20Factory bridge not set correctly. Got
${
actualBridge
}
, expected
${
expectedBridge
}
`
)
}
})
packages/contracts-bedrock/tasks/index.ts
View file @
76705dcf
import
'
./deposits
'
import
'
./deposits
'
import
'
./rekey
'
import
'
./rekey
'
import
'
./rollup-config
'
import
'
./check-op-node
'
import
'
./check-op-node
'
import
'
./check-l2-config
'
import
'
./watch
'
import
'
./watch
'
import
'
./forge-verify
'
import
'
./forge-verify
'
import
'
./validate-spacers
'
import
'
./validate-spacers
'
...
...
packages/contracts-bedrock/tasks/rollup-config.ts
deleted
100644 → 0
View file @
2fec1f8f
import
fs
from
'
fs
'
import
{
task
}
from
'
hardhat/config
'
import
{
OpNodeConfig
,
getChainId
}
from
'
@eth-optimism/core-utils
'
import
{
ethers
}
from
'
ethers
'
import
'
hardhat-deploy
'
import
'
@eth-optimism/hardhat-deploy-config
'
task
(
'
rollup-config
'
,
'
create a genesis config
'
)
.
addOptionalParam
(
'
outfile
'
,
'
The file to write the output JSON to
'
,
'
rollup.json
'
)
.
addOptionalParam
(
'
l1RpcUrl
'
,
'
The L1 RPC URL
'
,
'
http://127.0.0.1:8545
'
)
.
addOptionalParam
(
'
l2RpcUrl
'
,
'
The L2 RPC URL
'
,
'
http://127.0.0.1:9545
'
)
.
setAction
(
async
(
args
,
hre
)
=>
{
const
{
deployConfig
}
=
hre
const
l1
=
new
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l1RpcUrl
)
const
l2
=
new
ethers
.
providers
.
StaticJsonRpcProvider
(
args
.
l2RpcUrl
)
// sanity check our RPC connections
const
l1ChainID
=
await
getChainId
(
l1
)
if
(
l1ChainID
!==
deployConfig
.
l1ChainID
)
{
throw
new
Error
(
`connected to L1 RPC
${
args
.
l1RpcUrl
}
yielded chain ID
${
l1ChainID
}
but expected
${
deployConfig
.
l1ChainID
}
`
)
}
const
l2ChainID
=
await
getChainId
(
l2
)
if
(
l2ChainID
!==
deployConfig
.
l2ChainID
)
{
throw
new
Error
(
`connected to L2 RPC
${
args
.
l2RpcUrl
}
yielded chain ID
${
l2ChainID
}
but expected
${
deployConfig
.
l2ChainID
}
`
)
}
const
l2GenesisBlock
=
await
l2
.
getBlock
(
'
earliest
'
)
const
portal
=
await
hre
.
deployments
.
get
(
'
OptimismPortalProxy
'
)
const
l1StartingBlock
=
await
l1
.
getBlock
(
deployConfig
.
l1StartingBlockTag
)
if
(
l1StartingBlock
===
null
)
{
throw
new
Error
(
`Cannot fetch block tag
${
deployConfig
.
l1StartingBlockTag
}
`
)
}
const
config
:
OpNodeConfig
=
{
genesis
:
{
l1
:
{
hash
:
l1StartingBlock
.
hash
,
number
:
l1StartingBlock
.
number
,
},
l2
:
{
hash
:
l2GenesisBlock
.
hash
,
number
:
l2GenesisBlock
.
number
,
},
l2_time
:
l1StartingBlock
.
timestamp
,
},
block_time
:
deployConfig
.
l2BlockTime
,
max_sequencer_drift
:
deployConfig
.
maxSequencerDrift
,
seq_window_size
:
deployConfig
.
sequencerWindowSize
,
channel_timeout
:
deployConfig
.
channelTimeout
,
l1_chain_id
:
deployConfig
.
l1ChainID
,
l2_chain_id
:
deployConfig
.
l2ChainID
,
p2p_sequencer_address
:
deployConfig
.
p2pSequencerAddress
,
batch_inbox_address
:
deployConfig
.
batchInboxAddress
,
batch_sender_address
:
deployConfig
.
batchSenderAddress
,
deposit_contract_address
:
portal
.
address
,
}
fs
.
writeFileSync
(
args
.
outfile
,
JSON
.
stringify
(
config
,
null
,
2
))
})
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