0.0.2 ā¢ Published 7 months ago
@bobanetwork/contracts v0.0.2
BOBA Smart Contracts
1. Automatic contract deployment and serving
This spins up the entire stack, with all contracts deployed, all the right things needed for the wallet to function, and for development work on the wallet.
$ cd ops
$ ./up_local.sh
Note - please provide syntax for setting the .env variables (BUILD: 1, DAEMON: 1)
To get the contract addresses for the basic stack, and the BOBA-specific contracts:
curl http://127.0.0.1:8078/addresses.json | jq #basic stack
curl http://127.0.0.1:8080/addresses.json | jq #BOBA-specific contracts
2. Manual Deployment and Testing
Spin up the base local L1/L2:
$ cd ops
$ BUILD=1 DAEMON=0 ./up_local.sh
Create a .env
file in the root directory of the contracts folder. Add environment-specific variables on new lines in the form of NAME=VALUE
. Examples are given in the .env.example
file. Just pick which net you want to work on and copy either the "Rinkeby" or the "Local" envs to your .env
.
# Local
NODE_ENV=local
L1_NODE_WEB3_URL=http://localhost:9545
L2_NODE_WEB3_URL=http://localhost:8545
ETH1_ADDRESS_RESOLVER_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
TEST_PRIVATE_KEY_1=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
TEST_PRIVATE_KEY_2=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
TEST_PRIVATE_KEY_3=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a
TARGET_GAS_LIMIT=9000000000
CHAIN_ID=28 #for Rinkeby
TEST=1 #This deploys the ERC20 test token
Build and deploy all the needed contracts:
$ yarn build
$ yarn deploy
You will now see this, if everything worked correctly:
% yarn deploy
yarn run v1.22.10
$ ts-node "./bin/deploy.ts"
Starting BOBA core contracts deployment...
ADDRESS_MANAGER_ADDRESS was set to 0x5FbDB2315678afecb367f032d93F642f64180aa3
Nothing to compile
Deploying...
š L2LiquidityPool deployed to: 0x7A9Ec1d04904907De0ED7b6839CcdD59c3716AC9
š L1LiquidityPool deployed to: 0xe8D2A1E88c91DCd5433208d4152Cc4F399a7e91d
āļø L1 LP initialized: 0x511a3000131b6d3ac16a22d12707dc4121a62c198679300a081cfa9586b32d89
āļø L2 LP initialized: 0x0797a3c93960e62a84c59f7f49c91916e430488b08afd38519ef9ac057eabec6
L1 and L2 pools have registered ETH and OETH
š L1ERC20 deployed to: 0x4b6aB5F819A515382B0dEB6935D793817bB4af28
š L2ERC20 deployed to: 0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D
š L2TokenPool deployed to: 0xA4899D35897033b927acFCf422bc745916139776
āļø L2TokenPool registered: 0x43f4d7adec84555ef5548adf41a75c8bdf45798a993cf4d5e42e2b31ab140d01
š L1_CrossDomainMessenger_Fast deployed to: 0xCace1b78160AE76398F486c8a18044da0d66d86D
āļø Fast L1 Messager initialized: 0x6480f00ca7f65d207bbbf4831074a71fb7ca4b6d999aeb78fbb5fb3841938362
āļø Fast L1 Messager initialized: 0xc44a3f18a3e6c10ceb6da3cebd4b23ee491ef6947ab3bf05574260e3c7f8c206
š AtomicSwap deployed to: 0xAA292E8611aDF267e563f334Ee42320aC96D0463
š L1 Message deployed to: 0xc0F115A19107322cFBf1cDBC7ea011C19EbDB4F8
š L2 Message deployed to: 0x5c74c94173F05dA1720953407cbb920F3DF9f887
āļø L1 Message initialized: 0x37fbbe3ef0ed3f1f4ae6c94fcd1f1825ea6c425091b038c4d4541c8760ea2c53
āļø L2 Message initialized: 0xa736724e36f8098f70f737ac0c643490732a9ff350bd0fc9629a6face73178a8
āØ Done in 10.84s.