Coder Social home page Coder Social logo

Comments (3)

omarish avatar omarish commented on August 16, 2024

Proposed messages (all from UniswapV3Staker.sol). What do you think @ewilz @moodysalem ?

The proposed messages are a little verbose. If the contract is too big, here's what we will do to reduce it:

  1. Change all the UniswapV3Staker:: prefixes to Staker:
  2. Omit the Staker: prefix
  3. Omit the function names
  4. Make descriptions more terse
Before After
claimDeadline_not_gte_endTime UniswapV3Staker::createIncentive: claim deadline before end time
endTime_not_gte_startTime UniswapV3Staker::createIncentive: end time before start time
INCENTIVE_EXISTS UniswapV3Staker::createIncentive: incentive already exists
INVALID_REWARD_ADDRESS UniswapV3Staker::createIncentive: invalid reward address
INVALID_REWARD_AMOUNT UniswapV3Staker::createIncentive: invalid reward amount
REWARD_TRANSFER_FAILED UniswapV3Staker::createIncentive: reward transfer failed
TIMESTAMP_LTE_CLAIMDEADLINE UniswapV3Staker::endIncentive: claim deadline before block timestamp
INVALID_INCENTIVE UniswapV3Staker::endIncentive: incentive is invalid
uniswap v3 nft only UniswapV3Staker::onERC721Received: uniswap v3 nft only
NUMBER_OF_STAKES_NOT_ZERO UniswapV3Staker::withdrawToken: nonzero number of stakes
NOT_YOUR_NFT UniswapV3Staker::withdrawToken: nft does not belong to msg.sender
NOT_YOUR_DEPOSIT UniswapV3Staker::stakeToken: deposit owner is not msg.sender
INVALID_POSITION UniswapV3Staker::unstakeToken: specified position is invalid
BAD INCENTIVE UniswapV3Staker::unstakeToken: incentive not found
non-existent incentive UniswapV3Staker::_stakeToken: incentive not found

from v3-staker.

visavishesh avatar visavishesh commented on August 16, 2024

I would propose the following if the goal is to be terse / save bytespace. Added a few recent ones to this list. All have been made shorter where possible, except for already staked which I proposed "incentive already staked".

Before After
claimDeadline_not_gte_endTime claim deadline before end time
endTime_not_gte_startTime end time before start
INCENTIVE_EXISTS incentive already exists
INVALID_REWARD_ADDRESS invalid reward address
INVALID_REWARD_AMOUNT invalid reward amount
REWARD_TRANSFER_FAILED reward transfer failed
TIMESTAMP_LTE_CLAIMDEADLINE claim deadline before block time
INVALID_INCENTIVE invalid incentive
uniswap v3 nft only not a univ3 nft
NUMBER_OF_STAKES_NOT_ZERO nonzero num of stakes
NOT_YOUR_NFT sender is not nft owner
NOT_YOUR_DEPOSIT sender is not deposit owner
INVALID_POSITION position is invalid
BAD INCENTIVE incentive not found
non-existent incentive incentive not found
Stake does not exist nonexistent stake
incentive not started yet incentive not started
incentive ended incentive ended
already staked incentive already staked

from v3-staker.

omarish avatar omarish commented on August 16, 2024

These messages look good.

If we have the space, it might be good to prefix them with the function name (invalid incentive would become createIncentive: invalid incentive), but I don't feel strongly about that.

@ewilz @moodysalem looks good to you?

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.