Skip to content

Latest commit

 

History

History
96 lines (86 loc) · 16.7 KB

PROPERTIES.md

File metadata and controls

96 lines (86 loc) · 16.7 KB

Introduction

Here is a list of the property tests for the top five forked protocols. For each property, there is a permalink to the file implementing it in the repository and a small description of the invariant tested.

This may not be a complete list and there may be some more invariants to test. I focused more on functions that transferred funds or of major state updates. Also note that there are still some invariants listed here that needs to be implemented. Within each project folder README.md one can find what is left under Invariants TODO section.

Table of contents

Uniswap v2

ID Name Invariant tested
UNI-001 testFuzz_AddLiq Adding liquidity to a pair should:
  • Increase reserves
  • Increase address to balance
  • Increase totalSupply
  • Increase k
UNI-002 testFuzz_ETHAddLiq Same as adding liquidity
UNI-003 testFuzz_RemoveLiq Removing liquidity from a pair should:
  • Decrease reserves
  • Decrease address to balance
  • Decrease totalSupply
  • Decrease K
UNI-004 testFuzz_ETHRemoveLiq Same as removing liquidity
UNI-005 testFuzz_removeLiqWithPermit Same as removing liquidity
UNI-006 testFuzz_removeLiquidityETHWithPermit Same as removing liquidity
UNI-007 testFuzz_removeLiqETHSupportingFeeOnTransferTokens Same as removing liquidity
UNI-008 testFuzz_removeLiqETHWithPermitSupportingFeeOnTransferTokens Same as removing liquidity
UNI-009 testFuzz_swapExactTokensForTokens Swapping within a pair should:
  • Decrease balance of user for token 2
  • Increase balance of user for token 1
  • Decrease/leave k unchanged
UNI-010 testFuzz_swapExactETHForTokens Same as Swap
UNI-011 testFuzz_swapTokensForExactETH Same as Swap
UNI-012 testFuzz_swapExactTokensForETH Same as Swap
UNI-013 testFuzz_swapETHForExactTokens Same as Swap
UNI-014 testFuzz_swapExactTokensForTokensSupportingFeeOnTransferTokens Same as Swap
UNI-015 testFuzz_swapExactETHForTokensSupportingFeeOnTransferTokens Same as Swap
UNI-016 testFuzz_swapExactTokensForETHSupportingFeeOnTransferTokens Same as Swap

Olympus DAO

ID Name Invariant tested
OLY-001 testFuzz_deposit Depositing into the BondDepo should:
  • Increase user Bond Payout
  • Updates users last block to latest
  • Updates Bond Price
  • Increase Total Debt
  • Increase Treasury Total Reserves
  • Updates control variable accordingly
  • Updates rate accordingly
OLY-002 testFuzz_redeemNoStaking Redeeming without staking from BondDepo should:
  • Decrease user payout
  • Decrease user vesting
  • Update user lastBlock
  • Increase user OHM Balance
OLY-003 testFuzz_redeemWith Redeeming with staking from BondDepo should:
  • Decrease user payout
  • Decrease user vesting
  • Update user lastBlock
  • Increase staking OHM Balance
  • Increase staking warmup sOHM Balance
  • Increase user staking deposit
  • Increase user gons
  • Increase user expiry
  • Update user lock to false
OLY-004 testFuzz_redeemRebase Redeeming from BondDepo should:
  • Updates distribute
  • Increases number
  • Increases endBlock
OLY-005 testFuzz_unstake Unstaking should:
  • Increase user OHM balance
  • Decrease user sOHM balance
  • Increase Staking sOHM balance
  • Decrease Staking OHM balance

Compound v2

ID Name Invariant tested
COM-001 testFuzz_mint Calling mint Should:
  • Increase cToken TotalSupply
  • Increase User cToken Balance
  • Decrease User underlying Balance
  • Update Supply Index in Comptroller
  • Update Comp Supplier Index in Comptroller
  • Update supplier compAccrued in Comptroller
  • Update Supply block Number in Comptroller
  • Update cToken accrualBlockNumber
  • Update cToken borrowIndex
  • Update cToken totalBorrows
  • Update cToken totalReserves
COM-002 testFuzz_redeem Calling redeem Should:
  • Decrease cToken TotalSupply
  • Decrease User cToken Balance
  • Increase User underlying Balance
  • Update Supply Index in Comptroller
  • Update Comp Supplier Index in Comptroller
  • Update supplier compAccrued in Comptroller
  • Update Supply block Number in Comptroller
  • Update cToken accrualBlockNumber
  • Update cToken borrowIndex
  • Update cToken totalBorrows
  • Update cToken totalReserves
COM-003 testFuzz_borrow Calling borrow Should:
  • Update borrow index in Comptroller
  • Update borrow block in Comptroller
  • Update borrower compAccrued in Comptroller
  • Update compBorrowerIndex in Comptroller
  • Add user to market in Comptroller
  • Add cToken to users accountAssets in Comptroller
  • Increase accountBorrows principal
  • Update accountBorrows interestIndex
  • Increase totalBorrows
  • Increase User underlying Balance
COM-004 testFuzz_repayBorrow Calling repayBorrow Should:
  • Update borrow index in Comptroller
  • Update borrow block in Comptroller
  • Update borrower compAccrued in Comptroller
  • Update compBorrowerIndex in Comptroller
  • Add user to market in Comptroller
  • Add cToken to users accountAssets in Comptroller
  • Increase accountBorrows principal
  • Update accountBorrows interestIndex
  • Increase totalBorrows
  • Increase User underlying Balance
COM-005 testFuzz_liquidateBorrow Calling liquidateBorrow Should:
  • Update cToken accrualBlockNumber
  • Update cToken borrowIndex
  • Update cToken totalBorrows
  • Increase totalReserves
  • Decrease cToken totalSupply
  • Decrease borrower accountTokens
  • Increase liquidator accountTokens
COM-006 testFuzz_repayBorrowBehalf Calling repayBorrowBehalf Should:
  • Update borrow index in Comptroller
  • Update borrow block in Comptroller
  • Update borrower compAccrued in Comptroller
  • Update compBorrowerIndex in Comptroller
  • Add user to market in Comptroller
  • Add cToken to users accountAssets in Comptroller
  • Increase accountBorrows principal
  • Update accountBorrows interestIndex
  • Increase totalBorrows
  • Increase User underlying Balance
COM-007 testFuzz_sweepToken Calling sweepToken Should:
  • Decrease ctoken random token balance
  • Increase Admin random token balance
COM-008 testFuzz_addReserves Calling addReserves Should:
  • Update cToken accrualBlockNumber
  • Update cToken borrowIndex
  • Update cToken totalBorrows
  • Update cToken totalReserves (after accrueInterest)
  • Decease User balance
  • Increase ctoken underlying balance
COM-009 testFuzz_transfer Calling transfer Should:
  • Decrease from address accountTokens
  • Increase to address accountTokens
COM-010 testFuzz_transferFrom Calling transferFrom Should:
  • Decrease from address accountTokens
  • Increase to address accountTokens

Tomb Finance

ID Name Invariant tested
TMF-001 testFuzz_tombMint Tomb mint should:
  • Increase User Balance
  • Increase Total Supply
TMF-002 testFuzz_tombBurn Tomb burn should:
  • Decrease User Balance
  • Decrease Total Supply
TMF-003 testFuzz_tombBurnFrom Tomb burnFrom should:
  • Decrease User Balance
  • Decrease Total Supply
TMF-004 testFuzz_tombTransferFrom Tomb transferFrom without autoCalculateTax & currentTaxRate == 0 should:
  • Decrease from User Balance
  • Increase to User Balance
  • Total Supply should remain the same
TMF-005 testFuzz_tombTaxTransferFrom Tomb transferFrom with autoCalculateTax should:
  • Decrease from User Balance
  • Increase to User Balance
  • Decrease Total Supply
TMF-006 testFuzz_tBondMint TBond mint should:
  • Increase User Balance
  • Increase Total Supply
TMF-007 testFuzz_tBondBurn TBond burn should:
  • Decrease User Balance
  • Decrease Total Supply
TMF-008 testFuzz_tBondBurnFrom TBond burnFrom should:
  • Decrease User Balance
  • Decrease Total Supply
TMF-009 testFuzz_tombGenesisRewardPoolDeposit Depositing into TombGenesisRewardPool Should:
  • Update pool reward variables
  • Decrease User bal of token
  • Update User rewardDebt
  • Increase user bal amount
TMF-010 testFuzz_tombGenesisRewardPoolWithdraw Withdrawing from TombGenesisRewardPool Should:
  • Update pool reward variables
  • Increase User bal of token
  • Update User rewardDebt
  • Decrease user bal amount
TMF-011 testFuzz_tombGenesisRewardPoolEmergencyWithdraw Emergency withdrawing from TombGenesisRewardPool Should:
  • Increase User bal of token
  • Decrease User rewardDebt
  • Decrease user bal amount
TMF-012 testFuzz_tombGenesisRewardPooGovernanceRecoverUnsupported TombGenesisRewardPool Governance recover Should:
  • Decrease contract bal of token
  • Increase to User bal of token
TMF-013 testFuzz_tombRewardPoolDeposit Depositing into TombRewardPool Should:
  • Update pool reward variables
  • Decrease User bal of token
  • Increase User rewardDebt
  • Increase user bal amount
TMF-014 testFuzz_tombRewardPoolWithdraw Withdrawing from TombRewardPool Should:
  • Update pool reward variables
  • Increase User bal of token
  • Update User rewardDebt
  • Decrease user bal amount
TMF-015 testFuzz_tombRewardPoolEmergencyWithdraw Emergency withdrawing from TombRewardPool Should:
  • Increase User bal of token
  • Decrease User rewardDebt
  • Decrease user bal amount
TMF-016 testFuzz_tombRewardPoolGovernanceRecoverUnsupported TombRewardPool Governance recover Should:
  • Decrease contract bal of token
  • Increase to User bal of token
TMF-017 testFuzz_tShareRewardPoolDeposit Depositing into TShareRewardPool Should:
  • Update pool reward variables
  • Decrease User bal of token
  • Increase User rewardDebt
  • Increase user bal amount
TMF-018 testFuzz_tShareRewardPoolWithdraw Withdrawing from TShareRewardPool Should:
  • Update pool reward variables
  • Increase User bal of token
  • Update User rewardDebt
  • Decrease user bal amount
TMF-019 testFuzz_tShareRewardPoolEmergencyWithdraw Emergency withdrawing from TShareRewardPool Should:
  • Increase User bal of token
  • Decrease User rewardDebt
  • Decrease user bal amount
TMF-020 testFuzz_testFuzztShareRewardPoolGovernanceRecoverUnsupported TShareRewardPool Governance recover Should:
  • Decrease contract bal of token
  • Increase to User bal of token
TMF-021 testFuzz_masonryStake Staking into Masonry Should:
  • Increase totalSupply
  • Increase User staked bal
  • Decrease User tBond amount
TMF-022 testFuzz_masonryWithdraw Depositing into Masonry Should:
  • Decrease totalSupply
  • Decrease User staked bal
  • Increase User tBond amount
TMF-023 testFuzz_masonryClaimReward Claiming reward from Masonry Should:
  • Decrease User Reward
  • Increase tomb bal
  • Update User epochTimerStart
TMF-024 testFuzz_masonryExit Exiting from Masonry Should:
  • Decrease totalSupply
  • Decrease User staked bal
  • Increase User tBond amount
TMF-025 testFuzz_masonryAllocateSeigniorage Masonry Allocate Seigniorage Should:
  • Update nextRPS
  • Update time
  • Decrease from User tomb bal
  • Increase contracts tomb bal
TMF-026 testFuzz_masonryGovernanceRecoverUnsupported Masonry Governance recover Should:
  • Decrease contract bal of token
  • Increase to User bal of token
TMF-027 testFuzz_treasuryBuyBonds Buying bonds from the Treasury Should:
  • Decrease User tomb bal
  • Increase User tBond bal
  • Decrease epochSupplyContractionLeft
TMF-028 testFuzz_treasuryRedeemBonds Redeeming bonds from the Treasury Should:
  • Decrease User tBond bal
  • Increase User tomb bal
  • Decrease epochSupplyContractionLeft
TMF-029 testFuzz_treasuryAllocateSeigniorage Treasury Allocate Seigniorage Should:
  • Update previousEpochTombPrice
  • If _savedForBond > 0, increase contract tomb bal
  • If _savedForMasonry > 0 && daoFundSharedPercent > 0 increase daoFund tomb bal
  • If _savedForMasonry > 0 && devFundSharedPercent > 0 increase devFund tomb bal
  • Update masonry's allowance
TMF-030 testFuzz_treasuryGovernanceRecoverUnsupported Treasury Governance recover Should:
  • Decrease contract bal of token
  • Increase to User bal of token
TMF-031 testFuzz_tShareClaimRewards tShare Claim rewards Should:
  • Increase totalSupply
  • If _pending > 0 && communityFund != address(0) increase communityFund tShare bal
  • If _pending > 0 && devFund != address(0) increase devFund tShare bal
TMF-032 testFuzz_tShareBurn TShare Burn Should:
  • Decrease User Balance
  • Decrease Total Supply
TMF-033 testFuzz_tShareGovernanceRecoverUnsupported Governance recover from TShare Should:
  • Decrease contract bal of token
  • Increase to User bal of token