git clone [email protected]:Jeiwan/zuniswapv2.git
- Ensure you have installed Rust and Cargo: Install Rust
- Install Foundry:
cargo install --git https://github.com/gakonst/foundry --bin forge --locked
- Install dependency contracts:
git submodule update --init --recursive
- Run tests:
forge test
To allow for live or testing again, a localhost RPC
cp .env.sample .env
Set a private key and address in DEPLOYER_PRIVATE_KEY
and DEPLOYER_ADDRESS
source .env && forge script script/Deploy.s.sol:DeployScript --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --broadcast --verify --verifier blockscout --verifier-url $VERIFIER_URL
source .env && forge script script/DeployAndSetup.s.sol:DeployAndSetupScript --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --broadcast --verify --verifier blockscout --verifier-url $VERIFIER_URL
source .env && cast send $FACTORY "createPair(address,address)" $TOKEN1 $TOKEN2 --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
If you want the receipt, you can add -- --receipt
source .env && cast send $TOKEN1 "mint(uint256,address)" $AMOUNT $DEPLOYER_ADDRESS --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
source .env && cast send $TOKEN2 "mint(uint256,address)" $AMOUNT $DEPLOYER_ADDRESS --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
If you want the receipt, you can add -- --receipt
source .env && cast send $TOKEN1 "approve(address,uint256)" $ROUTER $AMOUNT --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
source .env && cast send $TOKEN2 "approve(address,uint256)" $ROUTER $AMOUNT --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
If you want the receipt, you can add -- --receipt
source .env && cast send $ROUTER "addLiquidity(address,address,uint256,uint256,uint256,uint256,address)" $TOKEN1 $TOKEN2 $AMOUNT $AMOUNT $AMOUNT $AMOUNT $DEPLOYER_ADDRESS --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY
If you want the receipt, you can add -- --receipt
source .env && cast send $ROUTER "addLiquidity(address,address,uint256,uint256,uint256,uint256,address)" $TOKEN1 $TOKEN2 $AMOUNT $AMOUNT $AMOUNT $AMOUNT $DEPLOYER_ADDRESS --rpc-url $NOVA_RPC_URL --private-key $DEPLOYER_PRIVATE_KEY --gas-limit 100000
If you want the receipt, you can add -- --receipt
This repo was a fork of Zuniswap2