-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates examples directory and removes proxy-consumer
- Loading branch information
1 parent
4ebc7bb
commit 7717098
Showing
33 changed files
with
962 additions
and
428 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
target | ||
.snfoundry_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# TODO: these helper commands may be useful for the deploy script(s) | ||
# | ||
# ACCOUNT_NAME="test-acct" | ||
# | ||
# create-account: | ||
# @sncast account create --name $(ACCOUNT_NAME) | ||
# | ||
# deploy-account: | ||
# @sncast account deploy --name $(ACCOUNT_NAME) | ||
|
||
run-script: | ||
@cd ./scripts && sncast script run $(NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Examples | ||
|
||
## Overview | ||
|
||
## Prerequisites | ||
|
||
|
||
To get started, ensure that you have the following tools installed on your machine: | ||
|
||
- [starknet-foundry (v0.18.0)](https://github.com/foundry-rs/starknet-foundry/releases/tag/v0.18.0) | ||
- [scarb (v2.5.4)](https://github.com/software-mansion/scarb/releases/tag/v2.5.4) | ||
|
||
## Running Test Cases | ||
|
||
To run all test cases, you can use the following command: | ||
|
||
```sh | ||
snforge test | ||
``` | ||
|
||
## Running Scripts | ||
|
||
To run a script, you can use the following command replacing the `NAME` argument with the name of the script to run: | ||
|
||
```sh | ||
make run-script NAME=example | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Code generated by scarb DO NOT EDIT. | ||
version = 1 | ||
|
||
[[package]] | ||
name = "aggregator_consumer" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"chainlink", | ||
"openzeppelin", | ||
"snforge_std", | ||
] | ||
|
||
[[package]] | ||
name = "chainlink" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"openzeppelin", | ||
] | ||
|
||
[[package]] | ||
name = "openzeppelin" | ||
version = "0.9.0" | ||
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.9.0#861fc416f87addbe23a3b47f9d19ab27c10d5dc8" | ||
|
||
[[package]] | ||
name = "snforge_std" | ||
version = "0.18.0" | ||
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.18.0#48f909a56b08cbdc5ca6a21a836b0fbc6c36d55b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This project was generated using snforge init | ||
# | ||
# https://foundry-rs.github.io/starknet-foundry/appendix/snforge/init.html | ||
# | ||
|
||
[package] | ||
name = "aggregator_consumer" | ||
version = "0.1.0" | ||
edition = "2023_11" | ||
|
||
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html | ||
|
||
[dependencies] | ||
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.9.0" } | ||
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.18.0" } | ||
chainlink = { path = "../../../contracts" } | ||
starknet = "2.5.4" | ||
|
||
[[target.starknet-contract]] | ||
casm = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Code generated by scarb DO NOT EDIT. | ||
version = 1 | ||
|
||
[[package]] | ||
name = "sncast_std" | ||
version = "0.18.0" | ||
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.18.0#48f909a56b08cbdc5ca6a21a836b0fbc6c36d55b" | ||
|
||
[[package]] | ||
name = "src" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"sncast_std", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "src" | ||
version = "0.1.0" | ||
edition = "2023_11" | ||
|
||
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html | ||
|
||
[dependencies] | ||
sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.18.0" } | ||
starknet = ">=2.5.4" |
5 changes: 5 additions & 0 deletions
5
examples/contracts/aggregator_consumer/scripts/src/deploy.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use sncast_std::{call, CallResult}; | ||
|
||
fn main() { | ||
println!("replace this with a deploy script!"); | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/contracts/aggregator_consumer/scripts/src/example.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use sncast_std::{call, CallResult}; | ||
|
||
// The example below uses a contract deployed to the Goerli testnet | ||
fn main() { | ||
let contract_address = 0x7ad10abd2cc24c2e066a2fee1e435cd5fa60a37f9268bfbaf2e98ce5ca3c436; | ||
let call_result = call(contract_address.try_into().unwrap(), 'get_greeting', array![]); | ||
assert(*call_result.data[0] == 'Hello, Starknet!', *call_result.data[0]); | ||
println!("{:?}", call_result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod example; | ||
mod deploy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# A full list of RPC endpoints can be found here: | ||
# | ||
# https://blastapi.io/public-api/starknet | ||
# | ||
|
||
[sncast.default] | ||
url = "https://starknet-testnet.public.blastapi.io/rpc/v0_6" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod sequencer_uptime_feed; |
Oops, something went wrong.