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

feat(target_chains/ethereum): add arbirum stylus sdk #2041

Open
wants to merge 164 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
e002660
chore: init stylus project
Ifechukwudaniel Sep 18, 2024
8d19bc1
chore: added scripts
Ifechukwudaniel Sep 18, 2024
08c010c
chore: created workspace
Ifechukwudaniel Sep 18, 2024
483eced
chore: docs setup
Ifechukwudaniel Sep 18, 2024
9d4a368
chore: pyth contracts init
Ifechukwudaniel Sep 19, 2024
900f2d4
chore: docs command setup
Ifechukwudaniel Sep 19, 2024
583ca72
mock: example project
Ifechukwudaniel Sep 19, 2024
c813c7a
chore : created test workspace
Ifechukwudaniel Sep 19, 2024
c088e12
chore: changed toml version
Ifechukwudaniel Sep 19, 2024
62030d7
chore: created mock pyth workspace
Ifechukwudaniel Sep 20, 2024
d731068
chore: renamed project sdk
Ifechukwudaniel Sep 23, 2024
83ccc12
chore: refactored files
Ifechukwudaniel Sep 24, 2024
e94d4c5
chore : helpers functions
Ifechukwudaniel Sep 24, 2024
c891962
refacor : refactord code
Ifechukwudaniel Sep 24, 2024
93a7291
chore: removed struct type , implemented abstract_pyth
Ifechukwudaniel Sep 27, 2024
65ea9a5
chore: created storage price and storage price feed
Ifechukwudaniel Sep 27, 2024
28019ed
chore: integrating storage price and storage price feed
Ifechukwudaniel Sep 27, 2024
81f45ae
chore: fixed error created by storage type
Ifechukwudaniel Oct 3, 2024
96dda48
chore: config changes
Ifechukwudaniel Oct 3, 2024
dc847cd
chore: forge init
Ifechukwudaniel Oct 3, 2024
6588fe6
forge install: forge-std
Ifechukwudaniel Oct 3, 2024
da11d45
mock pyth : created mock solidity pyth contract
Ifechukwudaniel Oct 3, 2024
5cc9626
chore: Renamed MockPyth Scripts
Ifechukwudaniel Oct 4, 2024
da154c0
chore: started testing
Ifechukwudaniel Oct 5, 2024
e3302d8
chore: removed projects
Ifechukwudaniel Oct 14, 2024
824d767
feture :completed unit test and stylus contracts
Ifechukwudaniel Oct 14, 2024
60baf08
added initializtion for mock
Ifechukwudaniel Oct 14, 2024
86ad529
examples setup
Ifechukwudaniel Oct 14, 2024
a131593
chore:fixed imports
Ifechukwudaniel Oct 23, 2024
299b0ce
chore:fixed types
Ifechukwudaniel Oct 23, 2024
7ac267f
completed contract
Ifechukwudaniel Oct 23, 2024
41e3009
External call and fution call sample
Ifechukwudaniel Oct 23, 2024
05b9593
chore: Changed motsu
Ifechukwudaniel Oct 23, 2024
70e2e6c
chore: Created Proxy call example
Ifechukwudaniel Oct 24, 2024
5ad08c4
feture: Example for both type of call
Ifechukwudaniel Oct 24, 2024
568ba56
chore: Added beches
Ifechukwudaniel Oct 24, 2024
72a9b5b
Lib Changes
Ifechukwudaniel Oct 24, 2024
ec4d75b
chore:Scripts modifications
Ifechukwudaniel Oct 24, 2024
047a73d
chore : fuction call and proxy call
Ifechukwudaniel Oct 24, 2024
ded7cb4
chore: added workflow
Ifechukwudaniel Oct 24, 2024
d31557a
chore: doc pages docs
Ifechukwudaniel Oct 24, 2024
86dfbb1
chore: doc changes
Ifechukwudaniel Oct 24, 2024
bcd86d6
smaller chages
Ifechukwudaniel Oct 24, 2024
94517ee
chore: benches and toml changes
Ifechukwudaniel Oct 27, 2024
703e43a
chore: added foundry to e2e workflow
Ifechukwudaniel Oct 28, 2024
28fa93e
chore:set up benchmark
Ifechukwudaniel Oct 28, 2024
22bae51
Added Benches
Ifechukwudaniel Oct 28, 2024
85cd41c
chore:added setup mock pyth script to bench and e2e and logs
Ifechukwudaniel Oct 28, 2024
d1c010b
changes
Ifechukwudaniel Oct 29, 2024
8826fa5
feture: Added Proxy call to bench
Ifechukwudaniel Oct 30, 2024
343de13
chore: Removed sol file
Ifechukwudaniel Oct 30, 2024
1407ed4
Added deploy scripts
Ifechukwudaniel Oct 30, 2024
15a47a9
chore: proxy calls
Ifechukwudaniel Oct 30, 2024
5904a1a
chore: removed file
Ifechukwudaniel Oct 30, 2024
28d9316
changes
Ifechukwudaniel Oct 30, 2024
74a4dd4
chore:added constructor file and worked on bench
Ifechukwudaniel Oct 31, 2024
b1dc655
chore: moved Ipyth to pyth-contract file
Ifechukwudaniel Oct 31, 2024
5fafd30
chore: added variable to bash scripts
Ifechukwudaniel Oct 31, 2024
5171513
chore:decode and encode helper
Ifechukwudaniel Oct 31, 2024
08fd4cb
chore: fixed mock pyth deploy script
Ifechukwudaniel Nov 1, 2024
e5ba09d
chore: removed dotenv crates
Ifechukwudaniel Nov 1, 2024
d1d5cec
chore: completed benches functions
Ifechukwudaniel Nov 1, 2024
64e3be5
chore: examples and proxy call fixes
Ifechukwudaniel Nov 1, 2024
69b61df
changes
Ifechukwudaniel Nov 1, 2024
a21b5fa
chore: added create functions
Ifechukwudaniel Nov 2, 2024
b354747
chore: completed get data benchmarks
Ifechukwudaniel Nov 3, 2024
d1a4eae
chore:contract changes
Ifechukwudaniel Nov 3, 2024
8464896
chore:function calls
Ifechukwudaniel Nov 3, 2024
196018c
chore: Ignore all broadcast
Ifechukwudaniel Nov 3, 2024
072ec4e
chore: completed get benches
Ifechukwudaniel Nov 3, 2024
70432b7
chore:changes
Ifechukwudaniel Nov 3, 2024
cd728b6
chore: Added Type Test
Ifechukwudaniel Nov 4, 2024
30c5056
chore: tests
Ifechukwudaniel Nov 5, 2024
908b866
env and examples
Ifechukwudaniel Nov 5, 2024
3538303
Update README.md
Ifechukwudaniel Nov 5, 2024
bd054a3
Update README.md
Ifechukwudaniel Nov 5, 2024
e0f68e4
Update README.md
Ifechukwudaniel Nov 5, 2024
58f5a2d
chore: worked on bench and e2e test
Ifechukwudaniel Nov 6, 2024
0af7c1a
removed log
Ifechukwudaniel Nov 6, 2024
f389baa
chore: completed e2e test for function call example
Ifechukwudaniel Nov 7, 2024
9471852
chore : changed pyth script
Ifechukwudaniel Nov 7, 2024
dee2846
chore:completed e2e test
Ifechukwudaniel Nov 7, 2024
9a8d23d
chore:benches
Ifechukwudaniel Nov 7, 2024
ebb4858
Update README.md
Ifechukwudaniel Nov 7, 2024
0f6da86
Update README.md
Ifechukwudaniel Nov 7, 2024
4b84ac0
Update README.md
Ifechukwudaniel Nov 7, 2024
d5b33e0
Update README.md
Ifechukwudaniel Nov 7, 2024
87ea83b
Update README.md
Ifechukwudaniel Nov 7, 2024
46810a6
Merge branch 'pyth-network:main' into stylus-sdk
Ifechukwudaniel Nov 7, 2024
de44253
chore: removed docs
Ifechukwudaniel Nov 7, 2024
670456a
Update README.md
Ifechukwudaniel Nov 7, 2024
4b8f43c
Update README.md
Ifechukwudaniel Nov 7, 2024
0625759
Update CODEOWNERS
Ifechukwudaniel Nov 9, 2024
1924721
Delete target_chains/ethereum/sdk/stylus/SECURITY.md
Ifechukwudaniel Nov 9, 2024
b7e1a30
Delete target_chains/ethereum/sdk/stylus/lib/crypto directory
Ifechukwudaniel Nov 9, 2024
2ca8638
Delete target_chains/ethereum/sdk/stylus/.linkspector.yml
Ifechukwudaniel Nov 9, 2024
4ee4ccf
Delete target_chains/ethereum/sdk/stylus/netlify.toml
Ifechukwudaniel Nov 9, 2024
bf3199d
Update Cargo.toml removed openzepline crypto
Ifechukwudaniel Nov 9, 2024
a74751d
Update README.md
Ifechukwudaniel Nov 9, 2024
3ed5a92
Delete target_chains/ethereum/sdk/stylus/pyth-solidity/.env.example
Ifechukwudaniel Nov 9, 2024
7d2f445
Update gas-bench.yml
Ifechukwudaniel Nov 9, 2024
5c2b2c0
chore:removed a bunch of openzeplin files
Ifechukwudaniel Nov 9, 2024
038015b
chore: removed workflow
Ifechukwudaniel Nov 9, 2024
013ea47
chore:Added Guidlines
Ifechukwudaniel Nov 9, 2024
655e55e
chore: motsu changes
Ifechukwudaniel Nov 11, 2024
9628334
Create Test.md
Ifechukwudaniel Nov 11, 2024
3628d14
Update Test.md
Ifechukwudaniel Nov 11, 2024
859e6e8
Rename Test.md to TEST.md
Ifechukwudaniel Nov 11, 2024
28c3def
Update README.md
Ifechukwudaniel Nov 11, 2024
42241a6
Update README.md
Ifechukwudaniel Nov 11, 2024
45ff362
Update README.md
Ifechukwudaniel Nov 11, 2024
a118553
Delete target_chains/ethereum/sdk/stylus/TEST.md
Ifechukwudaniel Nov 11, 2024
5f5bc5e
chore: removed mostu
Ifechukwudaniel Nov 11, 2024
1397b2b
chore: changed Fixedbytes<32> to B256
Ifechukwudaniel Nov 11, 2024
6b37ea5
chore: removed local e2e testing library
Ifechukwudaniel Nov 11, 2024
b2ab6db
chore: changes
Ifechukwudaniel Nov 12, 2024
a610d23
forge install: forge-std
Ifechukwudaniel Nov 12, 2024
86a5d4a
forge install: openzeppelin-foundry-upgrades
Ifechukwudaniel Nov 12, 2024
819f8a1
forge install: openzeppelin-contracts
Ifechukwudaniel Nov 12, 2024
bc78af5
chore: formated code
Ifechukwudaniel Nov 14, 2024
36b862d
Merge branch 'main' into stylus-sdk
Ifechukwudaniel Nov 16, 2024
8617b13
chore: fixed scripts
Ifechukwudaniel Nov 17, 2024
746dfdf
Update target_chains/ethereum/sdk/stylus/README.md
Ifechukwudaniel Nov 25, 2024
fa25f06
Update target_chains/ethereum/sdk/stylus/README.md
Ifechukwudaniel Nov 25, 2024
fb942d2
chore: rustfmt changes
Ifechukwudaniel Nov 25, 2024
c2e0629
chore: changed solidity licenses to Apache 2
Ifechukwudaniel Nov 25, 2024
cf0f807
chore: deleted codeowner file and link
Ifechukwudaniel Nov 25, 2024
1b1e351
chore: removed comments
Ifechukwudaniel Nov 25, 2024
7c529fe
solidity changes
Ifechukwudaniel Nov 25, 2024
c1e656d
chore: removed folder
Ifechukwudaniel Nov 25, 2024
c9be56a
chore: removed = for version
Ifechukwudaniel Nov 25, 2024
8831682
forge install: forge-std
Ifechukwudaniel Nov 25, 2024
88ace13
forge install: openzeppelin-foundry-upgrades
Ifechukwudaniel Nov 25, 2024
1cd711e
forge install: openzeppelin-contracts-upgradeable
Ifechukwudaniel Nov 25, 2024
841af31
chore: Remove MIT license
Ifechukwudaniel Nov 25, 2024
f6a5fe6
chore: script changes
Ifechukwudaniel Nov 25, 2024
ce78d45
chore: removed dependices
Ifechukwudaniel Nov 25, 2024
f693364
forge install: forge-std
Ifechukwudaniel Nov 25, 2024
7a63cfd
forge install: openzeppelin-foundry-upgrades
Ifechukwudaniel Nov 25, 2024
42903d5
chore:added description to script
Ifechukwudaniel Nov 25, 2024
45d2d8d
Update target_chains/ethereum/sdk/stylus/README.md
Ifechukwudaniel Nov 25, 2024
3912338
Update target_chains/ethereum/sdk/stylus/README.md
Ifechukwudaniel Nov 25, 2024
50c7cb9
Update target_chains/ethereum/sdk/stylus/contracts/src/pyth/mod.rs
Ifechukwudaniel Nov 25, 2024
a399be4
Update target_chains/ethereum/sdk/stylus/contracts/src/pyth/errors.rs
Ifechukwudaniel Nov 25, 2024
4e00e9f
chore: changed // to /// and remove licenses because of root licenese
Ifechukwudaniel Nov 25, 2024
86e1b5b
chore: Apache-2.0 license
Ifechukwudaniel Nov 25, 2024
a91e478
chore: renamed file name pyth-solidity to pyth-mock-solidity
Ifechukwudaniel Nov 25, 2024
ebe40a8
Merge branch 'main' into stylus-sdk
Ifechukwudaniel Nov 25, 2024
f01d0e8
chore: removed commented code
Ifechukwudaniel Nov 25, 2024
a87645b
chore: foundry test workflow
Ifechukwudaniel Nov 25, 2024
ad0468f
chore: workflows
Ifechukwudaniel Nov 25, 2024
d3167e0
chore: changed readme to rust
Ifechukwudaniel Nov 25, 2024
7f53584
chore: fixed description mock solidity
Ifechukwudaniel Nov 25, 2024
605fc58
chore: fixed zero case
Ifechukwudaniel Nov 26, 2024
233f68b
chore: change all use case of gt and lt to > and <
Ifechukwudaniel Nov 26, 2024
d0973f2
chore: workflow
Ifechukwudaniel Nov 26, 2024
cea2843
chore: replaced the file with the link
Ifechukwudaniel Nov 26, 2024
0fdbb3e
chore: refactor and removed unused code
Ifechukwudaniel Nov 26, 2024
36f05f4
chore: renamed function for test
Ifechukwudaniel Nov 26, 2024
658ad51
chore: added some sort of path filters
Ifechukwudaniel Nov 26, 2024
5a15e17
Merge pull request #1 from pyth-network/main
Ifechukwudaniel Nov 27, 2024
dd82af7
chore: add cargo fmt and cargo clippy for stylus sdk
Ifechukwudaniel Nov 28, 2024
8e7c7cc
chore: package-json.lock moved depencies to pnpm-workspace.yaml
Ifechukwudaniel Nov 28, 2024
9e34259
chore:test attribute
Ifechukwudaniel Nov 28, 2024
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
20 changes: 20 additions & 0 deletions .github/workflows/publish-pythnet-stylus-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Pyth Stylus SDK to crates.io

on:
push:
tags:
- pythnet-stylus-sdk-v*
# jobs:
# publish-pythnet-sdk:
# name: Publish Pythnet SDK
# runs-on: ubuntu-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v2

# - run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# working-directory: "pythnet/pythnet_sdk"

#Just seetinh up this script
18 changes: 14 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
[submodule "lazer/contracts/evm/lib/forge-std"]
path = lazer/contracts/evm/lib/forge-std

[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lazer/contracts/evm/lib/openzeppelin-contracts-upgradeable"]
path = lazer/contracts/evm/lib/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "target_chains/ethereum/sdk/stylus/pyth-mock-solidity/lib/forge-std"]
path = target_chains/ethereum/sdk/stylus/pyth-mock-solidity/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "target_chains/ethereum/sdk/stylus/pyth-mock-solidity/lib/openzeppelin-foundry-upgrades"]
path = target_chains/ethereum/sdk/stylus/pyth-mock-solidity/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lazer/contracts/evm/lib/openzeppelin-contracts"]
path = lazer/contracts/evm/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,15 @@ repos:
entry: cargo +1.82.0 clippy --manifest-path ./lazer/Cargo.toml --all-targets -- --deny warnings
pass_filenames: false
files: lazer
- id: cargo-fmt-stylus-sdk
name: Cargo format for Stylus SDK
language: "rust"
entry: cargo +1.82.0 fmt --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all
pass_filenames: false
files: target_chains/ethereum/sdk/stylus
- id: cargo-clippy-stylus-sdk
name: Cargo clippy for Stylus SDK
language: "rust"
entry: cargo +1.82.0 clippy --manifest-path ./target_chains/ethereum/sdk/stylus/Cargo.toml --all-targets -- --deny warnings
pass_filenames: false
files: target_chains/ethereum/sdk/stylus
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at 1eea5b
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
1 change: 1 addition & 0 deletions lib/openzeppelin-foundry-upgrades
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ packages:
- "target_chains/ethereum/entropy_sdk/solidity"
- "target_chains/ethereum/sdk/js"
- "target_chains/ethereum/sdk/solidity"
- "target_chains/ethereum/sdk/stylus/pyth-mock-solidity"
- "target_chains/ethereum/examples/coin_flip/app"
- "target_chains/fuel/sdk/js"
- "target_chains/starknet/sdk/js"
Expand All @@ -44,6 +45,7 @@ catalog:
"@next/third-parties": 15.0.2
"@phosphor-icons/react": 2.1.7
"@pythnetwork/client": 2.22.0
"@pythnetwork/pyth-sdk-solidity": 4.0.0
"@react-hookz/web": 24.0.4
"@solana/web3.js": 1.95.4
"@storybook/addon-essentials": 8.3.5
Expand Down
8 changes: 8 additions & 0 deletions target_chains/ethereum/sdk/stylus/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.wasm32-unknown-unknown]
rustflags = ["-C", "link-arg=-zstack-size=8192"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
36 changes: 36 additions & 0 deletions target_chains/ethereum/sdk/stylus/.github/workflows/check-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: check-wasm
# This workflow checks that the compiled wasm binary of every example contract
# can be deployed to Arbitrum Stylus.
on:
pull_request:
paths:
- target_chains/ethereum/sdk/stylus/** **
push:
branches:
- main
paths:
- target_chains/ethereum/sdk/stylus/**
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
check-wasm:
name: Check WASM binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""

- name: Install cargo-stylus
run: cargo install [email protected]

- name: Run wasm check
run: ./scripts/check-wasm.sh
132 changes: 132 additions & 0 deletions target_chains/ethereum/sdk/stylus/.github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: check
# This workflow runs whenever a PR is opened or updated, or a commit is pushed
# to main. It runs several checks:
# - fmt: checks that the code is formatted according to `rustfmt`.
# - clippy: checks that the code does not contain any `clippy` warnings.
# - doc: checks that the code can be documented without errors.
# - hack: check combinations of feature flags.
# - typos: checks for typos across the repo.
permissions:
contents: read
# This configuration allows maintainers of this repo to create a branch and
# pull request based on the new branch. Restricting the push trigger to the
# main branch ensures that the PR only gets built once.
on:
pull_request:
paths:
- target_chains/ethereum/sdk/stylus/** **
push:
branches:
- main
paths:
- target_chains/ethereum/sdk/stylus/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
runs-on: ubuntu-latest
name: nightly / fmt
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
# We run in nightly to make use of some features only available there.
# Check out `rustfmt.toml` to see which ones.
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
rustflags: ""

- name: Check formatting
run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
permissions:
contents: read
checks: write
strategy:
fail-fast: false
matrix:
# Get early warning of new lints which are regularly introduced in beta
# channels.
toolchain: [ stable, beta ]
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install rust ${{ matrix.toolchain }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
rustflags: ""

- name: Cargo clippy
uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
doc:
# Run docs generation on nightly rather than stable. This enables features
# like https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html
# which allows an API be documented as only available in some specific
# platforms.
runs-on: ubuntu-latest
name: nightly / doc
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
rustflags: ""

- name: Cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
hack:
# `cargo-hack` checks combinations of feature flags to ensure that features
# are all additive which is required for feature unification.
runs-on: ubuntu-latest
name: ubuntu / stable / features
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
rustflags: ""

- name: Cargo install cargo-hack
uses: taiki-e/install-action@cargo-hack
# Intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# `--feature-powerset` runs for every combination of features. Note that
# target in this context means one of `--lib`, `--bin`, etc, and not the
# target triple.
- name: Cargo hack
run: cargo hack check --feature-powerset --depth 2 --release --target wasm32-unknown-unknown --skip std --workspace --exclude e2e --exclude basic-example-script --exclude benches
typos:
runs-on: ubuntu-latest
name: ubuntu / stable / typos
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling of files in the workspace
uses: crate-ci/[email protected]
52 changes: 52 additions & 0 deletions target_chains/ethereum/sdk/stylus/.github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow runs our end-to-end tests suite.
#
# It roughly follows these steps:
# - Install rust
# - Install `cargo-stylus`
# - Install `solc`
# - Spin up `nitro-testnode`
#
# Contract deployments and account funding happen on a per-test basis.
name: e2e
permissions:
contents: read
on:
pull_request:
paths:
- target_chains/ethereum/sdk/stylus/** **
push:
branches:
- main
paths:
- target_chains/ethereum/sdk/stylus/**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
required:
name: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: "e2e-tests"
rustflags: ""

- name: Install cargo-stylus
run: cargo install [email protected]

- name: Install solc
run: |
curl -LO https://github.com/ethereum/solidity/releases/download/v0.8.24/solc-static-linux
sudo mv solc-static-linux /usr/bin/solc
sudo chmod a+x /usr/bin/solc

- name: Setup nitro node
run: ./scripts/nitro-testnode.sh -d -i
- name: run integration tests
run: ./scripts/e2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: foundry-test

on:
pull_request:
paths:
- target_chains/ethereum/sdk/stylus/** **
push:
branches:
- main
paths:
- target_chains/ethereum/sdk/stylus/**

env:
FOUNDRY_PROFILE: ci

jobs:
check:
name: Foundry project
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Show Forge version
run: forge --version

- name: Change directory to pyth-mock-solidity
run: cd pyth-mock-solidity

- name: Run Forge fmt
run: forge fmt --check
id: fmt

- name: Run Forge build
run: forge build --sizes
id: build

- name: Run Forge tests
run: forge test -vvv
id: test
Loading