enzymefinance / protocol

Enzyme Protocol Implementation

Home Page:https://enzyme.finance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revoke unused asset approvals after a successful order fill

SeanJCasey opened this issue · comments

The new validateAndFinalizeFilledOrder modifier introduced in #822 needs to revoke unused asset approvals (the difference between expected and actual fill amounts).

This will involve having the modifier handle all asset approvals as well. Either that, or the modifier could be split up into 2-4 functions that each exchange adapter calls, rather than one modifier.

This can be decided after the PR is merged, but before the next release.

Now that we're getting rid of non-instant settlement transactions, we could also just revoke all asset approvals (reset them all to 0) afterwards. Would need to re-institute doing this with increase/decrease when we have non-instant settlement.