Request form
Aerodrome-Finance
  • AMM
  • Tading
  • Liquidity
  • Finance
  • Dexes
  • Protocol
Docs
Source
ChefGPT

The trading and liquidity marketplace on Base network

Aero.sol
AirdropDistributor.sol
BokkyPooBahsDateTimeLibrary.sol
PerlinNoise.sol
Trig.sol
EpochGovernor.sol
FactoryRegistry.sol
GaugeFactory.sol
ManagedRewardsFactory.sol
PoolFactory.sol
VotingRewardsFactory.sol
Gauge.sol
GovernorCountingMajority.sol
GovernorSimple.sol
GovernorSimpleVotes.sol
IGovernor.sol
IVetoGovernor.sol
IVotes.sol
VetoGovernor.sol
VetoGovernorCountingSimple.sol
VetoGovernorVotes.sol
VetoGovernorVotesQuorumFraction.sol
IFactoryRegistry.sol
IGaugeFactory.sol
IManagedRewardsFactory.sol
IPoolFactory.sol
IVotingRewardsFactory.sol
IAero.sol
IAirdropDistributor.sol
IEpochGovernor.sol
IGauge.sol
IMinter.sol
IPool.sol
IPoolCallee.sol
IReward.sol
IRewardsDistributor.sol
IRouter.sol
IVeArtProxy.sol
IVoter.sol
IVotingEscrow.sol
IWETH.sol
BalanceLogicLibrary.sol
DelegationLogicLibrary.sol
ProtocolTimeLibrary.sol
SafeCastLibrary.sol
Minter.sol
Pool.sol
PoolFees.sol
ProtocolForwarder.sol
ProtocolGovernor.sol
BribeVotingReward.sol
FeesVotingReward.sol
FreeManagedReward.sol
LockedManagedReward.sol
ManagedReward.sol
Reward.sol
VotingReward.sol
RewardsDistributor.sol
Router.sol
VeArtProxy.sol
Voter.sol
VotingEscrow.sol
Forwarder.sol
IForwarder.sol
Ownable.sol
IERC165.sol
IERC4906.sol
IERC5267.sol
IERC6372.sol
IERC721.sol
ERC2771Context.sol
Clones.sol
ReentrancyGuard.sol
IERC1155Receiver.sol
ERC20.sol
ERC20Permit.sol
IERC20Metadata.sol
IERC20Permit.sol
IERC20.sol
SafeERC20.sol
IERC721Metadata.sol
IERC721.sol
IERC721Receiver.sol
Address.sol
Base64.sol
Checkpoints.sol
Context.sol
Counters.sol
ECDSA.sol
EIP712.sol
ERC165.sol
IERC165.sol
Math.sol
SafeCast.sol
SignedMath.sol
ShortStrings.sol
StorageSlot.sol
Strings.sol
DoubleEndedQueue.sol
EnumerableSet.sol
Timers.sol

TVL

$638.03M

3 downloads

Chains

Authors

Aerodrome-Finance
  • AMM
  • Tading
  • Liquidity
  • Finance
  • Dexes
  • Protocol
Info
Source
ChefGPT
Expand
Share

Get Cookin'

3 downloads

Chains

Authors

Protocol

All contracts for the Protocol, an AMM on EVMs inspired by Solidly.

See SPECIFICATION.md for more detail.

Protocol Overview

AMM contracts

FilenameDescription
Pool.solAMM constant-product implementation similar to Uniswap V2 liquidity pools
Router.solHandles multi-pool swaps, deposit/withdrawal, similar to Uniswap V2 Router interface
PoolFees.solStores the liquidity pool trading fees, these are kept separate from the reserves
ProtocolLibrary.solProvides router-related helpers, eg. for price-impact calculations
FactoryRegistry.solRegistry of factories approved for creation of pools, gauges, bribes and managed rewards.

Tokenomy contracts

FilenameDescription
Aero.solProtocol ERC20 token
VotingEscrow.solProtocol ERC-721 (ve)NFT representing the protocol vote-escrow lock. Beyond standard ve-type functions, there is also the ability to merge, split and create managed nfts.
Minter.solProtocol token minter. Distributes emissions to Voter.sol and rebases to RewardsDistributor.sol.
RewardsDistributor.solIs used to handle the rebases distribution for (ve)NFTs/lockers.
VeArtProxy.sol(ve)NFT art proxy contract, exists for upgradability purposes
AirdropDistributor.solDistributes permanently locked (ve)NFTs to the provided addresses, in the desired amounts.

Protocol mechanics contracts

FilenameDescription
Voter.solHandles votes for the current epoch, gauge and voting reward creation as well as emission distribution to Gauge.sol contracts.
Gauge.solGauges are attached to a Pool and based on the (ve)NFT votes it receives, it distributes proportional emissions in the form of protocol tokens. Deposits to the gauge take the form of LP tokens for the Pool. In exchange for receiving protocol emissions, claims on fees from the pool are relinquished to the gauge. Standard rewards contract.
rewards/
Reward.solBase reward contract to be inherited for distribution of rewards to stakers.
VotingReward.solRewards contracts used by FeesVotingReward.sol and BribeVotingReward.sol which inherits Reward.sol. Rewards are distributed in the following epoch proportionally based on the last checkpoint created by the user, and are earned through "voting" for a pool or gauge.
FeesVotingReward.solStores LP fees (from the gauge via PoolFees.sol) to be distributed for the current voting epoch to it's voters.
BribeVotingReward.solStores the users/externally provided rewards for the current voting epoch to it's voters. These are deposited externally every week.
ManagedReward.solStaking implementation for managed veNFTs used by LockedManagedReward.sol and FreeManagedReward.sol which inherits Reward.sol. Rewards can be earned passively by veNFTs who delegate their voting power to a "managed" veNFT.
LockedManagedReward.solHandles "locked" rewards (i.e. Aero rewards / rebases that are compounded) for managed NFTs. Rewards are not distributed and only returned to VotingEscrow.sol when the user withdraws from the managed NFT.
FreeManagedReward.solHandles "free" (i.e. unlocked) rewards for managed NFTs. Any rewards earned by a managed NFT that a manager passes on will be distributed to the users that deposited into the managed NFT.

Governance contracts

FilenameDescription
ProtocolGovernor.solOpenZeppelin's Governor contracts used in protocol-wide access control to whitelist tokens for trade within the protocol, update minting emissions, and create managed veNFTs.
EpochGovernor.solA simple epoch-based governance contract used exclusively for adjusting emissions.

Testing

This repository uses Foundry for testing and deployment.

Foundry Setup

forge install
forge build
forge test

Base Mainnet Fork Tests

In order to run mainnet fork tests against base, inherit BaseTest in BaseTest.sol in your new class and set the deploymentType variable to Deployment.FORK. The BASE_RPC_URL field must be set in .env. Optionally, BLOCK_NUMBER can be set in the .env file or in the test file if you wish to test against a consistent fork state (this will make tests faster).

Lint

yarn format to run prettier.

yarn lint to run solhint (currently disabled in CI).

Deployment

See script/README.md for more detail.

Access Control

See PERMISSIONS.md for more detail.

Deployment

NameAddress
ArtProxy0xE9992487b2EE03b7a91241695A58E0ef3654643E
RewardsDistributor0x227f65131A261548b057215bB1D5Ab2997964C7d
FactoryRegistry0x5C3F18F06CC09CA1910767A34a20F771039E37C0
Forwarder0x15e62707FCA7352fbE35F51a8D6b0F8066A05DCc
GaugeFactory0x35f35cA5B132CaDf2916BaB57639128eAC5bbcb5
ManagedRewardsFactory0xFdA1fb5A2a5B23638C7017950506a36dcFD2bDC3
Minter0xeB018363F0a9Af8f91F06FEe6613a751b2A33FE5
PoolFactory0x420DD381b31aEf6683db6B902084cB0FFECe40Da
Router0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43
AERO0x940181a94A35A4569E4529A3CDfB74e38FD98631
Voter0x16613524e02ad97eDfeF371bC883F2F5d6C480A5
VotingEscrow0xeBf418Fe2512e7E6bd9b87a8F0f294aCDC67e6B4
VotingRewardsFactory0x45cA74858C579E717ee29A86042E0d53B252B504
Pool0xA4e46b4f701c62e14DF11B48dCe76A7d793CD6d7
The trading and liquidity marketplace on Base network
Aero.sol
AirdropDistributor.sol
BokkyPooBahsDateTimeLibrary.sol
PerlinNoise.sol
Trig.sol
EpochGovernor.sol
FactoryRegistry.sol
GaugeFactory.sol
ManagedRewardsFactory.sol
PoolFactory.sol
VotingRewardsFactory.sol
Gauge.sol
GovernorCountingMajority.sol
GovernorSimple.sol
GovernorSimpleVotes.sol
IGovernor.sol
IVetoGovernor.sol
IVotes.sol
VetoGovernor.sol
VetoGovernorCountingSimple.sol
VetoGovernorVotes.sol
VetoGovernorVotesQuorumFraction.sol
IFactoryRegistry.sol
IGaugeFactory.sol
IManagedRewardsFactory.sol
IPoolFactory.sol
IVotingRewardsFactory.sol
IAero.sol
IAirdropDistributor.sol
IEpochGovernor.sol
IGauge.sol
IMinter.sol
IPool.sol
IPoolCallee.sol
IReward.sol
IRewardsDistributor.sol
IRouter.sol
IVeArtProxy.sol
IVoter.sol
IVotingEscrow.sol
IWETH.sol
BalanceLogicLibrary.sol
DelegationLogicLibrary.sol
ProtocolTimeLibrary.sol
SafeCastLibrary.sol
Minter.sol
Pool.sol
PoolFees.sol
ProtocolForwarder.sol
ProtocolGovernor.sol
BribeVotingReward.sol
FeesVotingReward.sol
FreeManagedReward.sol
LockedManagedReward.sol
ManagedReward.sol
Reward.sol
VotingReward.sol
RewardsDistributor.sol
Router.sol
VeArtProxy.sol
Voter.sol
VotingEscrow.sol
Forwarder.sol
IForwarder.sol
Ownable.sol
IERC165.sol
IERC4906.sol
IERC5267.sol
IERC6372.sol
IERC721.sol
ERC2771Context.sol
Clones.sol
ReentrancyGuard.sol
IERC1155Receiver.sol
ERC20.sol
ERC20Permit.sol
IERC20Metadata.sol
IERC20Permit.sol
IERC20.sol
SafeERC20.sol
IERC721Metadata.sol
IERC721.sol
IERC721Receiver.sol
Address.sol
Base64.sol
Checkpoints.sol
Context.sol
Counters.sol
ECDSA.sol
EIP712.sol
ERC165.sol
IERC165.sol
Math.sol
SafeCast.sol
SignedMath.sol
ShortStrings.sol
StorageSlot.sol
Strings.sol
DoubleEndedQueue.sol
EnumerableSet.sol
Timers.sol