-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ERC721 from Starport, caveat naming/deadline refactor, lots of…
… cleanup (#63) * natspec and some import cleanup, removing unsued modules * remove repayApproval mapping as its not used, update previewOrder to fetch ERC721 approval update fuzz testing to be more dynamic * coverage boost, dead code cleanup * fixed up the non default custody call success test * remove commented out code * remove ERC721 from Starport, cleanup state * update mermaid, cleanup useless tests/helpers, update salts to not invalidate if they are bytes32(0), fix tests, add snapshot * rename CaveatWithApproval => SignedCaveats, move deadline out of Caveat into signed caveats, add deadline into the intent origination typehash, update tests, move to packed signatures from explicit vrs values * add test for caveat deadline, snapshot updated * cleanup the counter example, add an assume for testing invalid salts that the salt is not bytes32(0), foundry toml update to not include storage in the fuzz runs * update the reference starport lib validate salt to match the optimized * chore: update snapshot * update the signed caveats to take an invalidate bit to identify if the salt is re usable * chore snapshot * remove on open hook * chore: update snapshot
- Loading branch information
1 parent
012be7a
commit 91e848c
Showing
42 changed files
with
1,073 additions
and
1,186 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,67 @@ | ||
sequenceDiagram | ||
title Starport Origination Sequence Diagram | ||
participant F as Fulfiller | ||
participant L as Lender | ||
participant B as Borrower | ||
|
||
|
||
F->>LoanManager: originate | ||
Box green Orignation | ||
participant Fulfiller | ||
participant Starport | ||
participant CaveatEnforcer | ||
end | ||
|
||
Box blue Assets | ||
participant Lender | ||
participant Borrower | ||
participant Custodian | ||
participant FeeRecipient | ||
participant AdditionalTransferRecipient | ||
end | ||
|
||
Fulfiller->>Starport: originate | ||
|
||
opt F is not Borrower | ||
opt Fulfiller is not Borrower | ||
loop 1->n | ||
LoanManager->>CaveatEnforcer: validate | ||
Starport->>CaveatEnforcer: validate | ||
end | ||
end | ||
opt F is not Lender | ||
opt Fulfiller is not Lender | ||
loop 1->n | ||
LoanManager->>CaveatEnforcer: validate | ||
Starport->>CaveatEnforcer: validate | ||
end | ||
end | ||
loop Transfer 1->n collateral items | ||
B->>Custodian: Move Collateral to Custodian | ||
Borrower->>Custodian: transfer collateral | ||
end | ||
opt Custodian is not default | ||
LoanManager->>Custodian: custody (optional) | ||
Starport->>Custodian: custody (optional) | ||
end | ||
|
||
alt Fees Disabled | ||
loop Transfer 1->n debt items | ||
L->>B: Move debt to borrower | ||
Lender->>Borrower: transfer debt | ||
end | ||
else Fees Enabled | ||
LoanManager->>LoanManager: compute feeRake | ||
opt FeeItems length > 0 | ||
loop Transfer 1->n fee items | ||
L->>FeeRecipient: Move Fee to FeeRecipient | ||
Lender->>FeeRecipient: Move Fee to FeeRecipient | ||
end | ||
end | ||
loop Transfer 1->n debt items | ||
L->>B: Move debt to Borrower | ||
Lender->>Borrower: Move debt to Borrower - Fee | ||
end | ||
end | ||
|
||
opt AdditionalTransferItems length > 0 | ||
loop 1->n | ||
alt From is Borrower | ||
B->>AdditionalTransferRecipient: AdditionalTransferItem from Borrower => AdditionalTransferRecipient | ||
Borrower->>AdditionalTransferRecipient: AdditionalTransferItem from Borrower => AdditionalTransferRecipient | ||
else From is Lender | ||
L->>AdditionalTransferRecipient: AdditionalTransferItem from Lender => AdditionalTransferRecipient | ||
Lender->>AdditionalTransferRecipient: AdditionalTransferItem from Lender => AdditionalTransferRecipient | ||
else From is F | ||
F->>AdditionalTransferRecipient: AdditionalTransferItem from Fulfiller => AdditionalTransferRecipient | ||
Fulfiller->>AdditionalTransferRecipient: AdditionalTransferItem from Fulfiller => AdditionalTransferRecipient | ||
end | ||
end | ||
end | ||
|
||
opt Lender is contract | ||
LoanManager->>L: onERC721Received | ||
Starport->>Lender: onLoanOpened | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.