-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.sh
executable file
·24 lines (18 loc) · 1.01 KB
/
init.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
#!/bin/sh
if [ $# -ne 2 ]; then
echo "Usage: $0 <contract_account> <master_account>"
exit 1
fi
CONTRACT=$1
MASTER_ACCOUNT=$2
echo ">> Initializing the contract"
near call $CONTRACT new '{"owner_id": "'$MASTER_ACCOUNT'"}' --accountId $MASTER_ACCOUNT
echo ">> Creating the pools"
near call $CONTRACT create_pool '{"token1": "usdt.fakes.testnet", "token2": "usdc.fakes.testnet", "initial_price": 1.0, "protocol_fee": 1, "rewards": 1}' --accountId $CONTRACT
near call $CONTRACT create_pool '{"token1": "wrap.testnet", "token2": "usdt.fakes.testnet", "initial_price": 0.0000000000000001, "protocol_fee": 1, "rewards": 1}' --accountId $CONTRACT
echo ">> Pools created:"
near view $CONTRACT get_pools '{}'
echo ">> Creating reserves"
near call $CONTRACT create_reserve '{"reserve_token": "'usdt.fakes.testnet'"}' --accountId $CONTRACT
near call $CONTRACT create_reserve '{"reserve_token": "usdc.fakes.testnet"}' --accountId $CONTRACT
near call $CONTRACT create_reserve '{"reserve_token": "wrap.testnet"}' --accountId $CONTRACT