This project demonstrates PancaakeSwap V2 Triangular Arbitrage
run:
git clone <repository_url>
cd <repository_directory>
npm ci
npx hardhat
create files ./contracts/FlashSwap.sol
, ./test/tester.js
, ./scripts/deploy.js
create folers ./contracts/interfaces
, ./contracts/libraries
, ./utils
and files in them
edit file hardhat.config.js
, add solidity compilers in diffrent versions, add some networks
edit files ./contracts/FlashSwap.sol
,./scripts/deploy.js
, ./test/tester.js
run:
npx hardhat test
npx hardhat node
npx hardhat clean
edit file ./contracts/FlashSwap.sol
edit file ./contracts/FlashSwap.sol
edit file ./contracts/FlashSwap.sol
, add startArbitrage
funciton
edit file ./contracts/FlashSwap.sol
, edit pancakeCall
funciton
run:
npx hardhat compile
npx hardhat clean
edit file ./test/tester
edit file ./test/tester
run:
npx hardhat test
edit file ./test/tester
run:
npx hardhat test
edit file ./test/tester
run:
source .env
npx hardhat node --fork ${RPC_MAINNET}
npx hardhat test --network localhost
npx hardhat test --network hardhat
npx hardhat test
npx hardhat run scripts/deploy.js --network yourNetwork
npx hardhat run scripts/fundContract.js --network yourNetwork
npx hardhat run scripts/startArbitrage.js --network yourNetwork
edit file ./contracts/FlashSwap.sol
edit file ./contracts/FlashSwap.sol
note: Now, I've not found any arbitrage opportunities. We're doing this with some dummy coins here, we're basically just picking some random tokens here and doing an arbitrage.
npx hardhat test
edit file ./contracts/FlashSwap.sol
npx hardhat test
edit file ./contracts/FlashSwap.sol
npx hardhat test
edit file ./contracts/FlashSwap.sol
npx hardhat test
npx hardhat test
npx hardhat run scripts/deploy.js --network testnet