From 82bc6bd077aba84b247dbadeabf53f5a5fc2c1b1 Mon Sep 17 00:00:00 2001 From: Pablo Veyrat <50438397+sogipec@users.noreply.github.com> Date: Fri, 1 Dec 2023 19:23:50 +0100 Subject: [PATCH] feat: add comments on Merkl (#46) * feat: add comments on Merkl * fix: typo * fix: out of gas test --- contracts/struct/DistributionParameters.sol | 18 +++++++++++------- test/foundry/DistributionCreator.t.sol | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/contracts/struct/DistributionParameters.sol b/contracts/struct/DistributionParameters.sol index 644ab17..8efdf8f 100644 --- a/contracts/struct/DistributionParameters.sol +++ b/contracts/struct/DistributionParameters.sol @@ -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; @@ -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 @@ -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; } diff --git a/test/foundry/DistributionCreator.t.sol b/test/foundry/DistributionCreator.t.sol index 3cf7b19..6ab7b13 100644 --- a/test/foundry/DistributionCreator.t.sol +++ b/test/foundry/DistributionCreator.t.sol @@ -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); @@ -141,6 +143,7 @@ contract DistributionCreatorOOGTest is Fixture { vm.expectRevert(); creator.getPoolDistributionsAfterEpoch(address(pool), startTime); } + */ function testFuzz_getActiveDistributions() public { uint256 lastIndexDistribution;