Skip to content
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

[SC-1198] Upgrade FeeTaker #342

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

[SC-1198] Upgrade FeeTaker #342

wants to merge 16 commits into from

Conversation

ZumZoom
Copy link
Member

@ZumZoom ZumZoom commented Nov 19, 2024

  • Getters are split to multiple classes. The idea is that each new getter calls super and adds some extra multiplication overhead
  • FeeTaker checks that taker is either in whitelist or has AccessToken
  • _parseFeeData is universal for getters and postInteraction
  • _isWhitelisted is virtual to allow for different whitelist structure in getters and postInteraction
  • postInteraction now allows custom chained calls to other post-interactions

@ZumZoom ZumZoom changed the title Upgrade FeeTaker [SC-1198] Upgrade FeeTaker Nov 21, 2024
) internal view virtual override returns (uint256) {
unchecked {
(, uint256 integratorFee, uint256 resolverFee, bytes calldata tail) = _parseFeeData(extraData, taker, _isWhitelistedGetterImpl);
return Math.mulDiv(
Copy link
Contributor

@zZoMROT zZoMROT Nov 21, 2024

Choose a reason for hiding this comment

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

Is it correct to calculate makingAmount and then get fee from this amount? Should we at first get fee from takingAmount and then calculate makingAmount?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like incorrect in any case when order price is not 1:1, because we can get fee only in takerAsset

* (bytes10)[N] — taker whitelist
*/
function getMakingAmount(
function postInteraction(
Copy link
Contributor

Choose a reason for hiding this comment

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

No docs for this function. It may be worth referring to them in the interface.

* (bytes10)[N] — taker whitelist
*/
function getMakingAmount(
function postInteraction(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function postInteraction(
/**
* @notice See {IPostInteraction-postInteraction}.
*/
function postInteraction(

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.

3 participants