Skip to content

Commit

Permalink
Feat/final updates (#94)
Browse files Browse the repository at this point in the history
* remove shadowed newDebt declaration

* fee behavior updates

* use mulDivUp for fee rake
  • Loading branch information
0xgregthedev authored Jan 24, 2024
1 parent be0b40b commit a653644
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 175 deletions.
219 changes: 110 additions & 109 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
IntegrationTestCaveats:testInvalidCaveatLength() (gas: 130019)
IntegrationTestCaveats:testInvalidCaveats() (gas: 162299)
IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 332433)
IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 283300)
IntegrationTestCaveats:testOriginateWCaveatsAsBorrower() (gas: 308844)
IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 159528)
IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 168043)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 317621)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 142201)
IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 283614)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1053618)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 407763)
IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 347604)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 456421)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 377103)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 402755)
ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 437989)
ModuleTesting:testFixedTermDutchAuctionSettlementAuctionNotStarted() (gas: 441365)
ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 440814)
ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 437023)
ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 437910)
ModuleTesting:testModuleValidation() (gas: 1274210)
IntegrationTestCaveats:testInvalidCaveatLength() (gas: 130086)
IntegrationTestCaveats:testInvalidCaveats() (gas: 162366)
IntegrationTestCaveats:testOriginateUnapprovedFulfiller() (gas: 332567)
IntegrationTestCaveats:testOriginateWBorrowerApproval() (gas: 283456)
IntegrationTestCaveats:testOriginateWCaveatsAsBorrower() (gas: 308978)
IntegrationTestCaveats:testOriginateWCaveatsExpired() (gas: 159595)
IntegrationTestCaveats:testOriginateWCaveatsIncrementedNonce() (gas: 168066)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSalt() (gas: 317755)
IntegrationTestCaveats:testOriginateWCaveatsInvalidSaltManual() (gas: 142246)
IntegrationTestCaveats:testOriginateWLenderApproval() (gas: 283770)
IntegrationTestCaveats:testRefinanceAsLender() (gas: 1053752)
IntegrationTestCaveats:testRefinanceCaveatFailure() (gas: 407964)
IntegrationTestCaveats:testRefinanceLoanStartAtBlockTimestampInvalidLoan() (gas: 347805)
IntegrationTestCaveats:testRefinanceUnapprovedFulfiller() (gas: 456578)
IntegrationTestCaveats:testRefinanceWCaveatsInvalidSalt() (gas: 377260)
IntegrationTestCaveats:testRefinanceWLenderApproval() (gas: 402978)
ModuleTesting:testFixedTermDutchAuctionSettlement() (gas: 438123)
ModuleTesting:testFixedTermDutchAuctionSettlementAuctionNotStarted() (gas: 441499)
ModuleTesting:testFixedTermDutchAuctionSettlementGetSettlementAuctionExpired() (gas: 440948)
ModuleTesting:testFixedTermDutchAuctionSettlementNotValid() (gas: 437157)
ModuleTesting:testFixedTermDutchAuctionSettlementValid() (gas: 438044)
ModuleTesting:testModuleValidation() (gas: 1274344)
PausableNonReentrantImpl:test() (gas: 2464)
PausableNonReentrantImpl:testReentrancy() (gas: 2757)
TestBorrowerEnforcer:testBERevertAdditionalTransfersFromBorrower() (gas: 76462)
TestBorrowerEnforcer:testBERevertInvalidLoanTerms() (gas: 81160)
TestBorrowerEnforcer:testBEValidLoanTerms() (gas: 72257)
TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72343)
TestCustodian:testCannotLazyMintTwice() (gas: 82167)
TestCustodian:testCannotLazyMintTwice() (gas: 82123)
TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 72495)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 78005)
TestCustodian:testCustodianCannotBeAuthorized() (gas: 142164)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 77961)
TestCustodian:testCustodianCannotBeAuthorized() (gas: 142120)
TestCustodian:testCustodySelector() (gas: 2731962)
TestCustodian:testDefaultCustodySelectorRevert() (gas: 72478)
TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173046)
TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163209)
TestCustodian:testGenerateOrderRepay() (gas: 177204)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193690)
TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 875911)
TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 804477)
TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 173134)
TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163297)
TestCustodian:testGenerateOrderRepay() (gas: 177292)
TestCustodian:testGenerateOrderRepayAsRepayApprovedBorrower() (gas: 193778)
TestCustodian:testGenerateOrderRepayERC1155AndERC20() (gas: 876355)
TestCustodian:testGenerateOrderRepayERC1155AndERC20HandlerAuthorized() (gas: 804921)
TestCustodian:testGenerateOrderRepayInvalidHookAddress() (gas: 97670)
TestCustodian:testGenerateOrderRepayInvalidHookReturnType() (gas: 92031)
TestCustodian:testGenerateOrderRepayNotBorrower() (gas: 106909)
TestCustodian:testGenerateOrderSettlement() (gas: 154920)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160317)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163387)
TestCustodian:testGenerateOrderSettlement() (gas: 155008)
TestCustodian:testGenerateOrderSettlementHandlerAuthorized() (gas: 160405)
TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163475)
TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101874)
TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461569)
TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461703)
TestCustodian:testGetBorrower() (gas: 78621)
TestCustodian:testInvalidAction() (gas: 173552)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130196)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130134)
TestCustodian:testInvalidAction() (gas: 173464)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130152)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130090)
TestCustodian:testInvalidEncodedData() (gas: 26160)
TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366668)
TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366758)
TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 64523)
TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 66842)
TestCustodian:testName() (gas: 7099)
TestCustodian:testNonPayableFunctions() (gas: 215289)
TestCustodian:testOnlySeaport() (gas: 17918)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105732)
TestCustodian:testPreviewOrderRepay() (gas: 230187)
TestCustodian:testPreviewOrderSettlement() (gas: 191915)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108293)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 117004)
TestCustodian:testRatifyOrder() (gas: 184025)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105688)
TestCustodian:testPreviewOrderRepay() (gas: 230231)
TestCustodian:testPreviewOrderSettlement() (gas: 191959)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108249)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116960)
TestCustodian:testRatifyOrder() (gas: 184113)
TestCustodian:testSeaportMetadata() (gas: 8644)
TestCustodian:testSupportsInterface() (gas: 9428)
TestCustodian:testSymbol() (gas: 7216)
Expand All @@ -73,82 +73,83 @@ TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81096)
TestLenderEnforcer:testLEValidLoanTerms() (gas: 72169)
TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72234)
TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73525)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 592756)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 599969)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 590120)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 580004)
TestNewLoan:testBuyNowPayLater() (gas: 3018395)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874061)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885086)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429501)
TestNewLoan:testNewLoanRefinance() (gas: 589921)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 324498)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 383316)
TestNewLoan:testSettleLoan() (gas: 642059)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 592934)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 600147)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 590365)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 580182)
TestNewLoan:testBuyNowPayLater() (gas: 3018529)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874195)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885220)
TestNewLoan:testNewLoanERC721CollateralDefaultTerms2() (gas: 429635)
TestNewLoan:testNewLoanRefinance() (gas: 590070)
TestNewLoan:testNewLoanViaOriginatorBorrowerApprovalAndLenderApproval() (gas: 324676)
TestNewLoan:testNewLoanViaOriginatorLenderApproval() (gas: 383472)
TestNewLoan:testSettleLoan() (gas: 642281)
TestPausableNonReentrant:testNotOwner() (gas: 21276)
TestPausableNonReentrant:testPauseAndUnpause() (gas: 22643)
TestPausableNonReentrant:testReentrancy() (gas: 15404)
TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12604)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 667011)
TestRepayLoan:testRepayLoanBase() (gas: 599797)
TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438643)
TestRepayLoan:testRepayLoanInSettlement() (gas: 585721)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603920)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 858461)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 667145)
TestRepayLoan:testRepayLoanBase() (gas: 599975)
TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438777)
TestRepayLoan:testRepayLoanInSettlement() (gas: 585811)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 604010)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 858771)
TestSimpleInterestPricing:test_calculateInterest() (gas: 881296)
TestSimpleInterestPricing:test_getPaymentConsideration() (gas: 928510)
TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 919314)
TestStarport:testAcquireTokensFail() (gas: 60386)
TestStarport:testAcquireTokensSuccess() (gas: 162955)
TestStarport:testActive() (gas: 69291)
TestStarport:testAdditionalTransfers() (gas: 300688)
TestStarport:testAdditionalTransfersOriginate() (gas: 275384)
TestStarport:testAdditionalTransfersRefinance() (gas: 218214)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129820)
TestStarport:testCannotIssueSameLoanTwice() (gas: 363991)
TestStarport:testCannotOriginateWhilePaused() (gas: 73523)
TestStarport:testCannotSettleInvalidLoan() (gas: 74881)
TestStarport:testCannotSettleUnlessValidCustodian() (gas: 70919)
TestStarport:testCaveatEnforcerRevert() (gas: 102534)
TestStarport:testDefaultFeeRake1() (gas: 387913)
TestStarport:testDefaultFeeRake2() (gas: 450256)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 397742)
TestStarport:testEIP712Signing() (gas: 83064)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237672)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1692715)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376786)
TestStarport:testIncrementCaveatNonce() (gas: 35183)
TestStarport:testInitializedFlagSetProperly() (gas: 67416)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230359)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170774)
TestStarport:testInvalidAmountCollateral() (gas: 165901)
TestStarport:testInvalidAmountCollateral721() (gas: 165901)
TestStarport:testInvalidItemType() (gas: 151849)
TestStarport:testInvalidTransferLengthCollateral() (gas: 154118)
TestStarport:testInvalidTransferLengthDebt() (gas: 175917)
TestStarport:testInvalidateCaveatSalt() (gas: 33450)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264200)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290347)
TestStarport:testAcquireTokensFail() (gas: 60473)
TestStarport:testAcquireTokensSuccess() (gas: 163042)
TestStarport:testActive() (gas: 69358)
TestStarport:testAdditionalTransfers() (gas: 300755)
TestStarport:testAdditionalTransfersOriginate() (gas: 275540)
TestStarport:testAdditionalTransfersRefinance() (gas: 218206)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129484)
TestStarport:testCannotIssueSameLoanTwice() (gas: 364125)
TestStarport:testCannotOriginateWhilePaused() (gas: 73479)
TestStarport:testCannotSettleInvalidLoan() (gas: 74969)
TestStarport:testCannotSettleUnlessValidCustodian() (gas: 71007)
TestStarport:testCaveatEnforcerRevert() (gas: 102601)
TestStarport:testDefaultFeeRake1() (gas: 383458)
TestStarport:testDefaultFeeRake2() (gas: 445821)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394564)
TestStarport:testEIP712Signing() (gas: 83109)
TestStarport:testExcessiveFeeRake() (gas: 19992)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237783)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1692826)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376831)
TestStarport:testIncrementCaveatNonce() (gas: 35117)
TestStarport:testInitializedFlagSetProperly() (gas: 67372)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230426)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170766)
TestStarport:testInvalidAmountCollateral() (gas: 165968)
TestStarport:testInvalidAmountCollateral721() (gas: 165968)
TestStarport:testInvalidItemType() (gas: 151916)
TestStarport:testInvalidTransferLengthCollateral() (gas: 154185)
TestStarport:testInvalidTransferLengthDebt() (gas: 175984)
TestStarport:testInvalidateCaveatSalt() (gas: 33428)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264267)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290392)
TestStarport:testNonPayableFunctions() (gas: 114479)
TestStarport:testOverrideFeeRake() (gas: 384236)
TestStarport:testPause() (gas: 18193)
TestStarport:testOverrideFeeRake() (gas: 379873)
TestStarport:testPause() (gas: 18127)
TestStarport:testRefinancePostRepaymentFails() (gas: 127864)
TestStarport:testStargateGetOwner() (gas: 8786)
TestStarport:testTokenNoCodeCollateral() (gas: 150640)
TestStarport:testTokenNoCodeDebt() (gas: 180913)
TestStarport:testUnpause() (gas: 17275)
TestStarport:testStargateGetOwner() (gas: 8851)
TestStarport:testTokenNoCodeCollateral() (gas: 150707)
TestStarport:testTokenNoCodeDebt() (gas: 180980)
TestStarport:testUnpause() (gas: 17187)
TestStrategistOriginator:testEncodeWithAccountCounter() (gas: 12330)
TestStrategistOriginator:testGetStrategistData() (gas: 1790990)
TestStrategistOriginator:testIncrementCounterAsStrategist() (gas: 38488)
TestStrategistOriginator:testIncrementCounterNotAuthorized() (gas: 13423)
TestStrategistOriginator:testInvalidCollateral() (gas: 210224)
TestStrategistOriginator:testInvalidDeadline() (gas: 216045)
TestStrategistOriginator:testInvalidDebt() (gas: 211932)
TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 212306)
TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 212636)
TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 212571)
TestStrategistOriginator:testInvalidDebtLength() (gas: 211226)
TestStrategistOriginator:testInvalidOffer() (gas: 427005)
TestStrategistOriginator:testInvalidSigner() (gas: 214364)
TestStrategistOriginator:testInvalidCollateral() (gas: 210380)
TestStrategistOriginator:testInvalidDeadline() (gas: 216201)
TestStrategistOriginator:testInvalidDebt() (gas: 212088)
TestStrategistOriginator:testInvalidDebtAmountAskingMoreThanOffered() (gas: 212462)
TestStrategistOriginator:testInvalidDebtAmountOfferingZero() (gas: 212792)
TestStrategistOriginator:testInvalidDebtAmountRequestingZero() (gas: 212727)
TestStrategistOriginator:testInvalidDebtLength() (gas: 211382)
TestStrategistOriginator:testInvalidOffer() (gas: 427161)
TestStrategistOriginator:testInvalidSigner() (gas: 214520)
TestStrategistOriginator:testSetStrategist() (gas: 17884)
TestStrategistOriginator:testWithdraw() (gas: 167966)
Loading

0 comments on commit a653644

Please sign in to comment.