Giter VIP home page Giter VIP logo

aave-stake-v2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aave-stake-v2's Issues

Adaptive domain separator

The staked token implementation writes DOMAIN_SEPARATOR to storage in initialize. It will therefore not be able to handle a hard fork post-deployment, as the chainID is not updated and a valid signature for one chain could be replayed on the other.

The issue can be handled by using a dynamic domain separator which is generated on demand instead of reading from storage.

Add emergency shutdown and governance proposal

Add noEmergency modifier to user initiated functions that will perform a non-reverting noop in case of emergency. The cooldown admin will control the switch.

  • Add setEmergencyShutdown() only callable by cooldown admin
  • Add getEmergencyShutdown() for easy access
  • Add noEmergency modifier to:
    • stake
    • cooldown
    • stakeWithPermit
    • redeem
    • redeemOnBehalf
    • claimRewards
    • claimRewardsOnBehalf
    • claimRewardsAndStake
    • claimRewardsAndStakeOnBehalf
    • claimRewardsAndRedeem
    • claimRewardsAndRedeemOnbehalf

Implement slashing logic

The current StakeTokenV2 implementation does not have slashing capabilities. Right now there is no way of executing a slash of the stake without governance intervention and a token upgrade. This issue tracks the introduction of slashing capabilities on the StakeTokenV2.

The functionality will be implemented as follows:

  1. Introduction of an exchangeRate() function that tracks the ratio between the total supply of the StakeToken and the underlying. A ratio of 1:1 means no slashes happened. An eventual slashing of the stake will seize some of the underlying asset reducing the exchange rate of underlying:stake token of an amount proportional to the underlying seized
  2. Introduction of a SlashingAdmin role. The Slashing admin will be the the sole entity able to execute the slashing of the underlying asset. For the Aave stake, it will be configured as 0xEE56e2B3D491590B5b31738cC34d5232F378a8D5, that is the current governance V2 short executor
  3. introduce a CooldownAdmin. The Cooldown admin will be able to pause all the cooldown periods in case of a shortfall event, to allow proper resolution of the event. The pauseCooldown() function allows the admin to pause all the cooldowns.Cooldowns are expected to be resumed once the slashing event is resolved by the CooldownAdmin. If the pause is 4. longer than 10 days, the cooldowns are expected to expire.
  4. Introduce a slash() function. The slash() function allows the SlashingAdmin to seize some of the underlying stored in the stake to be transferred to a different address, for subsequent auctioning and recollateralization of the protocol. The exchange rate will automatically update to reflect the change in the underlying/total stake shares ratio.

Add staking using permit, allow staking on behalf using helpers, implement claim and restake functionality

On top of StakedTokenV3 which implements the slashing functionalities, the following are needed:

  • ability to stake using permit
  • implement a claimRewardsOnBehalf() that allows whitelisted helper contracts to claim on behalf of a user. This will be used to implement claiming across all the possible stake tokens in the safety module
  • implement a claim and restake functionality to allow easy compounding without requiring two transactions

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.