Closed ethanfrey closed 2 years ago
@ethanfrey already question: why ControlQuery::CanTransfer
has the token
field? Why the MessageInfo::sender
is not used as it should be more accurate?
Queries have no sender, only messages do.
So, when querying for a balance, you must specify which account
Please reference cw20-base... much can be copied
The lender token will be used both for the collateral (l-Tokens) as well as the loans (b-Tokens). The difference is the logic in minting, burning, and allowing transfer. That logic will be delegated to another contract that has a more holistic view of the system, called the "Market". For now, we develop the common parts.
They should be a minimal subset of cw20, which we extend. Init something like this (note initial balance is 0):
We will implement this without allowances for now:
Burn
andMint
should only be callable by the controller (with no further restrictions).Transfer
andSend
will call the controller address with the following query and only allow the transfer on success.Please provide a mock contract for multi-test testing that can either return true, false, or amount < X.
We also support the following queries:
NB: I recommend storing the
total_supply
in it's own Item separate from the rest of the config, just combining them for queries. You can look at cw20-base to see an implementation of all these (feel free to copy useful code)