BellwoodStudios / dss-psm

Peg Stability Module for Maker
GNU Affero General Public License v3.0
11 stars 1 forks source link

check approval return #7

Open alexisgayte opened 3 years ago

alexisgayte commented 3 years ago

https://github.com/BellwoodStudios/dss-psm/blob/ac61d164f89467a8a74ca8f6a7390e83898e0b0a/src/psmflip.sol#L67

hexonaut commented 3 years ago

If this is an invalid call it will revert. It's up to the integrator to ensure the gem in gemJoin is well formed. This is outside the scope of the psm flipper imo.

alexisgayte commented 3 years ago

you don't check invalid call, I believe, you check for return false. If the token contract reject the approval. There is also another reason but I don't remember, something like computer failure.

It was also inside the security report as well. image

I don't believe we use something that check it. https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#SafeERC20

hexonaut commented 3 years ago

Ah I see what you're saying. This makes sense.