This repo works in pair with collateral-watchtower and zktls-eth-proving
contracts/PositionManagement.sol is deployed on the source chain, user deposits ERC20 tokens in it. contracts/SyntheticManagement.sol and contracts/SyntheticStablecoin.sol are deployed on the destination chain.
Users use PositionManagement to deposit and withdraw funds. This emits event, collateral-watchtower proves EVM storage and submits to SyntheticManagement.
forge test
Command line interface helps you interact with PositionManagement.
- Export environment variables (example in .env.example)
source .env
and from lib/sgx_verifier_deployer
source lib/sgx_verifier_deployer/.env
- Run two local nodes in different terminal windows:
anvil --port 1111
anvil --port 2222
- Send funds to your
$PUBLIC_KEY
wallet on both local networks:
python3 cli/refresh_anvil.py
- Deploy contracts run
python3 cli/deploy.py --src local --dst local_2
this command will deploy PositionManagement and testETH, testBTC, testUSDC, testUSDT contracts on the src chain, SyntheticManagement and SyntheticStablecoin on the destination chain.
- Interact with test tokens Check balance
python3 cli/src_coin.py --src local -c testETH -b
Airdrop test tokens
python3 cli/src_coin.py --src local -c testETH -a
- Interact with PositionManagement Deposit:
python3 cli/position_management.py --src local -c testETH -d 1
Check deposit:
python3 cli/position_management.py --src local -c testETH -b
Check amount of minted stablecoins:
python3 cli/position_management.py --src local -c testETH -u
Withdraw:
python3 cli/position_management.py --src local -c testETH -w 1