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
22c3885f
Commit
22c3885f
authored
Mar 13, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Optionally print cast commands during migration
parent
711ebbe8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
0 deletions
+29
-0
chilled-melons-speak.md
.changeset/chilled-melons-speak.md
+5
-0
.env.example
packages/contracts-bedrock/.env.example
+4
-0
020-SystemDictatorSteps-1.ts
...ges/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
+4
-0
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+4
-0
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+12
-0
No files found.
.changeset/chilled-melons-speak.md
0 → 100644
View file @
22c3885f
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Optionally print cast commands during migration
packages/contracts-bedrock/.env.example
View file @
22c3885f
...
@@ -7,3 +7,7 @@ PRIVATE_KEY_DEPLOYER=
...
@@ -7,3 +7,7 @@ PRIVATE_KEY_DEPLOYER=
# Optional Tenderly details for a simulation link during deployment
# Optional Tenderly details for a simulation link during deployment
TENDERLY_PROJECT=
TENDERLY_PROJECT=
TENDERLY_USERNAME=
TENDERLY_USERNAME=
# Optional boolean to define if cast commands should be printed.
# Useful during migration testing
CAST_COMMANDS=1
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
22c3885f
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
doStep
,
doStep
,
jsonifyTransaction
,
jsonifyTransaction
,
getTenderlySimulationLink
,
getTenderlySimulationLink
,
getCastCommand
,
}
from
'
../src/deploy-utils
'
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
@@ -98,6 +99,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -98,6 +99,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
@@ -135,6 +137,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -135,6 +137,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
@@ -172,6 +175,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -172,6 +175,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
22c3885f
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
isStep
,
isStep
,
doStep
,
doStep
,
getTenderlySimulationLink
,
getTenderlySimulationLink
,
getCastCommand
,
}
from
'
../src/deploy-utils
'
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
@@ -194,6 +195,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -194,6 +195,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
@@ -305,6 +307,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -305,6 +307,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
@@ -334,6 +337,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -334,6 +337,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
22c3885f
...
@@ -395,3 +395,15 @@ export const getTenderlySimulationLink = async (
...
@@ -395,3 +395,15 @@ export const getTenderlySimulationLink = async (
}).
toString
()}
`
}).
toString
()}
`
}
}
}
}
/**
* Returns a cast commmand for submitting a given transaction.
*
* @param tx Ethers transaction object.
* @returns the cast command
*/
export
const
getCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
if
(
process
.
env
.
CAST_COMMANDS
)
{
return
`cast send
${
tx
.
to
}
${
tx
.
data
}
--from
${
tx
.
from
}
--value
${
tx
.
value
}
`
}
}
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