Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevincharm/arbitrageurs-and-oracle-manipulators
https://github.com/kevincharm/arbitrageurs-and-oracle-manipulators
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/kevincharm/arbitrageurs-and-oracle-manipulators
- Owner: kevincharm
- Created: 2021-06-26T21:45:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-01T22:24:29.000Z (over 3 years ago)
- Last Synced: 2024-04-14T13:45:58.563Z (7 months ago)
- Language: TypeScript
- Size: 138 KB
- Stars: 10
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Countering Arbitrageurs and Resisting Oracle Manipulators in Ethereum Smart Contracts
This repository contains experiments performed for my Bachelor's research project at TU Delft, exploring frontrunning and oracle manipulation vulnerabilities. This project utilises Hardhat to fork Ethereum mainnet and run scripts.
## Frontrunning
The test case `test/frontrun.spec.ts` contains code exemplifying a typical sandwich attack on Uniswap, using frontrunning and backrunning via the PGA mechanism.
## Oracle Manipulation
The scripts `test/vulnerable-price-oracle.spec.ts` and `test/resistant-price-oracle.spec.ts` contain code demonstrating oracle manipulation attacks on the contracts in the `contracts/` directory. `contracts/VulnerableLendingProtocol.sol` is an example lending protocol that uses Uniswap V2 as a price oracle by calculating reserves, and is vulnerable to an oracle manipulation attack defined in `contracts/SimpleOracleAttack.sol`.
`contracts/ResistantLendingProtocol.sol` describes a lending protocol that uses a TWAP price oracle as a countermeasure to oracle manipulation.
## Running Experiments
To run the test cases, use the command `yarn test`.