ebtc-protocol/ebtc

Zap Entry Path Routing Fuzz

Closed this issue · 0 comments

See ETH entry here where 1 wei is lost in division when converting to stETH.

isCollateralIncrease :
True
collateralTokenDelta :
5000000000000000000
stEthDelta :
4999999999999999999

https://sepolia.etherscan.io/tx/0x15e21dcc9f10a55e06729bc8b6d3f8328919f1420e16999d0e7857e71e844080#eventlog

  • add fuzz tests for ETH entry paths (openCdp, adjustCdp)
    • check that stEthDelta matches collateralTokenDelta in event and in reality (looking at CDP after the fact)
  • add fuzz tests for WETH entry paths (openCdp, adjustCdp)
  • check that stEthDelta matches collateralTokenDelta in event and in reality (looking at CDP after the fact)
  • add fuzz tests for WSTETH entry paths (openCdp, adjustCdp)
  • check that stEthDelta matches expected collateralTokenDelta * wsteth "ppfs" in event and in reality (looking at CDP after the fact)
  • only revert if rounding error exceeds a threshold of 1 wei
  • rather than revert on one wei, print out scenarios where a diff is seen