Skip to content

Secondary action fee#184

Merged
carlosgj94 merged 4 commits into
mainfrom
feat/secondary-action-fee
Mar 25, 2026
Merged

Secondary action fee#184
carlosgj94 merged 4 commits into
mainfrom
feat/secondary-action-fee

Conversation

@ashhanai
Copy link
Copy Markdown
Collaborator

@ashhanai ashhanai commented Mar 6, 2026

Implement secondary action fee that is charged during deposit/mint if withdraw/redeem occurred in the same transaction. Fee size is configurable by Config Manager.

@ashhanai ashhanai requested a review from carlosgj94 March 6, 2026 14:11
Copy link
Copy Markdown
Contributor

@carlosgj94 carlosgj94 left a comment

Choose a reason for hiding this comment

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

Code looks good, I didn't see any particular problem.
Just to be 100% (this is an upgrade after all), I added a comment.

/**
* @notice Flag of deposit action in the current transaction
*/
bool internal transient _depositedInTx;
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.

Although transient storage should not alter the storage layout, would you mind generating a before and after of forge inspect storage --pretty?
That should ensure us we are not messing it. Just to fully double check, this is a critical component.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Original storage:

Name Type Slot Offset Bytes
paused bool 0 0 1
skipNextRebalanceSafetyBufferCheck bool 0 1 1
_share contract IGenericShare 0 2 20
priceFeeds mapping(address => struct BaseController.PriceFeed) 1 0 32
vaultSettings mapping(address => struct BaseController.VaultSettings) 2 0 32
_vaultFor mapping(address => address) 3 0 32
_vaults mapping(address => address) 4 0 32
_vaultsCount uint8 5 0 1
maxProtocolRebalanceSlippage uint16 5 1 2
rewardsCollector address 5 3 20
isRewardAsset mapping(address => bool) 6 0 32
_swapper contract ISwapper 7 0 20
_yieldDistributor contract IYieldDistributor 8 0 20
safetyBufferYieldDeduction uint256 9 0 32
__gap uint256[50] 10 0 1600

Updated storage:

Name Type Slot Offset Bytes
paused bool 0 0 1
skipNextRebalanceSafetyBufferCheck bool 0 1 1
_share contract IGenericShare 0 2 20
priceFeeds mapping(address => struct BaseController.PriceFeed) 1 0 32
vaultSettings mapping(address => struct BaseController.VaultSettings) 2 0 32
_vaultFor mapping(address => address) 3 0 32
_vaults mapping(address => address) 4 0 32
_vaultsCount uint8 5 0 1
maxProtocolRebalanceSlippage uint16 5 1 2
rewardsCollector address 5 3 20
isRewardAsset mapping(address => bool) 6 0 32
_swapper contract ISwapper 7 0 20
_yieldDistributor contract IYieldDistributor 8 0 20
safetyBufferYieldDeduction uint256 9 0 32
secondaryActionFee uint16 10 0 2
__gap uint256[49] 11 0 1568

You can see that the transient properties are not even there. The new secondaryActionFee is at the end even though it fits after _share address.

Copy link
Copy Markdown
Contributor

@carlosgj94 carlosgj94 left a comment

Choose a reason for hiding this comment

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

lgtm

@carlosgj94 carlosgj94 merged commit be92605 into main Mar 25, 2026
1 of 2 checks passed
@carlosgj94 carlosgj94 deleted the feat/secondary-action-fee branch March 25, 2026 15:24
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