A minimal Hardhat project pre-configured for building smart contract integrations with the Algebra Integral protocol.
- Node.js >= 22
- npm
git clone https://github.com/cryptoalgebra/boilerplate
cd boilerplate
npm installcontracts/ — your Solidity contracts
test/ — Hardhat tests
scripts/ — deployment and utility scripts
hardhat.config.js
| Command | Description |
|---|---|
npm run compile |
Compile all contracts |
npm test |
Run the test suite |
npm run node |
Start a local Hardhat node |
To test against real on-chain liquidity, start a local fork of Polygon using an Alchemy RPC URL:
npx hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/{YOUR_API_KEY}Then run tests against it:
npx hardhat test --network localhostThis boilerplate includes:
@cryptoalgebra/integral-core— core pool contracts and interfaces@cryptoalgebra/integral-periphery— router, position manager, and helper libraries
See the Algebra Integral Guides for step-by-step walkthroughs:
- Environment Setup
- Swaps (single-hop & multi-hop)
- Providing Liquidity
- Flashloans