-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
27,931 additions
and
26,446 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
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
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,41 @@ | ||
# Starkli config. | ||
config := --account katana-0 \ | ||
--rpc http://0.0.0.0:5050 | ||
|
||
# Build files helpers. | ||
build := ./target/dev/controller_ | ||
sierra := .contract_class.json | ||
compiled := .compiled_contract_class.json | ||
store := ./packages/account_sdk/compiled/ | ||
|
||
# Contract params for deploy. | ||
test_pubkey = 0x1234 | ||
katana_0 = 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 | ||
|
||
generate_artifacts: | ||
scarb --manifest-path ./packages/contracts/controller/Scarb.toml build | ||
mkdir -p ${store} | ||
|
||
jq . ${build}CartridgeAccount${sierra} > ${store}controller${sierra} | ||
jq . ${build}ERC20${sierra} > ${store}erc20${sierra} | ||
|
||
cp ${build}CartridgeAccount${compiled} ${store}controller${compiled} | ||
cp ${build}ERC20${compiled} ${store}erc20${compiled} | ||
|
||
cainome --artifacts-path packages/account_sdk/compiled --parser-config packages/account_sdk/parser_config.json --output-dir packages/account_sdk/src/abigen --rust | ||
|
||
deploy-katana: | ||
@set -x; \ | ||
erc20_class=$$(starkli class-hash ${build}ERC20${sierra}); \ | ||
account_class=$$(starkli class-hash ${build}Account${sierra}); \ | ||
starkli declare ${build}Account${sierra} ${config}; \ | ||
starkli deploy "$${account_class}" ${test_pubkey} --salt 0x1234 ${config}; \ | ||
starkli declare ${build}ERC20${sierra} ${config}; \ | ||
starkli deploy "$${erc20_class}" str:token str:tkn u256:1 ${katana_0} --salt 0x1234 ${config}; | ||
|
||
test-session: generate_artifacts | ||
rm -rf ./account_sdk/log | ||
cargo test --manifest-path account_sdk/Cargo.toml session -- --nocapture | ||
|
||
clean: | ||
rm -rf ./target |
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
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,21 @@ | ||
[workspace] | ||
members = [ | ||
"packages/contracts/controller", | ||
"packages/contracts/auth", | ||
"packages/contracts/session", | ||
] | ||
|
||
[workspace.package] | ||
edition = "2023_10" | ||
version = "0.1.0" | ||
|
||
[workspace.dependencies] | ||
starknet = "2.6.3" | ||
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "cairo-v2.6.0" } | ||
alexandria_encoding = { git = "https://github.com/keep-starknet-strange/alexandria.git", rev = "cairo-v2.6.0" } | ||
alexandria_merkle_tree = { git = "https://github.com/keep-starknet-strange/alexandria.git", tag = "cairo-v2.6.0" } | ||
alexandria_data_structures = { git = "https://github.com/keep-starknet-strange/alexandria.git", tag = "cairo-v2.6.0" } | ||
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.20.0" } | ||
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.10.0" } | ||
controller_auth = { path = "packages/contracts/auth" } | ||
controller_session = { path = "packages/contracts/session" } |
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
Oops, something went wrong.