This project demonstrates basic integration of Permit2 using Hardhat
Permit2 is a token approval contract that can safely share and manage token approvals across different smart contracts. As more projects integrate with Permit2, we can standardize token approvals across all applications. In turn, Permit2 will improve the user experience by reducing transaction costs while improving smart contract security.
1. Install foundry
Make sure foundry is installed on your system, if not you can follow this guide. Get Foundry
npm install
# Run
npx hardhat init-foundry
# or setup manually
git submodule add https://github.com/foundry-rs/forge-std lib/forge-std
cd lib/forge-std
forge install
git submodule add https://github.com/Uniswap/permit2 lib/permit2
cd lib/permit2
forge install
forge build
npm run test # or
yarn test
How to integrate Permit2
Permit2 repository
Permit2 and universal router
Permit2 Documentation