Skip to content

Analyzing Olympus V2 protocol and smart contracts (WIP)

License

Notifications You must be signed in to change notification settings

joescharf/olympus-v2-analysis

 
 

Repository files navigation

Ω Olympus V2 Smart Contract Analysis

Overview

One of the best ways to come up to speed on solidity, smart contracts, DeFi, and Olympus V2 is to dive into the code. The following posts are my notes as I've been digging into the Olympus V2 contracts to better understand how it all works.

This repository contains some scripts I've developed to investigate the v2 contracts along with some changes and additions to support deploying to the IOTA EVM testnet.

This repository is forked from the Olympus Contracts Repository and references the v2.0 tag (commit 3bb3605)

Table of Contents

Quickstart

Clone the analysis repository (this repo)

# Clone the repo and install node modules
git clone https://github.com/joescharf/olympus-v2-analysis.git
cd olympus-v2-analysis
yarn install

Create .env file

MNEMONIC="twelve secret words designating your wallet accounts ..."
ALCHEMY_API_KEY="your_alchemy_api_key"
IOTA_PRIVATE_KEY="your_iota_evm_testnet_private_key"

Deploy the contracts, run tests and checkDeployment script:

# start local json-rpc server and deploy all the contracts.
# uses overloaded hardhat-node provided by hardhat-deploy plugin
npx hardhat node

## You'll probably get an error along the lines of:
## scripts/deploy/005_deploy_treasury.ts:5:42 - error TS2307: Cannot find module '../../types' or its corresponding type declarations.

## Fix: Just run the deployment again!
npx hardhat node

# Run test suite:
npx hardhat test

# Run checkDeployment script
npx hardhat run --network localhost scripts/00_checkDeployment.ts

## Dispense some OHM from the Faucet
npx hardhat run --network localhost scripts/01_dispenseOHM.ts

Other Commands and Scripts

# Deploy just the testnet
npx hardhat deploy --network localhost --tags testnet

# Test the iota evm by attempting to deploy just the OlympusAuthority
npx hardhat deploy --network iota --tags OlympusAuthority

About

Analyzing Olympus V2 protocol and smart contracts (WIP)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Solidity 68.8%
  • TypeScript 18.1%
  • JavaScript 12.8%
  • Other 0.3%