yearn / veYFI

Voting YFI
75 stars 38 forks source link

[Gauge] - Improve UX around setApprovals for delegating actions #163

Open storming0x opened 2 years ago

storming0x commented 2 years ago

https://github.com/yearn/veYFI/blob/bff7cc2dfb0953c36f1ade969ac6272052195bc8/contracts/Gauge.sol#L537

i think it's better UX to have granular methods, instead of a single setter with boolean arguments where one argument can easily be sent in bad order and confusing for caller.

setApprovals(0x01, true, false) can have different consequences than setApprovals(0x01, false, true)

potentially error prone, i prefer explicit methods.

enableClaimingFrom(address). disableClaimingFrom(address)

enableLockingFrom(address). disableLockingFrom(address)

less arguments and makes the side effect explicit avoiding potential oops factor