makerdao / dss-flash

MakerDAO Flash Mint Module
GNU Affero General Public License v3.0
50 stars 35 forks source link

Use ERC20 DAI #21

Closed hexonaut closed 3 years ago

hexonaut commented 3 years ago

I've been going back and forth on this, but apart from the use-case of paying back a vault loan, I think every other use is going to require ERC20 DAI. Now this would be fine if all it required was some more boilerplate code, but in fact we have a more gas-efficient implementation if we switch to dai.mint() and dai.burn() instead of vat.suck() and vat.heal() as it doesn't require using daiJoin.exit(). I think these gas-savings for arguably the at least majority use-case is a worthwhile change.

Alternatively we could just add support for both.

gbalabasquer commented 3 years ago

Yeah, it would be fantastic to use dai.mint and dai.burn, that would have been the way I would have done it, as the final accounting of the vat and dai doesn't get affected. However, the only contract that has authority over the dai contract is the daiJoin, not the pauseProxy, then the only way to do it is migrating to a new join and dai contracts.

hexonaut commented 3 years ago

Oh I didn't realize. Yeah this is definitely not worth upgrading the dai / join over. If there is no other route other than vat.suck() then I guess let's just stick with that.