Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
18f9979
fix: False positives, clean up the code
0kn0t Jun 10, 2025
015e818
fix: Conflicts + doomsday props
0kn0t Jun 11, 2025
e1b9c3d
fix: merge conflicts
0kn0t Jun 11, 2025
df36cd0
fix: false positives
0kn0t Jun 11, 2025
9031602
Fix: Doomsday
0kn0t Jun 11, 2025
355457e
fix: before/after updates
nican0r Jun 11, 2025
be57ecb
feat: revert behavior handler for MockERC4626Tester
nican0r Jun 11, 2025
2374d3b
fix: property_debt_increase_after_realizing_interest implementation
nican0r Jun 11, 2025
0a55a71
feat: property_total_system_collateralization
nican0r Jun 11, 2025
16a7047
chore: cleanup
nican0r Jun 11, 2025
806b4d6
feat: more properties
nican0r Jun 11, 2025
b63ad97
fix: false positives
nican0r Jun 12, 2025
4faa4e3
fix: false positive in health check after realizing interest
nican0r Jun 12, 2025
d2d3fa4
fix: lender_liquidate false positive
nican0r Jun 12, 2025
326ee43
fix: false positives
nican0r Jun 12, 2025
7bd9267
chore: repros
nican0r Jun 12, 2025
4ec165e
feat: property - ERC4626 must always be divestable
nican0r Jun 12, 2025
e7beb9c
feat: property - Borrow should only revert with an expected error
nican0r Jun 12, 2025
9dea705
fix: false positives + repros
nican0r Jun 13, 2025
5357bc9
fix: false positives and repros
nican0r Jun 13, 2025
d004686
Merge pull request #5 from Recon-Fuzz/feat/additional-team-properties
nican0r Jun 13, 2025
b40b002
fix: solvency false positive
nican0r Jun 13, 2025
f946af8
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 13, 2025
854589d
chore: remove incorrect property
nican0r Jun 13, 2025
dd3f8b5
fix: false positive in lender_repay
nican0r Jun 13, 2025
438b703
fix: false positive in lender_realizeRestakerInterest
nican0r Jun 13, 2025
bd7230a
feat: optimization test for no fees on burning
nican0r Jun 13, 2025
3627c30
chore: reproducers
nican0r Jun 13, 2025
6729055
Merge branch 'feat/remaining-properties' into feat/recon
nican0r Jun 13, 2025
6d36de4
chore: update table
nican0r Jun 13, 2025
9b46944
fix: false positive + reproducers
nican0r Jun 13, 2025
88c18fe
fix: false positives + repros
nican0r Jun 13, 2025
47dbe77
chore: optimization config
nican0r Jun 13, 2025
97659ee
Update to latest version - more properties
0kn0t Jun 14, 2025
505144d
FeeReceiverTarget added
0kn0t Jun 14, 2025
6d9eea7
Added props
0kn0t Jun 14, 2025
b8def90
Fix False Positives
0kn0t Jun 14, 2025
9cb16e8
cleanup
0kn0t Jun 14, 2025
eb6d453
Avoid stack too deep
0kn0t Jun 14, 2025
caa5d52
fix: false positives
nican0r Jun 16, 2025
74ddc67
fix: more false positives
nican0r Jun 16, 2025
e00fddc
Latest false positives
0kn0t Jun 16, 2025
0d61aae
cleanup
0kn0t Jun 16, 2025
de5245a
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 16, 2025
2b93049
Fix property_debt_token_balance_gte_total_vault_debt
0kn0t Jun 16, 2025
464e011
Merge remote-tracking branch 'origin/feat/recon' into feat/recon
0kn0t Jun 16, 2025
de67a3e
Fix conflict
0kn0t Jun 16, 2025
1cac804
fix: clamping in capToken_setReserve
nican0r Jun 16, 2025
60c8f83
feat: property_utilization_ratio_never_greater_than_1e27
nican0r Jun 16, 2025
d960f6b
chore: property description
nican0r Jun 16, 2025
12913c1
feat: liquidated value properties
nican0r Jun 16, 2025
a988d8b
chore: comment for test_capToken_redeem_clamped_6
nican0r Jun 17, 2025
7af367e
feat: realize interest properties
nican0r Jun 17, 2025
c14f450
fix: assertion in lender_liquidate
nican0r Jun 17, 2025
9d7b6f5
Merge pull request #12 from Recon-Fuzz/feat/final-team-properties
nican0r Jun 17, 2025
8ba161b
fix false positives
0kn0t Jun 17, 2025
c2c9993
Merge remote-tracking branch 'origin/feat/recon' into feat/recon
0kn0t Jun 17, 2025
2f11847
fix: remove mintUnbackedShares from ERC46426Tester
nican0r Jun 17, 2025
5b68aed
Merge pull request #13 from Recon-Fuzz/fix/minting-unbacked-shares-issue
nican0r Jun 17, 2025
1251df5
fix: compilation error
nican0r Jun 17, 2025
e0941fd
chore: remove incorrect property
nican0r Jun 17, 2025
6209ece
feat: property - Total supplies increases by the amountIn - mintFee o…
nican0r Jun 17, 2025
4072e6b
fix: stack too deep error
nican0r Jun 17, 2025
d575dba
fix: property falsified description
nican0r Jun 17, 2025
437207c
chore: property description
nican0r Jun 17, 2025
c757401
chore: remove handlers for depositing directly into vault since it wi…
nican0r Jun 17, 2025
cbde5e2
feat: property_maxWithdraw_less_than_loaned_and_reserve
nican0r Jun 17, 2025
c11a3eb
feat: property_loaned_less_than_maxWithdraw
nican0r Jun 17, 2025
c32a03f
fix: property_debt_token_balance_gte_total_vault_debt
nican0r Jun 18, 2025
699c0d8
fix: received amount check on burn
nican0r Jun 18, 2025
37690ec
chore: update latest repros
nican0r Jun 18, 2025
2a20cb1
fix: assertion
nican0r Jun 18, 2025
7c60f91
feat: optimize_property_debt_token_supply_neq_total_vault_debt
nican0r Jun 18, 2025
cbee771
fix: debt optimization properties
nican0r Jun 18, 2025
b636413
fix: false positives in doomsdays due to removed asset
nican0r Jun 18, 2025
0221d31
chore: newest repro
nican0r Jun 18, 2025
2d5e7cb
fix: arbitrary minting to fractional reserve vault
nican0r Jun 18, 2025
2c2c06d
fix: remove incorrect loan property
nican0r Jun 18, 2025
f8b667d
fix: false positive
nican0r Jun 18, 2025
7ab6c0a
chore: remove unnecessary check
nican0r Jun 18, 2025
25cf059
chore: update table
nican0r Jun 18, 2025
9740723
feat: property_fractional_reserve_vault_has_reserve_amount_of_underly…
nican0r Jun 18, 2025
0c7f0f5
fix: property_fractional_reserve_vault_has_reserve_amount_of_underlyi…
nican0r Jun 19, 2025
c719459
fix: consistency between increase/decreaseYield and simulateGain/Loss
nican0r Jun 19, 2025
55f6a45
fix: remove trivially broken property
nican0r Jun 19, 2025
d1f70c0
chore: repro for test_lender_realizeRestakerInterest_8
nican0r Jun 19, 2025
23c96df
chore: comments for repro
nican0r Jun 19, 2025
96b4caa
chore: fix LTV used in assertion + add reproducer
nican0r Jun 19, 2025
665ba5c
fix: DIVEST preconditions for property_fractional_reserve_vault_has_r…
nican0r Jun 20, 2025
1ebf3e2
chore: remove invalid property
nican0r Jun 20, 2025
8279abb
Merge branch 'feat/recon' into feat/additional-properties
nican0r Jun 20, 2025
e58b131
Merge pull request #14 from Recon-Fuzz/feat/additional-properties
nican0r Jun 20, 2025
30e2423
Merge pull request #15 from Recon-Fuzz/feat/optimize-debt-property
nican0r Jun 20, 2025
5842221
feat: optimize_max_ltv_delta
nican0r Jun 20, 2025
8fc0c57
feat: health decrease after realizeRestakerInterest optimization test
nican0r Jun 20, 2025
6526902
chore: update propery table
nican0r Jun 20, 2025
ef8ea68
feat: property_no_operation_makes_user_liquidatable
nican0r Jun 20, 2025
e5f2c57
chore: update reproducers
nican0r Jun 20, 2025
117899e
feat: property -liquidating a healthy agent should not generate bad debt
nican0r Jun 20, 2025
143f080
feat: property_liquidation_does_not_increase_bonus
nican0r Jun 20, 2025
e5d8e3f
fix: doomsday_liquidate false positive
nican0r Jun 20, 2025
094e37d
Merge pull request #18 from Recon-Fuzz/feat/more-properties
nican0r Jun 20, 2025
ea3e0b6
fix: missing pause checks in lender_realizeInterest
nican0r Jun 20, 2025
944b91d
fix: doomsday false positives due to paused protocol
nican0r Jun 20, 2025
c9cc4b6
chore: additional checks for paused asset/protocol
nican0r Jun 20, 2025
d42f886
fix: stack too deep error
nican0r Jun 20, 2025
b9e796e
fix: property_fractional_reserve_vault_has_reserve_amount_of_underlyi…
nican0r Jun 20, 2025
1d42d52
Merge branch 'feat/recon' into feat/optimization-tests
nican0r Jun 20, 2025
24f9ff0
Merge pull request #17 from Recon-Fuzz/feat/optimization-tests
nican0r Jun 20, 2025
7a7aaaf
latest version
0kn0t Jun 23, 2025
dd8916c
fix: property_fractional_reserve_vault_has_reserve_amount_of_underlyi…
nican0r Jun 23, 2025
2c35f87
chore: latest reproducers
nican0r Jun 23, 2025
946381a
fix: simplification in doomsday_liquidate
nican0r Jun 23, 2025
14e92df
feat: property_dust_on_repay
nican0r Jun 23, 2025
c45931c
Merge remote-tracking branch 'origin/feat/recon' into feat/recon
0kn0t Jun 23, 2025
04e7d67
Latest Version
0kn0t Jun 23, 2025
bd1c111
feat: property_agent_always_has_more_than_min_borrow
nican0r Jun 23, 2025
624ef77
feat: property_not_borrowing_with_zero_debt
nican0r Jun 24, 2025
7be8383
property_zero_debt_is_borrowing
0kn0t Jun 24, 2025
8a72b36
fix: remove borrowing property already added by knot
nican0r Jun 24, 2025
d14b96e
feat: property_lender_does_not_accumulate_dust
nican0r Jun 24, 2025
804226e
feat: property_agent_always_has_more_than_min_borrow
nican0r Jun 23, 2025
2eefb42
feat: property_not_borrowing_with_zero_debt
nican0r Jun 24, 2025
fbd892b
fix: remove borrowing property already added by knot
nican0r Jun 24, 2025
12f452d
feat: property_lender_does_not_accumulate_dust
nican0r Jun 24, 2025
154bf84
Merge branch 'feat/more-properties' of https://github.com/Recon-Fuzz/…
nican0r Jun 24, 2025
0ab0cd8
feat: property_debt_zero_after_repay
nican0r Jun 24, 2025
d1b2ad3
feat: doomsday_repay_all
nican0r Jun 24, 2025
f0f5e09
feat: doomsday_manipulate_utilization_rate
nican0r Jun 24, 2025
f5eb20e
fix: doomsday_debt_token_solvency implementation
nican0r Jun 24, 2025
aaf62dd
fix: optimization properties for insolvency
nican0r Jun 24, 2025
22ad806
fix: false positive in property_agent_always_has_more_than_min_borrow
nican0r Jun 24, 2025
e91cd73
chore: add reproducers
nican0r Jun 24, 2025
9584a95
chore: removed reproducer no longer valid
nican0r Jun 24, 2025
f3ef5a7
Merge branch 'feat/recon' into feat/more-properties
nican0r Jun 24, 2025
d0f3abf
Merge pull request #19 from Recon-Fuzz/feat/more-properties
nican0r Jun 24, 2025
1f58db6
feat: optimization properties for failed call to liquidate and repay
nican0r Jun 24, 2025
65ebd57
chore: clamping benchmark rate up to max of 100%
nican0r Jun 24, 2025
06936e9
More properties + Liam
0kn0t Jun 24, 2025
a31c008
Fix conflicts
0kn0t Jun 24, 2025
80fb129
Merge pull request #21 from Recon-Fuzz/kn0t-more-properties
0kn0t Jun 24, 2025
d8d159d
fix: additional check in lender_addAsset to prevent adding a nonexist…
nican0r Jun 25, 2025
a8d2009
feat: additional handler for setting loss on withdraw in vault
nican0r Jun 25, 2025
48f9399
chore: additional check in divestAll
nican0r Jun 25, 2025
127c2b3
chore: clamping upper bound of restakerRate
nican0r Jun 25, 2025
698cf5b
fix: false positive
nican0r Jun 25, 2025
658017f
Merge pull request #22 from Recon-Fuzz/fix/false-positives
nican0r Jun 25, 2025
440f7d6
fix: test_lender_borrow_clamped_13
0kn0t Jun 25, 2025
570117a
fix: remove unused debtToken
0kn0t Jun 25, 2025
00e68f1
chore: remove optimization test for burnable amount with no fee
nican0r Jun 25, 2025
94874ce
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 25, 2025
50ca546
Merge pull request #20 from Recon-Fuzz/feat/more-optimization-tests
nican0r Jun 25, 2025
e4a633f
fix: optimize_max_ltv_delta
nican0r Jun 25, 2025
654f276
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 25, 2025
7df5629
chore: remove repay optimization because doomsday_repay no longer breaks
nican0r Jun 25, 2025
c21c6a6
chore: remove loss on withdrawal because not realistic for 4626 vault…
nican0r Jun 25, 2025
6d9a732
fix property_cap_token_backed_1_to_1
0kn0t Jun 25, 2025
a0b4033
fix: false positive
nican0r Jun 25, 2025
ba16872
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 25, 2025
bb6d860
feat: doomsday_dust_on_redeem property
nican0r Jun 25, 2025
9cb9707
feat: property - no assets should be left in the vault after divestin…
nican0r Jun 25, 2025
f554123
fix: commit
GalloDaSballo Jun 26, 2025
17e82c4
Merge pull request #23 from Recon-Fuzz/temp-fix-recon
GalloDaSballo Jun 26, 2025
0153ad5
feat: property_available_balance_never_reverts
nican0r Jun 26, 2025
56ce72c
feat: property_maxBorrow_never_reverts
nican0r Jun 26, 2025
48f7d7a
chore: arithmetic checks in LenderTargets
nican0r Jun 26, 2025
2389c94
Fix property_cap_token_backed_1_to_1
0kn0t Jun 26, 2025
91d7ab5
feat: properties for if no agent is borrowing
nican0r Jun 26, 2025
0103222
feat: recon README
nican0r Jun 26, 2025
b89fe88
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 26, 2025
32d8e15
fix: L0 submodule
nican0r Jun 26, 2025
cc3b0fe
Update README.md
nican0r Jun 26, 2025
41b2c3e
Update README.md
nican0r Jun 26, 2025
2c08f8c
feat: doomsday_maxBorrow properties
nican0r Jun 26, 2025
81caf32
feat: doomsday_compound_vs_linear_accumulation
nican0r Jun 26, 2025
fbdfa6c
fix: borrowing more than LTV property inlined
nican0r Jun 26, 2025
abe2305
chore: add overflow check back to lender_borrow
nican0r Jun 26, 2025
a6c7649
Update setup-helpers to latest commit
nican0r Jun 26, 2025
b95ef75
feat: additional balance/allowance checks in doomsday_liquidate
nican0r Jun 26, 2025
9c251e2
chore: removed resolved test
nican0r Jun 26, 2025
63c0665
Merge pull request #25 from Recon-Fuzz/fix/properties
nican0r Jun 26, 2025
c65fbc7
chore: bump setup-helpers
nican0r Jun 26, 2025
ec4c0b7
fix: property name + add reproducers
nican0r Jun 26, 2025
0f4f7bd
Merge branch 'feat/recon' into feat/more-properties
nican0r Jun 26, 2025
b0ce0e9
Merge branch 'feat/recon' into feat/more-properties
nican0r Jun 26, 2025
9c3e772
Merge pull request #24 from Recon-Fuzz/feat/more-properties
nican0r Jun 26, 2025
fc9b8b9
debtToken.totalSupply should never be less than reserve.debt
0kn0t Jun 27, 2025
bf5930f
more liquidation properties
0kn0t Jun 27, 2025
3e0c096
Fix false positives
0kn0t Jun 27, 2025
5280219
chore: remove unspecifiable property
nican0r Jun 27, 2025
49689bd
chore: 0 address check in asset minting
nican0r Jun 27, 2025
7f5198f
fix: remove incorrectly specified property
nican0r Jun 27, 2025
41422c7
fix: property_maxBorrow_never_reverts to include PriceError check
nican0r Jun 27, 2025
f181b5e
fix: borrowing clamping
nican0r Jun 27, 2025
4e43207
feat: reproducers
nican0r Jun 27, 2025
f3153db
chore: additional check for borrow revert error
nican0r Jun 27, 2025
cf06224
fix: clamping in borrow that messed up reproducers
nican0r Jun 27, 2025
84787e4
Fix property_cap_token_backed_1_to_1
0kn0t Jun 27, 2025
0d448ba
chore: latest reproducers
nican0r Jun 27, 2025
e239e02
Merge branch 'feat/recon' into fix/more-properties
nican0r Jun 27, 2025
105fe7b
Merge pull request #26 from Recon-Fuzz/fix/more-properties
nican0r Jun 27, 2025
1f08d5b
feat: optimization test for increasing max utilization difference in …
nican0r Jun 27, 2025
a0e517c
Merge pull request #27 from Recon-Fuzz/feat/optimizations
nican0r Jun 27, 2025
c435cda
feat: doomsday_realizeRestakerInterest_never_reverts
nican0r Jun 27, 2025
dc579a8
feat: liquidation cancellation properties
nican0r Jun 27, 2025
af3964e
feat: additional arithmetic checks
nican0r Jun 27, 2025
bb0a4c4
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jun 27, 2025
16bb1c2
feat: additional arithmetic checks
nican0r Jun 27, 2025
43fdacf
chore: remove property_fractional_reserve_vault_has_reserve_amount_of…
nican0r Jun 29, 2025
9925820
chore: remove doomsday_compound_vs_linear_accumulation as behavior is…
nican0r Jun 29, 2025
aa03440
fix: 0 checks in liquidation handler
nican0r Jun 29, 2025
9d74b3b
fix: lender_liquidate handler for property check
nican0r Jun 29, 2025
6b302db
fix: reproducer for test_doomsday_manipulate_utilization_rate_2
nican0r Jun 29, 2025
d13e676
Fix false positives
0kn0t Jun 30, 2025
8f33a47
fix doomsday_liquidate_0
0kn0t Jun 30, 2025
938b51c
latest version
0kn0t Jun 30, 2025
455fb5e
property_no_agent_borrowing_current_utilization_rate_should_be_zero
0kn0t Jun 30, 2025
9a85662
test_property_no_agent_borrowing_current_utilization_rate_should_be_z…
0kn0t Jun 30, 2025
0d0b9b4
cleanup repros
0kn0t Jun 30, 2025
6c7acd4
chore: remove dust check in divestAll
nican0r Jun 30, 2025
282f2e4
chore: removed incorrectly specified property_no_agent_borrowing_curr…
nican0r Jun 30, 2025
7dbd424
fix property_maxBorrow_never_reverts
0kn0t Jun 30, 2025
fb73c7b
fix: doomsday_manipulate_utilization_rate
nican0r Jul 1, 2025
ca5f101
fix: remove doomsday_repay_all as expected
nican0r Jul 1, 2025
7a52515
fix: remove property_previewRedeem_greater_than_loaned
nican0r Jul 1, 2025
7b0645f
fix lender_repay
0kn0t Jul 1, 2025
834966a
fix: remove property_dust_on_repay because it breaks with bad debt
nican0r Jul 1, 2025
d31a476
chore: add comments for properties that are expected to break
nican0r Jul 1, 2025
b21446f
Merge branch 'feat/recon' of https://github.com/Recon-Fuzz/cap-contra…
nican0r Jul 1, 2025
55abcf8
chore: remove arithmetic check in lender_borrow
nican0r Jul 1, 2025
8628597
chore: note for failing property
nican0r Jul 1, 2025
a816cd4
fix: false positive in divestAll should never revert property
nican0r Jul 1, 2025
6d0d0b4
fix: check in precondition and additional reproducer
nican0r Jul 1, 2025
3e5b64c
chore: modify test_doomsday_manipulate_utilization_rate_0 for minimal…
nican0r Jul 1, 2025
dda5a0e
chore: remove property_liquidation_does_not_increase_bonus
nican0r Jul 1, 2025
f8e6425
chore: merging in latest main
nican0r Jul 1, 2025
6066dc5
chore: doomsday_maxBorrow reproducer
nican0r Jul 1, 2025
a7268e2
chore: remove doomsday_manipulate_utilization_rate
nican0r Jul 2, 2025
4b803ad
chore: remove poorly specified property
nican0r Jul 2, 2025
32aa8fa
chore: remove optimizations for UR changes
nican0r Jul 2, 2025
bd26318
chore: cleanup reproducers
nican0r Jul 2, 2025
88b6fcf
chore: remove setReserve handler because it introduces too many false…
nican0r Jul 2, 2025
e4b5a27
chore: remove insufficiently specified property in repay
nican0r Jul 2, 2025
8c9af70
chore: latest burn reproducer
nican0r Jul 2, 2025
b168ede
chore: latest burn reproducer
nican0r Jul 16, 2025
985f135
feat: property_storedTotal_only_increases_after_lockDuration
nican0r Jul 16, 2025
bd31d45
feat:property_lockedProfit_decreases_over_lockDuration
nican0r Jul 16, 2025
a0dcd2c
feat: property_asset_balance_always_greater_than_stored_total
nican0r Jul 16, 2025
6464b52
fix: property_notify_only_after_lockDuration
nican0r Jul 16, 2025
1c36c42
fix: remove incorrect spec property
nican0r Jul 21, 2025
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ bin

.gambit
.sumo*
sumo
sumo
.idea

# Coverage files
crytic-export
echidna
medusa
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
[submodule "lib/layerzero-v1"]
path = lib/layerzero-v1
url = https://github.com/LayerZero-Labs/LayerZero-v1
[submodule "lib/chimera"]
path = lib/chimera
url = https://github.com/Recon-Fuzz/chimera
[submodule "lib/setup-helpers"]
path = lib/setup-helpers
url = https://github.com/Recon-Fuzz/setup-helpers
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"solidity.compileUsingRemoteVersion": "v0.8.28",
"solidity.packageDefaultDependenciesContractsDirectory": "src",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.defaultCompiler": "remote"
"solidity.defaultCompiler": "remote",
"recon.defaultFuzzer": "echidna",
"recon.echidna.workers": 4
}
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.

Parameters

Licensor: CAP Labs
Licensor: CAP Labs, Inc.

Licensed Work: CAP-CONTRACTS

Additional Use Grant: Any uses listed

Change Date: The earlier of 2029-04-01 or a date specified
Change Date: The earlier of 2029-06-01 or a date specified

Change License: GNU General Public License v2.0 or later

Expand Down
78 changes: 78 additions & 0 deletions access.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
No files changed, compilation skipped
Script ran successfully.

== Logs ==
Checking Access for Delegation Contract...
Delegation.slash Lender
Delegation.setLastBorrow Lender
Delegation.addAgent 🚨 Dev EOA 🚨
Delegation.modifyAgent 🚨 Dev EOA 🚨
Delegation.registerNetwork 🚨 Dev EOA 🚨
Delegation.setLtvBuffer 🚨 Dev EOA 🚨
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Lender Contract...
Lender.addAsset 🚨 Dev EOA 🚨
Lender.removeAsset 🚨 Dev EOA 🚨
Lender.pauseAsset 🚨 Dev EOA 🚨
Lender.setMinBorrow 🚨 Dev EOA 🚨
Lender.liquidate 🚨 Dev EOA 🚨
Vault.removeAsset 🚨 Dev EOA 🚨
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Oracle Contract...
PriceOracle.setPriceOracleData 🚨 Dev EOA 🚨
PriceOracle.setPriceBackupOracleData 🚨 Dev EOA 🚨
PriceOracle.setStaleness 🚨 Dev EOA 🚨
RateOracle.setMarketOracleData 🚨 Dev EOA 🚨
RateOracle.setUtilizationOracleData 🚨 Dev EOA 🚨
RateOracle.setBenchmarkRate 🚨 Dev EOA 🚨
RateOracle.setRestakerRate 🚨 Dev EOA 🚨
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Access Control Contract...
AccessControl.grantAccess 🚨 Dev EOA 🚨
AccessControl.revokeAccess 🚨 Dev EOA 🚨

Checking Access for Network Contract...
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Network Middleware Contract...
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Fee Auction (cUSD) Contract...
FeeAuction.setStartPrice Lender
FeeAuction.setStartPrice 🚨 Dev EOA 🚨
FeeAuction.setDuration Lender
FeeAuction.setDuration 🚨 Dev EOA 🚨
FeeAuction.setMinStartPrice Lender
FeeAuction.setMinStartPrice 🚨 Dev EOA 🚨
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Fee Receiver (cUSD) Contract...
FeeReceiver.setProtocolFeePercentage 🚨 Dev EOA 🚨
FeeReceiver.setProtocolFeeReceiver 🚨 Dev EOA 🚨

Checking Access for Vault (cUSD) Contract...
FractionalReserve.investAll 🚨 Dev EOA 🚨
FractionalReserve.divestAll 🚨 Dev EOA 🚨
FractionalReserve.setFractionalReserveVault 🚨 Dev EOA 🚨
FractionalReserve.setReserve 🚨 Dev EOA 🚨
Minter.setFeeData 🚨 Dev EOA 🚨
Minter.setRedeemFee 🚨 Dev EOA 🚨
Minter.setWhitelist 🚨 Dev EOA 🚨
Vault.repay Lender
Vault.pauseAsset 🚨 Dev EOA 🚨
Vault.unpauseAsset 🚨 Dev EOA 🚨
Vault.pauseProtocol 🚨 Dev EOA 🚨
Vault.unpauseProtocol 🚨 Dev EOA 🚨
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Staked Vault (cUSD) Contract...
Proxy.upgrade 🚨 Dev EOA 🚨

Checking Access for Debt Token 0 of cUSD vault (Debt USD Coin) Contract...
DebtToken.mint Lender
DebtToken.burn Lender
Proxy.upgrade 🚨 Dev EOA 🚨

25 changes: 25 additions & 0 deletions config/cap-infra.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
{
"1": {
"implems": {
"accessControl": "0xc162E91576246f90ff7E5A3B3c9a0daA05BF1Bd5",
"capToken": "0x031b51BEd47543Aa87D2f74Ab3B1FCd606c99B24",
"debtToken": "0x8868614D7e945ef0b30988B11B63103976edfD6d",
"delegation": "0x65721910DaeA0F28CBaa99964F952c68Cd9bBFef",
"feeAuction": "0xbD12E50Bfaa25735D074DBfDCF73208b9ccD2e43",
"feeReceiver": "0xdDAF4E33Ad99a9Ec7bB453dB0869E064A47255B0",
"lender": "0x48C442cb3cC8503690D39582B0E9F36872126749",
"oracle": "0xA99C0AE66dd5131AE155F25F42ACEb1D1A00ff6F",
"stakedCap": "0x7858d18569E8e232415b07b82B8E1EC896ade1c8"
},
"infra": {
"accessControl": "0x32fd97A5196a6D98656a7F2f191Ae4732ad13170",
"delegation": "0xDB34C0849DE02ABC719740E147e6df4ffE4e8163",
"lender": "0x1036C242ccE7a6632E2f2649F293eaa881835772",
"oracle": "0xe23680f14214c4c9238411d2a85e74A9297ECEF0"
},
"libs": {
"aaveAdapter": "0x05913A7f54Ce258D58D0D57BE38f72ABDF77beA8",
"capTokenAdapter": "0xF7e1B01404676CDb1F2B7faA46D915Aa118918ac",
"chainlinkAdapter": "0x5e3C5D90054ce319694306bb692e06511fC91B6C",
"stakedCapAdapter": "0x0e037A45D28DDF171688954863487FF18635d4ea"
}
},
"17000": {
"implems": {
"accessControl": "0x6FC075b619ABEEC86A37f2a347C5147348c2033d",
Expand Down
12 changes: 6 additions & 6 deletions config/cap-symbiotic.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"11155111": {
"1": {
"adapter": {
"network": "0x7DE28046eE237912DD799a596F7Ea4a66f2A8fa3",
"networkMiddleware": "0xC0cED3b51222507f5fD16861f90cb3dC4F2C41B5",
"slashDuration": 3000
"feeAllowed": 1000,
"network": "0x0000000000000000000000000000000000000000",
"networkMiddleware": "0x0000000000000000000000000000000000000000"
},
"implems": {
"network": "0xB95E2C9d43EB886EDAb0441A6BFf2b59D7e89e5D",
"networkMiddleware": "0xcaadd1b8dD14b1581cB3D3172359C643FaCD82D9"
"network": "0x0000000000000000000000000000000000000000",
"networkMiddleware": "0x0000000000000000000000000000000000000000"
}
},
"17000": {
Expand Down
42 changes: 42 additions & 0 deletions config/cap-vaults-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"cUSD": {
"assets": [
{
"asset": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"decimals": 6,
"name": "USD Coin",
"symbol": "USDC"
}
}
],
"capOFTLockbox": "0x0000000000000000000000000000000000000000",
"capToken": {
"address": "0xF79e8E7Ba2dDb5d0a7D98B1F57fCb8A50436E9aA",
"decimals": 18,
"name": "cap USD",
"symbol": "cUSD"
},
"capZapComposer": "0x0000000000000000000000000000000000000000",
"debtTokens": [
{
"debtToken": {
"address": "0xe20fbE3467436bd6Dd7096aDf0770A0870bAe567",
"decimals": 6,
"name": "Debt USD Coin",
"symbol": "debtUSDC"
}
}
],
"feeAuction": "0x019B65850E3ad55939169845551f3D9C512E52Cd",
"feeReceiver": "0xfdeb31951781effbd2a0c5eb3f1da4da5c1b29ac",
"stakedCapOFTLockbox": "0x0000000000000000000000000000000000000000",
"stakedCapToken": {
"address": "0x5349937179F7B7e499FA58C797a27d000156A489",
"decimals": 18,
"name": "Staked cap USD",
"symbol": "stcUSD"
},
"stakedCapZapComposer": "0x0000000000000000000000000000000000000000"
}
}
4 changes: 3 additions & 1 deletion contracts/access/Access.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ abstract contract Access is IAccess, Initializable, AccessStorageUtils {
/// @dev Check caller has access to a function, revert overwise
/// @param _selector Function selector
function _checkAccess(bytes4 _selector) internal view {
IAccessControl(getAccessStorage().accessControl).checkAccess(_selector, address(this), msg.sender);
bool hasAccess =
IAccessControl(getAccessStorage().accessControl).checkAccess(_selector, address(this), msg.sender);
if (!hasAccess) revert AccessDenied();
}
}
4 changes: 3 additions & 1 deletion contracts/access/AccessControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ contract AccessControl is IAccessControl, UUPSUpgradeable, AccessControlEnumerab
/// @param _selector Function selector
/// @param _contract Contract being called
/// @param _caller Address to check role for
function checkAccess(bytes4 _selector, address _contract, address _caller) external view {
/// @return hasAccess True if access is granted
function checkAccess(bytes4 _selector, address _contract, address _caller) external view returns (bool hasAccess) {
_checkRole(role(_selector, _contract), _caller);
hasAccess = true;
}

/// @notice Grant access to a specific method on a contract
Expand Down
11 changes: 4 additions & 7 deletions contracts/delegation/Delegation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ contract Delegation is IDelegation, UUPSUpgradeable, Access, DelegationStorageUt
if (_liquidationThreshold > 1e27) revert InvalidLiquidationThreshold();
if (_ltv != 0 && _liquidationThreshold < _ltv + $.ltvBuffer) revert LiquidationThresholdTooCloseToLtv();

// If the agent already exists, we revert
if ($.agents.contains(_agent)) revert DuplicateAgent();
if (!$.networks.contains(_network)) revert NetworkDoesntExist();

$.agents.add(_agent);
// If the agent already exists, we revert
if (!$.agents.add(_agent)) revert DuplicateAgent();
$.agentData[_agent].network = _network;
$.agentData[_agent].ltv = _ltv;
$.agentData[_agent].liquidationThreshold = _liquidationThreshold;
Expand Down Expand Up @@ -214,9 +213,7 @@ contract Delegation is IDelegation, UUPSUpgradeable, Access, DelegationStorageUt
if (_network == address(0)) revert InvalidNetwork();

// Check for duplicates
if ($.networks.contains(_network)) revert DuplicateNetwork();

$.networks.add(_network);
if (!$.networks.add(_network)) revert DuplicateNetwork();
emit RegisterNetwork(_network);
}

Expand All @@ -230,7 +227,7 @@ contract Delegation is IDelegation, UUPSUpgradeable, Access, DelegationStorageUt
/// @notice Set the ltv buffer
/// @param _ltvBuffer LTV buffer
function setLtvBuffer(uint256 _ltvBuffer) external checkAccess(this.setLtvBuffer.selector) {
if (_ltvBuffer > 1e27) revert InvalidLtvBuffer();
if (_ltvBuffer > 1e27 || _ltvBuffer <= 0.01e27) revert InvalidLtvBuffer();
getDelegationStorage().ltvBuffer = _ltvBuffer;
emit SetLtvBuffer(_ltvBuffer);
}
Expand Down
2 changes: 2 additions & 0 deletions contracts/deploy/interfaces/DeployConfigs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct ImplementationsConfig {
address oracle;
address debtToken;
address feeAuction;
address feeReceiver;
}

struct InfraConfig {
Expand Down Expand Up @@ -54,6 +55,7 @@ struct VaultConfig {
address capToken; // also called the vault
address stakedCapToken;
address feeAuction;
address feeReceiver;
VaultLzPeriphery lzperiphery;
address[] assets;
address[] debtTokens;
Expand Down
9 changes: 5 additions & 4 deletions contracts/deploy/service/ConfigureOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.0;

import { IOracle } from "../../interfaces/IOracle.sol";
import { IOracleTypes } from "../../interfaces/IOracleTypes.sol";
import { Oracle } from "../../oracle/Oracle.sol";

import { AaveAdapter } from "../../oracle/libraries/AaveAdapter.sol";
Expand All @@ -18,7 +19,7 @@ contract ConfigureOracle {
address asset,
address priceFeed
) internal {
IOracle.OracleData memory oracleData = IOracle.OracleData({
IOracleTypes.OracleData memory oracleData = IOracleTypes.OracleData({
adapter: libs.chainlinkAdapter,
payload: abi.encodeWithSelector(ChainlinkAdapter.price.selector, priceFeed)
});
Expand All @@ -29,7 +30,7 @@ contract ConfigureOracle {
function _initAaveRateOracle(LibsConfig memory libs, InfraConfig memory infra, address asset, address dataProvider)
internal
{
IOracle.OracleData memory oracleData = IOracle.OracleData({
IOracleTypes.OracleData memory oracleData = IOracleTypes.OracleData({
adapter: libs.aaveAdapter,
payload: abi.encodeWithSelector(AaveAdapter.rate.selector, dataProvider, asset)
});
Expand All @@ -43,11 +44,11 @@ contract ConfigureOracle {
}

function _initVaultOracle(LibsConfig memory libs, InfraConfig memory infra, VaultConfig memory vault) internal {
IOracle.OracleData memory cTokenOracleData = IOracle.OracleData({
IOracleTypes.OracleData memory cTokenOracleData = IOracleTypes.OracleData({
adapter: libs.capTokenAdapter,
payload: abi.encodeWithSelector(CapTokenAdapter.price.selector, vault.capToken)
});
IOracle.OracleData memory stcTokenOracleData = IOracle.OracleData({
IOracleTypes.OracleData memory stcTokenOracleData = IOracleTypes.OracleData({
adapter: libs.stakedCapAdapter,
payload: abi.encodeWithSelector(StakedCapAdapter.price.selector, vault.stakedCapToken)
});
Expand Down
3 changes: 3 additions & 0 deletions contracts/deploy/service/DeployImplems.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { FeeAuction } from "../../feeAuction/FeeAuction.sol";
import { Lender } from "../../lendingPool/Lender.sol";
import { DebtToken } from "../../lendingPool/tokens/DebtToken.sol";

import { FeeReceiver } from "../../feeReceiver/FeeReceiver.sol";
import { Oracle } from "../../oracle/Oracle.sol";
import { CapToken } from "../../token/CapToken.sol";
import { StakedCap } from "../../token/StakedCap.sol";

import { ImplementationsConfig } from "../interfaces/DeployConfigs.sol";

contract DeployImplems {
Expand All @@ -24,5 +26,6 @@ contract DeployImplems {
d.oracle = address(new Oracle());
d.debtToken = address(new DebtToken());
d.feeAuction = address(new FeeAuction());
d.feeReceiver = address(new FeeReceiver());
}
}
4 changes: 3 additions & 1 deletion contracts/deploy/service/DeployInfra.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pragma solidity ^0.8.0;
import { AccessControl } from "../../access/AccessControl.sol";

import { Delegation } from "../../delegation/Delegation.sol";

import { FeeReceiver } from "../../feeReceiver/FeeReceiver.sol";
import { Lender } from "../../lendingPool/Lender.sol";
import { Oracle } from "../../oracle/Oracle.sol";

Expand Down Expand Up @@ -36,7 +38,7 @@ contract DeployInfra is ProxyUtils {

// init infra instances
AccessControl(d.accessControl).initialize(users.access_control_admin);
Lender(d.lender).initialize(d.accessControl, d.delegation, d.oracle, 1.33e27, 1 hours, 1 days, 0.1e27, 0.7e27);
Lender(d.lender).initialize(d.accessControl, d.delegation, d.oracle, 1.25e27, 1 hours, 1 days, 0.1e27, 0.9e27);
Oracle(d.oracle).initialize(d.accessControl);
Delegation(d.delegation).initialize(d.accessControl, d.oracle, _delegationEpochDuration);
}
Expand Down
Loading