Compound v2 on Ethereum
Deployments
Action: deposit
Parameters
| Name | Type | Description |
|---|---|---|
targets | string[] (required) | Token symbols | Token addresses |
Target: ERC-20
For targets that are ERC-20 tokens, the following functions are allowed:
TARGET below refers to the ERC-20 token address of each element given in
targets.
TARGET · approve
Approve cToken to spend TARGET tokens on behalf of the avatar.
-
Contract:
TARGET -
Function:
approve(address,uint256)Parameter Constraint spenderequal to cTokenamount-
cToken · mint
Deposit TARGET and receive cToken tokens in exchange.
-
Contract:
cToken -
Function:
mint(uint256)Parameter Constraint amount-
Comptroller · enterMarkets
Set deposited asset as collateral.
-
Contract:
Comptroller -
Function:
enterMarkets(address[])Parameter Constraint cToken[]equal to [cToken]
Comptroller · exitMarket
Unset deposited asset as collateral.
-
Contract:
Comptroller -
Function:
exitMarket(address)Parameter Constraint cTokenequal to cToken
cToken · redeem
Redeem cToken and withdraw TARGET tokens.
This function is called when MAX underlying amount is withdrawn.
-
Contract:
cToken -
Function:
redeem(uint256)Parameter Constraint amount-
cToken · redeemUnderlying
Redeem cToken and withdraw TARGET tokens.
-
Contract:
cToken -
Function:
redeemUnderlying(uint256)Parameter Constraint amount-
Comptroller · claimComp
Claim COMP rewards.
-
Contract:
Comptroller -
Function:
claimComp(address,address[])Parameter Constraint holderequal to AVATARcToken[]equal to [cToken]
Target: ETH
For ETH as an element of targets, the following functions are allowed:
cETH · mint
Deposit ETH and receive cETH tokens in exchange.
-
Contract:
cETH -
Function:
mint()Ξ allow sending ETHParameter Constraint N/A N/A
Comptroller · enterMarkets
Set deposited asset as collateral.
-
Contract:
Comptroller -
Function:
enterMarkets(address[])Parameter Constraint cToken[]equal to [cETH]
Comptroller · exitMarket
Unset deposited asset as collateral.
-
Contract:
Comptroller -
Function:
exitMarket(address)Parameter Constraint cTokenequal to cETH
cETH · redeem
Redeem cETH and withdraw ETH tokens.
This functions is called when MAX underlying amount is withdrawn.
-
Contract:
cETH -
Function:
redeem(uint256)Parameter Constraint amount-
cETH · redeemUnderlying
Redeem cETH and withdraw ETH tokens.
-
Contract:
cETH -
Function:
redeemUnderlying(uint256)Parameter Constraint amount-
Comptroller · claimComp
Claim COMP rewards.
-
Contract:
Comptroller -
Function:
claimComp(address,address[])Parameter Constraint holderequal to AVATARcToken[]equal to [cETH]
Action: borrow
Parameters:
| Name | Type | Description |
|---|---|---|
targets | string[] (required) | Token symbols | Token addresses |
Target: ERC-20
For targets that are ERC-20 tokens, the following functions are allowed:
TARGET below refers to the ERC-20 token address of each element given in
targets.
TARGET · approve
Approve cToken to spend TARGET tokens on behalf of the avatar.
-
Contract:
TARGET -
Function:
approve(address,uint256)Parameter Constraint spenderequal to cTokenamount-
cToken · borrow
Receive TARGET tokens.
-
Contract:
cToken -
Function:
borrow(uint256)Parameter Constraint amount-
cToken · repayBorrow
Repay borrowed TARGET tokens.
-
Contract:
cToken -
Function:
repayBorrow(uint256)Parameter Constraint amount-
Target: ETH
For ETH as an element of targets, the following functions are allowed:
cETH · borrow
Receive ETH.
-
Contract:
cETH -
Function:
borrow(uint256)Parameter Constraint amount-
Maximillion · repayBehalf
Repay borrowed ETH.
-
Contract:
Maximillion -
Function:
repayBehalf(address)Ξ allow sending ETHParameter Constraint borrowerequal to AVATAR