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
153e5781
Commit
153e5781
authored
Apr 05, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Change json tx getter func to printer
parent
02b5d60b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
36 deletions
+29
-36
020-SystemDictatorSteps-1.ts
...ges/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
+4
-7
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+4
-7
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+21
-22
No files found.
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
153e5781
...
...
@@ -12,7 +12,7 @@ import {
getContractsFromArtifacts
,
getDeploymentAddress
,
doPhase
,
jsonify
Transaction
,
printJson
Transaction
,
printTenderlySimulationLink
,
printCastCommand
,
}
from
'
../src/deploy-utils
'
...
...
@@ -99,8 +99,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`Please transfer AddressManager owner to MSD`
)
console
.
log
(
`AddressManager address:
${
AddressManager
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
@@ -137,8 +136,7 @@ const deployFn: DeployFunction = async (hre) => {
`L1StandardBridgeProxy address:
${
L1StandardBridgeProxy
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
@@ -175,8 +173,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`Please transfer L1ERC721Bridge (proxy) owner to MSD`
)
console
.
log
(
`L1ERC721BridgeProxy address:
${
L1ERC721BridgeProxy
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
153e5781
...
...
@@ -10,7 +10,7 @@ import '@nomiclabs/hardhat-ethers'
import
{
assertContractVariable
,
getContractsFromArtifacts
,
jsonify
Transaction
,
printJson
Transaction
,
isStep
,
doStep
,
printTenderlySimulationLink
,
...
...
@@ -206,8 +206,7 @@ const deployFn: DeployFunction = async (hre) => {
)
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
@@ -318,8 +317,7 @@ const deployFn: DeployFunction = async (hre) => {
const
tx
=
await
OptimismPortal
.
populateTransaction
.
unpause
()
console
.
log
(
`Please unpause the OptimismPortal...`
)
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
@@ -348,8 +346,7 @@ const deployFn: DeployFunction = async (hre) => {
const
tx
=
await
SystemDictator
.
populateTransaction
.
finalize
()
console
.
log
(
`Please finalize deployment...`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
153e5781
...
...
@@ -305,17 +305,20 @@ export const getDeploymentAddress = async (
* @param tx Ethers transaction object.
* @returns JSON-ified transaction object.
*/
export
const
jsonifyTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
return
JSON
.
stringify
(
{
from
:
tx
.
from
,
to
:
tx
.
to
,
data
:
tx
.
data
,
value
:
tx
.
value
,
chainId
:
tx
.
chainId
,
},
null
,
2
export
const
printJsonTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
console
.
log
(
'
JSON transaction parameters:
\n
'
+
JSON
.
stringify
(
{
from
:
tx
.
from
,
to
:
tx
.
to
,
data
:
tx
.
data
,
value
:
tx
.
value
,
chainId
:
tx
.
chainId
,
},
null
,
2
)
)
}
...
...
@@ -388,11 +391,8 @@ export const doStep = async (opts: {
]()
console
.
log
(
`Please execute step
${
opts
.
step
}
...`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
printJsonTransaction
(
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
}
// Wait for the step to complete.
...
...
@@ -444,11 +444,8 @@ export const doPhase = async (opts: {
]()
console
.
log
(
`Please execute phase
${
opts
.
phase
}
...`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
printJsonTransaction
(
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
}
// Wait for the step to complete.
...
...
@@ -495,6 +492,8 @@ export const printTenderlySimulationLink = async (
*/
export
const
printCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
if
(
process
.
env
.
CAST_COMMANDS
)
{
console
.
log
(
`cast send
${
tx
.
to
}
${
tx
.
data
}
--from
${
tx
.
from
}
--value
${
tx
.
value
}
`
)
console
.
log
(
`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