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

STAKE instruction and mechanism in smart contract #171

Closed
taihaofu opened this issue Aug 5, 2020 · 1 comment
Closed

STAKE instruction and mechanism in smart contract #171

taihaofu opened this issue Aug 5, 2020 · 1 comment

Comments

@taihaofu
Copy link
Contributor

taihaofu commented Aug 5, 2020

Background

As mentioned in 156 and 157, TRON need to provide vote and collect SR reward mechanism for smart contract. Motivate contract developer and increase the profit for TRON ecosystem contributors. But FREEZE/VOTE system is not direct for a smart contract. This issue provide a more efficient and direct way to implement a similar functionality for smart contracts.

Implementation

Basically we need at least 2 Instructions:

  • STAKE (update stake and vote for a single SR)
  • UNSTAKE (cancel stake)

STAKE only available for single SR, and update the whole vote & account state on chain, which means smart contract will only allow single SR staking change in one transaction.

assembly level:
stake(sr_address, trx_amount)
unstake()

@yanghang8612
Copy link
Contributor

The related TIP-171 has been marked as Withdrawn which means that we do not have further implemention plan.
So we close this issue.

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

No branches or pull requests

2 participants