Submitted by kenzo, also found by MaratCerby, 0x1f8b, berndartmueller, Dravee, 0xsomeone, cryptphi, IllIllI, and xiaoming90
https://github.com/code-423n4/2022-05-rubicon/blob/main/contracts/rubiconPools/BathHouse.sol#L180
https://github.com/code-423n4/2022-05-rubicon/blob/main/contracts/RubiconRouter.sol#L157
https://github.com/code-423n4/2022-05-rubicon/blob/main/contracts/rubiconPools/BathToken.sol#L256
When using the approval mechanism in USDT, the approval must be set to 0 before it is updated.
In Rubicon, when creating a pair, the paired assets approval is not set to 0 before it is updated.
Cant create pairs with USDT, the most popular stablecoin, as the approval will revert.
USDT reverts on approval if previous allowance is not 0:
When creating a pair, Rubicon approves the paired asset without first setting it to 0:
Therefore, if desiredPairedAsset is USDT, the function will revert, and pairs with USDT can not be created.
This problem will also manifest in RubiconMarkets approval function and BathTokens approval function,
Set the allowance to 0 before setting it to the new value.
bghughes (Rubicon) disputed and commented:
KenzoAgada (warden) commented:
HickupHH3 (judge) commented:
bghughes (Rubicon) confirmed and commented:
