This repository contains all of the smart contracts used to run Elk Finance.
Elk Finance uses three main contract templates:
- ElkRouter: high-level interface for all Elk Exchange functionality
- ElkFactory: creates and manages liquidity pairs
- ElkPair: a liquidity pair made of two assets
Please see https://docs.elk.finance/addresses for an up-to-date list of addresses of deployed contracts on supported chains.
- Get Hardhat.
- Execute
yarn install
to prepare the environment. - Execute
yarn compile
to compile the contracts.
A tutorial for using Remix is located here.
- Install into your project using
npm install --dev @elkdex/avax-exchange-contracts
. - Import the ABI:
import { abi as IPangolinPairABI } from '@elkdex/avax-exchange-contracts/artifacts/contracts/elk-core/interfaces/IElkPair.sol/IElkPair.json'
.
These contracts were adapted from these Uniswap repos: uniswap-v2-core, uniswap-v2-periphery, and uniswap-lib.