Skip to content

snapshot-labs/sx-starknet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

af131eb · Oct 21, 2024
Oct 3, 2024
Oct 31, 2023
Oct 3, 2024
Oct 3, 2024
Oct 21, 2024
Oct 3, 2024
Sep 4, 2023
Aug 16, 2023
Aug 16, 2023
Oct 3, 2024
Oct 3, 2024
Aug 16, 2023
Jul 14, 2023
Oct 3, 2024
Sep 4, 2023
Oct 3, 2024
Oct 3, 2024
Sep 4, 2023
Oct 3, 2024

Repository files navigation

Snapshot X

A Cairo implementation of the Snapshot X Protocol. Refer to the documentation for more information.

Architecture

The repository is split into two different parts:

  1. The Cairo files are in a Scarb package under ./starknet. (Tested with Scarb version 0.7.0)
  2. The Solidity files are in a Forge 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:

cd starknet

Build contracts:

scarb build

Run tests:

scarb test

Run Solidity Tests

Enter directory:

cd ethereum

Build contracts:

forge build

Run tests:

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):

yarn hardhat node

Now run the tests:

yarn test-ts

Run Hardhat Tests

The Hardhat tests can be run following the procedure followed in the CI. You will need local Starknet Devnet and Ethereum devnet instances running.