Skip to content

Add Safe module to help automate claim bribes #2510

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

Merged
merged 5 commits into from
May 28, 2025

Conversation

shahthepro
Copy link
Collaborator

@shahthepro shahthepro commented May 8, 2025

Deployment

Contract Address
ClaimBribesSafeModule 0x5bd73897E92Ecf3E6295FFe5C1104E99000d2c98

Code Change Checklist

To be completed before internal review begins:

  • The contract code is complete
  • Executable deployment file
  • Fork tests that test after the deployment file runs
  • Unit tests *if needed
  • The owner has done a full checklist review of the code + tests

Internal review:

  • Two approvals by internal reviewers

Deploy checklist

Two reviewers complete the following checklist:

- [ ] All deployed contracts are listed in the deploy PR's description
- [ ] Deployed contract's verified code (and all dependencies) match the code in master
- [ ] Contract constructors have correct arguments
- [ ] The transactions that interacted with the newly deployed contract match the deploy script.
- [ ] Governance proposal matches the deploy script
- [ ] Smoke tests pass after fork test execution of the governance proposal

Copy link

github-actions bot commented May 8, 2025

Warnings
⚠️ 👀 This PR needs at least 2 reviewers

Generated by 🚫 dangerJS against 7941d6c

Copy link

codecov bot commented May 8, 2025

Codecov Report

Attention: Patch coverage is 0% with 93 lines in your changes missing coverage. Please review.

Project coverage is 40.26%. Comparing base (614cb92) to head (7941d6c).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...cts/contracts/automation/ClaimBribesSafeModule.sol 0.00% 93 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2510      +/-   ##
==========================================
- Coverage   40.89%   40.26%   -0.64%     
==========================================
  Files         101      102       +1     
  Lines        4707     4801      +94     
  Branches     1242     1258      +16     
==========================================
+ Hits         1925     1933       +8     
- Misses       2780     2866      +86     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@clement-ux clement-ux left a comment

Choose a reason for hiding this comment

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

Looks good, but it is a bit weird to me to push code without real tests. However I agree this is not easy to setup test for this. So maybe test in prod it enough.

I'll have another pass a bit later, but otherwise looks good. 👍

Comment on lines 102 to 104
uint256 _nftIndexEnd = nftIndexStart;
nftIndexStart = nftIndexEnd;
nftIndexEnd = _nftIndexEnd;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can have something simple here:
(nftIndexStart, nftIndexEnd) = (nftIndexEnd, nftIndexStart)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I didn't know this worked in Solidity, thanks

Comment on lines 316 to 320
if (poolIndex >= _bribePools.length) {
return false;
}

return _bribePools[poolIndex].poolAddress == bribePool;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Do you think it could be possible to have the same code structure as there is for nftIdExists()?
What I mean is that it could be nice to have all the value returned "calculated" on the return.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, will do

@shahthepro shahthepro marked this pull request as ready for review May 10, 2025 15:42
Copy link
Collaborator

@clement-ux clement-ux left a comment

Choose a reason for hiding this comment

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

LGTM 👍

clement-ux
clement-ux previously approved these changes May 12, 2025
Copy link
Collaborator

@clement-ux clement-ux left a comment

Choose a reason for hiding this comment

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

  • All deployed contracts are listed in the deploy PR's description
  • Deployed contract's verified code (and all dependencies) match the code in master
  • Contract constructors have correct arguments
  • The transactions that interacted with the newly deployed contract match the deploy script.
    • No interactions.
  • Governance proposal matches the deploy script
    • No governance
  • Smoke tests pass after fork test execution of the governance proposal

Diff contract

sol2uml diff 0x5bd73897E92Ecf3E6295FFe5C1104E99000d2c98 .,node_modules -k VE23DGDT5V32ZIQI1RE4GS6NXZPW447GYX -n base
(node:4677) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Compared the "ClaimBribesSafeModule" contract with address 0x5bd73897E92Ecf3E6295FFe5C1104E99000d2c98 on base
to local files under folders ".,node_modules"

match   @openzeppelin/contracts/access/AccessControl.sol
match   @openzeppelin/contracts/access/AccessControlEnumerable.sol
match   @openzeppelin/contracts/access/IAccessControl.sol
match   @openzeppelin/contracts/access/IAccessControlEnumerable.sol
match   @openzeppelin/contracts/utils/Context.sol
match   @openzeppelin/contracts/utils/introspection/ERC165.sol
match   @openzeppelin/contracts/utils/introspection/IERC165.sol
match   @openzeppelin/contracts/utils/Strings.sol
match   @openzeppelin/contracts/utils/structs/EnumerableSet.sol
match   contracts/automation/ClaimBribesSafeModule.sol
match   contracts/interfaces/aerodrome/ICLGauge.sol
match   contracts/interfaces/aerodrome/ICLPool.sol

@shahthepro shahthepro merged commit c5a58b3 into master May 28, 2025
16 of 19 checks passed
@shahthepro shahthepro deleted the shah/claim-bribes-auto branch May 28, 2025 10:03
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