Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snapshot-labs/sx-starknet
Core smart contracts of Snapshot X for Starknet
https://github.com/snapshot-labs/sx-starknet
ethereum starknet
Last synced: 1 day ago
JSON representation
Core smart contracts of Snapshot X for Starknet
- Host: GitHub
- URL: https://github.com/snapshot-labs/sx-starknet
- Owner: snapshot-labs
- License: mit
- Created: 2021-10-27T13:37:37.000Z (about 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-05-15T15:37:57.000Z (8 months ago)
- Last Synced: 2024-05-17T00:42:47.840Z (8 months ago)
- Topics: ethereum, starknet
- Language: Cairo
- Homepage: https://docs.snapshotx.xyz
- Size: 12.9 MB
- Stars: 110
- Watchers: 6
- Forks: 67
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Audit: audited_cairo_libfuncs.json
Awesome Lists containing this project
README
# Snapshot X
A Cairo implementation of the Snapshot X Protocol. Refer to the [documentation](https://docs.snapshot.box) for more
information.## Architecture
The repository is split into two different parts:
1. The Cairo files are in a [Scarb](https://github.com/software-mansion/scarb) package under `./starknet`. (Tested with Scarb version 0.7.0)
2. The Solidity files are in a [Forge](https://github.com/foundry-rs/foundry) package under `./ethereum`. (Tested with Forge version 0.2.0)There is also Hardhat Project in the root directory for crosschain tests.
#### Run Cairo Tests
Enter directory:
```sh
cd starknet
```Build contracts:
```sh
scarb build
```Run tests:
```sh
scarb test
```### Run Solidity Tests
Enter directory:
```sh
cd ethereum
```Build contracts:
```sh
forge build
```Run tests:
```sh
forge test
```### Run L1 <-> L2 tests and signature tests (typescript tests)
On a separate terminal, spin an L1 node (hardhat in this example, but could be anvil):
```sh
yarn hardhat node
```Now run the tests:
```sh
yarn test-ts
```#### Run Hardhat Tests
The Hardhat tests can be run following the procedure followed in the [CI](.github/workflows/test.yml). You will need local Starknet Devnet and Ethereum devnet instances running.