1 unstable release
0.1.0 | Jul 20, 2023 |
---|
#236 in #identifier
215KB
4.5K
SLoC
Astroport native coins wrapper contract
This contract allows you to wrap native coins into Cw20 tokens.
InstantiateMsg
Initializes the contract with the token code identifier that will be used to create a Cw20 token for wrapping native coins.
{
"denom": "denom",
"token_code_id": 123,
"token_decimals": 6
}
ExecuteMsg
wrap
Wraps the amount of specified native coin and issues cw20 tokens instead.
You should send the amount of the native coin through the funds
array.
{
"wrap": {}
}
receive
CW20 receive msg.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}
Unwrap
Receives Cw20 wrapped tokens and returns unwrapped native coins.
Execute this message by calling the CW20 native wrapped token contract and use a message like this:
{
"send": {
"contract": <NativeWrapperContractAddress>,
"amount": "999",
"msg": "base64-encodedStringOfWithdrawMsg"
}
}
In send.msg
, you may encode this JSON string into base64 encoding:
{
"unwrap": {}
}
QueryMsg
config
Returns the general config of the contract.
{
"config": {}
}
Dependencies
~5.5–7.5MB
~158K SLoC