Skip to content

Commit

Permalink
feat: Add lending migrator contract and testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
thorseldon committed May 4, 2023
1 parent a0bf541 commit aa49fcd
Show file tree
Hide file tree
Showing 22 changed files with 1,562 additions and 1 deletion.
41 changes: 41 additions & 0 deletions abis/IAaveFlashLoanReceiver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"inputs": [
{
"internalType": "address[]",
"name": "assets",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "premiums",
"type": "uint256[]"
},
{
"internalType": "address",
"name": "initiator",
"type": "address"
},
{
"internalType": "bytes",
"name": "params",
"type": "bytes"
}
],
"name": "executeOperation",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
58 changes: 58 additions & 0 deletions abis/IAaveLendPool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"inputs": [],
"name": "FLASHLOAN_PREMIUM_TOTAL",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "receiverAddress",
"type": "address"
},
{
"internalType": "address[]",
"name": "assets",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "amounts",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "modes",
"type": "uint256[]"
},
{
"internalType": "address",
"name": "onBehalfOf",
"type": "address"
},
{
"internalType": "bytes",
"name": "params",
"type": "bytes"
},
{
"internalType": "uint16",
"name": "referralCode",
"type": "uint16"
}
],
"name": "flashLoan",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
15 changes: 15 additions & 0 deletions abis/IAaveLendPoolAddressesProvider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"inputs": [],
"name": "getLendingPool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
201 changes: 201 additions & 0 deletions abis/ILendPool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "reserveAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
},
{
"internalType": "address",
"name": "onBehalfOf",
"type": "address"
},
{
"internalType": "uint16",
"name": "referralCode",
"type": "uint16"
}
],
"name": "borrow",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
}
],
"name": "getNftAuctionData",
"outputs": [
{
"internalType": "uint256",
"name": "loanId",
"type": "uint256"
},
{
"internalType": "address",
"name": "bidderAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "bidPrice",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bidBorrowAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bidFine",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
}
],
"name": "getNftDebtData",
"outputs": [
{
"internalType": "uint256",
"name": "loanId",
"type": "uint256"
},
{
"internalType": "address",
"name": "reserveAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "totalCollateral",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "availableBorrows",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "healthFactor",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bidFine",
"type": "uint256"
}
],
"name": "redeem",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "repay",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
28 changes: 28 additions & 0 deletions abis/ILendPoolAddressesProvider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"inputs": [],
"name": "getLendPool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getLendPoolLoan",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
45 changes: 45 additions & 0 deletions abis/ILendPoolLoan.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[
{
"inputs": [
{
"internalType": "uint256",
"name": "loanId",
"type": "uint256"
}
],
"name": "borrowerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "nftAsset",
"type": "address"
},
{
"internalType": "uint256",
"name": "nftTokenId",
"type": "uint256"
}
],
"name": "getCollateralLoanId",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
Loading

0 comments on commit aa49fcd

Please sign in to comment.