contracts icon indicating copy to clipboard operation
contracts copied to clipboard

[Audit] Discrete Bondingcurve

Open FHieser opened this issue 4 months ago • 0 comments

This is the audit feature branch for the Discrete Bonding Curve Update. The following contracts are the main focus points of the Audit.

  • src/modules/fundingManager/bondingCurve/libraries/PackedSegmentLib.sol

  • src/modules/fundingManager/bondingCurve/formulas/DiscreteCurveMathLib_v1.sol

  • src/modules/fundingManager/bondingCurve/FM_BC_Discrete_Redeeming_VirtualSupply_v1.sol

  • Direct periphery contracts like:

    • src/modules/fundingManager/bondingCurve/abstracts/BondingCurveBase_v1.sol
    • src/modules/fundingManager/bondingCurve/abstracts/RedeemingBondingCurveBase_v1.sol
    • src/modules/fundingManager/bondingCurve/types/PackedSegment_v1.sol
    • src/modules/fundingManager/bondingCurve/interfaces/IDiscreteCurveMathLib_v1.sol
    • src/modules/fundingManager/bondingCurve/interfaces/IFM_BC_Discrete_Redeeming_VirtualSupply_v1.sol

A special care should be had for the precision and robustness of the Discrete Bonding Curve logic itself. A recommend read on this is the following blog post: https://www.carbondefi.xyz/blog/theory-vs-reality-the-precision-and-accuracy-of-carbon-defi-s-fixed-point-arithmetic

To get a better feel for the implementation and usage of the contracts I recommend to look at the following files:

  • script/workflowDeploymentAndSetupScripts/DeployFullSetupAndDiscreteBondingCurveWorkflow.s.sol
  • test/e2e/fundingManager/FM_BC_Discrete_Redeeming_VirtualSupply_v1_E2E.t.sol

Folders and Files to ignore for the audit:

  • context folder
  • docs folder
  • memory-bank folder

FHieser avatar Sep 26 '25 12:09 FHieser