Converter
Last updated
Last updated
The Converter contract is used to convert between wrapped bAsset tokens (wrapped tokens transferred to Terra via Wormhole bridge) and Anchor collateral bAsset tokens (token registered as Anchor collateral).
The existence of two bAsset tokens is due reward-accruing functionalities required for Anchor collateral tokens, which is not available on Wormhole wrapped tokens (automatically created by Wormhole bridge).
The Converter contract allows users to convert between the two tokens. Locking Wormhole wrapped tokens mints new Anchor collateral bAsset tokens in 1:1 ratio and vice versa.
Stores information about the contract configuration.
Key | Type | Description |
---|---|---|
* = not stored until value registered
Receive
Can be called during a CW20 token transfer when the Mint contract is the recipient. Allows the token transfer to execute a Receive Hook as a subsequent action within the same transaction.
Registers token contract addresses.
ConvertWormholeToAnchor
Converts Wormhole wrapped tokens to Anchor collateral bAsset tokens.
ConvertAnchorToWormhole
Converts Anchor collateral bAsset tokens to Wormhole wrapped tokens.
Config
Gets the contract configuration.
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
owner
CanonicalAddr
Address of contract owner
anchor_token_address
*
CanonicalAddr
Contract address of Wormhole wrapped token
wormhole_token_address
*
CanonicalAddr
Contract address of Anchor bAsset collateral token
owner
String
Address of contract owner
owner
String
Address of contract owner
sender
String
Sender of token transfer
amount
Uint128
Amount of tokens received
msg
Binary
Base64-encoded string of JSON of Receive Hook
sender
String
Sender of token transfer
amount
Uint128
Amount of tokens received
msg
Binary
Base64-encoded string of JSON of Receive Hook
wormhole_token_address
String
Contract address of Wormhole wrapped token
anchor_token_address
String
Contract address of Anchor bAsset collateral token
wormhole_token_address
String
Contract address of Wormhole wrapped token
anchor_token_address
String
Contract address of Anchor bAsset collateral token
owner
String
Address of contract owner
wormhole_token_address
*
String
Contract address of Wormhole wrapped token
anchor_token_address
*
String
Contract address of Anchor collateral token
owner
String
Address of contract owner
wormhole_token_address
*
String
Contract address of Wormhole wrapped token
anchor_token_address
*
String
Contract address of Anchor collateral token