Safeguarding DeFi Smart Contracts against Oracle Deviations (2401.06044v1)
Abstract: This paper presents OVer, a framework designed to automatically analyze the behavior of decentralized finance (DeFi) protocols when subjected to a "skewed" oracle input. OVer firstly performs symbolic analysis on the given contract and constructs a model of constraints. Then, the framework leverages an SMT solver to identify parameters that allow its secure operation. Furthermore, guard statements may be generated for smart contracts that may use the oracle values, thus effectively preventing oracle manipulation attacks. Empirical results show that OVer can successfully analyze all 10 benchmarks collected, which encompass a diverse range of DeFi protocols. Additionally, this paper also illustrates that current parameters utilized in the majority of benchmarks are inadequate to ensure safety when confronted with significant oracle deviations.
- 2020. Warp Contracts. https://github.com/warpfinance/Warp-Contracts/releases/tag/v2.0-production-contracts.
- 2021. Solo protocol. https://github.com/dydxprotocol/solo/releases/tag/v0.41.0.
- 2022. Beefy Vault Contract. https://explorer.kava.io/address/0xC3821F0b56FA4F4794d5d760f94B812DE261361B/contracts.
- 2023. Yearn Attack Disclosure. https://github.com/yearn/yearn-security/blob/master/disclosures/2021-02-04.md.
- Aave. 2023. Aave V2. https://github.com/aave/protocol-v2/tree/master.
- Astraea: A decentralized blockchain oracle. In 2018 IEEE international conference on internet of things (IThings) and IEEE green computing and communications (GreenCom) and IEEE cyber, physical and social computing (CPSCom) and IEEE smart data (SmartData). IEEE, 1145–1152.
- Ayana T Aspembitova and Michael A Bentley. 2022. Oracles in Decentralized Finance: Attack Costs, Profits and Mitigation Measures. Entropy 25, 1 (2022), 60.
- Formal analysis of lending pools in decentralized finance. In International Symposium on Leveraging Applications of Formal Methods. Springer, 335–355.
- WIP: Finding bugs automatically in smart contracts with parameterized invariants. Retrieved July 14 (2020), 2020.
- Vitalik Buterin. 2014. Ethereum: A next-generation smart contract and decentralized application platform. https://ethereum.org/en/whitepaper/.
- Truthful decentralized blockchain oracles. International Journal of Network Management 32, 2 (2022), e2179.
- calvwang9. 2022. Oracle Manipulation. https://github.com/calvwang9/oracle-manipulation.
- FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation. arXiv preprint arXiv:2206.10708 (2022).
- Smartian: Enhancing smart contract fuzzing with static and dynamic data-flow analyses. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 227–239.
- Compound Finance. 2020. Compound V2. https://github.com/compound-finance/compound-protocol/releases/tag/v2.8.1.
- Consensys. 2023. Mythril: a security analysis tool for EVM bytecode. https://github.com/Consensys/mythril.
- Towards Verified Price Oracles for Decentralized Exchange Protocols. In 3rd International Workshop on Formal Methods for Blockchains (FMBC 2021) (Open Access Series in Informatics (OASIcs), Vol. 95), Bruno Bernardo and Diego Marmsoler (Eds.). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 1:1–1:14. https://doi.org/10.4230/OASIcs.FMBC.2021.1
- Leonardo de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 337–340.
- DeFiLlama. 2023a. DeFiLlama - DeFi Dashboard. https://defillama.com/.
- DeFiLlama. 2023b. DeFiLlama - Oracles Dashboard. https://defillama.com/oracles.
- Artifact for OVer: Safeguarding DeFi Smart Contracts against Oracle Deviations. https://doi.org/10.5281/zenodo.10436720
- dforce Network. 2021. Lending Contracts. https://github.com/dforce-network/LendingContractsV2/tree/master/contracts.
- Etherscanners. 2020. xToken Victim Contract. https://etherscan.io/address/0x04bef870de607519c91d16a23434ad5745f62a63#code.
- Etherscanners. 2023. Yearn Attack. https://etherscan.io/tx/0xf6022012b73770e7e2177129e648980a82aab555f9ac88b8a9cda3ec44b30779.
- Euler. 2023. Euler Smart Contracts. https://github.com/euler-xyz/euler-contracts.
- Slither: a static analysis framework for smart contracts. In 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB). IEEE, 8–15.
- Chainlink Foundation. 2023a. Chainlink API. https://docs.chain.link/any-api/api-reference/.
- Ethereum Foundation. 2023b. The Solidity Contract-Oriented Programming Language. https://github.com/ethereum/solidity
- Contractfuzzer: Fuzzing smart contracts for vulnerability detection. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering. 259–269.
- Zeus: analyzing safety of smart contracts.. In Ndss. 1–12.
- Uniswap Labs. 2023. Uniswap Protocol. https://uniswap.org/.
- Towards automated verification of smart contract fairness. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 666–677.
- Making smart contracts smarter. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security. 254–269.
- TWAP Oracle Attacks: Easier Done than Said?. In 2022 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). 1–8. https://doi.org/10.1109/ICBC54727.2022.9805499
- Demystifying Loops in Smart Contracts (ASE ’20). Association for Computing Machinery, New York, NY, USA, 262–274. https://doi.org/10.1145/3324884.3416626
- Morpho. 2023. Morpho Aave. https://github.com/morpho-org/morpho-aave-v3/releases/tag/v1.0.0.
- Manticore: A user-friendly symbolic execution framework for binaries and smart contracts. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 1186–1189.
- sfuzz: An efficient adaptive fuzzer for solidity smart contracts. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering. 778–788.
- Trail of Bits. 2023. Slither: Static Analyzer for Solidity. https://github.com/crytic/slither.
- Attacking the defi ecosystem with flash loans for fun and profit. In International conference on financial cryptography and data security. Springer, 3–32.
- ItyFuzz: Snapshot-Based Fuzzer for Smart Contract. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis. 322–333.
- Tianyu Sun and Wensheng Yu. 2020. A formal verification framework for security issues of blockchain smart contracts. Electronics 9, 2 (2020), 255.
- Vyper Team. 2023. Vyper. https://vyper.readthedocs.io/en/stable/
- Smartcheck: Static analysis of ethereum smart contracts. In Proceedings of the 1st international workshop on emerging trends in software engineering for blockchain. 9–16.
- Formal analysis of composable DeFi protocols. In Financial Cryptography and Data Security. FC 2021 International Workshops: CoDecFin, DeFi, VOTING, and WTSC, Virtual Event, March 5, 2021, Revised Selected Papers 25. Springer, 149–161.
- Securify: Practical security analysis of smart contracts. In Proceedings of the 2018 ACM SIGSAC conference on computer and communications security. 67–82.
- Oracle-supported dynamic exploit generation for smart contracts. IEEE Transactions on Dependable and Secure Computing 19, 3 (2020), 1795–1809.
- ProMutator: Detecting vulnerable price oracles in DeFi by mutated transactions. In 2021 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW). IEEE, 380–385.
- DeFiRanger: Detecting Price Manipulation Attacks on DeFi Applications. arXiv:2104.15068 [cs.CR]
- Preventing Price Manipulation Attack by Front-Running. In International Conference on Artificial Intelligence and Security. Springer, 309–322.
- Park: Accelerating smart contract vulnerability detection via parallel-fork symbolic execution. In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis. 740–751.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.