Smart contract specifications
Last updated
Last updated
The codebase of our Liquid Staking Protocol can be found on GitHub, inside our milkyway-labs/milkyway-contracts repository. Particularly, you will find two smart contracts:
The staking contract: it contains the logic that allows to stake TIA tokens in exchange for our milkTIA Liquid Staking Token, as well as unstaking such token to receive back TIA.
The treasury contract: this is where all the fees collected by MilkyWay are stored and managed.
Both contracts are deployed on the Osmosis mainnet at the following addresses:
Smart contract | Address | Explorer link |
---|---|---|
In order to liquid stake some TIA and receive milkTIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract
message having the following structure:
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)
Make sure the user has bridged the amount of TIA they want to liquid stake to the Osmosis mainnet using IBC. This because we only support IBC TIA to be liquid staked (denom: ibc/D79E7D83AB399BFFF93433E54FAA480C191248FC556924A2A8351AE2638B3877
)
Make sure the amount of tokens to be liquid staked is multiplied by 1.000.000
when creating the message. This means that if the users wants to liquid stake 10.5 TIA, you should set 10500000
as the amount.
In order to liquid unstake some milkTIA and receive back TIA, you will need to broadcast a transaction containing a /cosmwasm.wasm.v1.MsgExecuteContract
message having the following structure:
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)
Make sure the amount of tokens to be liquid unstaked is multiplied by 1.000.000
when creating the message. This means that if the users wants to liquid unstake 10.5 milkTIA, you should set 10500000
as the amount.
Please note that, differently from what happens when liquid staking their TIA tokens, users will not immediately receive back their TIA tokens when liquid unstaking milkTIA. This because, as per our architecture, we first need to process the batch requesting the staked TIA to be unlocked. This usually takes around 14 days, after which the TIA tokens will be ready to be claimed by the user. Claiming your tokens will require you to provide the batch_id
that is returned to you when executing the liquid_unstake
operation.
After you request your milkTIA to be unstaked, it will need around 14 days for them to be available again. Once that time has passed, you can use the following message in order to claim your tokens:
When creating this message, please note the following:
Make sure the contract address is the one of our liquid staking contract: (osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
)
The batch_id
provided matches the value returned by the liquid_unstake
operation execution.
Staking contract
osmo1f5vfcph2dvfeqcqkhetwv75fda69z7e5c2dldm3kvgj23crkv6wqcn47a0
Treasury contract
osmo1r88fszmnpn8ez5wc42pssd2597mhtrdzex7tzzulj98fmqee2fksg7z5yh