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 testCommand line interface helps you interact with PositionManagement.
- Export environment variables (example in .env.example)
source .envand from lib/sgx_verifier_deployer
source lib/sgx_verifier_deployer/.env- Run two local nodes in different terminal windows:
anvil --port 1111anvil --port 2222- Send funds to your
$PUBLIC_KEYwallet on both local networks:
python3 cli/refresh_anvil.py- Deploy contracts run
python3 cli/deploy.py --src local --dst local_2this 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 -bAirdrop 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 1Check deposit:
python3 cli/position_management.py --src local -c testETH -bCheck amount of minted stablecoins:
python3 cli/position_management.py --src local -c testETH -uWithdraw:
python3 cli/position_management.py --src local -c testETH -w 1