DEPRECATED, all protocol code now located here
- Foundry
- For live network deployments:
npm i @openzeppelin/[email protected] -g
source .env && forge clean && forge build --via-ir && \
forge script --chain arbitrum scripts/DeployRiftExchange.s.sol:DeployRiftExchange \
--rpc-url $ARBITRUM_RPC_URL --broadcast --sender $SENDER --private-key $SENDER_PRIVATE_KEY \
--verify --etherscan-api-key $ARBITRUM_ETHERSCAN_API_KEY --ffi -vvvv --via-ir
source .env && forge clean && forge build --via-ir && \
forge script --chain arbitrum scripts/UpgradeRiftExchange.s.sol:UpgradeRiftExchange \
--rpc-url $ARBITRUM_RPC_URL --broadcast --sender $SENDER --private-key $SENDER_PRIVATE_KEY \
--verify --etherscan-api-key $ARBITRUM_ETHERSCAN_API_KEY --ffi -vvvv --via-ir
npm i @openzeppelin/[email protected] -g
source .env && forge clean && forge build --via-ir && \
forge script --chain arbitrum-sepolia scripts/DeployRiftExchange.s.sol:DeployRiftExchange \
--rpc-url $ARBITRUM_SEPOLIA_RPC_URL --broadcast --sender $SENDER --private-key $SENDER_PRIVATE_KEY \
--verify --etherscan-api-key $ARBITRUM_ETHERSCAN_API_KEY --ffi -vvvv --via-ir
forge test
- Install slither
- Run:
python -m slither .
- Install mythril
- Run:
myth analyze src/RiftExchange.sol --solc-json mythril.config.json
- Invariant 1: Unreserved balance should never exceed initial balance
map(reservation.initialBalance >= reservation.unreservedBalance)
Invariant 2: The sum of differences between initial balance and unreserved balance across all deposit vaults should equal the sum of all non-completed reserved amounts (Time expired + Created reservation states)
sum(depositVault.initialBalance - depositVault.unreservedBalance for all depositVaults) ==
sum(nonCompletedReservations.amountsToReserve for all nonCompletedReservations)