osmosis-labs / isotonic

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

Add cw2222 style Distribution #4

Closed ethanfrey closed 2 years ago

ethanfrey commented 2 years ago

We will later want to airdrop "governance tokens" on the token holders. In order to do so, we will need an efficient way to distribute a different token to the group. The rebase mechanism works to provide "rewards" in the same token, but cw2222 allows us to provide rewards in a different token.

Use the same logic implemented in tgrade-contracts (likely cut and paste, I don't think this has been fully abstracted).

When distributing the tokens, the pointsPerShare will use the raw values in storage, not referencing the global multiplier. This makes the points more stable as inflation happens.

In the planned use case, there will be one predetermined reward token that can be distributed to the token holders. We can make it a native token for simplicity. (There is a chance it will be cw20 later, but Osmosis really wants native tokens for anything that can be listed).