Add two more messages to the Market contract to "borrow" and "repay" B tokens.
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
/// X base_asset must be sent along with this message. If it matches, X b_token is burned from the sender address.
/// If more was sent than needed to repay all debt, the excess is returned to the sender (this doesn't error)
/// The underlying base_asset is stored in this Market contract
Repay { },
/// This requests to borrow amount base_asset in exchange for accepting amount B Tokens
/// In the future we will do a check if this is allowed, for now, you can always allow.
/// Dispatches two messages, one to mint amount B Token for this sender, and the other to send amount base asset to the sender.
Borrow { amount: Uint128 },
}
There should be a placeholder function can_borrow(sender: &Addr, amount: Uint128) that always returns true now. This will later check if there is enough collateral to cover this debt.
Requires https://github.com/confio/lendex/issues/6.
Add two more messages to the Market contract to "borrow" and "repay" B tokens.
There should be a placeholder function
can_borrow(sender: &Addr, amount: Uint128)
that always returns true now. This will later check if there is enough collateral to cover this debt.