✨ New!✨  C4 Cosmos leagueRead more »

Contest ran May 20May 26

7 day contest

FairSide contest

FairSide Network

$55,000 USDC

Total Awards

FairSide contest details

Contest scope information

The FairSide system is composed of the following contracts:

  • conviction/FairSideConviction.sol (71 SLoC)
    • token/FSD.sol as ERC20 (External Contract)
    • dependencies/DSMath.sol (Library)
  • dao/FairSideDAO.sol (301 SLoC, based on Compound)
    • token/FSD.sol as ERC20ConvictionScore (External Contract)
    • timelock/Timelock.sol (External Contract)
    • dependencies/DSMath.sol (Library)
  • dependencies/ABDKMathQuad.sol (Imported Contract from ABDK Consulting)
  • dependencies/DSMath.sol (Imported Contract from dAppHub)
  • dependencies/ERC20ConvictionScore.sol (190 SLoC)
    • dependencies/TributeAccrual.sol (Inherited Contract)
    • conviction/FairSideConviction.sol (External Contract)
  • dependencies/FSOwnable.sol (OZ Ownable.sol w/ 4 SLoC Inclusion of Renouncing Ownership)
  • dependencies/FairSideFormula.sol (148 SLoC)
    • dependencies/ABDKMathQuad.sol (Library)
  • dependencies/SignatureWhitelist.sol (25 SLoC)
    • ECDSA.sol (Library, OZ)
    • EIP712.sol (Inherited, OZ)
  • dependencies/TributeAccrual.sol (84 SLoC)
    • ERC20.sol (Inherited, OZ)
    • SafeMath.sol (Library, OZ)
  • dependencies/UniswapV2OracleLibrary.sol (Imported Contract from Uniswap V2)
  • dependencies/Withdrawable.sol (22 SLoC)
  • network/FSDNetwork.sol (236 SLoC)
    • token/FSD.sol (External Contract)
    • dependencies/FairSideFormula.sol (Library)
    • dependencies/DSMath.sol (Library)
  • timelock/Timelock.sol (Imported Contract from Compound)
  • token/ABC.sol (37 SLoC)
    • dependencies/FairSideFormula.sol (Library)
    • dependencies/DSMath.sol (Library)
  • token/FSD.sol (125 SLoC)
    • token/ABC.sol (Inherited Contract)
    • dependencies/ERC20ConvictionScore.sol (Inherited Contract)
    • dependencies/SignatureWhitelist.sol (Inherited Contract)
    • dependencies/Withdrawable.sol (Inherited Contract)
    • dependencies/FSOwnable.sol (Inherited Contract)
    • dependencies/DSMath.sol (Library)
    • network/FSDNetwork.sol (External Contract)

The main areas of interest for the audit is the novel bonding curve implementation located within FairSideFormula, the adaptations made to Compound's governance in FairSideDAO and finally the FSDNetwork implementation itself. Gas optimizations as well as a way to better define the formula are eligible for the contest and would be greatly appreciated.

The FSD token is a bonding curve based token that implements the Nexus Mutual formula from scratch using bonding curve math. The Nexus Mutual is a linear stepped graph whereas the implementation of FairSide is a true bonding curve using integral calculus. In particular, the FairSideFormula contract implements g(x) = (1 / f(x))' where f(x) is the price formula defined in the link above. For the calculation of the arctan trigonometric function, we used the following tautology:

  • arctan(x) = pi / 2 - arctan(1 / x), x > 0
  • arctan(x) = - pi / 2 - arctan(1 / x), x < 0

Additionally, the implementation itself is based on the Efficient Approximations for the Arctangent Function academic paper. The bonding curve formula is not based on any other implementation on the blockchain space and as such is one of the main targets to secure during the contest.

The token is meant to be fully compliant with the ERC20 standard and differs in that it boasts the following features:

  • Tracks the amount of time units are held by each individual address and assigns a conviction score that accumulates based on this
  • Allows the creation of tokens on the bonding curve based on the funding existing within the funding pool
  • Allows the withdrawal of ether from the bodning curve based on the funding existing within the funding pool
  • Possesses the ability to validate EIP-712 signatures for the early phase of the bonding curve
  • Accrues tributes that are meant to be awarded to both users and governance members based on the conviction score above
  • Enables the creation of an NFT based on the conviction score of a user via the FairSideConviction contract

Additional Info

A technical document lies under the docs folder meant to depict how the various components are meant to interact with each other. A more fleshed out docuemntation paper will be provided prior to the formal initiation of the contest.