-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross-Currency Rollover #133
Merged
Merged
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f01464c
feat(cross-currency-rollover): cross currency rollover contract and s…
Mouzayan af38b42
feat(cross-currency-rollover): update package json
Mouzayan f27f621
feat(cross-currency-rollover): updated yearn lock files
Mouzayan 716a0a2
feat(cross-currency-rollover): update workflows test yml
Mouzayan ac12198
feat(cross-currency-rollover): print balances in script
Mouzayan 030c43b
feat(cross-currency-rollover): kvk pr comments
Mouzayan 22dd570
feat(cross-currency-rollover): remove flashloan. add script for princ…
Mouzayan 1804c1a
feat(cross-currency-rollover): rename and separate function concerns
Mouzayan 9636c04
feat(cross-currency-rollover): enable yul optimizer
Mouzayan 591ff15
feat(cross-currency-rollover): make scripts options: with new lender …
Mouzayan f1e0083
feat(cross-currency-rollover): remove commented out code
Mouzayan 279802e
feat(cross-currency-rollover): break up function to remove viair:true
Mouzayan 3b90020
feat(cross-currency-rollover): revert change to test.yml
Mouzayan 121605c
feat(cross-currency-rollover): keep swapparams outside of repaydata
Mouzayan d10f3d8
feat(cross-currency-rollover): eliminate fetchcurrentprice
Mouzayan 5d9291a
feat(cross-currency-rollover): comment fixes
Mouzayan 3dabfe9
feat(cross-currency-rollover): cleanup amounts.amounttoborrower and a…
Mouzayan a71368f
feat(cross-currency-rollover): update comment
Mouzayan 848bda5
feat(cross-currency-rollover): add origination controller base and se…
Mouzayan 653ed23
feat(cross-currency-rollover): add ocbase and separate out functional…
Mouzayan 7c71949
feat(cross-currency-rollover): ocbase
Mouzayan 0e2d23c
feat(cross-currency-rollover): ocbase
Mouzayan e6e9cde
feat(cross-currency-rollover): move helper functions from ocbase to oc
Mouzayan 2c898b9
feat(cross-currency-rollover): kvk comment fixes
Mouzayan 05b422c
feat(cross-currency-rollover): comment fixes
Mouzayan b1f28a5
feat(cross-currency-rollover): comment fixes
Mouzayan 776dcc9
feat(cross-currency-rollover): kvk comment fixes
Mouzayan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.18; | ||
|
||
import "../libraries/LoanLibrary.sol"; | ||
import "../libraries/OriginationLibrary.sol"; | ||
|
||
import "./IOriginationController.sol"; | ||
|
||
interface ICrossCurrencyRollover { | ||
// =========================== EVENTS ========================== | ||
event PausedStateChanged(bool isPaused); | ||
event CurrencyRollover(address indexed lender, address indexed borrower, uint256 collateralTokenId, uint256 newLoanId); | ||
|
||
// ================== CROSS CURRENCY ROLLOVER ================== | ||
function rolloverCrossCurrencyLoan( | ||
uint256 oldLoanId, | ||
LoanLibrary.LoanTerms calldata loanTerms, | ||
address lender, | ||
IOriginationController.Signature calldata sig, | ||
IOriginationController.SigProperties calldata sigProperties, | ||
LoanLibrary.Predicate[] calldata itemPredicates, | ||
OriginationLibrary.SwapParameters calldata swapParams | ||
) external; | ||
|
||
// ======================== OWNER OPS ========================= | ||
function pause(bool _pause) external; | ||
} |
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,57 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.18; | ||
|
||
import "../libraries/LoanLibrary.sol"; | ||
|
||
interface IOriginationControllerBase { | ||
// ============= Data Types ============= | ||
|
||
struct SigProperties { | ||
uint160 nonce; | ||
uint96 maxUses; | ||
} | ||
|
||
enum Side { | ||
BORROW, | ||
LEND | ||
} | ||
|
||
struct Signature { | ||
uint8 v; | ||
bytes32 r; | ||
bytes32 s; | ||
bytes extraData; | ||
} | ||
|
||
// ================ Events ================ | ||
|
||
event Approval(address indexed owner, address indexed signer, bool isApproved); | ||
|
||
// ================ Permission Management ================ | ||
|
||
function approve(address signer, bool approved) external; | ||
|
||
function isApproved(address owner, address signer) external returns (bool); | ||
|
||
function isSelfOrApproved(address target, address signer) external returns (bool); | ||
|
||
// ============== Signature Verification ============== | ||
|
||
function recoverTokenSignature( | ||
LoanLibrary.LoanTerms calldata loanTerms, | ||
Signature calldata sig, | ||
SigProperties calldata sigProperties, | ||
Side side, | ||
address signingCounterparty | ||
) external view returns (bytes32 sighash, address signer); | ||
|
||
function recoverItemsSignature( | ||
LoanLibrary.LoanTerms calldata loanTerms, | ||
Signature calldata sig, | ||
LoanLibrary.Predicate[] calldata itemPredicates, | ||
SigProperties calldata sigProperties, | ||
Side side, | ||
address signingCounterparty | ||
) external view returns (bytes32 sighash, address signer); | ||
} |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be part of
ICrossCurrencyRollover
, since it is only used in the cross-currency case