Closed ethanfrey closed 2 years ago
So basically think of an extendable abstraction layer for coins without actually implementing cw20 or anything yet, right? Makes sense.
We will need this for LP tokens I imagine.
LP tokens are also native tokens. If we do some staking derivatives stuff, that would be cw20.
We have this abstraction in a number of places already. cw20-escrow is a good example. @maurolacy should be able to help with links to where this is used (and I think there is a generic Balance/Cw20Coin type in packages/cw20)
Right now we only work with native tokens.
In the future, we may want "super fluid" staking derivatives as collateral. These would most likely be cw20 tokens.
We could extend the API in such a way that this would not be breaking, but not adding this functionality yet. (For example rather than storing
Coin
in some API, we could returnenum Balance{ Native(Coin), Token(Cw20Coin) }
Or actually, only returnenum Balance{ Native(Coin)}
But with a shape thatBalance::Token
would not break the APIs (or maybe make final APIs and return error onBalance::Token
?