Skip to content

Commit

Permalink
fix: final cleanup for release
Browse files Browse the repository at this point in the history
  • Loading branch information
dangerousfood committed Jan 25, 2024
1 parent 71eb445 commit 18be8c8
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 339 deletions.
52 changes: 26 additions & 26 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ TestBorrowerEnforcer:testBEValidLoanTermsAnyIssuer() (gas: 72343)
TestCustodian:testCannotLazyMintTwice() (gas: 82105)
TestCustodian:testCannotMintInvalidLoanInvalidCustodian() (gas: 72477)
TestCustodian:testCannotMintInvalidLoanValidCustodian() (gas: 77943)
TestCustodian:testCustodianCannotBeAuthorized() (gas: 141967)
TestCustodian:testCustodySelector() (gas: 2717132)
TestCustodian:testCustodianCannotBeAuthorized() (gas: 142026)
TestCustodian:testCustodySelector() (gas: 2732377)
TestCustodian:testDefaultCustodySelectorRevert() (gas: 72478)
TestCustodian:testGenerateOrderInvalidPostRepayment() (gas: 172899)
TestCustodian:testGenerateOrderInvalidPostSettlement() (gas: 163178)
Expand All @@ -47,22 +47,22 @@ TestCustodian:testGenerateOrderSettlementNoActiveLoan() (gas: 163374)
TestCustodian:testGenerateOrderSettlementUnauthorized() (gas: 101809)
TestCustodian:testGenerateOrdersWithLoanStartAtBlockTimestampInvalidLoan() (gas: 461511)
TestCustodian:testGetBorrower() (gas: 78603)
TestCustodian:testInvalidAction() (gas: 179690)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130036)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 129973)
TestCustodian:testInvalidEncodedData() (gas: 26160)
TestCustodian:testInvalidAction() (gas: 179808)
TestCustodian:testInvalidActionRepayInActiveLoan() (gas: 130095)
TestCustodian:testInvalidActionSettleActiveLoan() (gas: 130032)
TestCustodian:testInvalidEncodedData() (gas: 26219)
TestCustodian:testMintWithApprovalSetAsBorrower() (gas: 366740)
TestCustodian:testMintWithApprovalSetAsBorrowerInvalidLoan() (gas: 64505)
TestCustodian:testMintWithApprovalSetNotAuthorized() (gas: 66842)
TestCustodian:testName() (gas: 7077)
TestCustodian:testNonPayableFunctions() (gas: 215289)
TestCustodian:testOnlySeaport() (gas: 17918)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105670)
TestCustodian:testPreviewOrderRepay() (gas: 229793)
TestCustodian:testPreviewOrderSettlement() (gas: 191754)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 108161)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116854)
TestCustodian:testRatifyOrder() (gas: 183880)
TestCustodian:testOnlySeaport() (gas: 17915)
TestCustodian:testPreviewOrderNoActiveLoan() (gas: 105729)
TestCustodian:testPreviewOrderRepay() (gas: 231938)
TestCustodian:testPreviewOrderSettlement() (gas: 191813)
TestCustodian:testPreviewOrderSettlementInvalidFufliller() (gas: 110326)
TestCustodian:testPreviewOrderSettlementInvalidRepayer() (gas: 116902)
TestCustodian:testRatifyOrder() (gas: 183877)
TestCustodian:testSeaportMetadata() (gas: 8588)
TestCustodian:testSupportsInterface() (gas: 9428)
TestCustodian:testSymbol() (gas: 7194)
Expand All @@ -73,10 +73,10 @@ TestLenderEnforcer:testLERevertInvalidLoanTerms() (gas: 81096)
TestLenderEnforcer:testLEValidLoanTerms() (gas: 72169)
TestLenderEnforcer:testLEValidLoanTermsAnyBorrower() (gas: 72234)
TestLenderEnforcer:testLEValidLoanTermsWithAdditionalTransfers() (gas: 73525)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 592496)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 599709)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 589927)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 579744)
TestLoanCombinations:testLoan20For721SimpleInterestDutchFixedRepay() (gas: 592542)
TestLoanCombinations:testLoan20for20SimpleInterestDutchFixedRepay() (gas: 599755)
TestLoanCombinations:testLoan721for20SimpleInterestDutchFixedRepay() (gas: 589973)
TestLoanCombinations:testLoanAstariaSettlementRepay() (gas: 579790)
TestNewLoan:testBuyNowPayLater() (gas: 3018513)
TestNewLoan:testNewLoanAs1271ProxyAccountSender() (gas: 874179)
TestNewLoan:testNewLoanAs1271ProxyAccountThirdPartyFiller() (gas: 885204)
Expand All @@ -89,12 +89,12 @@ TestPausableNonReentrant:testNotOwner() (gas: 21276)
TestPausableNonReentrant:testPauseAndUnpause() (gas: 22643)
TestPausableNonReentrant:testReentrancy() (gas: 15404)
TestPausableNonReentrant:testUnpauseWhenNotPaused() (gas: 12604)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 666673)
TestRepayLoan:testRepayLoanBase() (gas: 599539)
TestRepayLoan:testRepayLoanApprovedRepayer() (gas: 666719)
TestRepayLoan:testRepayLoanBase() (gas: 599585)
TestRepayLoan:testRepayLoanGenerateOrderNotSeaport() (gas: 438777)
TestRepayLoan:testRepayLoanInSettlement() (gas: 585633)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603643)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 857698)
TestRepayLoan:testRepayLoanInSettlement() (gas: 585692)
TestRepayLoan:testRepayLoanInvalidRepayer() (gas: 603689)
TestRepayLoan:testRepayLoanThatDoesNotExist() (gas: 857790)
TestSimpleInterestPricing:test_calculateInterest() (gas: 869870)
TestSimpleInterestPricing:test_getPaymentConsideration() (gas: 916886)
TestSimpleInterestPricing:test_getRefinanceConsideration() (gas: 907796)
Expand All @@ -103,7 +103,7 @@ TestStarport:testAcquireTokensSuccess() (gas: 162844)
TestStarport:testActive() (gas: 69358)
TestStarport:testAdditionalTransfers() (gas: 300755)
TestStarport:testAdditionalTransfersOriginate() (gas: 275540)
TestStarport:testAdditionalTransfersRefinance() (gas: 218107)
TestStarport:testAdditionalTransfersRefinance() (gas: 218120)
TestStarport:testApplyRefinanceConsiderationToLoanMalformed() (gas: 129484)
TestStarport:testCannotIssueSameLoanTwice() (gas: 364125)
TestStarport:testCannotOriginateWhilePaused() (gas: 73479)
Expand All @@ -115,13 +115,13 @@ TestStarport:testDefaultFeeRake2() (gas: 445821)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394368)
TestStarport:testEIP712Signing() (gas: 83109)
TestStarport:testExcessiveFeeRake() (gas: 19992)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237783)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1695822)
TestStarport:testExoticDebtWithCustomPricingAndRepayment() (gas: 1237829)
TestStarport:testExoticDebtWithCustomPricingAndSettlement() (gas: 1695881)
TestStarport:testExoticDebtWithNoCaveatsNotAsBorrower() (gas: 376639)
TestStarport:testIncrementCaveatNonce() (gas: 35117)
TestStarport:testInitializedFlagSetProperly() (gas: 67372)
TestStarport:testInvalidAdditionalTransfersOriginate() (gas: 230426)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170667)
TestStarport:testInvalidAdditionalTransfersRefinance() (gas: 170620)
TestStarport:testInvalidAmountCollateral() (gas: 165968)
TestStarport:testInvalidAmountCollateral721() (gas: 165968)
TestStarport:testInvalidItemType() (gas: 151916)
Expand Down
66 changes: 0 additions & 66 deletions docs/mermaid/origination.mmd

This file was deleted.

1 change: 0 additions & 1 deletion docs/mermaid/origination.svg

This file was deleted.

55 changes: 0 additions & 55 deletions docs/mermaid/refinance.mmd

This file was deleted.

1 change: 0 additions & 1 deletion docs/mermaid/refinance.svg

This file was deleted.

36 changes: 0 additions & 36 deletions docs/mermaid/settlement.mmd

This file was deleted.

1 change: 0 additions & 1 deletion docs/mermaid/settlement.svg

This file was deleted.

87 changes: 0 additions & 87 deletions docs/trust_model.md

This file was deleted.

16 changes: 1 addition & 15 deletions ffi-scripts/test-origination-hash.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Address, hashTypedData, pad, Hex, hexToString, keccak256 } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { Address, hashTypedData, pad, Hex } from "viem";
import { decodeAbiParameters, parseAbiParameters } from "viem";


const types = {
Origination: [
{
Expand Down Expand Up @@ -42,33 +40,21 @@ const types = {
]
};


const domain = (verifyingContract: Address, chainId: number) => ({
name: "Starport",
version: "0",
chainId: chainId,
verifyingContract
});

type caveatType = [`0x${string}`, `0x${string}`];

const typeDataMessage = (account: Address, accountNonce: string, singleUse: boolean, salt: Hex, deadline: string, caveats: any) => ({
account: account, accountNonce: parseInt(accountNonce), singleUse: singleUse, salt: salt, deadline: deadline, caveats: caveats[0]
});

//verifying contract
//account
//singleUse
//salt
//deadline
//caveats

const args = process.argv.slice(2);

const main = async () => {
const [signerKeyRaw, verifyingContract, account, accountNonce, singleUse, salt, deadline, caveatsRaw, chainId] = args;
const signerKey: any = `${signerKeyRaw}`;
// const signer = privateKeyToAccount(signerKey);//anvil account 1
const caveats: any = decodeAbiParameters(parseAbiParameters("(address enforcer,bytes data)[]"), caveatsRaw as `0x${string}`);
const hashData: any = {
domain: domain(verifyingContract as Address, parseInt(chainId as Hex)),
Expand Down
Loading

0 comments on commit 18be8c8

Please sign in to comment.