Secondary action fee#184
Merged
Merged
Conversation
carlosgj94
approved these changes
Mar 9, 2026
Contributor
carlosgj94
left a comment
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
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.
Collaborator
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.