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: 17 days 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 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T11:35:22.000Z (5 months ago)
- Last Synced: 2024-12-11T12:30:31.581Z (5 months 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)
[](https://codecov.io/gh/AngleProtocol/merkl-contracts)This repository contains the smart contracts of Merkl.
It basically contains two contracts:
- `DistributionCreator`: to which DAOs and individuals can deposit their rewards to incentivize onchain actions
- `Distributor`: the contract where users can claim their rewardsYou can learn more about the Merkl system in the [documentation](https://docs.merkl.xyz).
## Setup
### Install packages
You can install all dependencies by running
```bash
bun i
```### Create `.env` file
You can copy paste `.env.example` file into `.env` and fill with your keys/RPCs.
Warning: always keep your confidential information safe.
### Foundry Installation
```bash
curl -L https://foundry.paradigm.xyz | bashsource /root/.zshrc
# or, if you're under bash: source /root/.bashrcfoundryup
```## Tests
```bash
# Whole test suite
forge test
```## Deploying
Run without broadcasting:
```bash
yarn foundry:script --rpc-url
```Run with broadcasting:
```bash
yarn foundry:deploy --rpc-url
```## Scripts
Scripts can be executed in two ways:
1. With parameters: directly passing values as arguments
2. Without parameters: modifying the default values in the script### Running Scripts
```bash
--broadcast -i 1 \
# With parameters
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender
--sig "run(string,string,uint8)" "MyToken" "MTK" 18# Without parameters (modify default values in the script first)
--broadcast -i 1
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender# Common options:
The address which will execute the script
# --broadcast Broadcasts the transactions to the network
# --sender
# -i 1 Open an interactive prompt to enter private key of the sender when broadcasting
```### Examples
```bash
--broadcast \
# Deploy a Mock Token
forge script scripts/MockToken.s.sol:Deploy --rpc-url --sender
--sig "run(string,string,uint8)" "MyToken" "MTK" 18# Mint tokens
--broadcast \
forge script scripts/MockToken.s.sol:Mint --rpc-url --sender
--sig "run(address,address,uint256)" 1000000000000000000# Set minimum reward token amount
--broadcast \
forge script scripts/DistributionCreator.s.sol:SetRewardTokenMinAmounts --rpc-url --sender
--sig "run(address,uint256)"# Set fees for campaign
--broadcast \
forge script scripts/DistributionCreator.s.sol:SetCampaignFees --rpc-url --sender
--sig "run(uint32,uint256)"# Toggle token whitelist status
--broadcast \
forge script scripts/DistributionCreator.s.sol:ToggleTokenWhitelist --rpc-url --sender
--sig "run(address)"
```For scripts without parameters, you can modify the default values directly in the script file:
```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'; // <- modify this
string memory symbol = 'MTK'; // <- modify this
uint8 decimals = 18; // <- modify this
_run(name, symbol, decimals);
}
```## Audits
The Merkl smart contracts have been audited by Code4rena, find the audit report [here](https://code4rena.com/reports/2023-06-angle).
## Access Control

## Media
Don't hesitate to reach out on [Twitter](https://x.com/merkl_xyz) 🐦