osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

lendex-token: Basic contract #14

Closed hashedone closed 2 years ago

hashedone commented 2 years ago

Closes #2

hashedone commented 2 years ago

Tests are missing - it is marked as ready for review to not block other tasks, but I will add tests today (either add into this review, or - if it is already closed - in follow up).

hashedone commented 2 years ago

Note from my side: I applied the query to the controller basing on task description, but I am not happy about it. My proposal is, to substitute ControllerQuery::CanTransfer with

ControllerQuery::TransferableAmount {
  token,
  account,
}

The change here is to remove amount at all. The response would be just:

TransferableAmountResp {
  transferable: Amount,
}

And then contract would check against the amount it want to transfer. It is the same information basically, but communication protocol is simplified. @ethanfrey ?

ethanfrey commented 2 years ago

That is a good improvement, as it provides more information for the same question.

Feel free to update that in this PR or a follow up, but I accept the api change