From e8319ea5e056e42217b162469b0f612d14eb5e4f Mon Sep 17 00:00:00 2001 From: Bayu Aldi Yansyah Date: Wed, 29 Dec 2021 05:28:34 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A6=20Update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 154 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 95 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 778e92da..41f43353 100644 --- a/README.md +++ b/README.md @@ -51,65 +51,101 @@ Use this command to run the test against Arbitrum One mainnet: here is the example output: - [PASS] test_getETHUSDCPrice() (gas: 57539) - - Running 1 tests for src/test/CurveSwap.t.sol:CurveSwapTest - [PASS] test_SwapUSDCToWETH() (gas: 27533) - - Running 3 tests for src/test/Hevm.t.sol:HevmTest - [PASS] test_setUSDTBalance() (gas: 13698) - [PASS] test_setWETHBalance() (gas: 11267) - [PASS] test_setUSDCBalance() (gas: 18526) - - Running 4 tests for src/test/RisedleETFTokenAccessControl.t.sol:RisedleETFTokenAccessControl - [PASS] testFail_NonGovernanceCannotMintToken() (gas: 1660983) - [PASS] testFail_NonGovernanceCannotBurnToken() (gas: 1715299) - [PASS] test_GovernanceCanBurnToken() (gas: 1713852) - [PASS] test_GovernanceCanMintToken() (gas: 1709342) - - Running 8 tests for src/test/RisedleMarketAccessControl.t.sol:RisedleMarketAccessControlTest - [PASS] test_GovernanceIsProperlySet() (gas: 4977069) - [PASS] test_GovernanceCanSetFeeRecipientAddress() (gas: 4982806) - [PASS] testFail_NonGovernanceCannotSetFeeRecipientAddress() (gas: 4985801) - [PASS] testFail_NonGovernanceCannotSetVaultParameters() (gas: 4984538) - [PASS] test_GovernanceCanSetVaultParameters() (gas: 4984700) - [PASS] testFail_NonGovernanceCannotCreateNewETF() (gas: 4987469) - [PASS] test_GovernanceCanCreateNewETF() (gas: 5133440) - [PASS] test_AnyoneCanAccrueInterest() (gas: 4984059) - - Running 6 tests for src/test/RisedleMarketExternal.t.sol:RisedleMarketExternalTest - [PASS] test_LenderCanRemoveSupplyFromTheVault() (gas: 5876060) - [PASS] test_LenderCanAddSupplytToTheVault() (gas: 5809925) - [PASS] test_InvestorCanMintETFToken() (gas: 8344951) - [PASS] test_InvestorMintTwice() (gas: 8482115) - [PASS] testFail_InvestorCannotMintETFTokenIfNoSupplyAvailable() (gas: 8090668) - [PASS] test_InvestorCanRedeemETFToken() (gas: 8514927) - - Running 20 tests for src/test/RisedleMarketInternal.t.sol:RisedleMarketInternalTest - [PASS] test_CalculateBorrowRatePerSecondInEther() (gas: 11466) - [PASS] test_CalculateETFNAV() (gas: 1781) - [PASS] test_GetDebtProportionRateInEther() (gas: 48288) - [PASS] test_GetTotalAvailableCash() (gas: 54086) - [PASS] test_SetVaultStates() (gas: 71021) - [PASS] test_VaultProperties() (gas: 19010) - [PASS] testFail_GetCollateralPerETFFeeTooLarge() (gas: 1042) - [PASS] test_GetChainlinkPriceInGwei() (gas: 44894) - [PASS] test_GetCollateralPrice() (gas: 46125) - [PASS] test_GetUtilizationRateInEther() (gas: 90497) - [PASS] test_GetSupplyRatePerSecondInEther() (gas: 69085) - [PASS] test_GetBorrowRatePerSecondInEther() (gas: 56017) - [PASS] test_CalculateUtilizationRateInEther() (gas: 3097) - [PASS] test_GetExchangeRateInEther() (gas: 170657) - [PASS] test_AccrueInterest() (gas: 111911) - [PASS] test_GetCollateralAndFeeAmount() (gas: 1906) - [PASS] test_GetDebtPerETF() (gas: 110703) - [PASS] test_SwapExactOutputSingle() (gas: 191249) - [PASS] test_GetCollateralPerETF() (gas: 2915) - [PASS] test_GetInterestAmount() (gas: 2489) - - Running 2 tests for src/test/UniswapV3.t.sol:UniswapV3Test - [PASS] test_BorrowAndSwap() (gas: 229397) - [PASS] test_SwapUSDCToWETH() (gas: 136528) + Running 4 tests for src/test/Hevm.t.sol:HevmTest + [PASS] test_setUNIBalance() (gas: 18463) + [PASS] test_setUSDTBalance() (gas: 15882) + [PASS] test_setWETHBalance() (gas: 15744) + [PASS] test_setUSDCBalance() (gas: 15722) + + Running 8 tests for src/test/RiseTokenVaultAccessControl.t.sol:RiseTokenVaultAccessControlTest + [PASS] test_OwnerCanCreateNewETHRISEToken() (gas: 5324876) + [PASS] test_OwnerCanCreateNewERC20RISEToken() (gas: 5330534) + [PASS] testFail_NonOwnerCannotCreateNewETHRISEToken() (gas: 5061524) + [PASS] testFail_NonRiseTokenVaultCannotBurnRiseToken() (gas: 5056513) + [PASS] testFail_NonRiseTokenVaultCannotMintRISEToken() (gas: 5056413) + [PASS] test_OwnerCanSetMaxTotalCollateral() (gas: 5344065) + [PASS] testFail_NonOwnerCannotSetMaxTotalCollateral() (gas: 5321711) + [PASS] testFail_NonOwnerCannotCreateNewERC20RISEToken() (gas: 5066602) + + Running 25 tests for src/test/RiseTokenVaultExternal.t.sol:RiseTokenVaultExternalTest + [PASS] test_SubsequentMintETHRISE() (gas: 8812064) + [PASS] testFail_ETHRISELeverageUpFailedWhenHighSlippage() (gas: 6715965) + [PASS] testFail_UserCannotMintETHRISEWhenHighSlippage() (gas: 6715920) + [PASS] test_MintAndRedeemWithPriceGoDown() (gas: 6942309) + [PASS] test_ERC20RISELeverageDown() (gas: 6981796) + [PASS] test_ERC20RISELeverageUp() (gas: 6998199) + [PASS] testFail_UserCannotMintERC20RISEWithETH() (gas: 6563375) + [PASS] testFail_MaxTotalCollateralCap() (gas: 7045629) + [PASS] test_ETHRISELeverageDown() (gas: 6947282) + [PASS] test_SubsequentMintERC20RISE() (gas: 8925655) + [PASS] testFail_ERC20RISELeverageUpFailedWhenHighSlippage() (gas: 6740309) + [PASS] testFail_ETHRISERebalanceInRangeShouldBeReverted() (gas: 6868527) + [PASS] test_FeeCollections() (gas: 6940710) + [PASS] test_MintAndRedeemWithNoPriceChange() (gas: 6941692) + [PASS] testFail_ERC20RISELeverageDownFailedWhenHighSlippage() (gas: 6721831) + [PASS] testFail_UserCannotMintERC20RISEWhenHighSlippage() (gas: 6740265) + [PASS] test_MintRISETokenBelowNAVPrice() (gas: 13702739) + [PASS] test_MintRISETokenEqualNAVPrice() (gas: 13702796) + [PASS] testFail_UserCannotMintETHRISEWithZeroETH() (gas: 6551701) + [PASS] testFail_UserCannotMintERC20RISEWhenNotEnoughSupply() (gas: 6671869) + [PASS] test_ETHRISELeverageUp() (gas: 6964953) + [PASS] testFail_ETHRISELeverageDownFailedWhenHighSlippage() (gas: 6697506) + [PASS] testFail_UserCannotMintETHRISEWhenNotEnoughSupply() (gas: 6648717) + [PASS] test_MintAndRedeemWithPriceGoUp() (gas: 6942362) + [PASS] testFail_ERC20RISERebalanceInRangeShouldBeReverted() (gas: 6868526) + + Running 6 tests for src/test/RiseTokenVaultInternal.t.sol:RiseTokenVaultInternalTest + [PASS] testFail_CalculateCollateralPerRiseTokenFeeTooLarge() (gas: 756) + [PASS] test_CalculateNAV() (gas: 1237) + [PASS] test_CalculateDebtPerRiseToken() (gas: 101364) + [PASS] test_GetMintAmount() (gas: 2802) + [PASS] test_CalculateCollateralPerRiseToken() (gas: 1867) + [PASS] test_GetCollateralAndFeeAmount() (gas: 1086) + + Running 6 tests for src/test/RisedleVaultAccessControl.t.sol:RisedleVaultAccessControlTest + [PASS] testFail_NonOwnerCannotSetVaultParameters() (gas: 1818538) + [PASS] testFail_NonOwnerCannotSetMaxTotalDeposit() (gas: 1818485) + [PASS] testFail_NonOwnerCannotSetFeeRecipient() (gas: 1819931) + [PASS] test_OwnerCanSetVaultParameters() (gas: 1818980) + [PASS] test_OwnerCanSetMaxTotalDeposit() (gas: 1834896) + [PASS] test_OwnerCanSetFeeRecipient() (gas: 1818135) + + Running 4 tests for src/test/RisedleVaultExternal.t.sol:RisedleVaultExternalTest + [PASS] test_AnyoneCanRemoveSupplyFromTheVault() (gas: 2449176) + [PASS] test_VaultTokenPublicProperties() (gas: 1827553) + [PASS] test_AnyoneCanAddSupplyToTheVault() (gas: 2376578) + [PASS] testFail_CannotAddSupplyWhenCapIsReached() (gas: 2413334) + + Running 12 tests for src/test/RisedleVaultInternal.t.sol:RisedleVaultInternalTest + [PASS] test_CalculateBorrowRatePerSecondInEther() (gas: 7235) + [PASS] test_GetDebtProportionRateInEther() (gas: 45420) + [PASS] test_GetTotalAvailableCash() (gas: 45783) + [PASS] test_RisedleVaultProperties() (gas: 25368) + [PASS] test_SetVaultStates() (gas: 65353) + [PASS] test_GetUtilizationRateInEther() (gas: 75626) + [PASS] test_GetSupplyRatePerSecondInEther() (gas: 60168) + [PASS] test_GetBorrowRatePerSecondInEther() (gas: 45506) + [PASS] test_CalculateUtilizationRateInEther() (gas: 1954) + [PASS] test_GetExchangeRateInEther() (gas: 157472) + [PASS] test_AccrueInterest() (gas: 90615) + [PASS] test_GetInterestAmount() (gas: 1740) + + Running 2 tests for src/test/WETH9.t.sol:WETH9Test + [PASS] test_MintAddDeploy() (gas: 571724) + [PASS] test_DepositAndWithdraw() (gas: 750644) + + Running 2 tests for src/test/oracles/ChainlinkOracle.t.sol:ChainlinkOracleTest + [PASS] test_ChainlinkBTCUSDT() (gas: 326301) + [PASS] test_ChainlinkETHUSDC() (gas: 326323) + + Running 1 tests for src/test/swaps/UnsiwapV3Swap.t.sol:UniswapV3SwapTest + [PASS] test_SwapUSDCToWETH() (gas: 1001649) + + Running 4 tests for src/test/tokens/RisedleERC20AccessControl.t.sol:RisedleERC20AccessControl + [PASS] testFail_NonOwnerCannotBurnToken() (gas: 855289) + [PASS] test_OwnerCanMintToken() (gas: 851163) + [PASS] test_OwnerCanBurnToken() (gas: 854697) + [PASS] testFail_NonOwnerCannotMintToken() (gas: 803838) ## Gas Report