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

dev: 🧹 Cleanup Oracle v1 #130

Merged
merged 11 commits into from
Oct 27, 2024
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
Binary file removed .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pragma-oracle
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gas_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
result=$(python scripts/gas_usage/compare_snapshot.py| sed 's/\x1b\[[0-9;]*m//g')
result=$(python pragma-deployer/pragma_deployer/gas_usage/compare_snapshot.py| sed 's/\x1b\[[0-9;]*m//g')
result=$(echo "$result" | grep -v "Archive:")
result=$(echo "$result" | grep -v "inflating:")
echo "$result" > temp_result.txt
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/run_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
uses: software-mansion/setup-scarb@v1

- name: Build with Scarb
run: scarb build
run: |
cd ../pragma-oracle
scarb build

- name: Run Starknet Devnet and scripts
env:
Expand Down
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Python
__pycache__
venv
scripts/__pycache__
scripts/venv
.venv
.ruff_cache

# starknet
node.json
Expand All @@ -19,7 +23,7 @@ build
pragma/build/*
*logs.json

.DS_Store
# Env files
.env

lint.sarif
Expand All @@ -42,9 +46,5 @@ tmp
# scarb
target

# Scripts

# Python
scripts/__pycache__
scripts/venv
.venv
# Devnet deployments should not be pushed
deployments/devnet
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Pragma is a decentralized oracle built natively on Starknet. It leverages cairo
- <a href="/src/publisher_registry">Publisher Registry</a> handles the registration of different publishers along with the sources they are allowed to push data from.
- <a href="/src/compute_engines">Summary Stats</a> acts as a proxy contract for more sophisticated kind of data aggregation such as _volatility_ and _mean_.
- <a href="/src/randomness">Randomness</a> is the VRF requestor implementation, also includes an example on how to request random words.
- <a href="/src/lp_pricer">LP Pricer</a> is a Pricing contract for LP tokens. It allows registering pools (which underlying assets are supported by Pragma) and prices them in USD.

## Testing

Expand Down Expand Up @@ -55,37 +54,55 @@ This repo will gradually replace the previous Pragma implementation in Cairo 0 w
- Summary Stats : [0x49eefafae944d07744d07cc72a5bf14728a6fb463c3eae5bca13552f5d455fd](https://voyager.online/contract/0x49eefafae944d07744d07cc72a5bf14728a6fb463c3eae5bca13552f5d455fd)
- VRF : [0x4fb09ce7113bbdf568f225bc757a29cb2b72959c21ca63a7d59bdb9026da661](https://voyager.online/contract/0x4fb09ce7113bbdf568f225bc757a29cb2b72959c21ca63a7d59bdb9026da661)

**Pragma Devnet**

- Oracle : [0x5bec6ca0be39624d95818d17857428c9995d4db5ddd088aefbf218b6d280f2a](https://pragma-voyager.karnot.xyz/contract/0x5bec6ca0be39624d95818d17857428c9995d4db5ddd088aefbf218b6d280f2a)
- Publisher Registry :
[0x1051e6a2110d4b9d18344214180415f8d524867e42794f09e4ca975668db541](https://pragma-voyager.karnot.xyz/contract/0x1051e6a2110d4b9d18344214180415f8d524867e42794f09e4ca975668db541)

## Local Deployment

Prerequisites:

- [Scarb](https://docs.swmansion.com/scarb/)
- 3.9 <= Python < 3.13
- 3.12 <= Python < 3.13
- [Poetry](https://python-poetry.org/)

1. Install dependencies
1. Compile contracts

```bash
cd pragma-oracle
scarb build
```

2. Install dependencies

```bash
cd ../pragma-deployer
python -m venv .venv && source .venv/bin/activate
poetry install
```

2. Compile contracts
3. Setup env file

```bash
scarb build
# Make sure you are in the pragma-deployer folder
cp .env.example .env
```

3. Deploy contracts & setup
Populate the variables depending on where you wish to deploy.

4. Deploy contracts & setup

Make sure your local devnet is running, see latest instructions [here](https://0xspaceshard.github.io/starknet-devnet-rs/).

You can also specify a different network by setting `STARKNET_NETWORK` to a different value e.g `sepolia | testnet | mainnet`.
You can also specify a different network by setting `STARKNET_NETWORK` to a different value e.g `sepolia`, `mainnet` or `pragma_devnet`.

```bash

STARKNET_NETWORK=devnet poetry run deploy-pragma
STARKNET_NETWORK=devnet poetry run deploy-summary-stats
STARKNET_NETWORK=devnet poetry run register-publishers
STARKNET_NETWORK=devnet poetry run deploy-pragma --port [DEVNET_PORT]
STARKNET_NETWORK=devnet poetry run deploy-summary-stats --port [DEVNET_PORT]
STARKNET_NETWORK=devnet poetry run register-publishers --port [DEVNET_PORT]

```

Expand All @@ -97,4 +114,4 @@ For any question or feedback you can send an email to <[email protected]>

## License

The code is under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0, see <a href="./LICENSE">LICENSE</a>.
The code is under the MIT LICENSE, see <a href="./LICENSE">LICENSE</a>.
9 changes: 0 additions & 9 deletions deployments/devnet/declarations.json

This file was deleted.

22 changes: 0 additions & 22 deletions deployments/devnet/deployments.json

This file was deleted.

9 changes: 0 additions & 9 deletions deployments/testnet/declarations.json

This file was deleted.

22 changes: 0 additions & 22 deletions deployments/testnet/deployments.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion kakarot/README.md → kakarot-evm-interface/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PragmaCaller deployer
# Pragma Oracle - Kakarot Interface

Sample scripts to be able to deploy the PragmaCaller contract to Kakarot and verify it.

Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading