Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Potential fixes for off-by-one errors#7

Open
jaeaster wants to merge 1 commit intoGearbox-protocol:lagrange-distributorfrom
jaeaster:lagr-fixes
Open

Potential fixes for off-by-one errors#7
jaeaster wants to merge 1 commit intoGearbox-protocol:lagrange-distributorfrom
jaeaster:lagr-fixes

Conversation

@jaeaster
Copy link
Copy Markdown

@jaeaster jaeaster commented Aug 7, 2024

No description provided.

_campaigns[campaignId].rewards.push(rewards[i]);
IERC20(rewards[i].rewardToken).safeTransferFrom(
msg.sender, address(this), rewards[i].rewardRate * (endBlock - startBlock)
msg.sender, address(this), rewards[i].rewardRate * (endBlock - startBlock + 1)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lagrange queries are inclusive of the range; do you want the campaign to work in the same way? e.g.

startBlock = 1
endBlock = 2
=> 2 blocks of rewards in the campaign

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant