Skip to content

init eco traders veVirt feature#135

Open
koo-virtuals wants to merge 13 commits intomainfrom
feat/vp-1942
Open

init eco traders veVirt feature#135
koo-virtuals wants to merge 13 commits intomainfrom
feat/vp-1942

Conversation

@koo-virtuals
Copy link
Contributor

@koo-virtuals koo-virtuals commented Jan 5, 2026

Note

High Risk
Introduces new token-claim and staking flows plus modifies veVirtual’s storage layout and voting-unit accounting, which can affect upgrade safety and on-chain balances/governance power.

Overview
Adds an eco-trader distribution path by introducing CumulativeMerkleDrop/ICumulativeMerkleDrop, where claims are validated against a cumulative Merkle root and the delta amount is automatically staked into veVirtual instead of transferred to the user.

Upgrades veVirtual to support a separate per-user ecoLocks mapping and stakeEcoLockFor, and includes eco locks in balanceOfAt/stakedAmountOf and voting units while disallowing normal lock actions (withdraw/extend/toggle) on eco-lock IDs.

Updates deployment/ops tooling: deployVeVirtual.ts tweaks maxWeeks and explicitly grants AccessControl roles; adds scripts to deploy the merkle-drop contract, generate merkle roots/proofs locally, and upgrade the proxy; adds eco-trader end-to-end tests and updates .openzeppelin/base-sepolia.json plus dev deps (merkletreejs, keccak256).

Written by Cursor Bugbot for commit 3a431b7. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a 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);
}
Copy link

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.

Fix in Cursor Fix in Web

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