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
02b5d60b
Commit
02b5d60b
authored
Apr 05, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Change string getter funcs to printers
parent
8e76fac4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
34 deletions
+34
-34
020-SystemDictatorSteps-1.ts
...ges/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
+8
-8
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+8
-8
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+18
-18
No files found.
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
02b5d60b
...
...
@@ -13,8 +13,8 @@ import {
getDeploymentAddress
,
doPhase
,
jsonifyTransaction
,
ge
tTenderlySimulationLink
,
ge
tCastCommand
,
prin
tTenderlySimulationLink
,
prin
tCastCommand
,
}
from
'
../src/deploy-utils
'
const
uint128Max
=
ethers
.
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
)
...
...
@@ -101,8 +101,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
// Wait for the ownership transfer to complete.
...
...
@@ -139,8 +139,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
// Wait for the ownership transfer to complete.
...
...
@@ -177,8 +177,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
// Wait for the ownership transfer to complete.
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
02b5d60b
...
...
@@ -13,8 +13,8 @@ import {
jsonifyTransaction
,
isStep
,
doStep
,
ge
tTenderlySimulationLink
,
ge
tCastCommand
,
prin
tTenderlySimulationLink
,
prin
tCastCommand
,
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
...
@@ -208,8 +208,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
await
awaitCondition
(
...
...
@@ -320,8 +320,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
await
awaitCondition
(
...
...
@@ -350,8 +350,8 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
getCastCommand
(
tx
)
)
console
.
log
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
await
awaitCondition
(
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
02b5d60b
...
...
@@ -391,7 +391,7 @@ export const doStep = async (opts: {
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
ge
tTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
await
prin
tTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
}
...
...
@@ -447,7 +447,7 @@ export const doPhase = async (opts: {
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
ge
tTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
await
prin
tTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
}
...
...
@@ -465,36 +465,36 @@ export const doPhase = async (opts: {
}
/**
*
Return
s a direct link to a Tenderly simulation.
*
Print
s a direct link to a Tenderly simulation.
*
* @param provider Ethers Provider.
* @param tx Ethers transaction object.
* @returns the url of the tenderly simulation.
*/
export
const
ge
tTenderlySimulationLink
=
async
(
export
const
prin
tTenderlySimulationLink
=
async
(
provider
:
ethers
.
providers
.
Provider
,
tx
:
ethers
.
PopulatedTransaction
):
Promise
<
string
>
=>
{
):
Promise
<
void
>
=>
{
if
(
process
.
env
.
TENDERLY_PROJECT
&&
process
.
env
.
TENDERLY_USERNAME
)
{
return
`https://dashboard.tenderly.co/
${
process
.
env
.
TENDERLY_PROJECT
}
/
${
process
.
env
.
TENDERLY_USERNAME
}
/simulator/new?
${
new
URLSearchParams
({
network
:
(
await
provider
.
getNetwork
()).
chainId
.
toString
(),
contractAddress
:
tx
.
to
,
rawFunctionInput
:
tx
.
data
,
from
:
tx
.
from
,
}).
toString
()}
`
console
.
log
(
`https://dashboard.tenderly.co/
${
process
.
env
.
TENDERLY_PROJECT
}
/
${
process
.
env
.
TENDERLY_USERNAME
}
/simulator/new?
${
new
URLSearchParams
({
network
:
(
await
provider
.
getNetwork
()).
chainId
.
toString
(),
contractAddress
:
tx
.
to
,
rawFunctionInput
:
tx
.
data
,
from
:
tx
.
from
,
}).
toString
()}
`
)
}
}
/**
*
Return
s a cast commmand for submitting a given transaction.
*
Print
s a cast commmand for submitting a given transaction.
*
* @param tx Ethers transaction object.
* @returns the cast command
*/
export
const
getCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
export
const
printCastCommand
=
(
tx
:
ethers
.
PopulatedTransaction
):
void
=>
{
if
(
process
.
env
.
CAST_COMMANDS
)
{
return
`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