https://github.com/angleprotocol/merkl-contracts
🥨 Contracts for Merkl, Angle Labs incentivization product for concentrated liquidity AMMs
https://github.com/angleprotocol/merkl-contracts
Last synced: 3 months ago
JSON representation
🥨 Contracts for Merkl, Angle Labs incentivization product for concentrated liquidity AMMs
- Host: GitHub
- URL: https://github.com/angleprotocol/merkl-contracts
- Owner: AngleProtocol
- License: other
- Created: 2022-11-08T16:54:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T11:35:22.000Z (over 1 year ago)
- Last Synced: 2024-12-11T12:30:31.581Z (over 1 year ago)
- Language: Solidity
- Homepage:
- Size: 9.1 MB
- Stars: 36
- Watchers: 3
- Forks: 11
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/AngleProtocol/merkl-contracts/actions)
This repository contains the core smart contracts for the Merkl solution.
The system consists of two primary contracts:
- `DistributionCreator`: Allows DAOs and individuals to deposit rewards for incentivizing onchain actions
- `Distributor`: Enables users to claim their earned rewards
Learn more about Merkl in the [official documentation](https://docs.merkl.xyz).
## Setup
### Install packages
Install all dependencies by running:
```bash
bun i
```
### Create `.env` file
Copy the `.env.example` file to `.env` and populate it with your keys and RPC endpoints:
```bash
cp .env.example .env
```
**Warning:** Always keep your confidential information secure and never commit `.env` files to version control.
### Foundry Installation
Install Foundry using the official installer:
```bash
curl -L https://foundry.paradigm.xyz | bash
source /root/.zshrc
# or, if you're using bash: source /root/.bashrc
foundryup
```
## Tests
Run the complete test suite:
```bash
forge test
```
## Deploying
### Simulate deployment (dry run)
Run a script without broadcasting transactions to the network:
```bash
yarn foundry:script --rpc-url
```
### Deploy to network
Execute and broadcast transactions:
```bash
yarn foundry:deploy --rpc-url
```
## Scripts
Scripts can be executed with or without parameters:
1. **With parameters:** Pass values directly as command-line arguments
2. **Without parameters:** Modify default values within the script file before running
### Running Scripts
Execute scripts using the following pattern:
```bash
# With parameters - pass values as arguments
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender
--broadcast -i 1 \
--sig "run(string,string,uint8)" "MyToken" "MTK" 18
# Without parameters - modify default values in the script first
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender
--broadcast -i 1
# Common options:
# --broadcast Broadcasts transactions to the network
# --sender
Address that will execute the script
# -i 1 Opens an interactive prompt to securely enter the sender's private key
```
### Examples
#### Deploy a mock ERC20 token
```bash
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender
--broadcast \
--sig "run(string,string,uint8)" "MyToken" "MTK" 18
```
#### Mint tokens to an address
```bash
forge script scripts/MockToken.s.sol:Mint --rpc-url --sender
--broadcast \
--sig "run(address,address,uint256)" 1000000000000000000
```
#### Configure minimum reward token amount
```bash
forge script scripts/DistributionCreator.s.sol:SetRewardTokenMinAmounts --rpc-url --sender
--broadcast \
--sig "run(address,uint256)"
```
#### Set campaign fees
```bash
forge script scripts/DistributionCreator.s.sol:SetCampaignFees --rpc-url --sender
--broadcast \
--sig "run(uint32,uint256)"
```
### Modifying Default Script Parameters
For scripts without parameters, modify the default values directly in the script file before execution:
```solidity
// In scripts/MockToken.s.sol:Deploy
function run() external broadcast {
// MODIFY THESE VALUES TO SET YOUR DESIRED TOKEN PARAMETERS
string memory name = 'My Token'; // <- Customize token name
string memory symbol = 'MTK'; // <- Customize token symbol
uint8 decimals = 18; // <- Customize decimal places
_run(name, symbol, decimals);
}
```
## Audits
The Merkl smart contracts have been audited twice by Code4rena:
- [August 2023 Audit Report](https://code4rena.com/reports/2023-06-angle)
- [November 2025 Audit Report](https://code4rena.com/reports/2025-11-merkl)
## Access Control

## Media
Reach out to us on [Twitter](https://x.com/merkl_xyz) 🐦