Some tokens require resetting approval to 0 before another value in order to prevent frontrunning of the approve() function. Openzeppelin's safeApprove implementation ensures two approve() calls are made, enabling all tokens to be used in MISOMarket.sol and MISOLauncher.
Handle
leastwood
Vulnerability details
Impact
Some tokens require resetting approval to
0
before another value in order to prevent frontrunning of theapprove()
function. Openzeppelin'ssafeApprove
implementation ensures twoapprove()
calls are made, enabling all tokens to be used inMISOMarket.sol
andMISOLauncher
.Proof of Concept
https://github.com/sushiswap/miso/blob/master/contracts/MISOMarket.sol#L285 https://github.com/sushiswap/miso/blob/master/contracts/MISOLauncher.sol#L282
Tools Used
Manual code review
Recommended Mitigation Steps
Consider using Openzeppelin's implementation of
safeApprove
for allapprove()
calls.