Integrate
How to integrate staking and unstaking stHYPE on your frontend or from smart contracts.
Reference our integration Github repo for ABIs, frontend examples and guides.
Minting (Staking)
Send a transaction to the overseer with the function signature
mint(address to, uint256 communityCode)(uint256)
, which returns the amount of StakedHYPE (as of right now this will always be the same amount as minted). There is also another function signaturemint(address to)
that is callable if you do not have a community code to stake to. Theto
address is the address the stHYPE tokens will be inted to and thecommunityCode
is the code representing the validator you want those tokens to be designated too. The amount minted will be the amount of HYPE included in the value of the transaction.This will mint stHYPE to the user.
Community Codes
These will be whitelisted at the smart contract level for approved partners.
These are passed as a param to the staking and unstaking functions in order to track HYPE flow and rewards throughout the ecosystem.
Burning (Unstaking)
Burning is has the potential to be a multistep process depending on the amount of free (unstaked) tokens available in the protocol. We will always keep a small float of the total supply unstaked in order to instantly fulfill burns, but if it is the burn of a large amount of tokens or there is high outflow volume steps become a two-step process. You can access the amount of free tokens (if a burn has less than this amount it will be processed atomically) by calling maxRedeemable()
Approve the overseer with the amount of stHYPE tokens that you want to unstake.
Call
burnAndRedeemIfPossible(address to, uint256 amount, string communityCode)
to burnamount
of tokens fromcommunityCode
the redeemed HYPE will go to theto
address. Note: if you do not want to burn from a community code leave the field a blank string ("").maxRedeemable()
of these tokens will be burned instantly and sent to theto
address, and the rest will be processed in a burn request. This function returns theburnID
which will be used to redeem the burn once it has been finished.If this was a large burn or there was not enough tokens, wait some time until
redeemable(uint256 burnID
istrue
Call
redeem(uint256 burnID)
which will send the pending HYPE to theto
address specified in the previous transaction
Last updated