InverterNetwork/contracts

Staking Contract

Closed this issue · 1 comments

For the upcoming oStake Module we will need to implement a staking Contract.
The contract holds balances and allows for deposit/withdrawal (also of the depositFor() kind).

Possibly the easiest implementation for the staking use case would be to structure it as an ERC20Snapshot that gives out non-transferable receipt tokens (can be thought as transferable for future). This would allow us to query user balance based on a timestamp, which we can then use for reward distribution in other places.

While looking into the ERC20 snapshot structure I noticed some difficulties for directly integrating the contract here.
The snapshot system used there is based on a id system, that doesnt integrate block timestamps which are necessary to calculate how long stakes where being held
I decided to adapt a structure that enables this by making stakes their own entities.