-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-evm-contracts.sh
executable file
·90 lines (73 loc) · 3.74 KB
/
setup-evm-contracts.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# Copyright (c) 2024, Circle Internet Group, Inc.
# All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
echo "Deploying evm-cctp-contracts contracts"
FOUNDRY_PATH=~/.foundry/bin
# Check if foundry is installed
if ! "$FOUNDRY_PATH/forge" -V; then
curl -L https://foundry.paradigm.xyz | bash
# 07-14-2023 - The version following this version breaks our build, so setting to this version for now.
if ! "$FOUNDRY_PATH/foundryup" -V; then
FOUNDRY_PATH=~/.config/.foundry/bin
fi
"$FOUNDRY_PATH/foundryup" --version nightly-d369d2486f85576eec4ca41d277391dfdae21ba7
fi
cd evm-cctp-contracts
# Update submodules
git submodule update --init --recursive
# Install any needed dependency
yarn install
# Build the anvil image
docker build --no-cache -f Dockerfile -t foundry .
# Create the anvil container
docker stop anvil-eth && docker rm anvil-eth || true
docker run -d -p 8500:8545 --name anvil-eth --rm foundry "anvil --host 0.0.0.0 -a 13 --code-size-limit 250000"
# Define the contract parameters
RPC_URL_ETH=http://localhost:8500
SENDER='0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc'
export MESSAGE_TRANSMITTER_DEPLOYER_KEY=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a
export TOKEN_MESSENGER_DEPLOYER_KEY=0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6
export TOKEN_MINTER_DEPLOYER_KEY=0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a
export TOKEN_CONTROLLER_DEPLOYER_KEY=0x701b615bbdfb9de65240bc28bd21bbc0d996645a3dd57e7b12bc2bdf6f192c82
export ATTESTER_ADDRESS=0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f
export USDC_CONTRACT_ADDRESS=0x700b6a60ce7eaaea56f065753d8dcb9653dbad35
export TOKEN_CONTROLLER_ADDRESS=0x71be63f3384f5fb98995898a86b02fb2426c5788
export BURN_LIMIT_PER_MESSAGE=100000
export REMOTE_TOKEN_MESSENGER_ADDRESS=0x057ef64E23666F000b34aE31332854aCBd1c8544
export REMOTE_USDC_CONTRACT_ADDRESS=0x700b6a60ce7eaaea56f065753d8dcb9653dbad35
# Arbitrary addresses
export MESSAGE_TRANSMITTER_PAUSER_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export TOKEN_MINTER_PAUSER_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export MESSAGE_TRANSMITTER_RESCUER_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export TOKEN_MESSENGER_RESCUER_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export TOKEN_MINTER_RESCUER_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export MASTER_MINTER_ADDRESS=0xa0ee7a142d267c1f36714e4a8f75612f20a79720
export TOKEN_MINTER_ADDRESS=0xbdEd0D2bf404bdcBa897a74E6657f1f12e5C6fb6
export DUMMY_ADDRESS=0xfabb0ac9d68b0b445fb7357272ff202c5651694a
export MASTER_MINTER_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
export UPGRADEABLE_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6
export UPGRADEABLE_ADDRESS=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
sleep 10;
# Deploy the contracts
export DOMAIN=0
"$FOUNDRY_PATH/forge" script ../scripts/evm/cctp_deploy.s.sol:DeployScript --rpc-url $RPC_URL_ETH --sender $SENDER --broadcast
mkdir -p cctp-interfaces
cp -R ./out/* ./cctp-interfaces
"$FOUNDRY_PATH/forge" script ../scripts/evm/usdc_deploy.s.sol:USDCDeployScript --rpc-url $RPC_URL_ETH --sender $SENDER --broadcast --force --use 0.6.12
mkdir -p usdc-interfaces
cp -R ./out/* ./usdc-interfaces
cd ..