-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ERC900: Simple Staking Interface #910
Conversation
This is a courtesy notice to let you know that the format for EIPs has been modified slightly. If you want your draft merged, you will need to make some small changes to how your EIP is formatted:
If your PR is editing an existing EIP rather than creating a new one, this has already been done for you, and you need only rebase your PR. In addition, a continuous build has been setup, which will check your PR against the rules for EIP formatting automatically once you update your PR. This build ensures all required headers are present, as well as performing a number of other checks. Please rebase your PR against the latest master, and edit your PR to use the above format for frontmatter. For convenience, here's a sample header you can copy and adapt:
|
Hope I'm not too late to the discussion. According to this interface, if Alice calls |
@kierendavies I don't believe you should be allowed to unstake for a certain party. Maybe let's see what @izqui has to say about this. The |
eip: 900
title: Simple Staking Interface
author: Dean Eigenmann [email protected], Jorge Izquierdo [email protected]
type: Standards Track
category: ERC
status: Final
created: 2018-02-22
discussions-to: #900
Abstract
The following standard describes a common staking interface allowing for easy to use staking systems. The interface is kept simple allowing for various use cases to be implemented. This standard describes the common functionality for staking as well as providing information on stakes.
Motivation
As we move to more token models, having a common staking interface which is familiar to users can be useful. The common interface can be used by a variety of applications, this common interface could be beneficial especially to things like Token curated registries which have recently gained popularity.
Specification
stake
Stakes a certain amount of tokens, this MUST transfer the given amount from the user.
The data field can be used to add signalling information in more complex staking applications
MUST trigger
Staked
event.stakeFor
Stakes a certain amount of tokens, this MUST transfer the given amount from the caller.
The data field can be used to add signalling information in more complex staking applications
MUST trigger
Staked
event.unstake
Unstakes a certain amount of tokens, this SHOULD return the given amount of tokens to the user, if unstaking is currently not possible the function MUST revert.
The data field can be used to remove signalling information in more complex staking applications
MUST trigger
Unstaked
event.totalStakedFor
Returns the current total of tokens staked for an address.
totalStaked
Returns the current total of tokens staked.
token
Address of the token being used by the staking interface.
supportsHistory
MUST return true if the optional history functions are implemented, otherwise false.
lastStakedFor
OPTIONAL: As not all staking systems require a complete history, this function is optional.
Returns last block address staked at.
totalStakedForAt
OPTIONAL: As not all staking systems require a complete history, this function is optional.
Returns total amount of tokens staked at block for address.
totalStakedAt
OPTIONAL: As not all staking systems require a complete history, this function is optional.
Returns the total tokens staked at block.
Implementation
Original Discussion
Copyright
Copyright and related rights waived via CC0.