Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh: Project Structure refactor #12

Merged
merged 5 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DEPLOYER_PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1

ETHEREUM_GOERLI_RPC=API
ETHEREUM_SEPOLICA_RPC=API

ETHERSCAN_API_KEY=API
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,9 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/yarn.lock') }}

- name: Create mock .env file
run: |
cp .env.test .env
- name: All Tests pass
run: yarn test
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
node_modules/

# Hardhat / Solidity
contracts/cache
contracts/artifacts
contracts/coverage
contracts/coverage.json
contracts/typechain
contracts/typechain-types
contracts/ignition/deployments/**/build-info
contracts/ignition/deployments/**/artifacts/*.dbg.json
/cache
/artifacts
/coverage
/coverage.json
/typechain
/typechain-types
/ignition/deployments/**/build-info
/ignition/deployments/**/artifacts/*.dbg.json
File renamed without changes.
File renamed without changes.
59 changes: 55 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Token Price Oracle
A simple oracle for tracking token prices on-chain and accompanying API
for tracking & management of the data.
![Token Price Oracle - SC - banner](./assets/banner.jpeg)
# Token Price Oracle - Smart Contracts πŸ“‘
The core Solidity contracts for the Token Price Oracle

## Contributions
## Requirements βœ…
To run the project, you'll need:
- [Node.js](https://nodejs.org/en/) (Version 16 works)
- [Yarn](https://yarnpkg.com/)

## Running the project πŸš€
### Installation βš™οΈ
#### Git πŸ¦‘
1. Clone the repo: ```git clone https://github.com/pajicf/token-price-oracle.git```
2. Navigate to the folder: ```cd token-price-oracle```

#### Installing the dependencies 🧱
3. Run ```yarn``` to install the dependencies
4. Run ```cp .env.example .env``` and fill the values

#### Hardhat πŸ‘·β€β™‚οΈ
- Compile: ```yarn compile```
- Tests: ```yarn test```

#### Contracts CLI πŸ§‘β€πŸ’»
- Set a new price for a ticker: ```yarn contracts:set-ticker-price```
- Set a new feed for a ticker: ```yarn contracts:set-ticker-feed```

#### Miscellanious 🧹
- Project linting: ```yarn lint```
- Documentation generation: ```yarn docs:generate```

## Documentation πŸ“š
All the Smart Contract documentation can be found inside the `/docs` folder:
- [`docs/api`](https://github.com/pajicf/token-price-oracle/tree/main/docs/api) - Contains the API of the Smart Contracts generated from the natspec
- [`docs/diagrams`](https://github.com/pajicf/token-price-oracle/tree/main/docs/diagrams) - Contains the Diagrams of common SC interactions

## Deployments 🌐
### How to Deploy on a new network? πŸ“œ
The Deployment is done decoratively using [Hardhat Ignition](https://hardhat.org/ignition/docs/getting-started#overview).
To deploy to the new network, you should:
1. Add the network to the [`hardhat.config.ts`](https://github.com/pajicf/token-price-oracle/blob/main/contracts/hardhat.config.ts) file
2. Run ```yarn hardhat ignition deploy /ignition/modules/TickerPriceStorage.ts --network yournewnetwok --verify```
> [!IMPORTANT]
> Ensure that the network you're deploying supports Etherscan for verification to be successfull
### Bytecode πŸ’Ό
All the deployment and build artifacts are located inside [`ignition/deplotments`](https://github.com/pajicf/token-price-oracle/tree/main/ignition/deployments)

### Block Explorer Links πŸ”Ž
Ξ Ethereum Gâerli:
`TickerUSDFeedRegistry`: [0xF3D020838782213d3da52daa079A9c07F0A8e67e](https://goerli.etherscan.io/address/0xF3D020838782213d3da52daa079A9c07F0A8e67e#code)
`TickerPriceStorage`: [0xa909e0bC9a35cC161dE9eA85cA76AB7A9b5b0121](https://goerli.etherscan.io/address/0xa909e0bC9a35cC161dE9eA85cA76AB7A9b5b0121#code)

Ξ Ethereum Sepolia:
`TickerUSDFeedRegistry`: [0xF3D020838782213d3da52daa079A9c07F0A8e67e](https://sepolia.etherscan.io/address/0xF3D020838782213d3da52daa079A9c07F0A8e67e#code)
`TickerPriceStorage`: [0xa909e0bC9a35cC161dE9eA85cA76AB7A9b5b0121](https://sepolia.etherscan.io/address/0xa909e0bC9a35cC161dE9eA85cA76AB7A9b5b0121#code)
File renamed without changes
56 changes: 0 additions & 56 deletions contracts/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading