From 141026fdbfc303fa9c612649ee561fa5f0f94f3a Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Fri, 19 Apr 2024 17:43:07 +0530 Subject: [PATCH] updated gmp docs --- x/uibc/gmp/README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/x/uibc/gmp/README.md b/x/uibc/gmp/README.md index 930ed3a3df..6a4584a859 100644 --- a/x/uibc/gmp/README.md +++ b/x/uibc/gmp/README.md @@ -3,6 +3,63 @@ Cross chain transfers using Axelar General Message Passing (GMP) More info about cosmos GMP find [here](https://docs.axelar.dev/dev/cosmos-gmp) +## Axelar IBC Memo + +```go +type Memo struct { + SourceChain string `json:"source_chain"` + SourceAddress string `json:"source_address"` + Payload []byte `json:"payload"` + Type int64 `json:"type"` +} +``` + +When user wants to execute leverage supply or supply collateral or liquidate transaction using Axelar GMP , user have to send `Payload=[]byte(Msg)` in `Memo` , +in below example contract change [payload](https://github.com/axelarnetwork/evm-cosmos-gmp-sample/blob/main/native-integration/multi-send/solidity/contracts/MultiSend.sol) feild and version ,for now we are supporting `uint32(2)` version. + +## Supported Leverage Msgs through Axelar GMP + +### Supply the asset + +```go +type MsgSupply struct { + // Supplier is the account address supplying assets and the signer of the message. + Supplier string `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + Asset types.Coin `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset"` +} +``` + +### Supply and Collateral Msg + +```go +type MsgSupplyCollateral struct { + // Supplier is the account address supplying assets and the signer of the message. + Supplier string `protobuf:"bytes,1,opt,name=supplier,proto3" json:"supplier,omitempty"` + Asset types.Coin `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset"` +} +``` + +### Liquidate Msg + +```go +type MsgLiquidate struct { + // Liquidator is the account address performing a liquidation and the signer + // of the message. + Liquidator string `protobuf:"bytes,1,opt,name=liquidator,proto3" json:"liquidator,omitempty"` + // Borrower is the account whose borrow is being repaid, and collateral consumed, + // by the liquidation. It does not sign the message. + Borrower string `protobuf:"bytes,2,opt,name=borrower,proto3" json:"borrower,omitempty"` + // Repayment is the maximum amount of base tokens that the liquidator is willing + // to repay. + Repayment types.Coin `protobuf:"bytes,3,opt,name=repayment,proto3" json:"repayment"` + // RewardDenom is the denom that the liquidator will receive as a liquidation reward. + // If it is a uToken, the liquidator will receive uTokens from the borrower's + // collateral. If it is a base token, the uTokens will be redeemed directly at + // a reduced Liquidation Incentive, and the liquidator will receive base tokens. + RewardDenom string `protobuf:"bytes,4,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` +} +``` + ## Example transfer from fantom EVM to umee using Axelar GMP ```bash