Skip to content

Commit

Permalink
updated gmp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Apr 19, 2024
1 parent ad1026d commit 141026f
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions x/uibc/gmp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 141026f

Please sign in to comment.