You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is something a bit odd going on with the market called “WETH market” / 0xb4277c368b817db02bab8b684c9bfe10200461f7 on rinkeby, not sure yet but please avoid interacting with it for now so the state stays the same for more testing.
Potential there is an issue in the FixedProductMarketMaker contracts where withdrawFees can error out with an underflow preventing liquidity withdrawal (removeFunding -> _burn -> _beforeTokenTransfer -> withdrawFees btw)
The text was updated successfully, but these errors were encountered:
Create a standard Yes / No Categorical market with 1 Dai funding
Switch to a different account
Buy 1 Dai worth of Yes tokens
Fund the market with 1 Dai
Buy another 1 Dai worth of Yes tokens
Withdraw 0.001 pool tokens
Try to withdraw any amount of the remaining pool tokens and it will fail
You can confirm the overflow by plugging the market address into https://rinkeby.etherscan.io/ and calling feesWithdrawableBy with your CPK address, it should display: “Error: Returned error: execution reverted: SafeMath: subtraction overflow”
How does this happen
Basically if there are no buys/sell between liquidity withdrawals the calculation for a user's fees can be slightly lower than at the time of the last withdrawal. This can cause an underflow when the previously claimed, higher fee amounts are subtracted from new lower fee amounts.
What we should do
Overall I think this bug is pretty low risk but it is good to know about. It can lock user funds but not indefinitely and simply buying/selling on the market will allow for liquidity to be withdrawn. Contracts should be fixed and if we need to we can force users to withdraw all their liquidity at once to reduce chances of this happening.
There is something a bit odd going on with the market called “WETH market” / 0xb4277c368b817db02bab8b684c9bfe10200461f7 on rinkeby, not sure yet but please avoid interacting with it for now so the state stays the same for more testing.
Potential there is an issue in the FixedProductMarketMaker contracts where
withdrawFees
can error out with an underflow preventing liquidity withdrawal (removeFunding
->_burn
->_beforeTokenTransfer
->withdrawFees
btw)The text was updated successfully, but these errors were encountered: