Coder Social home page Coder Social logo

Comments (5)

moodysalem avatar moodysalem commented on August 16, 2024 1
  1. We could add a third param as uint256 claimAmount, but that would make things hard for people who want to claim everything, unless we also did item 2 in this list:

This is what we do with #collect, where the amount is a maximum to withdraw

To reduce calldata cost of specifying the max, you can treat 0 as the maximum (point 2 in your list, which is done just for calldata purposes)

You could do 3 and 2 and just call 2 from 3, to reduce calldata further (which is good for L2s)
but you can give them the same name, they will have a diff bytes4 function signature

from v3-staker.

omarish avatar omarish commented on August 16, 2024

Do we need this? I think it's a nice-to-have but let me know if you feel strongly and we can bump it. Are there use cases where someone would only want to partially claim rewards?

from v3-staker.

moodysalem avatar moodysalem commented on August 16, 2024

Do we need this? I think it's a nice-to-have but let me know if you feel strongly and we can bump it. Are there use cases where someone would only want to partially claim rewards?

mainly insolvency, for whatever reason the contract has less reward token than expected (e.g. the token collects a fee on transfer)

from v3-staker.

omarish avatar omarish commented on August 16, 2024

What's the best UX here?

Right the signature is: claimReward(IERC20Minimal rewardToken, address to).

Some ideas (just listing them out to be exhaustive):

  1. We could add a third param as uint256 claimAmount, but that would make things hard for people who want to claim everything, unless we also did item 2 in this list:
  2. We could make it such that if claimAmount is 0, then it claims rewards[rewardToken][msg.sender], but that feels a little bit messy.
  3. We could add another function entirely partialClaimReward, but that seems superfluous.
  4. We could make it claimReward(rewardToken, to, bool claimFullAmount, uint256 partialAmount)

Other ideas?

from v3-staker.

omarish avatar omarish commented on August 16, 2024

Ready for review: #166.

from v3-staker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.