-
Notifications
You must be signed in to change notification settings - Fork 59
init eco traders veVirt feature #135
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| IERC20(baseToken).safeTransferFrom(_msgSender(), address(this), amount); | ||
|
|
||
| _increaseEcoLockAmount(account, amount); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stakeEcoLockFor lacks access control, allowing unauthorized eco locks
Medium Severity
stakeEcoLockFor has no access control, unlike other privileged functions in the contract that use onlyRole(ADMIN_ROLE). Anyone can call it to create permanent, non-withdrawable eco locks for any account, giving that account unwanted voting power. This also bypasses the merkle proof verification that CumulativeMerkleDrop provides. The function likely needs a role restriction so only authorized contracts (like the merkle drop) can create eco locks.


Note
High Risk
Changes core token-locking/voting-power accounting and introduces a new Merkle-claim flow that moves funds and uses custom assembly proof verification; mistakes could mis-allocate voting units or enable incorrect claims/staking.
Overview
Introduces eco-trader staking by extending
veVirtualwith a per-userecoLocksmapping andstakeEcoLockFor()to create/accumulate an auto-renewing max-duration lock; these eco locks now contribute tobalanceOfAt()/stakedAmountOf()and emitEcoLockUpdated.Adds a new
CumulativeMerkleDrop(ICumulativeMerkleDrop) contract that owner-updates a cumulativemerkleRootand lets anyone submit proofs to claim the delta since last claim, then immediately approve and stake the tokens intoveVirtualviastakeEcoLockFor()(plus an owneradminWithdraw).Updates tooling and ops: adds
merkletreejs/keccak256deps, new deploy/upgrade/test scripts for eco traders, adjustsdeployVeVirtual.ts(maxWeeks 104, grants roles post-deploy), adds a comprehensive eco-trader test suite, and updates.openzeppelin/base-sepolia.jsonstorage layout entries to reflect the new state variables.Written by Cursor Bugbot for commit 2408e43. This will update automatically on new commits. Configure here.