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

Token Staking #11

Closed
wants to merge 9 commits into from
Closed

Token Staking #11

wants to merge 9 commits into from

Conversation

r-czajkowski
Copy link
Contributor

Ref: #2

This PR creates the Token Staking contract - a contract for a specified standard ERC20 token. A holder of the specified token can stake its tokens to this contract and recover the stake after undelegation period is over. This contract also supports approveAndCall/receiveApproval pattern so users can stake in one transaction (instead of 2: Token.approve + TokenStaking.stake). The initial implementation of staking tracks the staked balance and transfers the staked amount to the staking contract.

A token staking contract for a specified standard ERC20 token. A holder
of the specified token can stake its tokens to this contract and recover
the stake after undelegation period is over.
Use ERC20 contracts and libraries to interact with staking token in
staking contract.
Add function that stakes owner's tokens in the staking contract - tracks
user's staked funds and emit `Staked` event. The minimum amount is
required.
Add support for `approveAndCall`/`receiveApproval` pattern. The tBTC
token contract that will be a staking token supports this pattern. To be
able to stake in one transaction (instead of 2: approve + stake) we must
implement the `RecieveApproval` interface. The token staking contract
receives approval to spend tokens and create a stake for a given
account.
Add min and max staking amount. Currently, functions that return these
values have hardcoded values, but in the future we want to pull this
param from "parameters" contract that stores governable params.
`account` -> `staker`
We should mint staking token eg. `stBTC` that represents staked token
staked with Litmus. It will probably be a rebaseable ERC-20 token.
@r-czajkowski r-czajkowski self-assigned this Oct 31, 2023
This was referenced Oct 31, 2023
@r-czajkowski
Copy link
Contributor Author

We decided to implement the ERC-4626 standard (Tokenized Vaults) so we do not need a separate token staking contract.

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 this pull request may close these issues.

1 participant