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
Show 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 {
...
@@ -12,7 +12,7 @@ import {
getContractsFromArtifacts
,
getContractsFromArtifacts
,
getDeploymentAddress
,
getDeploymentAddress
,
doPhase
,
doPhase
,
jsonify
Transaction
,
printJson
Transaction
,
printTenderlySimulationLink
,
printTenderlySimulationLink
,
printCastCommand
,
printCastCommand
,
}
from
'
../src/deploy-utils
'
}
from
'
../src/deploy-utils
'
...
@@ -99,8 +99,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -99,8 +99,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`Please transfer AddressManager owner to MSD`
)
console
.
log
(
`Please transfer AddressManager owner to MSD`
)
console
.
log
(
`AddressManager address:
${
AddressManager
.
address
}
`
)
console
.
log
(
`AddressManager address:
${
AddressManager
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
}
...
@@ -137,8 +136,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -137,8 +136,7 @@ const deployFn: DeployFunction = async (hre) => {
`L1StandardBridgeProxy address:
${
L1StandardBridgeProxy
.
address
}
`
`L1StandardBridgeProxy address:
${
L1StandardBridgeProxy
.
address
}
`
)
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
}
...
@@ -175,8 +173,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -175,8 +173,7 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`Please transfer L1ERC721Bridge (proxy) owner to MSD`
)
console
.
log
(
`Please transfer L1ERC721Bridge (proxy) owner to MSD`
)
console
.
log
(
`L1ERC721BridgeProxy address:
${
L1ERC721BridgeProxy
.
address
}
`
)
console
.
log
(
`L1ERC721BridgeProxy address:
${
L1ERC721BridgeProxy
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
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'
...
@@ -10,7 +10,7 @@ import '@nomiclabs/hardhat-ethers'
import
{
import
{
assertContractVariable
,
assertContractVariable
,
getContractsFromArtifacts
,
getContractsFromArtifacts
,
jsonify
Transaction
,
printJson
Transaction
,
isStep
,
isStep
,
doStep
,
doStep
,
printTenderlySimulationLink
,
printTenderlySimulationLink
,
...
@@ -206,8 +206,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -206,8 +206,7 @@ const deployFn: DeployFunction = async (hre) => {
)
)
)
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
}
...
@@ -318,8 +317,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -318,8 +317,7 @@ const deployFn: DeployFunction = async (hre) => {
const
tx
=
await
OptimismPortal
.
populateTransaction
.
unpause
()
const
tx
=
await
OptimismPortal
.
populateTransaction
.
unpause
()
console
.
log
(
`Please unpause the OptimismPortal...`
)
console
.
log
(
`Please unpause the OptimismPortal...`
)
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
}
...
@@ -348,8 +346,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -348,8 +346,7 @@ const deployFn: DeployFunction = async (hre) => {
const
tx
=
await
SystemDictator
.
populateTransaction
.
finalize
()
const
tx
=
await
SystemDictator
.
populateTransaction
.
finalize
()
console
.
log
(
`Please finalize deployment...`
)
console
.
log
(
`Please finalize deployment...`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
printCastCommand
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
}
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
153e5781
...
@@ -305,8 +305,10 @@ export const getDeploymentAddress = async (
...
@@ -305,8 +305,10 @@ export const getDeploymentAddress = async (
* @param tx Ethers transaction object.
* @param tx Ethers transaction object.
* @returns JSON-ified transaction object.
* @returns JSON-ified transaction object.
*/
*/
export
const
jsonifyTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
export
const
printJsonTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
return
JSON
.
stringify
(
console
.
log
(
'
JSON transaction parameters:
\n
'
+
JSON
.
stringify
(
{
{
from
:
tx
.
from
,
from
:
tx
.
from
,
to
:
tx
.
to
,
to
:
tx
.
to
,
...
@@ -317,6 +319,7 @@ export const jsonifyTransaction = (tx: ethers.PopulatedTransaction): string => {
...
@@ -317,6 +319,7 @@ export const jsonifyTransaction = (tx: ethers.PopulatedTransaction): string => {
null
,
null
,
2
2
)
)
)
}
}
/**
/**
...
@@ -388,11 +391,8 @@ export const doStep = async (opts: {
...
@@ -388,11 +391,8 @@ export const doStep = async (opts: {
]()
]()
console
.
log
(
`Please execute step
${
opts
.
step
}
...`
)
console
.
log
(
`Please execute step
${
opts
.
step
}
...`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
}
}
// Wait for the step to complete.
// Wait for the step to complete.
...
@@ -444,11 +444,8 @@ export const doPhase = async (opts: {
...
@@ -444,11 +444,8 @@ export const doPhase = async (opts: {
]()
]()
console
.
log
(
`Please execute phase
${
opts
.
phase
}
...`
)
console
.
log
(
`Please execute phase
${
opts
.
phase
}
...`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
printJsonTransaction
(
tx
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
}
}
// Wait for the step to complete.
// Wait for the step to complete.
...
@@ -495,6 +492,8 @@ export const printTenderlySimulationLink = async (
...
@@ -495,6 +492,8 @@ export const printTenderlySimulationLink = async (
*/
*/
export
const
printCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
export
const
printCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
if
(
process
.
env
.
CAST_COMMANDS
)
{
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