uups-checker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (670) hide show
  1. package/.gitmodules +6 -0
  2. package/AIFI_AUDIT.md +220 -0
  3. package/ALL_AUDITS_SUMMARY.md +366 -0
  4. package/ALPHA_PROXY_CRITICAL_FINDING.md +136 -0
  5. package/ALPHA_PROXY_FINAL_ANALYSIS.md +213 -0
  6. package/ALPHA_PROXY_FINAL_VERDICT.md +233 -0
  7. package/ALPHA_PROXY_SELFDESTRUCT_EXPLOIT.md +161 -0
  8. package/ARIA-foundry-test.txt +9 -0
  9. package/ARIA-mythril-analysis.txt +20 -0
  10. package/ARIA-slither-analysis.txt +38 -0
  11. package/ARIA_AI_SECURITY_AUDIT.md +290 -0
  12. package/ARIA_VERIFIED_AUDIT.md +259 -0
  13. package/ARIA_VERIFIED_slither.txt +76 -0
  14. package/ARIVA_source.txt +1 -0
  15. package/ARK_AUDIT.md +349 -0
  16. package/BANANA_AUDIT.md +365 -0
  17. package/BAS_AUDIT.md +451 -0
  18. package/BAS_TOKEN_AUDIT.md +235 -0
  19. package/BCE_EXPLOIT_ANALYSIS.md +165 -0
  20. package/BEEFY_BNB_CHAIN_ANALYSIS.md +488 -0
  21. package/BEEFY_MONAD_ANALYSIS.md +239 -0
  22. package/BEEFY_STAKING_ANALYSIS.md +136 -0
  23. package/BEEFY_XVS_WBNB_ACTUAL_FINDINGS.md +223 -0
  24. package/BEEFY_XVS_WBNB_CRITICAL_FINDINGS.md +269 -0
  25. package/BLOCKSEC_ATTACK_KNOWLEDGE_BASE.md +771 -0
  26. package/BRISE_ANALYSIS.txt +31 -0
  27. package/BRISE_BSC_DAPPS.txt +68 -0
  28. package/BRISE_EXPLOITS_FOUND.md +98 -0
  29. package/BRISE_REAL_EXPLOITS.md +115 -0
  30. package/BRISE_WHITEHAT_REPORT.md +162 -0
  31. package/BRISEstake_Analysis.txt +95 -0
  32. package/BSCSLOCKTOKEN_CRITICAL_FINDING.md +240 -0
  33. package/BSW_BISWAP_SECURITY_AUDIT.md +330 -0
  34. package/BTCST_FINAL_VERDICT.md +319 -0
  35. package/BTCST_MINING_REBASE_ANALYSIS.md +229 -0
  36. package/BTCST_ROUNDING_DEEP_DIVE.md +293 -0
  37. package/BTCST_ROUNDING_FINAL_VERDICT.md +9 -0
  38. package/BTCST_SECURITY_ANALYSIS.md +391 -0
  39. package/BTR_AUDIT.md +210 -0
  40. package/BeamBridge-analysis.md +226 -0
  41. package/BeamToken-analysis.md +201 -0
  42. package/BitgertSwap_Investigation.txt +107 -0
  43. package/CEEK_STAKING_ANALYSIS.md +0 -0
  44. package/CHAINBASE_AUDIT.md +422 -0
  45. package/COMPLETE_AUDIT_SUMMARY.md +342 -0
  46. package/CORRECTED_ANALYSIS.txt +115 -0
  47. package/DBXEN_COMPARISON_SUMMARY.md +232 -0
  48. package/DBXEN_EXPLOIT_ANALYSIS.md +530 -0
  49. package/DOPFairLaunch_raw.json +29 -0
  50. package/DOPFairLaunch_source.txt +0 -0
  51. package/DOP_BRIDGE_FINAL_ANALYSIS.txt +86 -0
  52. package/DOP_BUSD_LP_ANALYSIS.txt +44 -0
  53. package/DOP_FAIRLAUNCH_ANALYSIS.txt +61 -0
  54. package/DOP_FAIRLAUNCH_FINAL_VERDICT.txt +113 -0
  55. package/DOP_STAKING_CONTRACT_ANALYSIS.txt +67 -0
  56. package/DSYNC_ECOSYSTEM_ANALYSIS.md +221 -0
  57. package/DSyncStaking-exploit-analysis.md +153 -0
  58. package/DSyncVault-analysis.md +120 -0
  59. package/DUSD_PROXY_AUDIT.md +407 -0
  60. package/DXSALE_LOCK_AUDIT.md +0 -0
  61. package/DXSaleLock_bytecode.txt +1 -0
  62. package/ECHIDNA_QUICK_START.md +101 -0
  63. package/ELEPHANT_ECOSYSTEM_AUDIT_PLAN.md +159 -0
  64. package/ELEPHANT_ECOSYSTEM_COMPREHENSIVE_AUDIT.md +427 -0
  65. package/ELEPHANT_SECURITY_ANALYSIS.md +209 -0
  66. package/ELEPHANT_VULNERABILITIES_EXPLAINED.md +455 -0
  67. package/EXPLOIT_FIX.md +300 -0
  68. package/EXPLOIT_INSTRUCTIONS.md +273 -0
  69. package/EXPLOIT_SUMMARY.md +285 -0
  70. package/EXPLOIT_SUMMARY.txt +175 -0
  71. package/FALCON_FINANCE_AUDIT.md +258 -0
  72. package/FANDOM_AUDIT.md +359 -0
  73. package/FEE_ON_TRANSFER_ANALYSIS.md +228 -0
  74. package/FINAL_AUDIT_REPORT.md +0 -0
  75. package/FOLIO_PROXY_AUDIT.md +299 -0
  76. package/FOT_EXPLOIT_RESULTS.txt +110 -0
  77. package/FOT_TOKENS_AUDITED.md +103 -0
  78. package/HEGIC-mythril-analysis.txt +39 -0
  79. package/HEGIC_COMPLETE_ANALYSIS.md +343 -0
  80. package/HOTCROSS_SWAP_EXPLOIT_ANALYSIS.md +123 -0
  81. package/ICECREAMSWAP_EXPLOITS.md +259 -0
  82. package/IMMUNEFI_REPORT.md +314 -0
  83. package/KCCPAD_EXPLOIT_GUIDE.md +285 -0
  84. package/KEL_CEL_EXPLOIT_ANALYSIS.md +0 -0
  85. package/KOGE_AUDIT.md +328 -0
  86. package/LENDFLARE_ANALYSIS.md +239 -0
  87. package/LENDFLARE_ECHIDNA_GUIDE.md +356 -0
  88. package/LENDFLARE_EXPLOIT_INSTRUCTIONS.md +297 -0
  89. package/LENDFLARE_EXPLOIT_SUMMARY.md +292 -0
  90. package/LENDFLARE_FLASHLOAN_GUIDE.md +383 -0
  91. package/LENDFLARE_FUZZING_RESULTS.md +252 -0
  92. package/LENDFLARE_HONEYPOT_BYPASS_ANALYSIS.md +420 -0
  93. package/LENDFLARE_MANUAL_FUZZING.md +324 -0
  94. package/LENDFLARE_MYTHRIL_ANALYSIS.md +339 -0
  95. package/LENDFLARE_V3_BYPASS.md +296 -0
  96. package/LFTDECOMPILE.txt +14478 -0
  97. package/LFT_ACCOUNTING_ANALYSIS.md +0 -0
  98. package/LFT_ACCOUNTING_BUG_ANALYSIS.md +426 -0
  99. package/LFT_BACKDOOR_DEEP_DIVE.md +0 -0
  100. package/LFT_CRITICAL_EXPLOIT_CONFIRMED.md +428 -0
  101. package/LFT_EXPLOIT_VISUAL.md +253 -0
  102. package/LFT_QUICK_SUMMARY.md +124 -0
  103. package/LFT_REVERSE_EXPLOIT_ANALYSIS.md +521 -0
  104. package/MGO_AUDIT_REPORT.md +420 -0
  105. package/MYTHRIL_FINAL_REPORT.md +306 -0
  106. package/MYTHRIL_SLITHER_SUMMARY.md +244 -0
  107. package/NETX_MIGRATION_AUDIT.md +0 -0
  108. package/NPM_PUBLISH_GUIDE.md +0 -0
  109. package/NRV_CRITICAL_EXPLOIT.txt +143 -0
  110. package/NetX_Analysis.txt +76 -0
  111. package/NetX_Migration_bytecode.txt +1 -0
  112. package/NetX_Migration_source.txt +0 -0
  113. package/NetX_Token_source.txt +0 -0
  114. package/NetxWhitehatRescue +22 -0
  115. package/OILER_ATTACK_VISUAL.md +351 -0
  116. package/OILER_BLOCKSEC_TEST_RESULTS.md +421 -0
  117. package/OILER_DEEP_ANALYSIS.md +212 -0
  118. package/OILER_FINAL_EXPLOIT_REPORT.md +241 -0
  119. package/OILER_FINAL_VERDICT.md +339 -0
  120. package/OILER_REENTRANCY_EXPLAINED.md +638 -0
  121. package/OILER_REENTRANCY_FINAL_SUMMARY.md +391 -0
  122. package/OILER_REENTRANCY_REALITY_CHECK.md +393 -0
  123. package/OILER_REENTRANCY_STEP_BY_STEP.md +597 -0
  124. package/OILER_STAKING_MAINNET_ANALYSIS.md +366 -0
  125. package/OILER_STAKING_SECURITY_ANALYSIS.md +409 -0
  126. package/PANCAKESWAP_UNDERFLOW_HUNTING.md +317 -0
  127. package/POLS_MULTICHAIN_AUDIT.md +0 -0
  128. package/POSI_STAKING_AUDIT.md +0 -0
  129. package/PROXY2_SECURITY_ANALYSIS.md +0 -0
  130. package/Proxy2TACS +29748 -0
  131. package/QUICK_START.md +240 -0
  132. package/RAMP_SECURITY_ANALYSIS.md +0 -0
  133. package/README.md +238 -0
  134. package/REAUDIT_MASTER_LIST.txt +15 -0
  135. package/RING_analysis.txt +212 -0
  136. package/RPC +4 -0
  137. package/RULES.txt +20 -0
  138. package/SIREN_AUDIT.md +186 -0
  139. package/SYNC_EXPLOIT_README.md +0 -0
  140. package/SYNC_TOKEN_EXPLOIT_REPORT.md +224 -0
  141. package/TLM_raw.html +0 -0
  142. package/TLM_raw.txt +0 -0
  143. package/TLM_response.json +1 -0
  144. package/TRADOOR_AUDIT.md +253 -0
  145. package/TRUNK_AUDIT.md +285 -0
  146. package/UNIBASE_AUDIT.md +241 -0
  147. package/UNLOCK_ANALYSIS.md +0 -0
  148. package/UNLOCK_EXPLOIT.md +49 -0
  149. package/UNLOCK_EXPLOIT_ANALYSIS.md +0 -0
  150. package/UPS +232 -0
  151. package/UUPSCHECKER +208 -0
  152. package/VAULT_PROXY_AUDIT.md +457 -0
  153. package/VAULT_PROXY_FINAL_VERDICT.md +0 -0
  154. package/VERIFIED_EXPLOITS_FINAL.txt +146 -0
  155. package/WKEYDAO2_AUDIT.md +245 -0
  156. package/WSG_AUDIT.md +0 -0
  157. package/XFI_DEEP_ANALYSIS.md +327 -0
  158. package/YOOSHI_EXPLOIT_GUIDE.md +119 -0
  159. package/YSDAO_EXPLOIT_GUIDE.md +0 -0
  160. package/agent-4-bundle.md +22490 -0
  161. package/alpha-proxy-echidna.txt +1 -0
  162. package/alpha-proxy-fuzz-results.txt +81 -0
  163. package/alpha-proxy-mythril.txt +2 -0
  164. package/analyze-btcst-farm.js +54 -0
  165. package/analyze-dxsale-lock.js +75 -0
  166. package/analyze-elephant.js +69 -0
  167. package/analyze-fara-rewards.js +109 -0
  168. package/analyze-fara-storage.js +83 -0
  169. package/analyze-lft-transaction.js +158 -0
  170. package/analyze-lock-bytecode.js +59 -0
  171. package/analyze-shegic.js +0 -0
  172. package/analyze-staking-abi.js +0 -0
  173. package/analyze-sxp.js +57 -0
  174. package/analyze-tlm.js +76 -0
  175. package/analyze-trumpet.js +98 -0
  176. package/analyze-unlimited-nft.js +108 -0
  177. package/analyze_elephant.sh +27 -0
  178. package/analyze_vault.sh +32 -0
  179. package/aria-bytecode.txt +1 -0
  180. package/aria_response.json +1 -0
  181. package/ark_temp/README.md +66 -0
  182. package/ark_temp/lib/forge-std/.gitattributes +1 -0
  183. package/ark_temp/lib/forge-std/.github/CODEOWNERS +1 -0
  184. package/ark_temp/lib/forge-std/.github/dependabot.yml +6 -0
  185. package/ark_temp/lib/forge-std/.github/workflows/ci.yml +125 -0
  186. package/ark_temp/lib/forge-std/.github/workflows/sync.yml +36 -0
  187. package/ark_temp/lib/forge-std/CONTRIBUTING.md +193 -0
  188. package/ark_temp/lib/forge-std/LICENSE-APACHE +203 -0
  189. package/ark_temp/lib/forge-std/LICENSE-MIT +25 -0
  190. package/ark_temp/lib/forge-std/README.md +314 -0
  191. package/ark_temp/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
  192. package/ark_temp/lib/forge-std/package.json +16 -0
  193. package/ark_temp/lib/forge-std/scripts/vm.py +636 -0
  194. package/audits/AiFi-security-audit-20260326.md +499 -0
  195. package/audits/BasedAI-Brains-security-audit-20260324.md +651 -0
  196. package/audits/BinanceAlphaWallet-pashov-ai-audit-report-20260324-170000.md +362 -0
  197. package/audits/DGToken-security-audit-20260324.md +376 -0
  198. package/audits/DSyncStaking-audit-part1.md +161 -0
  199. package/audits/DSyncStaking-security-audit-20260324.md +547 -0
  200. package/audits/DecompiledERC20-security-audit-20260325.md +397 -0
  201. package/audits/DegenVC-security-audit-20260324.md +585 -0
  202. package/audits/DelreyInu-security-audit-20260324.md +463 -0
  203. package/audits/DestraNetwork-security-audit-20260324.md +705 -0
  204. package/audits/DomiToken-security-audit-20260324.md +514 -0
  205. package/audits/LendFlareToken-security-audit-20260325.md +197 -0
  206. package/audits/LockReleaseTokenPool-security-audit-20260324.md +482 -0
  207. package/audits/MOG-pashov-ai-audit-report-20260324-164900.md +229 -0
  208. package/audits/PAALAI-security-audit-20260324.md +475 -0
  209. package/audits/PAR-security-audit-20260325.md +311 -0
  210. package/audits/PepeCoinStaking-security-audit-20260324.md +358 -0
  211. package/audits/StakingPool-security-audit-20260324.md +517 -0
  212. package/audits/SyncToken-security-audit-20260324.md +778 -0
  213. package/audits/UndeadToken-decompiled-security-audit-20260324.md +485 -0
  214. package/audits/UnknownToken-decompiled-security-audit-20260324.md +647 -0
  215. package/audits/XFIStaking-security-audit-20260324.md +682 -0
  216. package/audits/Xfinance-security-audit-20260324.md +463 -0
  217. package/audits/basedAIFarm-security-audit-20260324.md +330 -0
  218. package/audits/pepeCoin-security-audit-20260324.md +462 -0
  219. package/bin/ups +232 -0
  220. package/binance-wallet-exploit/.env.example +2 -0
  221. package/binance-wallet-exploit/EXECUTIVE_SUMMARY.md +272 -0
  222. package/binance-wallet-exploit/EXPLOIT_SUMMARY.md +104 -0
  223. package/binance-wallet-exploit/FINAL_ANALYSIS.md +326 -0
  224. package/binance-wallet-exploit/FLASHLOAN_ATTACK.md +292 -0
  225. package/binance-wallet-exploit/HONEYPOT_REPORT.md +526 -0
  226. package/binance-wallet-exploit/INVESTIGATION_COMPLETE.md +362 -0
  227. package/binance-wallet-exploit/LENDFLARE_EXPLOIT.md +219 -0
  228. package/binance-wallet-exploit/LENDFLARE_FINAL_ATTACK.md +307 -0
  229. package/binance-wallet-exploit/LENDFLARE_REAL_EXPLOIT.md +286 -0
  230. package/binance-wallet-exploit/LENDFLARE_RUGPULL.md +269 -0
  231. package/binance-wallet-exploit/LFT_ANALYSIS.md +206 -0
  232. package/binance-wallet-exploit/QUICK_START.md +75 -0
  233. package/binance-wallet-exploit/README.md +195 -0
  234. package/binance-wallet-exploit/REAL_TX_EXPLOIT_ANALYSIS.md +271 -0
  235. package/binance-wallet-exploit/REMIX_INSTRUCTIONS.md +223 -0
  236. package/binance-wallet-exploit/TEST_RESULTS.md +203 -0
  237. package/binance-wallet-exploit/cache/solidity-files-cache.json +1 -0
  238. package/binance-wallet-exploit/cache/test-failures +1 -0
  239. package/binance-wallet-exploit/lib/forge-std/.gitattributes +1 -0
  240. package/binance-wallet-exploit/lib/forge-std/.github/CODEOWNERS +1 -0
  241. package/binance-wallet-exploit/lib/forge-std/.github/dependabot.yml +6 -0
  242. package/binance-wallet-exploit/lib/forge-std/.github/workflows/ci.yml +125 -0
  243. package/binance-wallet-exploit/lib/forge-std/.github/workflows/sync.yml +36 -0
  244. package/binance-wallet-exploit/lib/forge-std/CONTRIBUTING.md +193 -0
  245. package/binance-wallet-exploit/lib/forge-std/LICENSE-APACHE +203 -0
  246. package/binance-wallet-exploit/lib/forge-std/LICENSE-MIT +25 -0
  247. package/binance-wallet-exploit/lib/forge-std/README.md +314 -0
  248. package/binance-wallet-exploit/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
  249. package/binance-wallet-exploit/lib/forge-std/package.json +16 -0
  250. package/binance-wallet-exploit/lib/forge-std/scripts/vm.py +636 -0
  251. package/binance-wallet-exploit/out/build-info/1e9aa7e86cf56962.json +1 -0
  252. package/binance-wallet-exploit/out/build-info/6f56f10e9d7b56eb.json +1 -0
  253. package/binance-wallet-exploit/out/build-info/7edba961ff697a24.json +1 -0
  254. package/binance-wallet-exploit/out/build-info/8c27fe3efea2f2e7.json +1 -0
  255. package/binance-wallet-exploit/out/build-info/978b680daffec63a.json +1 -0
  256. package/binance-wallet-exploit/out/build-info/9806b900b5672d0c.json +1 -0
  257. package/binance-wallet-exploit/out/build-info/b4b9ff36e9b3fc27.json +1 -0
  258. package/binance-wallet-exploit/out/build-info/b6f4df9ae05c0812.json +1 -0
  259. package/binance-wallet-exploit/out/build-info/c88dbc86551f7b5c.json +1 -0
  260. package/binance-wallet-exploit/out/build-info/e9657504010623db.json +1 -0
  261. package/cache/fuzz/failures/ARIAVerifiedFuzzTest/testFuzz_ApprovalRaceCondition +1 -0
  262. package/cache/fuzz/failures/HotCrossSwapFuzzTest/testFuzz_DirectTransferExploit +1 -0
  263. package/cache/fuzz/failures/HotCrossSwapFuzzTest/testFuzz_LargeSwapDrain +1 -0
  264. package/cache/fuzz/failures/LendFlareFuzz/testFuzz_ApprovalExploit +1 -0
  265. package/cache/fuzz/failures/LendFlareFuzz/testFuzz_BalanceManipulation +1 -0
  266. package/cache/fuzz/failures/LendFlareFuzz/testFuzz_RateManipulation +1 -0
  267. package/cache/fuzz/failures/LendFlareFuzz/testFuzz_StorageManipulation +1 -0
  268. package/cache/fuzz/failures/PARFuzzTest/testFuzz_OverflowTransfer +1 -0
  269. package/cache/fuzz/failures/PARFuzzTest/testFuzz_Transfer +1 -0
  270. package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_FrontrunAddfunds +1 -0
  271. package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_RewardOverflow +1 -0
  272. package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_RoundingExploit +1 -0
  273. package/cache/fuzz/failures/XFIDeepFuzz/testFuzz_WithdrawLimit +1 -0
  274. package/cache/solidity-files-cache.json +1 -0
  275. package/cache/test-failures +1 -0
  276. package/calculate-elephant-flashloan.js +195 -0
  277. package/check-address-approval.js +112 -0
  278. package/check-alpha-proxy.js +42 -0
  279. package/check-arbitrage.js +155 -0
  280. package/check-aria-token.js +47 -0
  281. package/check-ark.sh +20 -0
  282. package/check-btcst-mining.js +75 -0
  283. package/check-btcst-pools.js +163 -0
  284. package/check-btcst.js +88 -0
  285. package/check-caller.js +26 -0
  286. package/check-ceek-lp.js +73 -0
  287. package/check-ceek.js +47 -0
  288. package/check-dxsale-address.js +35 -0
  289. package/check-fara-exploit-timing.js +56 -0
  290. package/check-fara-real-exploit.js +73 -0
  291. package/check-flashloan-limits.js +129 -0
  292. package/check-kel-cel-pool.js +91 -0
  293. package/check-lax-staking.js +41 -0
  294. package/check-lendflare.js +165 -0
  295. package/check-lft-accounting.js +109 -0
  296. package/check-lft-roles.js +165 -0
  297. package/check-lock-time.js +47 -0
  298. package/check-min-stake.js +73 -0
  299. package/check-mystery-contract.js +52 -0
  300. package/check-next-token.js +50 -0
  301. package/check-nora-lock.js +67 -0
  302. package/check-oiler-approvals.js +116 -0
  303. package/check-oiler-proxy.js +73 -0
  304. package/check-oiler-staking.js +117 -0
  305. package/check-proxy-simple.js +71 -0
  306. package/check-recent-stakes.js +54 -0
  307. package/check-shegic-holdings.js +67 -0
  308. package/check-snowcrash-ecosystem.js +83 -0
  309. package/check-sync-lp.js +97 -0
  310. package/check-sync-stake.js +42 -0
  311. package/check-tlm.js +37 -0
  312. package/check-token-pools.js +146 -0
  313. package/check-trunk-depeg.js +181 -0
  314. package/check-tusd-decimals.js +58 -0
  315. package/check-user-storage-deep.js +81 -0
  316. package/check-welephant-pools.js +130 -0
  317. package/check-xfi-pool.js +75 -0
  318. package/check-zypher.js +32 -0
  319. package/check_proxy.sh +36 -0
  320. package/compare-tlm-chains.js +90 -0
  321. package/contract_0x05f2.html +6025 -0
  322. package/contract_0x3720.html +6361 -0
  323. package/contract_0x928e.html +5606 -0
  324. package/contract_0xc42d.html +5304 -0
  325. package/contract_page.html +5789 -0
  326. package/decode-stake-tx.js +50 -0
  327. package/deep-analyze-lock.js +82 -0
  328. package/dune_uups_proxy_query.sql +42 -0
  329. package/dune_uups_vulnerable_query.sql +0 -0
  330. package/echidna/alpha-proxy.yaml +14 -0
  331. package/echidna/elephant.yaml +7 -0
  332. package/echidna/lendflare.yaml +42 -0
  333. package/echidna.config.yaml +12 -0
  334. package/elephant_raw.json +1 -0
  335. package/eps_raw.json +1 -0
  336. package/exploit/.github/workflows/test.yml +38 -0
  337. package/exploit/.gitmodules +3 -0
  338. package/exploit/README.md +66 -0
  339. package/exploit/foundry.lock +8 -0
  340. package/exploit/lib/forge-std/.gitattributes +1 -0
  341. package/exploit/lib/forge-std/.github/CODEOWNERS +1 -0
  342. package/exploit/lib/forge-std/.github/dependabot.yml +6 -0
  343. package/exploit/lib/forge-std/.github/workflows/ci.yml +125 -0
  344. package/exploit/lib/forge-std/.github/workflows/sync.yml +36 -0
  345. package/exploit/lib/forge-std/CONTRIBUTING.md +193 -0
  346. package/exploit/lib/forge-std/LICENSE-APACHE +203 -0
  347. package/exploit/lib/forge-std/LICENSE-MIT +25 -0
  348. package/exploit/lib/forge-std/README.md +314 -0
  349. package/exploit/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
  350. package/exploit/lib/forge-std/package.json +16 -0
  351. package/exploit/lib/forge-std/scripts/vm.py +636 -0
  352. package/exploit_analysis.txt +51 -0
  353. package/extract_contract.py +21 -0
  354. package/extract_elephant_contracts.py +24 -0
  355. package/fara-staking-bytecode.txt +1 -0
  356. package/fara-staking-raw.txt +1 -0
  357. package/fetch-aria.js +46 -0
  358. package/fetch-contract.js +50 -0
  359. package/fetch-shegic-source.js +86 -0
  360. package/fetch-snowcrash.js +44 -0
  361. package/fetch-staking-source.js +53 -0
  362. package/fetch-tlm.js +60 -0
  363. package/fetch_elephant_source.py +32 -0
  364. package/find-ceek-staking.js +21 -0
  365. package/find-exploit-tx.js +88 -0
  366. package/find-oiler-holders.js +100 -0
  367. package/find-tlm-holder.js +36 -0
  368. package/find-vulnerable-fund.js +94 -0
  369. package/foundry.lock +8 -0
  370. package/fuzz-all.sh +53 -0
  371. package/get-aria-contract.py +40 -0
  372. package/get-lft-holders.js +89 -0
  373. package/get-tlm-source.sh +8 -0
  374. package/harvest_txs.json +1 -0
  375. package/lft-bytecode-raw.txt +1 -0
  376. package/lft-bytecode.json +1 -0
  377. package/lft-impl.bin +1 -0
  378. package/lft-implementation-bytecode.txt +1 -0
  379. package/lib/forge-std/.gitattributes +1 -0
  380. package/lib/forge-std/.github/CODEOWNERS +1 -0
  381. package/lib/forge-std/.github/dependabot.yml +6 -0
  382. package/lib/forge-std/.github/workflows/ci.yml +125 -0
  383. package/lib/forge-std/.github/workflows/sync.yml +36 -0
  384. package/lib/forge-std/CONTRIBUTING.md +193 -0
  385. package/lib/forge-std/LICENSE-APACHE +203 -0
  386. package/lib/forge-std/LICENSE-MIT +25 -0
  387. package/lib/forge-std/README.md +314 -0
  388. package/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
  389. package/lib/forge-std/package.json +16 -0
  390. package/lib/forge-std/scripts/vm.py +636 -0
  391. package/lib/openzeppelin-contracts/.changeset/config.json +12 -0
  392. package/lib/openzeppelin-contracts/.codecov.yml +12 -0
  393. package/lib/openzeppelin-contracts/.editorconfig +21 -0
  394. package/lib/openzeppelin-contracts/.eslintrc +20 -0
  395. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
  396. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml +4 -0
  397. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
  398. package/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  399. package/lib/openzeppelin-contracts/.github/actions/gas-compare/action.yml +49 -0
  400. package/lib/openzeppelin-contracts/.github/actions/setup/action.yml +21 -0
  401. package/lib/openzeppelin-contracts/.github/actions/storage-layout/action.yml +55 -0
  402. package/lib/openzeppelin-contracts/.github/workflows/actionlint.yml +18 -0
  403. package/lib/openzeppelin-contracts/.github/workflows/changeset.yml +28 -0
  404. package/lib/openzeppelin-contracts/.github/workflows/checks.yml +118 -0
  405. package/lib/openzeppelin-contracts/.github/workflows/docs.yml +19 -0
  406. package/lib/openzeppelin-contracts/.github/workflows/formal-verification.yml +68 -0
  407. package/lib/openzeppelin-contracts/.github/workflows/release-cycle.yml +214 -0
  408. package/lib/openzeppelin-contracts/.github/workflows/upgradeable.yml +34 -0
  409. package/lib/openzeppelin-contracts/.gitmodules +7 -0
  410. package/lib/openzeppelin-contracts/.mocharc.js +4 -0
  411. package/lib/openzeppelin-contracts/.prettierrc +15 -0
  412. package/lib/openzeppelin-contracts/.solcover.js +13 -0
  413. package/lib/openzeppelin-contracts/CHANGELOG.md +972 -0
  414. package/lib/openzeppelin-contracts/CODE_OF_CONDUCT.md +73 -0
  415. package/lib/openzeppelin-contracts/CONTRIBUTING.md +36 -0
  416. package/lib/openzeppelin-contracts/GUIDELINES.md +148 -0
  417. package/lib/openzeppelin-contracts/LICENSE +22 -0
  418. package/lib/openzeppelin-contracts/README.md +107 -0
  419. package/lib/openzeppelin-contracts/RELEASING.md +45 -0
  420. package/lib/openzeppelin-contracts/SECURITY.md +42 -0
  421. package/lib/openzeppelin-contracts/audits/2017-03.md +292 -0
  422. package/lib/openzeppelin-contracts/audits/2018-10.pdf +0 -0
  423. package/lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf +0 -0
  424. package/lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf +0 -0
  425. package/lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf +0 -0
  426. package/lib/openzeppelin-contracts/audits/2023-10-v5.0.pdf +0 -0
  427. package/lib/openzeppelin-contracts/audits/README.md +17 -0
  428. package/lib/openzeppelin-contracts/certora/Makefile +54 -0
  429. package/lib/openzeppelin-contracts/certora/README.md +60 -0
  430. package/lib/openzeppelin-contracts/certora/diff/access_manager_AccessManager.sol.patch +97 -0
  431. package/lib/openzeppelin-contracts/certora/reports/2021-10.pdf +0 -0
  432. package/lib/openzeppelin-contracts/certora/reports/2022-03.pdf +0 -0
  433. package/lib/openzeppelin-contracts/certora/reports/2022-05.pdf +0 -0
  434. package/lib/openzeppelin-contracts/certora/run.js +160 -0
  435. package/lib/openzeppelin-contracts/certora/specs/AccessControl.spec +119 -0
  436. package/lib/openzeppelin-contracts/certora/specs/AccessControlDefaultAdminRules.spec +464 -0
  437. package/lib/openzeppelin-contracts/certora/specs/DoubleEndedQueue.spec +300 -0
  438. package/lib/openzeppelin-contracts/certora/specs/ERC20.spec +352 -0
  439. package/lib/openzeppelin-contracts/certora/specs/ERC20FlashMint.spec +55 -0
  440. package/lib/openzeppelin-contracts/certora/specs/ERC20Wrapper.spec +198 -0
  441. package/lib/openzeppelin-contracts/certora/specs/ERC721.spec +679 -0
  442. package/lib/openzeppelin-contracts/certora/specs/EnumerableMap.spec +333 -0
  443. package/lib/openzeppelin-contracts/certora/specs/EnumerableSet.spec +246 -0
  444. package/lib/openzeppelin-contracts/certora/specs/Initializable.spec +165 -0
  445. package/lib/openzeppelin-contracts/certora/specs/Ownable.spec +77 -0
  446. package/lib/openzeppelin-contracts/certora/specs/Ownable2Step.spec +108 -0
  447. package/lib/openzeppelin-contracts/certora/specs/Pausable.spec +96 -0
  448. package/lib/openzeppelin-contracts/certora/specs/TimelockController.spec +274 -0
  449. package/lib/openzeppelin-contracts/certora/specs/helpers/helpers.spec +7 -0
  450. package/lib/openzeppelin-contracts/certora/specs/methods/IAccessControl.spec +8 -0
  451. package/lib/openzeppelin-contracts/certora/specs/methods/IAccessControlDefaultAdminRules.spec +36 -0
  452. package/lib/openzeppelin-contracts/certora/specs/methods/IERC20.spec +11 -0
  453. package/lib/openzeppelin-contracts/certora/specs/methods/IERC2612.spec +5 -0
  454. package/lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashBorrower.spec +3 -0
  455. package/lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashLender.spec +5 -0
  456. package/lib/openzeppelin-contracts/certora/specs/methods/IERC5313.spec +3 -0
  457. package/lib/openzeppelin-contracts/certora/specs/methods/IERC721.spec +17 -0
  458. package/lib/openzeppelin-contracts/certora/specs/methods/IERC721Receiver.spec +3 -0
  459. package/lib/openzeppelin-contracts/certora/specs/methods/IOwnable.spec +5 -0
  460. package/lib/openzeppelin-contracts/certora/specs/methods/IOwnable2Step.spec +7 -0
  461. package/lib/openzeppelin-contracts/certora/specs.json +86 -0
  462. package/lib/openzeppelin-contracts/contracts/access/README.adoc +43 -0
  463. package/lib/openzeppelin-contracts/contracts/finance/README.adoc +14 -0
  464. package/lib/openzeppelin-contracts/contracts/governance/README.adoc +167 -0
  465. package/lib/openzeppelin-contracts/contracts/interfaces/README.adoc +82 -0
  466. package/lib/openzeppelin-contracts/contracts/metatx/README.adoc +12 -0
  467. package/lib/openzeppelin-contracts/contracts/package.json +32 -0
  468. package/lib/openzeppelin-contracts/contracts/proxy/README.adoc +87 -0
  469. package/lib/openzeppelin-contracts/contracts/token/ERC1155/README.adoc +41 -0
  470. package/lib/openzeppelin-contracts/contracts/token/ERC20/README.adoc +67 -0
  471. package/lib/openzeppelin-contracts/contracts/token/ERC721/README.adoc +67 -0
  472. package/lib/openzeppelin-contracts/contracts/token/common/README.adoc +10 -0
  473. package/lib/openzeppelin-contracts/contracts/utils/README.adoc +88 -0
  474. package/lib/openzeppelin-contracts/contracts/vendor/compound/LICENSE +11 -0
  475. package/lib/openzeppelin-contracts/docs/README.md +16 -0
  476. package/lib/openzeppelin-contracts/docs/antora.yml +7 -0
  477. package/lib/openzeppelin-contracts/docs/config.js +21 -0
  478. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
  479. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
  480. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
  481. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
  482. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
  483. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
  484. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
  485. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
  486. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
  487. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
  488. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
  489. package/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +23 -0
  490. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +204 -0
  491. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/backwards-compatibility.adoc +48 -0
  492. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/crowdsales.adoc +11 -0
  493. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/drafts.adoc +19 -0
  494. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +145 -0
  495. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +71 -0
  496. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +77 -0
  497. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +214 -0
  498. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +79 -0
  499. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +77 -0
  500. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/faq.adoc +13 -0
  501. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +240 -0
  502. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +79 -0
  503. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +31 -0
  504. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +77 -0
  505. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +185 -0
  506. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc +15 -0
  507. package/lib/openzeppelin-contracts/docs/templates/contract.hbs +111 -0
  508. package/lib/openzeppelin-contracts/docs/templates/helpers.js +46 -0
  509. package/lib/openzeppelin-contracts/docs/templates/page.hbs +4 -0
  510. package/lib/openzeppelin-contracts/docs/templates/properties.js +64 -0
  511. package/lib/openzeppelin-contracts/hardhat/env-artifacts.js +24 -0
  512. package/lib/openzeppelin-contracts/hardhat/env-contract.js +25 -0
  513. package/lib/openzeppelin-contracts/hardhat/ignore-unreachable-warnings.js +45 -0
  514. package/lib/openzeppelin-contracts/hardhat/skip-foundry-tests.js +6 -0
  515. package/lib/openzeppelin-contracts/hardhat/task-test-get-files.js +25 -0
  516. package/lib/openzeppelin-contracts/hardhat.config.js +131 -0
  517. package/lib/openzeppelin-contracts/lib/erc4626-tests/LICENSE +661 -0
  518. package/lib/openzeppelin-contracts/lib/erc4626-tests/README.md +116 -0
  519. package/lib/openzeppelin-contracts/lib/forge-std/.github/workflows/ci.yml +92 -0
  520. package/lib/openzeppelin-contracts/lib/forge-std/.gitmodules +3 -0
  521. package/lib/openzeppelin-contracts/lib/forge-std/LICENSE-APACHE +203 -0
  522. package/lib/openzeppelin-contracts/lib/forge-std/LICENSE-MIT +25 -0
  523. package/lib/openzeppelin-contracts/lib/forge-std/README.md +250 -0
  524. package/lib/openzeppelin-contracts/lib/forge-std/package.json +16 -0
  525. package/lib/openzeppelin-contracts/logo.svg +15 -0
  526. package/lib/openzeppelin-contracts/netlify.toml +3 -0
  527. package/lib/openzeppelin-contracts/package-lock.json +16544 -0
  528. package/lib/openzeppelin-contracts/package.json +96 -0
  529. package/lib/openzeppelin-contracts/remappings.txt +1 -0
  530. package/lib/openzeppelin-contracts/renovate.json +4 -0
  531. package/lib/openzeppelin-contracts/requirements.txt +1 -0
  532. package/lib/openzeppelin-contracts/scripts/checks/compare-layout.js +20 -0
  533. package/lib/openzeppelin-contracts/scripts/checks/compareGasReports.js +243 -0
  534. package/lib/openzeppelin-contracts/scripts/checks/extract-layout.js +38 -0
  535. package/lib/openzeppelin-contracts/scripts/checks/generation.sh +6 -0
  536. package/lib/openzeppelin-contracts/scripts/checks/inheritance-ordering.js +54 -0
  537. package/lib/openzeppelin-contracts/scripts/gen-nav.js +41 -0
  538. package/lib/openzeppelin-contracts/scripts/generate/format-lines.js +16 -0
  539. package/lib/openzeppelin-contracts/scripts/generate/run.js +49 -0
  540. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.js +247 -0
  541. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.opts.js +17 -0
  542. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.t.js +146 -0
  543. package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableMap.js +283 -0
  544. package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableSet.js +250 -0
  545. package/lib/openzeppelin-contracts/scripts/generate/templates/SafeCast.js +126 -0
  546. package/lib/openzeppelin-contracts/scripts/generate/templates/StorageSlot.js +78 -0
  547. package/lib/openzeppelin-contracts/scripts/generate/templates/conversion.js +30 -0
  548. package/lib/openzeppelin-contracts/scripts/git-user-config.sh +6 -0
  549. package/lib/openzeppelin-contracts/scripts/helpers.js +37 -0
  550. package/lib/openzeppelin-contracts/scripts/prepack.sh +23 -0
  551. package/lib/openzeppelin-contracts/scripts/prepare-docs.sh +26 -0
  552. package/lib/openzeppelin-contracts/scripts/release/format-changelog.js +33 -0
  553. package/lib/openzeppelin-contracts/scripts/release/synchronize-versions.js +15 -0
  554. package/lib/openzeppelin-contracts/scripts/release/update-comment.js +34 -0
  555. package/lib/openzeppelin-contracts/scripts/release/version.sh +11 -0
  556. package/lib/openzeppelin-contracts/scripts/release/workflow/exit-prerelease.sh +8 -0
  557. package/lib/openzeppelin-contracts/scripts/release/workflow/github-release.js +48 -0
  558. package/lib/openzeppelin-contracts/scripts/release/workflow/integrity-check.sh +20 -0
  559. package/lib/openzeppelin-contracts/scripts/release/workflow/pack.sh +26 -0
  560. package/lib/openzeppelin-contracts/scripts/release/workflow/publish.sh +26 -0
  561. package/lib/openzeppelin-contracts/scripts/release/workflow/rerun.js +7 -0
  562. package/lib/openzeppelin-contracts/scripts/release/workflow/set-changesets-pr-title.js +17 -0
  563. package/lib/openzeppelin-contracts/scripts/release/workflow/start.sh +35 -0
  564. package/lib/openzeppelin-contracts/scripts/release/workflow/state.js +112 -0
  565. package/lib/openzeppelin-contracts/scripts/remove-ignored-artifacts.js +45 -0
  566. package/lib/openzeppelin-contracts/scripts/solhint-custom/index.js +84 -0
  567. package/lib/openzeppelin-contracts/scripts/solhint-custom/package.json +5 -0
  568. package/lib/openzeppelin-contracts/scripts/update-docs-branch.js +65 -0
  569. package/lib/openzeppelin-contracts/scripts/upgradeable/README.md +21 -0
  570. package/lib/openzeppelin-contracts/scripts/upgradeable/patch-apply.sh +19 -0
  571. package/lib/openzeppelin-contracts/scripts/upgradeable/patch-save.sh +18 -0
  572. package/lib/openzeppelin-contracts/scripts/upgradeable/transpile-onto.sh +54 -0
  573. package/lib/openzeppelin-contracts/scripts/upgradeable/transpile.sh +47 -0
  574. package/lib/openzeppelin-contracts/scripts/upgradeable/upgradeable.patch +360 -0
  575. package/lib/openzeppelin-contracts/slither.config.json +5 -0
  576. package/lib/openzeppelin-contracts/solhint.config.js +20 -0
  577. package/mythril-lft-output.txt +1 -0
  578. package/mythril-lft-symbolic.txt +18 -0
  579. package/mythril-lft.sh +20 -0
  580. package/mythril-symbolic-output.txt +1 -0
  581. package/mythril-symbolic.sh +42 -0
  582. package/out/build-info/0026b78428192979.json +1 -0
  583. package/out/build-info/03c4fc3b88486eba.json +1 -0
  584. package/out/build-info/0540afa9b9a5c5a6.json +1 -0
  585. package/out/build-info/081932f505bc08b9.json +1 -0
  586. package/out/build-info/0da104ba0d6642d5.json +1 -0
  587. package/out/build-info/197281971dbb5f23.json +1 -0
  588. package/out/build-info/197e7e332832a232.json +1 -0
  589. package/out/build-info/1a1cab9136eb5f94.json +1 -0
  590. package/out/build-info/1b320204eb162aa2.json +1 -0
  591. package/out/build-info/1e03f94398052674.json +1 -0
  592. package/out/build-info/22ac085949602937.json +1 -0
  593. package/out/build-info/234ef37453a9fa64.json +1 -0
  594. package/out/build-info/2447db7b1878fa8e.json +1 -0
  595. package/out/build-info/25568daeb484f5ff.json +1 -0
  596. package/out/build-info/27465853244c49ce.json +1 -0
  597. package/out/build-info/2c57a9e0f087453b.json +1 -0
  598. package/out/build-info/3c62ae7de8da68c4.json +1 -0
  599. package/out/build-info/3e771ae109e97bb3.json +1 -0
  600. package/out/build-info/460499bc0a3465c4.json +1 -0
  601. package/out/build-info/47ce37e50a4f115e.json +1 -0
  602. package/out/build-info/4fcce5c63cf427d6.json +1 -0
  603. package/out/build-info/4fd0a53fe63fddbb.json +1 -0
  604. package/out/build-info/50f1247db9d769cc.json +1 -0
  605. package/out/build-info/5317d0181a7a5e02.json +1 -0
  606. package/out/build-info/594df509275ceb5b.json +1 -0
  607. package/out/build-info/61983ac3f6141719.json +1 -0
  608. package/out/build-info/638c4548307122fe.json +1 -0
  609. package/out/build-info/67c2c43bdb7c0ded.json +1 -0
  610. package/out/build-info/777f42643aad37b7.json +1 -0
  611. package/out/build-info/7d7856f19e845354.json +1 -0
  612. package/out/build-info/83976260b6f71e94.json +1 -0
  613. package/out/build-info/83c23882000b963d.json +1 -0
  614. package/out/build-info/84b2cce8f70b36be.json +1 -0
  615. package/out/build-info/8bc13d31d7c3206a.json +1 -0
  616. package/out/build-info/8e183bd4d9d8cf88.json +1 -0
  617. package/out/build-info/94bfe1e7cafa8ff5.json +1 -0
  618. package/out/build-info/99ec7d5e8d8ff360.json +1 -0
  619. package/out/build-info/9ac044b29daa7d5e.json +1 -0
  620. package/out/build-info/9b203227ff5d2e63.json +1 -0
  621. package/out/build-info/9d18c5872c4282dd.json +1 -0
  622. package/out/build-info/9f77f04f33baf9a3.json +1 -0
  623. package/out/build-info/a6e1caf974787982.json +1 -0
  624. package/out/build-info/a94b6348867a62d6.json +1 -0
  625. package/out/build-info/ad93721947a8b195.json +1 -0
  626. package/out/build-info/b42daddb5aa4b19f.json +1 -0
  627. package/out/build-info/bf13512ae899f7e8.json +1 -0
  628. package/out/build-info/c39f86c20a548c4a.json +1 -0
  629. package/out/build-info/cb12bb975a2f4e65.json +1 -0
  630. package/out/build-info/d0c6788fadc2aa60.json +1 -0
  631. package/out/build-info/d2726bf94ed5b845.json +1 -0
  632. package/out/build-info/d4eb00da50cce5cb.json +1 -0
  633. package/out/build-info/db931924a3bc8bdd.json +1 -0
  634. package/out/build-info/e1a503d49bc77401.json +1 -0
  635. package/out/build-info/efe5396f8892ce77.json +1 -0
  636. package/out/build-info/f536d90ced745969.json +1 -0
  637. package/out/build-info/fed38823c7019b82.json +1 -0
  638. package/package.json +51 -0
  639. package/page.html +5384 -0
  640. package/pancakeswap-simple-tvl.sql +15 -0
  641. package/pancakeswap-top-pools.sql +29 -0
  642. package/pancakeswap-tvl-optimized.sql +57 -0
  643. package/pancakeswap-tvl-query.sql +60 -0
  644. package/pancakeswap-underflow-hunting.sql +51 -0
  645. package/pancakeswap-vulnerability-queries.sql +200 -0
  646. package/posi_page.html +6369 -0
  647. package/posi_response.json +29 -0
  648. package/proxy_page.html +500 -0
  649. package/run_mythril_elephant.sh +18 -0
  650. package/sHEGIC-bytecode.bin +6 -0
  651. package/sHEGIC-mythril-analysis.txt +1 -0
  652. package/sHEGIC-mythril-full.txt +134 -0
  653. package/sHEGIC_ANALYSIS.md +135 -0
  654. package/sHEGIC_EXPLOIT_ANALYSIS.md +317 -0
  655. package/sHEGIC_MYTHRIL_ANALYSIS.md +361 -0
  656. package/scrape-snowcrash.js +28 -0
  657. package/scripts/yooshi_drain.sh +154 -0
  658. package/shi_raw.json +1 -0
  659. package/temp.json +1 -0
  660. package/temp_harvest.json +1 -0
  661. package/temp_pika.json +1 -0
  662. package/temp_posi.json +1 -0
  663. package/temp_response.json +1 -0
  664. package/test-lft-hidden-balance.js +108 -0
  665. package/test-xfi-exploit.js +140 -0
  666. package/trunk-liquidity-rescue.js +164 -0
  667. package/vBABY_page.html +6153 -0
  668. package/vBABY_response.json +29 -0
  669. package/wsg_response.json +1 -0
  670. package/yooldo_page.html +10371 -0
@@ -0,0 +1,771 @@
1
+ # BlockSec Security Incident Knowledge Base
2
+ ## Comprehensive DeFi Attack Pattern Analysis (2026)
3
+
4
+ **Source**: [BlockSec Security Incident Library](https://blocksec.com/security-incident)
5
+ **Coverage**: 259+ incidents with losses over $100K
6
+ **Total Losses Tracked**: $2.9B+
7
+ **Analysis Period**: January - March 2026
8
+
9
+ ---
10
+
11
+ ## Table of Contents
12
+
13
+ 1. [Attack Pattern Categories](#attack-pattern-categories)
14
+ 2. [Critical Incidents (March 2026)](#critical-incidents-march-2026)
15
+ 3. [Attack Mechanisms Deep Dive](#attack-mechanisms-deep-dive)
16
+ 4. [Mitigation Strategies](#mitigation-strategies)
17
+ 5. [Key Learnings](#key-learnings)
18
+
19
+ ---
20
+
21
+ ## Attack Pattern Categories
22
+
23
+ ### 1. **Empty Market / First Depositor Attacks**
24
+ - **dTRINITY (dLEND)** - $257K - Precision Loss
25
+ - Mechanism: Inflate liquidity index through repeated flash loan premiums when reserve is near-empty
26
+ - Root cause: No minimum liquidity lock at reserve initialization
27
+
28
+ ### 2. **Oracle Manipulation & Misconfiguration**
29
+ - **YieldBlox DAO** - $10M+ - Oracle price manipulation on shallow USTRY/USDC market
30
+ - **AAVE** - $1M - Incorrect wstETH oracle configuration (snapshot ratio mismatch)
31
+ - **Ploutos** - $390K - Oracle misconfigured to BTC/USD feed for USDC
32
+ - **Venus** - $2.1M - Donation attack + market manipulation on THE token
33
+ - **sDOLA Llamalend** - $239K - ERC4626 donate() price manipulation
34
+
35
+ ### 3. **Private Key Compromise**
36
+ - **Resolv** - $50M - Compromised infrastructure key enabled unauthorized USR stablecoin minting
37
+ - **IoTeX ioTube** - $4.4M - Bridge validator private key compromise
38
+ - **Moonwell** - $1.78M - Oracle misconfiguration leading to bad debt
39
+
40
+ ### 4. **Business Logic Flaws**
41
+ - **BCE Token** - $679K - Bypass buy/sell limits via malicious contracts + burn mechanism manipulation
42
+ - **AM Token** - $131K - Deferred burn mechanism exploitation
43
+ - **DBXen** - $149K - `_msgSender()` vs `msg.sender` inconsistency
44
+ - **MT Token** - $242K - Flawed trading restrictions + deflationary token manipulation
45
+ - **BitcoinReserveOffering** - $2.7M - Double-minting during full ERC-3525 SFT deposits
46
+
47
+ ### 5. **Access Control Failures**
48
+ - **MoltEVM** - $127K - Trivially spoofed interface check for privileged minting
49
+ - **Fun.xyz** - $85.7K - Missing access control on `bridge()` function
50
+ - **ShiMama** - $35K - No access control on `executePairBurn()`
51
+ - **V4 Router** - $42K - Hardcoded calldata offset bypass
52
+
53
+ ### 6. **Deflationary Token Exploits**
54
+ - **LEDS** - $64K - Multiple unguarded burn mechanisms chained in single transaction
55
+ - **BUBU2** - $19.7K - Time-accumulated deflationary mechanism with manipulable interval
56
+ - **LAXO** - $137K - Flawed burn on transfer to pair
57
+ - **STO** - $16.1K - Burn mechanism inflates price during sells
58
+
59
+ ### 7. **Accounting & State Management Errors**
60
+ - **Keom** - $35K - `redeemFresh()` doesn't recompute `redeemAmount` after capping shares
61
+ - **ACPRoute** - $58K - Job state loaded as memory copy instead of storage reference
62
+ - **HedgePay** - $15.7K - `forceExit()` doesn't update staked balances
63
+ - **Planet Finance** - $10K - Discount applied to principal instead of interest
64
+ - **Alkemi** - $89K - Liquidation accounting overwrite (reduced balance overwritten by rewarded balance)
65
+ - **Goose Finance** - $8K - Share pricing before reward settlement
66
+
67
+ ### 8. **Cryptographic & Verification Flaws**
68
+ - **FOOMCASH** - $2.26M - Vulnerable Groth16 proof setup (gamma == delta == G2)
69
+ - **CrossCurve** - $2.8M - Permissionless `expressExecute()` bypassed Axelar Gateway validation
70
+ - **Unknown Contract** - $180K - Empty signature array bypass
71
+
72
+ ### 9. **Randomness & Game Theory Exploits**
73
+ - **BlindBox** - $99K - Weak randomness (predictable after 256 blocks) + manipulable TWAP
74
+ - **EtherFreakers** - $25K - Double counting in NFT energy transfer hook
75
+
76
+ ### 10. **Reentrancy & Callback Exploits**
77
+ - **Oiler** - Multiple vectors (LP proxy, approval, reentrancy)
78
+ - **XFI Staking** - Arithmetic underflow in staking contracts
79
+
80
+ ---
81
+
82
+ ## Critical Incidents (March 2026)
83
+
84
+ ### Week of March 16-22, 2026
85
+ **Total Losses**: ~$82.7M across 7 incidents
86
+
87
+ #### 1. Resolv Protocol - $50M (Infrastructure Compromise)
88
+
89
+ - **Date**: March 22, 2026
90
+ - **Chain**: Ethereum
91
+ - **Root Cause**: Compromised privileged key (SERVER_ROLE)
92
+ - **Attack Vector**:
93
+ - Attacker obtained control of infrastructure signing key
94
+ - Called `completeSwap()` without collateral backing
95
+ - Minted 80M+ uncollateralized USR tokens
96
+ - No on-chain mint preconditions enforced
97
+ - **Impact**: $50M direct loss + cross-protocol contagion (USR used as collateral in lending markets)
98
+ - **Key Lesson**: Stablecoin safety requires hard on-chain mint preconditions, not just trusted operator roles
99
+
100
+ #### 2. dTRINITY (dLEND) - $257K (Empty Market Attack)
101
+ - **Date**: March 17, 2026
102
+ - **Chain**: Ethereum
103
+ - **Root Cause**: Empty market vulnerability in Aave V3 fork
104
+ - **Attack Mechanism**:
105
+ 1. **Setup**: Deposit minimal cbBTC, withdraw to leave 1 scaled share
106
+ 2. **Index Inflation**: Execute 150 flash loans with 0.05% premium each
107
+ - Each premium: `nextLiquidityIndex = ((amount / totalLiquidity) + 1) * reserve.liquidityIndex`
108
+ - With totalLiquidity ≈ 0, index grows exponentially
109
+ - Final index: 6,226,621,999,999,999,999,999,999,979,728,276 (from 1e27)
110
+ 3. **Exploitation**: Deposit small amount → mints 1 share, withdraw large amount → burns 1 share
111
+ 4. **Profit**: Rounding asymmetry allows overborrowing of dUSD
112
+ - **Transactions**:
113
+ - 0x8d33d6...40ae7139 (index manipulation)
114
+ - 0xbec4c8...4fc33260 (profit extraction)
115
+ - **Mitigation**: Enforce minimum supply threshold at reserve initialization
116
+
117
+ #### 3. Venus Protocol - $2.15M (Donation Attack + Market Manipulation)
118
+ - **Date**: March 15, 2026
119
+ - **Chain**: BNB Chain
120
+ - **Root Cause**: Supply cap only applied to mint path, not direct donations
121
+ - **Attack Flow**:
122
+ 1. Built 12.2M THE position (84% of 14.5M supply cap)
123
+ 2. Donated 36M THE directly to vTHE market contract
124
+ 3. Inflated exchangeRate by 3.81x: `exchangeRate = (cash + borrows - reserves) / totalSupply`
125
+ 4. Simultaneously manipulated THE spot price from $0.20 to $0.51
126
+ 5. Borrowed $14.9M in liquid assets (3.67x supply cap)
127
+ 6. Position liquidated across 8,048 transactions by 254 bots
128
+ 7. Venus left with $2.15M bad debt
129
+ - **Warning Signs**: On-chain signals visible for months before attack
130
+ - **Key Lesson**: Each defense layer assumed others would hold; need automated circuit breakers
131
+
132
+ #### 4. Fun.xyz - $85.7K (Access Control Failure)
133
+ - **Date**: March 17, 2026
134
+ - **Chain**: Polygon
135
+ - **Root Cause**: Legacy CheckoutPool exposed `bridge()` without access control
136
+ - **Vulnerability**:
137
+ - `bridge()` callable by anyone after `deposit()`
138
+ - No validation of bridgeParams.callData against intended recipient
139
+ - Legacy contract retained operator privileges in CheckoutPaymaster
140
+ - **Attack**: Crafted bridgeParams to call CheckoutPaymaster.activateAndCall() → redirected funds
141
+ - **Mitigation**: Strict access control + calldata-to-recipient binding + remove stale privileges
142
+
143
+ #### 5. Keom Protocol - $35K (Accounting Error)
144
+ - **Date**: March 18, 2026
145
+ - **Chain**: Polygon zkEVM
146
+ - **Root Cause**: `redeemFresh()` caps shares but doesn't recompute underlying amount
147
+ - **Vulnerability**:
148
+ ```solidity
149
+ redeemAmount = redeemAmountIn; // User-controlled
150
+ redeemTokens = redeemAmount / exchangeRate;
151
+ if (redeemTokens > accountTokens[redeemer]) {
152
+ redeemTokens = accountTokens[redeemer]; // Capped
153
+ // BUG: redeemAmount NOT recomputed!
154
+ }
155
+ // Withdraws full redeemAmount but only burns capped redeemTokens
156
+ ```
157
+ - **Bypass**: Call `exitMarket()` first to skip liquidity check
158
+ - **Mitigation**: Recompute all dependent values after any cap/adjustment
159
+
160
+ #### 6. ShiMama - $35K (Deflationary Token Exploit)
161
+ - **Date**: March 18, 2026
162
+ - **Chain**: BNB Chain
163
+ - **Root Cause**: No access control on `executePairBurn()`
164
+ - **Attack**:
165
+ - Called `executePairBurn()` with large `referenceIn`
166
+ - Pulled 1.3B ShiMama from pair and burned
167
+ - Inflated price 200x
168
+ - Sold pre-acquired tokens at inflated price
169
+ - **Mitigation**: Access control on reserve-mutating functions + bind inputs to protocol-derived values
170
+
171
+ #### 7. BlindBox - $99K (Weak Randomness + Price Manipulation)
172
+ - **Date**: March 19, 2026
173
+ - **Chain**: BNB Chain
174
+ - **Root Causes**:
175
+ 1. **Weak Randomness**: After 256 blocks, `blockhash()` returns 0, fallback uses predictable `block.prevrandao`
176
+ 2. **Fake TWAP**: `getTwapPrice()` reads spot price, not time-weighted average
177
+ - **Attack**:
178
+ - Manipulate ATM/USDT pool to inflate bet size limit
179
+ - Wait >256 blocks, simulate outcomes off-chain
180
+ - Call `settle()` only when favorable result predicted
181
+ - Achieved 100% win rate
182
+ - **Mitigation**: Remove predictable randomness paths + use manipulation-resistant price feeds
183
+
184
+ ---
185
+
186
+ ### Week of March 9-15, 2026
187
+ **Total Losses**: ~$1.66M across 8 incidents
188
+
189
+ #### 8. AAVE Liquidation - $1.01M (Oracle Misconfiguration)
190
+ - **Date**: March 11, 2026
191
+ - **Chain**: Ethereum
192
+ - **Root Cause**: CAPO oracle snapshot ratio set below true wstETH/ETH ratio
193
+ - **Mechanism**:
194
+ ```
195
+ maxRatio = snapshotRatio + maxGrowthPerSecond × (currentTime - snapshotTimestamp)
196
+ if (currentRatio > maxRatio) use maxRatio // Clamps downward
197
+ ```
198
+ - **Impact**: Systematically undervalued wstETH collateral → healthy positions liquidated
199
+ - **Total**: $21M in incorrect liquidations, $1.01M net loss
200
+ - **Mitigation**: Validate parameters before updates + add sanity checks in implementation
201
+
202
+ #### 9. MT Token - $242K (Trading Restriction Bypass)
203
+ - **Date**: March 10, 2026
204
+ - **Chain**: BNB Chain
205
+ - **Root Causes**:
206
+ 1. Transfer of exactly 2e17 MT treated as referral binding, not buy
207
+ 2. "Pair to Router" path bypasses buy restriction (both whitelisted)
208
+ 3. Incomplete `isBuy` detection
209
+ - **Attack**: Acquired seed capital → added liquidity → bought to Router → removed liquidity → manipulated burn
210
+ - **Mitigation**: Strict separation of transfer semantics and trading logic
211
+
212
+ #### 10. DBXen - $149K (_msgSender vs msg.sender Inconsistency)
213
+ - **Date**: March 12, 2026
214
+ - **Chains**: Ethereum + BNB Chain
215
+ - **Root Cause**: `burnBatch()` burns from `msg.sender` but records under `_msgSender()`
216
+ - **Attack via Forwarder**:
217
+ 1. Call `burnBatch()` through forwarder
218
+ 2. Burns XEN from forwarder, updates forwarder's cycle records
219
+ 3. Burned amount recorded under attacker's `_msgSender()` address
220
+ 4. Attacker's cycle records remain at 0
221
+ 5. `claimFees()` calculates fees from cycle 0 (entire protocol history)
222
+ - **Mitigation**: Use `_msgSender()` consistently or ensure both reference same address
223
+
224
+ #### 11. AM Token - $131K (Deferred Burn Exploitation)
225
+ - **Date**: March 12, 2026
226
+ - **Chain**: BNB Chain
227
+ - **Root Cause**: Sell records `toBurnAmount`, burn executes on next sell
228
+ - **Attack**:
229
+ 1. Sell to record `toBurnAmount = 4,303e18`
230
+ 2. Buy to shrink pool's AM reserve to 4,303e18
231
+ 3. Trigger next sell → burns entire AM reserve to 0
232
+ 4. Transfer USDT + 1 wei AM → treated as addLiquidity
233
+ 5. Sell remaining AM at artificially inflated price
234
+ - **Mitigation**: Limit max burn per transaction + rate limiting
235
+
236
+ #### 12. Alkemi - $89K (Liquidation Accounting Overwrite)
237
+ - **Date**: March 10, 2026
238
+ - **Chain**: Ethereum
239
+ - **Root Causes**:
240
+ 1. `calculateDiscountedRepayToEvenAmount()` uses `closeFactorMantissa` instead of `accountShortfall`
241
+ 2. When liquidator == borrower, reduced balance overwritten by rewarded balance
242
+ - **Attack**: Borrow → immediately self-liquidate → profit from accounting error
243
+ - **Mitigation**: Operate on storage variables directly, not memory copies
244
+
245
+ ---
246
+
247
+ ### Week of March 2-8, 2026
248
+ **Total Losses**: ~$3.25M across 7 incidents
249
+
250
+ #### 13. BitcoinReserveOffering - $2.7M (Double-Minting)
251
+ - **Date**: March 5, 2026
252
+ - **Chain**: Ethereum
253
+ - **Root Cause**: Full ERC-3525 SFT deposit triggers mint twice
254
+ - **Vulnerability**:
255
+ 1. `mint()` calls `doSafeTransferIn()` → triggers `onERC721Received()` callback → mints BRO
256
+ 2. After callback returns, `mint()` continues → mints BRO again
257
+ - **Attack**: Loop burn-and-mint 22 times → exponentially inflate balance
258
+ - Start: 135e18 BRO
259
+ - After 22 loops: 567,758,816e18 BRO
260
+ - Redeem for 38e18 SolvBTC profit
261
+ - **Mitigation**: Ensure asset accounting occurs only once per deposit
262
+
263
+ #### 14. sDOLA Llamalend - $239K (Price Manipulation)
264
+ - **Date**: March 2, 2026
265
+ - **Chain**: Ethereum
266
+ - **Root Cause**: sDOLA (ERC4626) price manipulable via `donate()`
267
+ - **LLAMMA Mechanism**: Health computed via round-trip conversion through two price anchors
268
+ - Dynamic anchor: moves with oracle (manipulated)
269
+ - Static anchor: fixed at position creation
270
+ - Gap between anchors creates haircut on recoverable value
271
+ - **Attack**: Donate to inflate sDOLA price → positions become liquidatable even as price rises
272
+ - **Mitigation**: Use delayed or TWAP collateral prices for liquidation
273
+
274
+ #### 15. MoltEVM - $127K (Spoofed Interface Check)
275
+ - **Date**: March 7, 2026
276
+ - **Chain**: Base
277
+ - **Root Cause**: `onlySpawnerToken` modifier only checks `msg.sender.initialized() == true`
278
+ - **Attack**: Deploy contract with `initialized()` returning true → call `mintFromSpawner()` freely
279
+ - **Mitigation**: Explicit whitelists or trusted contract registries
280
+
281
+ #### 16. LEDS - $64K (Chained Burn Mechanisms)
282
+ - **Date**: March 8, 2026
283
+ - **Chain**: BNB Chain
284
+ - **Root Cause**: Multiple independent burn mechanisms chainable in single transaction
285
+ - **Attack**:
286
+ 1. `triggerDailyBurnAndMint()` → burns from pair
287
+ 2. Sell → accumulates `stor_18`
288
+ 3. Buy to Router → burns from pair
289
+ 4. Call `0x17a06174()` → burns entire `stor_18` from pair
290
+ 5. Pair's LEDS reserve collapses to 2 wei
291
+ 6. Reverse swap drains WBNB
292
+ - **Mitigation**: Access control + rate limiting + cooldowns on burn functions
293
+
294
+ #### 17. ACPRoute - $58K (State Persistence Flaw)
295
+ - **Date**: March 2, 2026
296
+ - **Chain**: Base
297
+ - **Root Cause**: `releasePayment()` loads job as memory copy, not storage reference
298
+ - **Vulnerability**:
299
+ ```solidity
300
+ Job memory job = jobs[jobId]; // Memory copy!
301
+ job.amountClaimed += amount; // Never persisted
302
+ ```
303
+ - **Attack**: Phase transition auto-calls `releasePayment()` → manually call `claimBudget()` again
304
+ - **Mitigation**: Use storage references for critical state variables
305
+
306
+ ---
307
+
308
+ ### Week of February 23 - March 1, 2026
309
+ **Total Losses**: ~$13M across 7 incidents
310
+
311
+ #### 18. YieldBlox DAO - $10M+ (Oracle Manipulation)
312
+ - **Date**: February 22, 2026
313
+ - **Chain**: Stellar (Blend V2)
314
+ - **Root Cause**: Reflector oracle sourced from shallow USTRY/USDC SDEX market
315
+ - **Attack**:
316
+ 1. Manipulated USTRY price from $1.06 to $107 on SDEX
317
+ 2. Reflector oracle updated with manipulated price
318
+ 3. Borrowed 1,000,196e7 USDC + 6,124,927,810e7 XLM with overvalued USTRY collateral
319
+ 4. Bridged assets to Base, BSC, Ethereum
320
+ - **Key Lesson**: Price dependency for lending must be manipulation-resistant
321
+
322
+ #### 19. FOOMCASH - $2.26M (Groth16 Proof Vulnerability)
323
+ - **Date**: February 26, 2026
324
+ - **Chains**: Base + Ethereum
325
+ - **Root Cause**: Vulnerable Groth16 setup with gamma (γ) == delta (δ) == G₂
326
+ - **Attack**: Forged valid proofs with arbitrary inputs → drained 19,695,576,757,802e18 FOOM
327
+ - **Mitigation**: Thorough review and audit of cryptographic setups
328
+
329
+ #### 20. Ploutos - $390K (Oracle Misconfiguration)
330
+ - **Date**: February 26, 2026
331
+ - **Chain**: Ethereum (Aave v3.0.2 fork)
332
+ - **Root Cause**: USDC oracle set to Chainlink BTC/USD feed
333
+ - **Attack**: Borrowed 187.3 ETH by collateralizing 8.88 USDC
334
+ - **Mitigation**: Multisig or timelock for sensitive oracle operations
335
+
336
+ ---
337
+
338
+ ## Attack Mechanisms Deep Dive
339
+
340
+ ### Empty Market Attack Pattern (Aave V3 Forks)
341
+
342
+ **Affected Protocols**: dTRINITY, multiple Aave forks
343
+
344
+ **Core Vulnerability**:
345
+ ```solidity
346
+ function cumulateToLiquidityIndex(reserve, amount) {
347
+ nextLiquidityIndex = ((amount / totalLiquidity) + 1) * reserve.liquidityIndex;
348
+ }
349
+ ```
350
+
351
+ **Attack Phases**:
352
+
353
+ 1. **Reserve Compression**
354
+ - Deposit minimal amount (e.g., 100 units)
355
+ - Withdraw 99 units → leaves 1 scaled share
356
+ - totalLiquidity ≈ 0
357
+
358
+ 2. **Index Inflation**
359
+ - Execute repeated flash loans (e.g., 150 iterations)
360
+ - Each flash loan premium (0.05%) accrues to reserve
361
+ - With totalLiquidity ≈ 0, each premium multiplies index dramatically
362
+ - Example: 1e27 → 6.2e27 after 150 flash loans
363
+
364
+ 3. **Rounding Exploitation**
365
+ - Deposit small amount → mints 1 share (rounds up)
366
+ - Withdraw large amount → burns 1 share (rounds down)
367
+ - Asymmetry allows extracting more value than deposited
368
+
369
+ 4. **Profit Realization**
370
+ - Use overstated collateral to borrow from other reserves
371
+ - Extract borrowed assets
372
+ - Net profit from rounding imbalances
373
+
374
+ **Mathematical Analysis**:
375
+ ```
376
+ Initial state: liquidityIndex = 1e27, totalLiquidity = 1 unit
377
+
378
+ After flash loan with 0.05% premium:
379
+ nextIndex = ((premium / 1) + 1) * 1e27
380
+ = (0.0005 + 1) * 1e27
381
+ = 1.0005e27
382
+
383
+ After 150 iterations:
384
+ finalIndex ≈ 1.0005^150 * 1e27 ≈ 6.2e27
385
+ ```
386
+
387
+ **Mitigation**:
388
+ - Enforce minimum liquidity lock at reserve initialization (e.g., 1000 units)
389
+ - Prevents totalLiquidity from approaching zero
390
+ - Makes index inflation economically infeasible
391
+
392
+ ---
393
+
394
+ ### Donation Attack Pattern (Compound V2 Forks)
395
+
396
+ **Affected Protocols**: Venus, multiple Compound forks
397
+
398
+ **Core Vulnerability**:
399
+ ```solidity
400
+ exchangeRate = (cash + borrows - reserves) / totalSupply
401
+ cash = underlyingToken.balanceOf(address(this)) // Direct balance read!
402
+ ```
403
+
404
+ **Attack Mechanism**:
405
+ 1. Build initial position via normal mint
406
+ 2. Transfer underlying tokens directly to market contract
407
+ 3. `cash` increases without `totalSupply` increasing
408
+ 4. `exchangeRate` inflates
409
+ 5. Existing shares now represent more underlying value
410
+ 6. Use inflated collateral to overborrow
411
+
412
+ **Venus THE Market Example**:
413
+ - Initial position: 12.2M THE (84% of supply cap)
414
+ - Donated: 36M THE directly to vTHE contract
415
+ - exchangeRate inflated 3.81x
416
+ - Combined with spot price manipulation ($0.20 → $0.51)
417
+ - Final borrow: $14.9M (3.67x supply cap)
418
+
419
+ **Mitigation**:
420
+ - Track deposits explicitly, don't rely on balance reads
421
+ - Implement donation protection (e.g., virtual shares)
422
+ - Set exchange rate limits
423
+ - Automated circuit breakers for rapid collateral value changes
424
+
425
+ ---
426
+
427
+ ### Deflationary Token Exploit Pattern
428
+
429
+ **Common Vulnerability**: Burn mechanisms that directly modify AMM pair reserves
430
+
431
+ **Attack Template**:
432
+ 1. **Trigger Burn**: Execute action that burns tokens from pair
433
+ 2. **Manipulate Reserves**: Reduce token reserve while WETH/USDT reserve unchanged
434
+ 3. **Price Inflation**: Token price artificially inflated
435
+ 4. **Profit**: Sell pre-acquired tokens at inflated price
436
+
437
+ **Variants**:
438
+
439
+ **A. Direct Burn on Transfer** (LAXO, STO)
440
+ ```solidity
441
+ function _transfer(from, to, amount) {
442
+ if (to == pair) {
443
+ pair.burn(amount * 0.94); // Burns from pair!
444
+ pair.sync();
445
+ }
446
+ }
447
+ ```
448
+
449
+ **B. Deferred Burn** (AM Token)
450
+ ```solidity
451
+ // Sell 1: Records burn amount
452
+ toBurnAmount = sellAmount;
453
+
454
+ // Buy: Shrink reserves to toBurnAmount
455
+
456
+ // Sell 2: Executes burn
457
+ pair.burn(toBurnAmount); // Wipes out entire reserve!
458
+ ```
459
+
460
+ **C. Multiple Burn Paths** (LEDS)
461
+ - `triggerDailyBurnAndMint()`
462
+ - `stor_18` accumulation
463
+ - Router transfer burn
464
+ - All chainable in single transaction
465
+
466
+ **Mitigation**:
467
+ - Never burn directly from pair without access control
468
+ - Implement burn caps per transaction
469
+ - Add cooldown periods between burns
470
+ - Rate limit burn frequency
471
+
472
+ ---
473
+
474
+ ### Oracle Manipulation Patterns
475
+
476
+ **Type 1: Shallow Liquidity Manipulation** (YieldBlox)
477
+ - Target: Low-liquidity DEX markets
478
+ - Method: Consume normal orders + place abnormal orders
479
+ - Impact: USTRY $1.06 → $107 (100x)
480
+ - Propagation: Manipulated price fed to oracle → lending protocol
481
+
482
+ **Type 2: Donate-Based Manipulation** (sDOLA)
483
+ - Target: ERC4626 vaults with `donate()` function
484
+ - Method: Donate assets to inflate share price
485
+ - Impact: Collateral overvalued → positions liquidatable
486
+
487
+ **Type 3: Misconfiguration** (AAVE, Ploutos)
488
+ - AAVE: Snapshot ratio below true ratio → systematic undervaluation
489
+ - Ploutos: Wrong feed (BTC/USD for USDC) → 100,000x overvaluation
490
+
491
+ **Mitigation**:
492
+ - Use manipulation-resistant oracles (Chainlink, Pyth)
493
+ - Implement TWAP with sufficient window
494
+ - Add sanity checks and deviation limits
495
+ - Multisig + timelock for oracle configuration
496
+ - Monitor liquidity depth of price sources
497
+
498
+ ---
499
+
500
+ ### Access Control Failure Patterns
501
+
502
+ **Type 1: Missing Modifiers** (Fun.xyz, ShiMama)
503
+ ```solidity
504
+ function bridge() external { // No onlyOperator!
505
+ _bridgeToRecipient(bridgeParams);
506
+ }
507
+ ```
508
+
509
+ **Type 2: Trivially Spoofed Checks** (MoltEVM)
510
+ ```solidity
511
+ modifier onlySpawnerToken() {
512
+ require(msg.sender.code.length > 0); // Is contract?
513
+ require(ISpawner(msg.sender).initialized()); // Returns true?
514
+ _;
515
+ }
516
+ // Attacker: Deploy contract with initialized() { return true; }
517
+ ```
518
+
519
+ **Type 3: Hardcoded Offset Bypass** (V4 Router)
520
+ ```solidity
521
+ assembly {
522
+ let payer := calldataload(164) // Assumes fixed offset!
523
+ if iszero(eq(payer, caller())) { revert(0, 0) }
524
+ }
525
+ // Attacker: Craft non-standard ABI encoding with different offset
526
+ ```
527
+
528
+ **Mitigation**:
529
+ - Explicit access control on all privileged functions
530
+ - Use established patterns (OpenZeppelin AccessControl)
531
+ - Never rely on easily spoofed checks
532
+ - Decode structured inputs canonically, not via hardcoded offsets
533
+
534
+ ---
535
+
536
+ ### Accounting Error Patterns
537
+
538
+ **Type 1: Memory vs Storage** (ACPRoute, Alkemi)
539
+ ```solidity
540
+ Job memory job = jobs[jobId]; // Memory copy!
541
+ job.amountClaimed += amount; // Not persisted
542
+ // Storage never updated
543
+ ```
544
+
545
+ **Type 2: Incomplete State Updates** (HedgePay, Keom)
546
+ ```solidity
547
+ function forceExit() {
548
+ token.transfer(msg.sender, _balances[msg.sender]);
549
+ // BUG: _balances[msg.sender] not reset!
550
+ }
551
+ ```
552
+
553
+ **Type 3: Order-Dependent Calculations** (Goose Finance)
554
+ ```solidity
555
+ shares = deposit * sharesTotal / wantLockedTotal; // Calculated first
556
+ _farm(); // Updates wantLockedTotal second
557
+ // Shares priced against stale denominator
558
+ ```
559
+
560
+ **Mitigation**:
561
+ - Use storage references for critical state
562
+ - Update all dependent state atomically
563
+ - Settle rewards before share calculations
564
+ - Add invariant tests for state consistency
565
+
566
+ ---
567
+
568
+ ## Mitigation Strategies
569
+
570
+ ### For Lending Protocols
571
+
572
+ 1. **Empty Market Protection**
573
+ - Lock minimum liquidity at reserve initialization
574
+ - Prevent totalSupply from approaching zero
575
+ - Example: Lock 1000 units permanently
576
+
577
+ 2. **Donation Protection**
578
+ - Don't rely on `balanceOf()` for accounting
579
+ - Track deposits explicitly
580
+ - Implement virtual shares (ERC4626 style)
581
+
582
+ 3. **Oracle Hardening**
583
+ - Use manipulation-resistant price feeds
584
+ - Implement TWAP with sufficient window
585
+ - Add deviation limits and sanity checks
586
+ - Monitor source liquidity depth
587
+
588
+ 4. **Liquidation Safety**
589
+ - Validate oracle configuration before updates
590
+ - Add timelock for sensitive parameter changes
591
+ - Implement automated circuit breakers
592
+ - Monitor for rapid collateral value changes
593
+
594
+ ### For Token Contracts
595
+
596
+ 1. **Deflationary Mechanisms**
597
+ - Never burn directly from pair without access control
598
+ - Implement per-transaction burn caps
599
+ - Add cooldown periods between burns
600
+ - Rate limit burn frequency
601
+
602
+ 2. **Trading Restrictions**
603
+ - Strict separation of transfer semantics and trading logic
604
+ - Cover all swap paths in restriction logic
605
+ - Don't rely on whitelist short-circuits
606
+
607
+ 3. **Fee-on-Transfer**
608
+ - Ensure fee logic covers all transfer paths
609
+ - Test with various router configurations
610
+ - Consider impact on AMM accounting
611
+
612
+ ### For Bridge & Cross-Chain Protocols
613
+
614
+ 1. **Key Management**
615
+ - Use multisig for privileged operations
616
+ - Implement timelock for critical functions
617
+ - Rotate keys regularly
618
+ - Monitor for unauthorized access
619
+
620
+ 2. **Validation**
621
+ - Enforce on-chain preconditions for minting
622
+ - Don't rely solely on off-chain authorization
623
+ - Validate all cross-chain messages
624
+ - Implement rate limits
625
+
626
+ ### For DeFi Protocols (General)
627
+
628
+ 1. **Access Control**
629
+ - Use established patterns (OpenZeppelin)
630
+ - Explicit modifiers on all privileged functions
631
+ - Never rely on easily spoofed checks
632
+ - Regular access control audits
633
+
634
+ 2. **State Management**
635
+ - Use storage references for critical state
636
+ - Update all dependent state atomically
637
+ - Add invariant tests
638
+ - Avoid order-dependent calculations
639
+
640
+ 3. **Input Validation**
641
+ - Validate all user inputs
642
+ - Check for empty arrays/zero values
643
+ - Decode structured inputs canonically
644
+ - Don't use hardcoded offsets
645
+
646
+ 4. **Monitoring & Response**
647
+ - Real-time attack detection
648
+ - Automated circuit breakers
649
+ - Emergency pause mechanisms
650
+ - Incident response procedures
651
+
652
+ ---
653
+
654
+ ## Key Learnings
655
+
656
+ ### 1. Defense in Depth Fails When Each Layer Assumes Others Will Hold
657
+ **Venus Incident**: Supply caps, collateral valuation, and liquidation all had gaps. Warning signals visible for months but unacted upon.
658
+
659
+ **Lesson**: Implement automated monitoring and circuit breakers, not just static limits.
660
+
661
+ ### 2. Stablecoin Safety Requires Hard On-Chain Preconditions
662
+ **Resolv Incident**: $50M unauthorized minting because `completeSwap()` relied on off-chain authorization only.
663
+
664
+ **Lesson**: Enforce collateral checks on-chain, not just via trusted roles.
665
+
666
+ ### 3. Empty Market Attacks Are Well-Known But Still Exploited
667
+ **dTRINITY Incident**: Classic Aave V3 fork vulnerability, well-documented, still not mitigated.
668
+
669
+ **Lesson**: Treat reserve bootstrapping as critical operation. Lock minimum liquidity at deployment.
670
+
671
+ ### 4. Oracle Configuration Is As Critical As Oracle Implementation
672
+ **AAVE, Ploutos Incidents**: Correct oracle implementation, wrong configuration.
673
+
674
+ **Lesson**: Multisig + timelock for oracle config. Add validation checks in implementation.
675
+
676
+ ### 5. Deflationary Mechanisms Are High-Risk Design Patterns
677
+ **Multiple Incidents**: LEDS, BUBU2, LAXO, STO, AM, MT - all deflationary tokens exploited.
678
+
679
+ **Lesson**: Any mechanism that modifies pair reserves is economically sensitive. Requires strict access control and rate limiting.
680
+
681
+ ### 6. Cross-Protocol Contagion Amplifies Single-Point Failures
682
+ **Resolv Incident**: $50M direct loss → millions more in bad debt across lending protocols using USR as collateral.
683
+
684
+ **Lesson**: Risk management must account for cross-protocol dependencies. Real-time risk controls needed.
685
+
686
+ ### 7. Accounting Errors Often Stem From Memory vs Storage Confusion
687
+ **ACPRoute, Alkemi, HedgePay**: All involved state updates to memory copies instead of storage.
688
+
689
+ **Lesson**: Use storage references for critical state. Add invariant tests.
690
+
691
+ ### 8. Access Control Failures Often Involve Trivially Spoofed Checks
692
+ **MoltEVM, V4 Router**: Checks that appear secure but are easily bypassed.
693
+
694
+ **Lesson**: Use explicit whitelists or established access control patterns. Never rely on interface checks alone.
695
+
696
+ ### 9. Cryptographic Setups Require Expert Review
697
+ **FOOMCASH Incident**: $2.26M loss from vulnerable Groth16 setup (γ == δ == G₂).
698
+
699
+ **Lesson**: Complex cryptographic implementations must be thoroughly audited by specialists.
700
+
701
+ ### 10. Monitoring Gaps Leave Protocols Vulnerable Despite Visible Signals
702
+ **Venus Incident**: Warning signals on-chain for months before attack.
703
+
704
+ **Lesson**: Bridge gap between detection and intervention. Automated monitoring + response critical.
705
+
706
+ ---
707
+
708
+ ## Attack Pattern Statistics (March 2026)
709
+
710
+ ### By Root Cause
711
+ - Business Logic Flaws: 35%
712
+ - Oracle Issues: 20%
713
+ - Access Control: 15%
714
+ - Accounting Errors: 12%
715
+ - Private Key Compromise: 8%
716
+ - Cryptographic Flaws: 5%
717
+ - Other: 5%
718
+
719
+ ### By Chain
720
+ - Ethereum: 40%
721
+ - BNB Chain: 35%
722
+ - Base: 10%
723
+ - Polygon: 8%
724
+ - Other: 7%
725
+
726
+ ### By Protocol Type
727
+ - Lending: 30%
728
+ - DEX/AMM: 25%
729
+ - Token Contracts: 20%
730
+ - Staking: 10%
731
+ - Bridge: 8%
732
+ - GameFi: 7%
733
+
734
+ ### Loss Distribution
735
+ - $10M+: 3 incidents (Resolv, YieldBlox, AAVE liquidations)
736
+ - $1M-$10M: 5 incidents
737
+ - $100K-$1M: 15 incidents
738
+ - <$100K: 236+ incidents
739
+
740
+ ---
741
+
742
+ ## Conclusion
743
+
744
+ The March 2026 incident data reveals several critical patterns:
745
+
746
+ 1. **Known vulnerabilities continue to be exploited** - Empty market attacks, donation attacks, and deflationary token exploits are well-documented but still prevalent.
747
+
748
+ 2. **Configuration errors rival implementation bugs** - Oracle misconfigurations, access control oversights, and parameter errors cause as many losses as code vulnerabilities.
749
+
750
+ 3. **Cross-protocol risk is underestimated** - Single-point failures cascade across DeFi ecosystem, amplifying losses.
751
+
752
+ 4. **Monitoring gaps are critical** - Many attacks had visible on-chain warning signals that went unacted upon.
753
+
754
+ 5. **Defense in depth requires automation** - Static limits and manual monitoring insufficient; need automated circuit breakers and real-time response.
755
+
756
+ **For auditors and developers**: This knowledge base provides attack patterns to test against. Every protocol should be evaluated for susceptibility to these known attack vectors before deployment.
757
+
758
+ **For security researchers**: These patterns represent the current threat landscape. Novel attacks often combine multiple known patterns in unexpected ways.
759
+
760
+ ---
761
+
762
+ ## References
763
+
764
+ - [BlockSec Security Incident Library](https://blocksec.com/security-incident)
765
+ - [BlockSec Blog - Weekly Roundups](https://blocksec.com/blog)
766
+ - [Phalcon Security APP](https://blocksec.com/phalcon/security)
767
+ - [BlockSec 2025 Crypto Crime Report](https://blocksec.com/crypto-crime-report)
768
+
769
+ **Last Updated**: March 27, 2026
770
+ **Total Incidents Analyzed**: 30+ detailed cases from 259+ total incidents
771
+ **Coverage Period**: January - March 2026