0xProject / 0x-monorepo

0x protocol monorepo - includes our smart contracts and many developer tools
Other
1.41k stars 467 forks source link

fix: [asset-swapper] Catch Uint256BinOp which can occur #2724

Closed dekz closed 4 years ago

dekz commented 4 years ago

Description

Sometimes Kyber was throwing a Uint256BinOpError for large buy amounts on certain pairs.

values: { error: 1, a: 4543042830303884935323379, b: 457454875418173172390967323045417612818571949129435461 }, abi: { type: 'error', name: 'Uint256BinOpError'

This would bubble all the way up the top and not be properly handled in a try/catch. I believe Mooniswap may also have the similar issue, but we check for balances of the pool.

Testing instructions

Types of changes

Checklist: