Skip to content

Private pool #37

Open
wants to merge 112 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
5454f5d
.editorconfig
Nov 8, 2021
830e8e0
(Personal formatting settings)
Nov 8, 2021
098e0fa
Add Private Lending pool (WIP, untested)
Nov 26, 2021
ae063b3
(Archive oracles and swappers to silence warnings)
Nov 26, 2021
3048143
Enforce limits on init() settings
Dec 3, 2021
e868f5b
Make feesOwedAmount public
Dec 10, 2021
1365a2e
Reword some things for symmetry/uniformity
Dec 9, 2021
11c9a15
Remove some overflow checks with proof
Dec 9, 2021
a2d8530
Add deployment script and some tests
Dec 9, 2021
9a2a087
Use full math in isSolvent check
Dec 9, 2021
f14bc0e
Revert "(Archive oracles and swappers to silence warnings)"
Dec 14, 2021
8a9812b
Change expiration logic: if set, everyone insolvent after
Dec 15, 2021
b3461a4
Test loan repayment and "fees owed" logic
Dec 11, 2021
22b5f65
Remove some more overflow checks with proof
Dec 16, 2021
889d833
Fix in-kind liquidation bonus calculation
Dec 18, 2021
643a85a
Test regular and in-kind liquidations
Dec 16, 2021
a7ffbaf
Start NFT-collateral contract (draft)
Dec 20, 2021
2f2e66c
Extract old OpenZeppelin code to avoid conflicts
Dec 25, 2021
cdc2af9
Merge branch 'main' into private-pool
0xCalibur Jan 14, 2022
c712693
rollback to original formatting setting
0xCalibur Jan 24, 2022
d040039
add a way to enable/disable approved borrowers
0xCalibur Jan 24, 2022
a2194ab
add a way to change approvedBorrowers and verify approvedBorrowers wh…
0xCalibur Jan 25, 2022
744bf7c
(Pull in new BoringSolidity with ERC721)
Jan 7, 2022
997b59d
(Format all .ts files with "yarn format")
Jan 25, 2022
3d7a45c
Refactor removeCollateral
Jan 25, 2022
630e3d1
Make "compound interest terms" a per-loan setting
Jan 25, 2022
49b7342
Borrow: Pass loan params as struct
Jan 25, 2022
a74f96f
Emit event on updating loan params
Jan 25, 2022
79e192b
Add some tests for the NFT contract
Jan 31, 2022
3c843d3
Always allow liquidation of insolvent positions
Feb 1, 2022
17a641d
Explicitly test PrivatePool contract size limit
Feb 1, 2022
8b07fc5
Always update exhchange rate in _isSolvent()
Feb 1, 2022
824e179
Split in-kind liquidation bonus between liquidator and lender
Feb 1, 2022
16524b9
NFT pair revisions -- untested draft
Feb 1, 2022
5ad449e
Allow repayments from anyone
Mar 5, 2022
e4dac51
Consistently case event messages
Mar 5, 2022
afc1e1a
Reorder requestLoan parameters and add cook action
Mar 5, 2022
0d57880
Fix lend(): store lender
Mar 5, 2022
fdc3d4f
Fix calculateInterest (and improve comments)
Mar 5, 2022
6fbf382
Add NFT tests (WIP)
Feb 22, 2022
243921f
Hardcode COMPOUND_INTEREST_TERMS
Mar 5, 2022
1d43ef3
Signed lend/borrow
Mar 11, 2022
40e2a98
Add some tests for recent changes (partial)
Mar 12, 2022
c06426c
Make feesEarnedShare public
Mar 12, 2022
92d1efd
Index tokenId in LogRepay event
Mar 16, 2022
df2b5f3
(Remove old TODO comments)
Mar 16, 2022
12f517b
Add tests for repay()
Mar 16, 2022
15e56cc
Signed lend/borrow: Include all addresses in signature
Mar 16, 2022
257425f
Fix precalculated borrow signature hash
Mar 17, 2022
138f82b
Add tests for signed lend/borrow
Mar 20, 2022
388f48f
Changed up protocol fee share
0xm3rlin Mar 25, 2022
f71f52a
(Add missing semicolon)
Mar 26, 2022
5cce3c7
Rework lend() tests to account for open fee change
Mar 26, 2022
c6c4f0c
Merge branch 'private-pool-additions' into private-pool
Mar 26, 2022
ffeb27d
Add cook actions for signed methods
Mar 26, 2022
a50400c
LendClub changes
0xm3rlin Apr 8, 2022
abb0ba6
Improve test coverage to all but cooks; start cook tests
Mar 26, 2022
5bf6699
Disallow calls to the collateral contract
Apr 11, 2022
8474d9a
Rework lend/borrow signatures; add "any token" option
Apr 11, 2022
3ba37d7
Merge private-pool-lendingclub (some fixes; no tests)
Apr 13, 2022
8828d48
Slightly change LendingClub signature and add test case
Apr 13, 2022
208e61f
(Address warning on mock contract)
Apr 14, 2022
a75094d
Take duration instead of expiration as loan parameter
Apr 14, 2022
bc882ec
(Format LendingClubMock in line with the rest of the repo)
Apr 14, 2022
a8bb75a
Cooks: Add ACTION_LEND and some tests
Apr 14, 2022
7783787
(Add deployment script for NFTPair master contract)
Apr 23, 2022
c6801ea
(Format/clean up PrivatePool deploy script)
Apr 23, 2022
6eac385
(Apply standard formatting to some config files)
Apr 23, 2022
8e370fc
Deploy a mock NFTPair ecosystem on Ropsten
Apr 23, 2022
1f7d3a9
Add freely mintable ERC20 and use in Ropsten NFTPair mocks
Apr 23, 2022
d808861
Deploy "Free Money" mock; redeploy NFT pair master (Ropsten)
Apr 23, 2022
3161f3b
(Whitelist master contract in Ropsten mock deployment)
Apr 23, 2022
dbacda0
Added Oracle
0xm3rlin Apr 26, 2022
6bd5af7
renamed contract
0xm3rlin Apr 26, 2022
750b1ae
Removed renamed contract
0xm3rlin Apr 26, 2022
ae47d03
Changed Removal to allow liquidation from other addresses
0xm3rlin Apr 26, 2022
a0a802b
More thoroughly check for expiration logic
Apr 26, 2022
0af7ea3
(Comments / auto-formatted line endings)
Apr 26, 2022
aa2ff04
Add LTV to relevant checks / parameter lists
Apr 26, 2022
9d59ccf
Rename ltv => ltvBPS
Apr 26, 2022
741a255
Formatting
Apr 26, 2022
5f6f302
Update signature hashes
Apr 26, 2022
7e3a383
Fix LTV parameter comparison check
Apr 29, 2022
ba4b627
Enforce that the oracle cannot be changed
Apr 30, 2022
d15cad3
Add cook test scenario for BentoBox transfers
Apr 30, 2022
d05d931
Allow the lender to "liquidate" to a different address
May 27, 2022
e179cd4
Deduplicate names in "WithOracle" contract
May 27, 2022
b364ed1
Remove unused import of BoringRebase
May 27, 2022
1818676
(init and updateLoanParams can be external)
May 27, 2022
c05979d
Add flash repayments and borrowing - swappers and cook
May 27, 2022
60d4e1c
Only expire loans AFTER duration has passed
Jun 5, 2022
bf367df
Include more detail in events
Jun 6, 2022
a349016
(Shorten revert message)
Jun 6, 2022
bf38d46
(Add revert message to interest calc)
Jun 6, 2022
f6555a1
(Spelling transfered -> transferred)
Jun 6, 2022
db06bf9
Fix comments; fix `_repayBefore()` accessibility
Jun 6, 2022
394e82a
Clear loan params whenever loan is cleared
Jun 6, 2022
12f4bf5
BringNFTPairWithOracle up to parity
Jun 6, 2022
635dc51
(Cache some BentoBox calculations)
Jun 6, 2022
a71a60f
Add partial repayments
Jun 7, 2022
8e41876
(Cache some reads)
Jun 7, 2022
05cd528
Use principal amount for partial repayments instead
Jun 7, 2022
f51b091
(Cache another read of asset)
Jun 9, 2022
6a82726
Round required BentoBox shares up for repayments
Jun 14, 2022
05e4088
Merge branch 'main' into private-pool
0xCalibur Jun 14, 2022
d1bfcb1
(Put mock BentoBox contracts back)
Jun 22, 2022
01609d2
Fix type annotations and format for PrivatePool tests
Jun 22, 2022
e1cf116
Still archive the PrivatePool tests
Jun 30, 2022
1a9d166
Change ILendingClub interface to work with either contract
Jul 3, 2022
6ec5a2e
Start NFT price floor example
Aug 30, 2022
b376874
Merge branch 'main' into private-pool
0xCalibur Aug 30, 2022
96aa80f
(Fix lending pool mock)
Sep 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
trim_trailing_whitespace = true

[*.{js,ts}]
insert_final_newline = true
indent_size = 2
indent_style = space

[*.sol]
insert_final_newline = true
indent_size = 4
indent_style = space
46 changes: 23 additions & 23 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module.exports = {
overrides: [
{
files: "*.ts",
options: {
printWidth: 145,
semi: true,
trailingComma: "es5",
},
},
{
files: "*.sol",
options: {
printWidth: 140,
tabWidth: 4,
useTabs: false,
singleQuote: false,
bracketSpacing: false,
explicitTypes: "always",
},
},
],
};
module.exports = {
overrides: [
{
files: "*.ts",
options: {
printWidth: 145,
semi: true,
trailingComma: "es5",
},
},
{
files: "*.sol",
options: {
printWidth: 140,
tabWidth: 4,
useTabs: false,
singleQuote: false,
bracketSpacing: false,
explicitTypes: "always",
},
},
],
};
23 changes: 10 additions & 13 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
// We are always skipping mocks and interfaces, add specific files here
skipFiles: [
"libraries/FixedPoint.sol",
"libraries/FullMath.sol",
"libraries/SignedSafeMath.sol",
"flat/BentoBoxFlat.sol",
"flat/KashiPairFlat.sol",
"flat/SushiSwapSwapperFlat.sol",
"mocks/",
"interfaces/"
],
}
module.exports = {
skipFiles: [
"libraries/FixedPoint.sol",
"libraries/FullMath.sol",
"libraries/SignedSafeMath.sol",
"BentoBoxFlat.sol",
"mocks/",
"interfaces/"
]
}
Loading