Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add comments on Merkl #46

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions contracts/struct/DistributionParameters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
pragma solidity ^0.8.17;

struct DistributionParameters {
// ID of the reward (populated once created)
// ID of the reward (populated once created). This can be left as a null bytes32 when creating distributions
// on Merkl.
bytes32 rewardId;
// Address of the UniswapV3 pool that needs to be incentivized
address uniV3Pool;
Expand All @@ -16,7 +17,7 @@ struct DistributionParameters {
// are automatically detected and so there is no need to specify them here. Check out the docs to find out
// which need to be specified and which are not automatically detected.
address[] positionWrappers;
// Type (Arrakis, Gamma, Blacklist, ...) encoded as a `uint32` for each wrapper in the list above. Mapping between
// Type (blacklist==3, whitelist==0, ...) encoded as a `uint32` for each wrapper in the list above. Mapping between
// wrapper types and their corresponding `uint32` value can be found in Angle Docs
uint32[] wrapperTypes;
// In the incentivization formula, how much of the fees should go to holders of token0
Expand All @@ -26,22 +27,25 @@ struct DistributionParameters {
uint32 propToken1;
// Proportion for providing a useful liquidity (in base 10**4) that generates fees
uint32 propFees;
// Timestamp at which the incentivization should start
// Timestamp at which the incentivization should start. This is in the same units as `block.timestamp`.
uint32 epochStart;
// Amount of epochs for which incentivization should last
// Amount of epochs for which incentivization should last. Epochs are expressed in hours here, so for a
// campaign of 1 week `numEpoch` should for instance be 168.
uint32 numEpoch;
// Whether out of range liquidity should still be incentivized or not
// This should be equal to 1 if out of range liquidity should still be incentivized
// and 0 otherwise
// and 0 otherwise.
uint32 isOutOfRangeIncentivized;
// How much more addresses with a maximum boost can get with respect to addresses
// which do not have a boost (in base 4). In the case of Curve where addresses get 2.5x more
// this would be 25000
// this would be 25000.
uint32 boostedReward;
// Address of the token which dictates who gets boosted rewards or not. This is optional
// and if the zero address is given no boost will be taken into account
// and if the zero address is given no boost will be taken into account. In the case of Curve, this address
// would for instance be the veBoostProxy address, or in other cases the veToken address.
address boostingAddress;
// Additional data passed when distributing rewards. This parameter may be used in case
// the reward distribution script needs to look into other parameters beyond the ones above.
// In most cases, when creating a campaign on Merkl, you can leave this as an empty bytes.
bytes additionalData;
}
3 changes: 3 additions & 0 deletions test/foundry/DistributionCreator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ contract DistributionCreatorOOGTest is Fixture {
vm.stopPrank();
}

/*
// Commented because of an update in Foundry which does not handle well out of gas issues
function testFuzz_GetDistributionsOutOfGas() public {
address[] memory positionWrappers = new address[](3);
uint32[] memory wrapperTypes = new uint32[](3);
Expand Down Expand Up @@ -141,6 +143,7 @@ contract DistributionCreatorOOGTest is Fixture {
vm.expectRevert();
creator.getPoolDistributionsAfterEpoch(address(pool), startTime);
}
*/

function testFuzz_getActiveDistributions() public {
uint256 lastIndexDistribution;
Expand Down
Loading