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
f52c0752
Commit
f52c0752
authored
Mar 07, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Print tenderly simulation URLs during deployment
parent
7617117c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
0 deletions
+45
-0
wicked-ads-pump.md
.changeset/wicked-ads-pump.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
+28
-0
No files found.
.changeset/wicked-ads-pump.md
0 → 100644
View file @
f52c0752
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Print tenderly simulation links during deployment
packages/contracts-bedrock/.env.example
View file @
f52c0752
...
@@ -3,3 +3,7 @@ L1_RPC=
...
@@ -3,3 +3,7 @@ L1_RPC=
# Private key for the deployer account
# Private key for the deployer account
PRIVATE_KEY_DEPLOYER=
PRIVATE_KEY_DEPLOYER=
# Optional Tenderly details for a simulation link during deployment
TENDERLY_PROJECT=
TENDERLY_USERNAME=
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
f52c0752
...
@@ -13,6 +13,7 @@ import {
...
@@ -13,6 +13,7 @@ import {
getDeploymentAddress
,
getDeploymentAddress
,
doStep
,
doStep
,
jsonifyTransaction
,
jsonifyTransaction
,
getTenderlySimulationLink
,
}
from
'
../src/deploy-utils
'
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
@@ -97,6 +98,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -97,6 +98,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
// Wait for the ownership transfer to complete.
// Wait for the ownership transfer to complete.
...
@@ -133,6 +135,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -133,6 +135,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
// Wait for the ownership transfer to complete.
// Wait for the ownership transfer to complete.
...
@@ -169,6 +172,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -169,6 +172,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
// Wait for the ownership transfer to complete.
// Wait for the ownership transfer to complete.
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
f52c0752
...
@@ -13,6 +13,7 @@ import {
...
@@ -13,6 +13,7 @@ import {
jsonifyTransaction
,
jsonifyTransaction
,
isStep
,
isStep
,
doStep
,
doStep
,
getTenderlySimulationLink
,
}
from
'
../src/deploy-utils
'
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
@@ -193,6 +194,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -193,6 +194,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
await
awaitCondition
(
await
awaitCondition
(
...
@@ -303,6 +305,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -303,6 +305,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
await
awaitCondition
(
await
awaitCondition
(
...
@@ -331,6 +334,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -331,6 +334,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
(
await
getTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
))
}
}
await
awaitCondition
(
await
awaitCondition
(
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
f52c0752
import
assert
from
'
assert
'
import
assert
from
'
assert
'
import
{
URLSearchParams
}
from
'
url
'
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
ethers
,
Contract
}
from
'
ethers
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
...
@@ -293,6 +294,7 @@ export const getDeploymentAddress = async (
...
@@ -293,6 +294,7 @@ export const getDeploymentAddress = async (
export
const
jsonifyTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
export
const
jsonifyTransaction
=
(
tx
:
ethers
.
PopulatedTransaction
):
string
=>
{
return
JSON
.
stringify
(
return
JSON
.
stringify
(
{
{
from
:
tx
.
from
,
to
:
tx
.
to
,
to
:
tx
.
to
,
data
:
tx
.
data
,
data
:
tx
.
data
,
value
:
tx
.
value
,
value
:
tx
.
value
,
...
@@ -354,6 +356,9 @@ export const doStep = async (opts: {
...
@@ -354,6 +356,9 @@ export const doStep = async (opts: {
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
opts
.
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
jsonifyTransaction
(
tx
))
console
.
log
(
await
getTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
)
}
}
// Wait for the step to complete.
// Wait for the step to complete.
...
@@ -368,3 +373,26 @@ export const doStep = async (opts: {
...
@@ -368,3 +373,26 @@ export const doStep = async (opts: {
// Perform post-step checks.
// Perform post-step checks.
await
opts
.
checks
()
await
opts
.
checks
()
}
}
/**
* Returns 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
getTenderlySimulationLink
=
async
(
provider
:
ethers
.
providers
.
Provider
,
tx
:
ethers
.
PopulatedTransaction
):
Promise
<
string
>
=>
{
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
()}
`
}
}
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