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
3170d759
Unverified
Commit
3170d759
authored
May 01, 2023
by
OptimismBot
Committed by
GitHub
May 01, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5539 from ethereum-optimism/jm/deploy-testing-fixes
Improvements to enable deployment practice
parents
9f934838
72e114c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
.env.example
packages/contracts-bedrock/.env.example
+13
-2
hardhat.config.ts
packages/contracts-bedrock/hardhat.config.ts
+1
-1
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+12
-7
No files found.
packages/contracts-bedrock/.env.example
View file @
3170d759
...
@@ -8,6 +8,17 @@ PRIVATE_KEY_DEPLOYER=
...
@@ -8,6 +8,17 @@ PRIVATE_KEY_DEPLOYER=
TENDERLY_PROJECT=
TENDERLY_PROJECT=
TENDERLY_USERNAME=
TENDERLY_USERNAME=
# Optional boolean to define if cast commands should be printed.
# Useful during migration testing
# The following settings are useful for manually testing the migration scripts.
# Define if cast commands should be printed.
CAST_COMMANDS=1
CAST_COMMANDS=1
# Saves deployment artifacts when using the 'live' network
SAVE_DEPLOYMENTS=1
# Disable the live deployer so that transactions must be submitted manually
DISABLE_LIVE_DEPLOYER=true
# Sets the deployer's key to match the first default hardhat account
PRIVATE_KEY_DEPLOYER=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
packages/contracts-bedrock/hardhat.config.ts
View file @
3170d759
...
@@ -25,7 +25,7 @@ const config: HardhatUserConfig = {
...
@@ -25,7 +25,7 @@ const config: HardhatUserConfig = {
local
:
{
local
:
{
live
:
false
,
live
:
false
,
url
:
'
http://localhost:8545
'
,
url
:
'
http://localhost:8545
'
,
saveDeployments
:
false
,
saveDeployments
:
!!
process
.
env
.
SAVE_DEPLOYMENTS
||
false
,
accounts
:
[
accounts
:
[
'
ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'
,
'
ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'
,
],
],
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
3170d759
...
@@ -359,19 +359,19 @@ export const doOwnershipTransfer = async (opts: {
...
@@ -359,19 +359,19 @@ export const doOwnershipTransfer = async (opts: {
* Check if the script should submit the transaction or wait for the deployer to do it manually.
* Check if the script should submit the transaction or wait for the deployer to do it manually.
*
*
* @param hre HardhatRuntimeEnvironment.
* @param hre HardhatRuntimeEnvironment.
* @param ovveride Allow m
* @param ovveride Allow m
anually disabling live transaction submission. Useful for testing.
* @returns True if the current step is the target step.
* @returns True if the current step is the target step.
*/
*/
export
const
liveDeployer
=
async
(
opts
:
{
export
const
liveDeployer
=
async
(
opts
:
{
hre
:
HardhatRuntimeEnvironment
hre
:
HardhatRuntimeEnvironment
disabled
:
string
|
undefined
disabled
:
string
|
undefined
}):
Promise
<
boolean
>
=>
{
}):
Promise
<
boolean
>
=>
{
let
ret
:
boolean
if
(
!!
opts
.
disabled
)
{
if
(
!!
opts
.
disabled
)
{
ret
=
false
console
.
log
(
'
Setting live deployer to
'
,
false
)
return
false
}
}
const
{
deployer
}
=
await
opts
.
hre
.
getNamedAccounts
()
const
{
deployer
}
=
await
opts
.
hre
.
getNamedAccounts
()
ret
=
const
ret
=
deployer
.
toLowerCase
()
===
opts
.
hre
.
deployConfig
.
controller
.
toLowerCase
()
deployer
.
toLowerCase
()
===
opts
.
hre
.
deployConfig
.
controller
.
toLowerCase
()
console
.
log
(
'
Setting live deployer to
'
,
ret
)
console
.
log
(
'
Setting live deployer to
'
,
ret
)
return
ret
return
ret
...
@@ -447,6 +447,7 @@ export const doStep = async (opts: {
...
@@ -447,6 +447,7 @@ 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
}
`
)
printJsonTransaction
(
tx
)
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
await
printTenderlySimulationLink
(
opts
.
SystemDictator
.
provider
,
tx
)
}
}
...
@@ -547,8 +548,12 @@ export const printTenderlySimulationLink = async (
...
@@ -547,8 +548,12 @@ 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
(
if
(
!!
tx
.
value
&&
tx
.
value
.
gt
(
0
))
{
`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
}
`
)
}
else
{
console
.
log
(
`cast send
${
tx
.
to
}
${
tx
.
data
}
--from
${
tx
.
from
}
`
)
}
}
}
}
}
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