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

Implement withdrawProtocolFees in CoW AMM Router #1242

Open
joaobrunoah opened this issue Jan 20, 2025 · 0 comments · May be fixed by #1252
Open

Implement withdrawProtocolFees in CoW AMM Router #1242

joaobrunoah opened this issue Jan 20, 2025 · 0 comments · May be fixed by #1252
Assignees

Comments

@joaobrunoah
Copy link
Contributor

joaobrunoah commented Jan 20, 2025

Depends on #1241

Contract Variables to add (all variables are internal)

  • address feeSweeper : Address of contract that will receive the protocol fees when withdrawProtocolFees is called. This is important to make withdrawProtocolFees permissionless, and reduce the risk of informing the wrong receiver of protocol fees.

Functions to add

getFeeSweeper

  • return:
    • feeSweeper

setFeeSweeper

  • permissioned
  • arguments:
    • address newFeeSweeper : Address of the contract that will receive fees when withdrawProtocolFees is called
  • Logic:
    • feeSweeper = newFeeSweeper (nothing to validate, except the permission)
    • Emit event FeeSweeperChanged with new fee sweeper address

withdrawProtocolFees

Withdraw protocol fees of a given token to feeSweeper contract.

  • permissionless
  • arguments
    • address token : Token which will be withdrawn
  • Logic
    • Transfer protocolFees[token] to feeSweeper contract
    • protocolFees[token] = 0
    • Emit event CoWProtocolFeeWithdrawn
      • address token
      • address feeSweeper
      • uint256 amount
@joaobrunoah joaobrunoah linked a pull request Jan 22, 2025 that will close this issue
12 tasks
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 a pull request may close this issue.

1 participant