Smart Contracts
This section describes the core smart contracts that make up the Rugdrome protocol.
Core Contracts
| Contract | File | Purpose |
|---|---|---|
RUGD | contracts/Rugd.sol | ERC-20 RUGD token. |
VotingEscrow | contracts/VotingEscrow.sol | Locks RUGD and mints veNFTs. |
Voter | contracts/Voter.sol | Lets veNFT holders vote for gauges and claim bribes. |
Router | contracts/Router.sol | Swap and liquidity routing for v1 pairs. |
Pair | contracts/Pair.sol | v1 AMM pair (Solidly-style). |
RewardsDistributor | contracts/RewardsDistributor.sol | Distributes fees to veNFT holders. |
Minter | contracts/Minter.sol | Mints weekly RUGD emissions. |
ProtocolForwarder | contracts/ProtocolForwarder.sol | ERC-2771 trusted forwarder. |
Factory Contracts
| Contract | File | Purpose |
|---|---|---|
PairFactory | contracts/factories/PairFactory.sol | Deploys v1 pairs. |
GaugeFactory | contracts/factories/GaugeFactory.sol | Deploys standard gauges. |
BribeFactory | contracts/factories/BribeFactory.sol | Deploys internal and external bribes. |
CLFactory | contracts/factories/CLFactory.sol | Deploys concentrated-liquidity pools. |
CLGaugeFactory | contracts/factories/CLGaugeFactory.sol | Deploys CL gauges. |
Concentrated Liquidity
| Contract | File | Purpose |
|---|---|---|
CLPool | contracts/cl/CLPool.sol | CL pool implementation. |
CLGauge | contracts/cl/CLGauge.sol | CL gauge for emissions. |
CLPositionManager | contracts/cl/CLPositionManager.sol | Manages CL positions. |
CLQuoter | contracts/cl/CLQuoter.sol | Off-chain swap quoting. |
Governance
| Contract | File | Purpose |
|---|---|---|
RugdGovernor | contracts/governance/RugdGovernor.sol | OpenZeppelin Governor. |
RugdTimelockController | contracts/governance/RugdTimelockController.sol | Delays and executes proposals. |
Deployment Order
A typical deployment follows this order:
- Deploy
RUGDtoken (Rugd.sol). - Deploy
VotingEscrowandVeArtProxy. - Deploy factories:
PairFactory,GaugeFactory,BribeFactory,CLFactory,CLGaugeFactory. - Deploy
FactoryRegistryand register factories. - Deploy
Voter,RewardsDistributor, andMinter. - Deploy
Router,ZapHelper,SwapHelper, andVestingHelper. - Deploy
RugdGovernor(RugdGovernor.sol) andRugdTimelockController(RugdTimelockController.sol). - Wire ownership and permissions.
The full deployment is automated by scripts/deploy/deployFull.js and scripts/deploy/runDeployment.js.
Contract Addresses
Mainnet addresses for the original Rugdrome deployment are listed in the root README.md. New Rugdrome deployment addresses are recorded in deployments.json after running the deployment scripts.
Contract READMEs
Each contract directory also contains a README.md with a file-by-file description. See:
contracts/README.mdcontracts/cl/README.mdcontracts/factories/README.mdcontracts/governance/README.mdcontracts/interfaces/README.mdcontracts/libraries/README.md