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(BridgeReward, BridgeTracking): improve sync reward in bridge reward #14

Merged
merged 11 commits into from
Mar 25, 2024

Conversation

nxqbao
Copy link
Contributor

@nxqbao nxqbao commented Mar 12, 2024

Description

  • Allow auto sync reward up to 5 periods per time. The remaining periods are auto settled reward in the next day.
  • Fix the emitted period of rewarding.

Checklist

  • I have clearly commented on all the main functions following the NatSpec Format
  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works

@nxqbao nxqbao changed the title feat(BridgeReward): improve sync reward in bridge reward feat(BridgeReward, BridgeTracking): improve sync reward in bridge reward Mar 12, 2024
@nxqbao nxqbao force-pushed the feat/improve-sync-reward-in-bridge-reward branch from 7f4a17e to 7af7490 Compare March 12, 2024 09:49
if (pdCount == 0) revert ErrPeriodCountIsZero();

// Not settle the period that already rewarded.
if (currPd <= lastRewardPd + 1) revert ErrPeriodAlreadyRewarded(currPd, lastRewardPd);

Choose a reason for hiding this comment

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

This line is not necessary as pdCount must be >= 1 (as last condition), combined with the following validation is sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noted, but I leave it unchanged, added in-line comment

src/ronin/gateway/BridgeReward.sol Show resolved Hide resolved
Base automatically changed from fix/handle-deposit-weth to release/v3.1.0 March 25, 2024 04:01
@nxqbao nxqbao merged commit b18cd86 into release/v3.1.0 Mar 25, 2024
@nxqbao nxqbao deleted the feat/improve-sync-reward-in-bridge-reward branch March 25, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants