Closed ethanfrey closed 2 years ago
@ethanfrey also question regarding transfering ltokens - we don't have such option currently, am I wrong? Our API is:
Deposit {}
Withdraw { amount }
Borrow { amount }
Repay
Token transfers happen on the lendex-token contract itself, not the market.
Where the lendex-token
contract needs to ask the market if it is allowed to transfer.
You may have to update some of those multi-tests as well.
With #23 we can get a global view of a user's account in all markets.
With this, we can make Markets more intelligent and properly authorise borrows and transfers, rather than use the stubs we defined in #6 and #7
The Market must store the address of the Credit Agency in the constructor (present as info.sender). When we need to check for withdraw LToken, transfer LToken or borrow BToken, we perform the following:
For borrowing, we can borrow up to
available
tokensFor withdraw or transfer, we can move more collateral, as eg 2 collateral remove the right to borrow 1 unit.