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
4fc6f5e9
Unverified
Commit
4fc6f5e9
authored
Dec 23, 2021
by
Indeavr
Committed by
GitHub
Dec 23, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ethereum-optimism:develop' into develop
parents
b7b14fe2
4c363a62
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
157 deletions
+106
-157
silent-keys-hunt.md
.changeset/silent-keys-hunt.md
+5
-0
docker-compose.yml
ops/docker-compose.yml
+27
-22
Dockerfile.deployer
ops/docker/Dockerfile.deployer
+1
-1
deployer.sh
ops/scripts/deployer.sh
+73
-16
deploy.ts
packages/contracts/bin/deploy.ts
+0
-117
package.json
packages/contracts/package.json
+0
-1
No files found.
.changeset/silent-keys-hunt.md
0 → 100644
View file @
4fc6f5e9
---
'
@eth-optimism/contracts'
:
patch
---
Remove legacy bin/deploy.ts script
ops/docker-compose.yml
View file @
4fc6f5e9
...
@@ -22,28 +22,33 @@ services:
...
@@ -22,28 +22,33 @@ services:
target
:
deployer
target
:
deployer
entrypoint
:
./deployer.sh
entrypoint
:
./deployer.sh
environment
:
environment
:
FRAUD_PROOF_WINDOW_SECONDS
:
0
# Env vars for the deployment script.
L1_NODE_WEB3_URL
:
http://l1_chain:8545
CONTRACTS_RPC_URL
:
http://l1_chain:8545
# these keys are hardhat's first 3 accounts, DO NOT use in production
CONTRACTS_DEPLOYER_KEY
:
"
ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
DEPLOYER_PRIVATE_KEY
:
"
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
CONTRACTS_TARGET_NETWORK
:
"
custom"
SEQUENCER_PRIVATE_KEY
:
"
0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
OVM_ADDRESS_MANAGER_OWNER
:
"
0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
PROPOSER_PRIVATE_KEY
:
"
0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
OVM_PROPOSER_ADDRESS
:
"
0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
# Default hardhat account 5
OVM_SEQUENCER_ADDRESS
:
"
0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
GAS_PRICE_ORACLE_OWNER
:
"
0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
SCC_FRAUD_PROOF_WINDOW
:
0
# setting the whitelist owner to address(0) disables the whitelist
NUM_DEPLOY_CONFIRMATIONS
:
0
WHITELIST_OWNER
:
"
0x0000000000000000000000000000000000000000"
# skip compilation when run in docker-compose, since the contracts
L1_FEE_WALLET_ADDRESS
:
"
0x391716d440c151c42cdf1c95c1d83a5427bca52c"
# were already compiled in the builder step
L2_CHAIN_ID
:
420
NO_COMPILE
:
1
L2_BLOCK_GAS_LIMIT
:
15000000
BLOCK_SIGNER_ADDRESS
:
"
0x00000398232E2064F896018496b4b44b3D62751F"
# Env vars for the dump script.
GAS_PRICE_ORACLE_OVERHEAD
:
"
2750"
# Default hardhat account 5
GAS_PRICE_ORACLE_SCALAR
:
"
1500000"
GAS_PRICE_ORACLE_OWNER
:
"
0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
GAS_PRICE_ORACLE_L1_BASE_FEE
:
"
1"
# setting the whitelist owner to address(0) disables the whitelist
GAS_PRICE_ORACLE_GAS_PRICE
:
"
1"
WHITELIST_OWNER
:
"
0x0000000000000000000000000000000000000000"
GAS_PRICE_ORACLE_DECIMALS
:
"
6"
L1_FEE_WALLET_ADDRESS
:
"
0x391716d440c151c42cdf1c95c1d83a5427bca52c"
# skip compilation when run in docker-compose, since the contracts
L2_CHAIN_ID
:
420
# were already compiled in the builder step
L2_BLOCK_GAS_LIMIT
:
15000000
NO_COMPILE
:
1
BLOCK_SIGNER_ADDRESS
:
"
0x00000398232E2064F896018496b4b44b3D62751F"
GAS_PRICE_ORACLE_OVERHEAD
:
2750
GAS_PRICE_ORACLE_SCALAR
:
1500000
GAS_PRICE_ORACLE_L1_BASE_FEE
:
1
GAS_PRICE_ORACLE_GAS_PRICE
:
1
GAS_PRICE_ORACLE_DECIMALS
:
6
ports
:
ports
:
# expose the service to the host for getting the contract addrs
# expose the service to the host for getting the contract addrs
-
${DEPLOYER_PORT:-8080}:8081
-
${DEPLOYER_PORT:-8080}:8081
...
...
ops/docker/Dockerfile.deployer
View file @
4fc6f5e9
...
@@ -34,4 +34,4 @@ COPY packages/contracts/test/helpers/constants.ts ./test/helpers/constants.ts
...
@@ -34,4 +34,4 @@ COPY packages/contracts/test/helpers/constants.ts ./test/helpers/constants.ts
COPY packages/contracts/scripts ./scripts
COPY packages/contracts/scripts ./scripts
COPY ./ops/scripts/deployer.sh .
COPY ./ops/scripts/deployer.sh .
ENTRYPOINT yarn run deploy
CMD ./ops/scripts/deployer.sh
ops/scripts/deployer.sh
View file @
4fc6f5e9
#!/bin/bash
#!/bin/bash
set
-e
set
-e
uo
RETRIES
=
${
RETRIES
:-
20
}
RETRIES
=
${
RETRIES
:-
20
}
JSON
=
'{"jsonrpc":"2.0","id":0,"method":"net_version","params":[]}'
JSON
=
'{"jsonrpc":"2.0","id":0,"method":"net_version","params":[]}'
if
[
-z
"
$CONTRACTS_RPC_URL
"
]
;
then
echo
"Must specify
\$
CONTRACTS_RPC_URL."
exit
1
fi
# wait for the base layer to be up
# wait for the base layer to be up
curl
\
curl
\
--fail
\
--fail
\
...
@@ -14,30 +19,82 @@ curl \
...
@@ -14,30 +19,82 @@ curl \
--retry
$RETRIES
\
--retry
$RETRIES
\
--retry-delay
1
\
--retry-delay
1
\
-d
$JSON
\
-d
$JSON
\
$
L1_NODE_WEB3_URL
$
CONTRACTS_RPC_URL
>
/dev/null
yarn run deploy
echo
"Connected to L1."
echo
"Building deployment command."
function
envSet
()
{
DEPLOY_CMD
=
"npx hardhat deploy"
VAR
=
$1
export
$VAR
=
$(
cat
./dist/dumps/addresses.json | jq
-r
".
$2
"
)
# Helper method to concatenate things onto $DEPLOY_CMD.
# Usage: concat_cmd "str-to-concat"
function
concat_cmd
()
{
DEPLOY_CMD
=
"
$DEPLOY_CMD
$1
"
}
}
# set the address to the proxy gateway if possible
# Helper method to conditionally concatenate CLI arguments
envSet L1_STANDARD_BRIDGE_ADDRESS Proxy__OVM_L1StandardBridge
# when a given env var is defined.
if
[
$L1_STANDARD_BRIDGE_ADDRESS
==
null
]
;
then
# Usage: concat_arg "--arg-name" "env-var-name"
envSet L1_STANDARD_BRIDGE_ADDRESS L1StandardBridge
function
concat_arg
()
{
fi
ARG
=
$1
ENV_VAR
=
$2
if
[
-n
"
${
!ENV_VAR+x
}
"
]
;
then
echo
"
$ENV_VAR
set to
${
!ENV_VAR
}
, applying
$ARG
argument."
concat_cmd
"
$ARG
\"
${
!ENV_VAR
}
\"
"
else
echo
"
$ENV_VAR
is not not set, skipping
$ARG
argument."
fi
}
concat_arg
"--network"
"CONTRACTS_TARGET_NETWORK"
concat_arg
"--ovm-address-manager-owner"
"OVM_ADDRESS_MANAGER_OWNER"
concat_arg
"--ovm-proposer-address"
"OVM_PROPOSER_ADDRESS"
concat_arg
"--ovm-sequencer-address"
"OVM_SEQUENCER_ADDRESS"
concat_arg
"--l1-block-time-seconds"
"L1_BLOCK_TIME_SECONDS"
concat_arg
"--ctc-max-transaction-gas-limit"
"CTC_MAX_TRANSACTION_GAS_LIMIT"
concat_arg
"--ctc-l2-gas-discount-divisor"
"CTC_L2_GAS_DISCOUNT_DIVISOR"
concat_arg
"--ctc-enqueue-gas-cost"
"CTC_ENQUEUE_GAS_COST"
concat_arg
"--scc-fraud-proof-window"
"SCC_FRAUD_PROOF_WINDOW"
concat_arg
"--num-deploy-confirmations"
"NUM_DEPLOY_CONFIRMATIONS"
concat_arg
"--forked"
"FORKED"
echo
"Deploying contracts. Deployment command:"
echo
"
$DEPLOY_CMD
"
eval
"
$DEPLOY_CMD
"
echo
"Building addresses.json."
export
ADDRESS_MANAGER_ADDRESS
=
$(
cat
"./deployments/
$CONTRACTS_TARGET_NETWORK
/Lib_AddressManager.json"
| jq
-r
.address
)
# First, create two files. One of them contains a list of addresses, the other contains a list of contract names.
find
"./deployments/
$CONTRACTS_TARGET_NETWORK
"
-maxdepth
1
-name
'*.json'
| xargs
cat
| jq
-r
'.address'
>
addresses.txt
find
"./deployments/
$CONTRACTS_TARGET_NETWORK
"
-maxdepth
1
-name
'*.json'
|
sed
-e
"s/.
\/
deployments
\/
$CONTRACTS_TARGET_NETWORK
\/
//g"
|
sed
-e
's/.json//g'
>
filenames.txt
# Start building addresses.json.
echo
"{"
>>
addresses.json
# Zip the two files describe above together, then, switch their order and format as JSON.
paste
addresses.txt filenames.txt |
sed
-e
"s/^
\(
[^ ]
\+\)\s\+\(
[^ ]
\+\)
/
\"\2\"
:
\"\1\"
,/"
>>
addresses.json
# Add the address manager alias.
echo
"
\"
AddressManager
\"
:
\"
$ADDRESS_MANAGER_ADDRESS
\"
"
>>
addresses.json
# End addresses.json
echo
"}"
>>
addresses.json
echo
"Built addresses.json. Content:"
jq
.
addresses.json
echo
"Env vars for the dump script:"
export
L1_STANDARD_BRIDGE_ADDRESS
=
$(
cat
"./addresses.json"
| jq
-r
.Proxy__OVM_L1StandardBridge
)
export
L1_CROSS_DOMAIN_MESSENGER_ADDRESS
=
$(
cat
"./addresses.json"
| jq
-r
.Proxy__OVM_L1CrossDomainMessenger
)
echo
"ADDRESS_MANAGER_ADDRESS=
$ADDRESS_MANAGER_ADDRESS
"
echo
"L1_STANDARD_BRIDGE_ADDRESS=
$L1_STANDARD_BRIDGE_ADDRESS
"
echo
"L1_CROSS_DOMAIN_MESSENGER_ADDRESS=
$L1_CROSS_DOMAIN_MESSENGER_ADDRESS
"
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__OVM_L1CrossDomainMessenger
if
[
$L1_CROSS_DOMAIN_MESSENGER_ADDRESS
==
null
]
;
then
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS L1CrossDomainMessenger
fi
# build the dump file
echo
"Building dump file."
yarn run build:dump
yarn run build:dump
mv
addresses.json ./dist/dumps
# service the addresses and dumps
# service the addresses and dumps
echo
"Starting server."
python3
-m
http.server
\
python3
-m
http.server
\
--bind
"0.0.0.0"
8081
\
--bind
"0.0.0.0"
8081
\
--directory
./dist/dumps
--directory
./dist/dumps
packages/contracts/bin/deploy.ts
deleted
100755 → 0
View file @
b7b14fe2
// WARNING: DO NOT USE THIS FILE TO DEPLOY CONTRACTS TO PRODUCTION
// WE ARE REMOVING THIS FILE IN A FUTURE RELEASE, IT IS ONLY TO BE USED AS PART OF THE LOCAL
// DEPLOYMENT PROCESS. USE A DEPLOYMENT SCRIPT LOCATED IN scripts/deploy-scripts/ WHEN DEPLOYING
// TO A PRODUCTION ENVIRONMENT.
import
{
Wallet
}
from
'
ethers
'
import
path
from
'
path
'
import
dirtree
from
'
directory-tree
'
import
fs
from
'
fs
'
// Ensures that all relevant environment vars are properly set. These lines *must* come before the
// hardhat import because importing will load the config (which relies on these vars). Necessary
// because CI currently uses different var names than the ones we've chosen here.
// TODO: Update CI so that we don't have to do this anymore.
process
.
env
.
HARDHAT_NETWORK
=
'
custom
'
// "custom" here is an arbitrary name. only used for CI.
process
.
env
.
CONTRACTS_TARGET_NETWORK
=
'
custom
'
process
.
env
.
CONTRACTS_DEPLOYER_KEY
=
process
.
env
.
DEPLOYER_PRIVATE_KEY
process
.
env
.
CONTRACTS_RPC_URL
=
process
.
env
.
L1_NODE_WEB3_URL
||
'
http://127.0.0.1:8545
'
import
hre
from
'
hardhat
'
const
sequencer
=
new
Wallet
(
process
.
env
.
SEQUENCER_PRIVATE_KEY
)
const
proposer
=
new
Wallet
(
process
.
env
.
PROPOSER_PRIVATE_KEY
)
const
deployer
=
new
Wallet
(
process
.
env
.
DEPLOYER_PRIVATE_KEY
)
const
parseEnv
=
()
=>
{
const
ensure
=
(
env
,
type
)
=>
{
if
(
typeof
process
.
env
[
env
]
===
'
undefined
'
)
{
return
undefined
}
if
(
type
===
'
number
'
)
{
return
parseInt
(
process
.
env
[
env
],
10
)
}
return
process
.
env
[
env
]
}
return
{
l1BlockTimeSeconds
:
ensure
(
'
BLOCK_TIME_SECONDS
'
,
'
number
'
),
ctcMaxTransactionGasLimit
:
ensure
(
'
MAX_TRANSACTION_GAS_LIMIT
'
,
'
number
'
),
ctcL2GasDiscountDivisor
:
ensure
(
'
L2_GAS_DISCOUNT_DIVISOR
'
,
'
number
'
),
ctcEnqueueGasCost
:
ensure
(
'
ENQUEUE_GAS_COST
'
,
'
number
'
),
sccFraudProofWindow
:
ensure
(
'
FRAUD_PROOF_WINDOW_SECONDS
'
,
'
number
'
),
sccSequencerPublishWindow
:
ensure
(
'
SEQUENCER_PUBLISH_WINDOW_SECONDS
'
,
'
number
'
),
}
}
const
main
=
async
()
=>
{
// Just be really verbose about this...
console
.
log
(
`WARNING: DO NOT USE THIS FILE IN PRODUCTION! FOR LOCAL DEVELOPMENT ONLY!`
)
const
config
=
parseEnv
()
await
hre
.
run
(
'
deploy
'
,
{
l1BlockTimeSeconds
:
config
.
l1BlockTimeSeconds
,
ctcMaxTransactionGasLimit
:
config
.
ctcMaxTransactionGasLimit
,
ctcL2GasDiscountDivisor
:
config
.
ctcL2GasDiscountDivisor
,
ctcEnqueueGasCost
:
config
.
ctcEnqueueGasCost
,
sccFraudProofWindow
:
config
.
sccFraudProofWindow
,
sccSequencerPublishWindow
:
config
.
sccFraudProofWindow
,
ovmSequencerAddress
:
sequencer
.
address
,
ovmProposerAddress
:
proposer
.
address
,
ovmAddressManagerOwner
:
deployer
.
address
,
numDeployConfirmations
:
0
,
noCompile
:
process
.
env
.
NO_COMPILE
?
true
:
false
,
})
// Stuff below this line is currently required for CI to work properly. We probably want to
// update our CI so this is no longer necessary. But I'm adding it for backwards compat so we can
// get the hardhat-deploy stuff merged. Woot.
const
nicknames
=
{
Lib_AddressManager
:
'
AddressManager
'
,
}
const
contracts
:
any
=
dirtree
(
path
.
resolve
(
__dirname
,
`../deployments/custom`
)
)
.
children
.
filter
((
child
)
=>
{
return
child
.
extension
===
'
.json
'
})
.
reduce
((
contractsAccumulator
,
child
)
=>
{
const
contractName
=
child
.
name
.
replace
(
'
.json
'
,
''
)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const
artifact
=
require
(
path
.
resolve
(
__dirname
,
`../deployments/custom/
${
child
.
name
}
`
))
contractsAccumulator
[
nicknames
[
contractName
]
||
contractName
]
=
artifact
.
address
return
contractsAccumulator
},
{})
contracts
.
OVM_Sequencer
=
await
sequencer
.
getAddress
()
contracts
.
Deployer
=
await
deployer
.
getAddress
()
const
addresses
=
JSON
.
stringify
(
contracts
,
null
,
2
)
const
dumpsPath
=
path
.
resolve
(
__dirname
,
'
../dist/dumps
'
)
if
(
!
fs
.
existsSync
(
dumpsPath
))
{
fs
.
mkdirSync
(
dumpsPath
)
}
const
addrsPath
=
path
.
resolve
(
dumpsPath
,
'
addresses.json
'
)
fs
.
writeFileSync
(
addrsPath
,
addresses
)
}
main
()
.
then
(()
=>
process
.
exit
(
0
))
.
catch
((
error
)
=>
{
console
.
log
(
JSON
.
stringify
({
error
:
error
.
message
,
stack
:
error
.
stack
},
null
,
2
)
)
process
.
exit
(
1
)
})
packages/contracts/package.json
View file @
4fc6f5e9
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"clean"
:
"rm -rf ./dist ./artifacts ./cache ./coverage ./tsconfig.build.tsbuildinfo"
,
"clean"
:
"rm -rf ./dist ./artifacts ./cache ./coverage ./tsconfig.build.tsbuildinfo"
,
"deploy"
:
"ts-node bin/deploy.ts && yarn autogen:markdown"
,
"prepublishOnly"
:
"yarn copyfiles -u 1 -e
\"
**/test-*/**/*
\"
\"
contracts/**/*
\"
./"
,
"prepublishOnly"
:
"yarn copyfiles -u 1 -e
\"
**/test-*/**/*
\"
\"
contracts/**/*
\"
./"
,
"postpublish"
:
"rimraf chugsplash L1 L2 libraries standards"
,
"postpublish"
:
"rimraf chugsplash L1 L2 libraries standards"
,
"prepack"
:
"yarn prepublishOnly"
,
"prepack"
:
"yarn prepublishOnly"
,
...
...
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