Closed hexonaut closed 4 years ago
After discussion with @lucas-manuel, we decided to pull out all the delegation and accounting inside keg
as this functionality is already available within the vat
. Additionally, I removed the reliance on ERC20 Dai as I originally just forgot that vat
has delegation with hope
.
This is a rather large update to
keg
to move it towards compliance with the governance's requirements: https://forum.makerdao.com/t/flapperdistributor-a-way-to-distribute-system-surplus-while-minimizing-governance/4591Notable changes:
transferFrom()
with pre-approval allows us to pull the Dai in and distribute it with one call which allows us to push Dai into thekeg
instead of requiringauth
ed contracts. Anyone can pay into thekeg
now without admin access.flights
which allows for a pre-authorized distribution of funds which can be specified by supplying an arbitrary string. This allows governance to do stuff like set an "operations" budget which distributes 50% to smart contracts and 50% to risk domain teams.Tap
contract which is used to connect the surplus buffer with thekeg
. Atap
has a pre-authorized rate at which funds can be drained from thevow
. This allows us to set say a weekly budget for a particularflight
of 20k Dai / week for example. Anyone can callpump()
which distributes the funds.FlapTap
contract which sits between thevow
and the currentflapper
. This contract acts as a siphon which pulls some fixed % of funds from theflapper
. It is designed to forward all calls to theflapper
and behave nicely so as not to change the assumptions made by thevow
when eitherkick
ing off an auction orcage
ing the system.