-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove lazy mint functionality from custodian
- Loading branch information
1 parent
0fae7dd
commit e89da9a
Showing
6 changed files
with
116 additions
and
280 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//pragma solidity ^0.8.17; | ||
// | ||
//import "starport-test/StarportTest.sol"; | ||
//import {StarportLib, Actions} from "starport-core/lib/StarportLib.sol"; | ||
//import {BNPLHelper, IFlashLoanRecipient} from "starport-test/mocks/BNPLHelper.sol"; | ||
//import {Originator} from "starport-core/originators/Originator.sol"; | ||
//import {SignatureCheckerLib} from "solady/src/utils/SignatureCheckerLib.sol"; | ||
// | ||
//contract TestNewLoan is StarportTest { | ||
// using {StarportLib.getId} for Starport.Loan; | ||
// | ||
// function testLazyMintCustodian() public { | ||
// Starport.Terms memory terms = Starport.Terms({ | ||
// status: address(status), | ||
// settlement: address(settlement), | ||
// pricing: address(pricing), | ||
// pricingData: defaultPricingData, | ||
// settlementData: defaultSettlementData, | ||
// statusData: defaultStatusData | ||
// }); | ||
// | ||
// Starport.Loan memory loan = | ||
// _createLoan721Collateral20Debt({lender: lender.addr, borrowAmount: 100, terms: terms}); | ||
// | ||
// uint256 loanId = loan.getId(); | ||
// | ||
// //Borrower mints and sells custodian token to sucker | ||
// Custodian(loan.custodian).mint(loan); | ||
// address sucker = vm.createWallet("sucker").addr; | ||
// vm.prank(loan.borrower); | ||
// Custodian(loan.custodian).transferFrom(loan.borrower, sucker, loanId); | ||
// | ||
// Starport.Loan memory refiLoan = loanCopy(loan); | ||
// bytes memory newPricingData = abi.encode( | ||
// SimpleInterestPricing.Details({carryRate: (uint256(1e16) * 10), rate: uint256(1e16) * 100, decimals: 18}) | ||
// ); | ||
// refiLoan.terms.pricingData = newPricingData; | ||
// refiLoan.debt = SP.applyRefinanceConsiderationToLoan(loan.debt, new SpentItem[](0)); | ||
// LenderEnforcer.Details memory details = LenderEnforcer.Details({loan: refiLoan}); | ||
// | ||
// details.loan.issuer = refinancer.addr; | ||
// details.loan.originator = address(0); | ||
// details.loan.start = 0; | ||
// CaveatEnforcer.SignedCaveats memory refiCaveat = getLenderSignedCaveat({ | ||
// details: details, | ||
// signer: refinancer, | ||
// salt: bytes32(0), | ||
// enforcer: address(lenderEnforcer) | ||
// }); | ||
// _setApprovalsForSpentItems(refinancer.addr, loan.debt); | ||
// | ||
// skip(1); | ||
// Starport.Loan memory newLoan = refinanceLoan(loan, newPricingData, refinancer.addr, refiCaveat, refinancer.addr); | ||
// | ||
// bool oldLoanOpen = SP.open(loanId); | ||
// bool newLoanOpen = SP.open(newLoan.getId()); | ||
// bool borrowerOfOldLoanIsSucker = Custodian(loan.custodian).getBorrower(loan) == sucker; | ||
// bool suckerHasCT = Custodian(loan.custodian).ownerOf(loanId) == sucker; | ||
// | ||
// if (!oldLoanOpen && newLoanOpen && suckerHasCT && borrowerOfOldLoanIsSucker) { | ||
// revert("Sucker has been scammed"); | ||
// } | ||
// } | ||
//} |
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.