Skip to content

feat: add dynamic tax adjustment#168

Open
twx-virtuals wants to merge 1 commit into
mainfrom
feat/dynamic-tax-manager
Open

feat: add dynamic tax adjustment#168
twx-virtuals wants to merge 1 commit into
mainfrom
feat/dynamic-tax-manager

Conversation

@twx-virtuals
Copy link
Copy Markdown
Contributor

@twx-virtuals twx-virtuals commented May 27, 2026

Note

Medium Risk
Changes on-chain fund split between treasury and creators during tax swaps; misconfiguration or compromised FEE_RATE_ADJUSTER_ROLE could redirect fees per agent.

Overview
Adds per-agent treasury fee overrides on tax swaps in AgentTax, controlled by a new FEE_RATE_ADJUSTER_ROLE instead of only the global feeRate.

Operators can call setAgentFeeRate / clearAgentFeeRate to store basis-point overrides per agentId (capped at DENOM). When tax is swapped to the asset token, the treasury cut now uses _feeRateForAgent(agentId) so an override replaces the global rate until cleared. AgentFeeRateUpdated is emitted for monitoring.

Reviewed by Cursor Bugbot for commit 07d0161. Configure here.

IBondingV4ForTax public bondingV4;

mapping(uint256 agentId => uint16) public agentFeeRate;
mapping(uint256 agentId => bool) public hasAgentFeeRate;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if agentFeeRate[agentId] > 0 means hasAgentFeeRate, one var should be enough

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