threshold-network / merkle-distribution

Threshold Network rewards generation and distribution
https://threshold.network
1 stars 6 forks source link

Replace `transfer` with `transferFrom` #6

Closed theref closed 2 years ago

theref commented 2 years ago

The current plan is to transfer all rewards into the merkle-distribution contract, which then automatically sends rewards as they are claimed. New proposal is to instead Authorize the merkle-distribution contract to spend from the DOA/council (up to total rewards). When a user claims, it then uses transferFrom. If there are bugs in the merkle-distribution contract, we are not stuck with all the funds locked away.

cygnusv commented 2 years ago

This implies also introducing a new contract variable to store the location of the approved funds, i.e., the from address for the transferFrom. This can be initialized in the constructor.