Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ccf4d58
feat: new premium accounting (src)
avniculae Nov 7, 2025
8b2bd7e
fix: most tests
avniculae Nov 7, 2025
d8774a1
Merge branch 'main' into feat/new-premium-accounting
yan-man Nov 8, 2025
ff0031f
fix: tests
avniculae Nov 8, 2025
36cadbb
fix: remaining tests
avniculae Nov 9, 2025
f470e9c
test: add refresh premium test
avniculae Nov 9, 2025
249e145
fix: restore validation & add fromRayUp
avniculae Nov 9, 2025
d95bc71
Merge branch 'main' into feat/new-premium-accounting
avniculae Nov 12, 2025
1df1b5f
fix: comments
avniculae Nov 12, 2025
afba1de
Merge branch 'main' into feat/new-premium-accounting
avniculae Nov 12, 2025
e35d83f
fix: struct natspec
avniculae Nov 12, 2025
913deec
refactor: liquidateUser (#1000)
avniculae Nov 13, 2025
a59b446
fix: comments
avniculae Nov 13, 2025
2e5a290
fix: comments
avniculae Nov 13, 2025
9c25e4c
fix: comments
avniculae Nov 13, 2025
5367c3e
fix: comments
avniculae Nov 14, 2025
f0513a3
feat: add z3 script for share price post repay
avniculae Nov 14, 2025
7dbdaf2
feat: enhance z3 script
avniculae Nov 14, 2025
fb4cbbf
fix: WadRayMath comments
avniculae Nov 14, 2025
de23c0c
fix: gas snapshot
avniculae Nov 14, 2025
f1f547a
feat: uint200
avniculae Nov 14, 2025
ff113f2
refactor: settlePremiumDebt
avniculae Nov 14, 2025
6f529bb
fix: slots
avniculae Nov 14, 2025
be9a6de
fix: comment
avniculae Nov 14, 2025
7c35e48
docs: fix docs
miguelmtzinf Nov 15, 2025
981b49a
wip: Initial upload
CheyenneAtapour Nov 18, 2025
ada1a84
wip: Try fixing setup
CheyenneAtapour Nov 18, 2025
afa028b
wip: merge in main
CheyenneAtapour Dec 1, 2025
e4ae2ce
fix: Compilation without via ir
CheyenneAtapour Dec 1, 2025
b24f0e7
fix: Tests
CheyenneAtapour Dec 1, 2025
de42d9a
fix: compiler warnings
CheyenneAtapour Dec 1, 2025
658b9d4
chore: Cleanup
CheyenneAtapour Dec 1, 2025
35b3f3a
fix: Omit tests from size check
CheyenneAtapour Dec 1, 2025
c04cd52
feat: Upload invariant code
CheyenneAtapour Dec 9, 2025
63d7aca
feat: Upload invariant code
CheyenneAtapour Dec 9, 2025
e79f2fc
wip: Attempt to debug failing invariant
CheyenneAtapour Dec 10, 2025
8997921
wip: Attempt to debug failing invariant
CheyenneAtapour Dec 10, 2025
de42172
feat: Add isolated failing test
CheyenneAtapour Dec 10, 2025
84546ed
fix: test checks and revert src
CheyenneAtapour Dec 11, 2025
4fc128c
chore: Remove unneded files
CheyenneAtapour Dec 11, 2025
a31bdce
chore: Revert spacing
CheyenneAtapour Dec 11, 2025
8b6f432
chore: cleanup
CheyenneAtapour Dec 11, 2025
b7018c4
Merge remote-tracking branch 'origin/dev' into test/tob-fuzzing
CheyenneAtapour Dec 21, 2025
d3ab5ed
fix: compiler warning
CheyenneAtapour Dec 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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ lcov*
report/

.DS_Store
.venv/
.venv/

tests/tob/medusa-corpus/
tests/tob/echidna-corpus/
crytic-export/
slither_results.json
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ coverage :
make coverage-clean
make coverage-report
make coverage-badge

medusa-fuzz, mf :; medusa fuzz --config medusa.json
echidna-fuzz, ef :; echidna tests/tob/Fuzzing.sol --contract FuzzingTob --config echidna.yaml
16 changes: 16 additions & 0 deletions echidna.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
testMode: assertion # run to detect failed assertions
coverage: true # turns coverage saving "on"
corpusDir: "tests/tob/echidna-corpus"
deployContracts: [["0x1f", "LiquidationLogic"]]
cryticArgs: ["--compile-libraries=(LiquidationLogic,0x1f)"]
testMaxGas: 1250000000 # increases test max gas for future complex operations
codeSize: 0xfffffffffff # increase the code size
testLimit: 600000 # this is the # of iterations Echidna will attempt before it shuts down
workers: 5 # increases the # of workers/threads to run
format: text # this defaults to text mode as opposed to using Echidna UI
maxTimeDelay: 2689117 # this increases the time delay that Echidna can test in the system
maxBlockDelay: 2689117 #this increases the block delay that Echidna can test
seqLen: 100 # this increases the # of sequences Echidna can use to determine exploitability
deployer: "0x30000"
sender: ["0x10000", "0x20000", "0x30000"]
symExec: false
91 changes: 91 additions & 0 deletions medusa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"fuzzing": {
"workers": 10,
"workerResetLimit": 50,
"timeout": 0,
"testLimit": 0,
"shrinkLimit": 2000,
"callSequenceLength": 100,
"pruneFrequency": 5,
"corpusDirectory": "tests/tob/medusa-corpus",
"coverageEnabled": true,
"coverageFormats": ["html"],
"coverageExclusions": [],
"revertReporterEnabled": false,
"targetContracts": ["FuzzingTob"],
"predeployedContracts": {},
"targetContractsBalances": [],
"constructorArgs": {},
"deployerAddress": "0x30000",
"senderAddresses": ["0x10000", "0x20000", "0x30000"],
"blockNumberDelayMax": 60480,
"blockTimestampDelayMax": 604800,
"transactionGasLimit": 12500000,
"testing": {
"stopOnFailedTest": true,
"stopOnFailedContractMatching": false,
"stopOnNoTests": true,
"testAllContracts": false,
"testViewMethods": true,
"verbosity": 1,
"assertionTesting": {
"enabled": true,
"panicCodeConfig": {
"failOnCompilerInsertedPanic": false,
"failOnAssertion": true,
"failOnArithmeticUnderflow": false,
"failOnDivideByZero": false,
"failOnEnumTypeConversionOutOfBounds": false,
"failOnIncorrectStorageAccess": false,
"failOnPopEmptyArray": false,
"failOnOutOfBoundsArrayAccess": false,
"failOnAllocateTooMuchMemory": false,
"failOnCallUninitializedVariable": false
}
},
"propertyTesting": {
"enabled": false,
"testPrefixes": ["property_"]
},
"optimizationTesting": {
"enabled": false,
"testPrefixes": ["optimize_"]
},
"targetFunctionSignatures": [],
"excludeFunctionSignatures": []
},
"chainConfig": {
"codeSizeCheckDisabled": true,
"cheatCodes": {
"cheatCodesEnabled": true,
"enableFFI": false
},
"skipAccountChecks": true,
"forkConfig": {
"forkModeEnabled": false,
"rpcUrl": "",
"rpcBlock": 1,
"poolSize": 20
}
}
},
"compilation": {
"platform": "crytic-compile",
"platformConfig": {
"target": "./tests/tob/Fuzzing.sol",
"solcVersion": "",
"exportDirectory": "",
"args": []
}
},
"slither": {
"useSlither": true,
"cachePath": "slither_results.json",
"args": []
},
"logging": {
"level": "info",
"logDirectory": "",
"noColor": false
}
}
4 changes: 3 additions & 1 deletion src/spoke/Spoke.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {SafeCast} from 'src/dependencies/openzeppelin/SafeCast.sol';
import {SafeERC20, IERC20} from 'src/dependencies/openzeppelin/SafeERC20.sol';
import {IERC20Permit} from 'src/dependencies/openzeppelin/IERC20Permit.sol';
import {SignatureChecker} from 'src/dependencies/openzeppelin/SignatureChecker.sol';
import {AccessManagedUpgradeable} from 'src/dependencies/openzeppelin-upgradeable/AccessManagedUpgradeable.sol';
import {
AccessManagedUpgradeable
} from 'src/dependencies/openzeppelin-upgradeable/AccessManagedUpgradeable.sol';
import {EIP712} from 'src/dependencies/solady/EIP712.sol';
import {MathUtils} from 'src/libraries/math/MathUtils.sol';
import {PercentageMath} from 'src/libraries/math/PercentageMath.sol';
Expand Down
11 changes: 9 additions & 2 deletions tests/Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import {console2 as console} from 'forge-std/console2.sol';

// dependencies
import {AggregatorV3Interface} from 'src/dependencies/chainlink/AggregatorV3Interface.sol';
import {TransparentUpgradeableProxy, ITransparentUpgradeableProxy} from 'src/dependencies/openzeppelin/TransparentUpgradeableProxy.sol';
import {
TransparentUpgradeableProxy,
ITransparentUpgradeableProxy
} from 'src/dependencies/openzeppelin/TransparentUpgradeableProxy.sol';
import {IERC20Metadata} from 'src/dependencies/openzeppelin/IERC20Metadata.sol';
import {SafeCast} from 'src/dependencies/openzeppelin/SafeCast.sol';
import {IERC20Errors} from 'src/dependencies/openzeppelin/IERC20Errors.sol';
Expand Down Expand Up @@ -44,7 +47,11 @@ import {AccessManagerEnumerable} from 'src/access/AccessManagerEnumerable.sol';
import {HubConfigurator, IHubConfigurator} from 'src/hub/HubConfigurator.sol';
import {Hub, IHub, IHubBase} from 'src/hub/Hub.sol';
import {SharesMath} from 'src/hub/libraries/SharesMath.sol';
import {AssetInterestRateStrategy, IAssetInterestRateStrategy, IBasicInterestRateStrategy} from 'src/hub/AssetInterestRateStrategy.sol';
import {
AssetInterestRateStrategy,
IAssetInterestRateStrategy,
IBasicInterestRateStrategy
} from 'src/hub/AssetInterestRateStrategy.sol';

// spoke
import {Spoke, ISpoke, ISpokeBase} from 'src/spoke/Spoke.sol';
Expand Down
Loading
Loading