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

L2 part of the bridge #1

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @maciejka
4 changes: 4 additions & 0 deletions .github/linter/base_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all
# lame rules
exclude_rule 'MD002'
exclude_rule 'MD041'
12 changes: 12 additions & 0 deletions .github/linter/readme_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all
# allow inline HTML for README fmt
exclude_rule 'MD033'
# badges trigger rule
exclude_rule 'MD034'
# README img serves as 'First Header'
exclude_rule 'MD002'
exclude_rule 'MD041'
# TODO: disable/enable not working for all-contribs
exclude_rule 'MD013'
# Allow no endline at the end
exclude_rule 'MD047'
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions: read-all

jobs:
l2-check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./l2
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.9.1"
- uses: foundry-rs/setup-snfoundry@v3
with:
starknet-foundry-version: 0.34.0
- run: pwd
- run: scarb --version
- run: scarb fmt --check
- run: scarb build
36 changes: 36 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: check

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions: read-all

jobs:
markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo gem install mdl
mdl -s .github/linter/readme_style.rb README.md
mdl -s .github/linter/base_style.rb .github

l2-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./l2
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.9.1"
- uses: foundry-rs/setup-snfoundry@v3
with:
starknet-foundry-version: 0.34.0
- run: pwd
- run: scarb --version
- run: scarb test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
.snfoundry_cache
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Pontis

`OP_CAT` enabled Bitcoin <> Starknet Bridge POC

<p align="center" width="100%">
Expand Down
67 changes: 67 additions & 0 deletions l2/Scarb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "openzeppelin_access"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:7734901a0ca7a7065e69416fea615dd1dc586c8dc9e76c032f25ee62e8b2a06c"
dependencies = [
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_account"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1aa3a71e2f40f66f98d96aa9bf9f361f53db0fd20fa83ef7df04426a3c3a926a"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_introspection"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:13e04a2190684e6804229a77a6c56de7d033db8b9ef519e5e8dee400a70d8a3d"

[[package]]
name = "openzeppelin_token"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:4452f449dc6c1ea97cf69d1d9182749abd40e85bd826cd79652c06a627eafd91"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_utils"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:44f32d242af1e43982decc49c563e613a9b67ade552f5c3d5cde504e92f74607"

[[package]]
name = "pontis"
version = "0.1.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_token",
"snforge_std",
]

[[package]]
name = "snforge_scarb_plugin"
version = "0.34.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.34.0#d6976d4635cbe69bd199fd502788c469d408ed2d"

[[package]]
name = "snforge_std"
version = "0.34.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.34.0#d6976d4635cbe69bd199fd502788c469d408ed2d"
dependencies = [
"snforge_scarb_plugin",
]
51 changes: 51 additions & 0 deletions l2/Scarb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[package]
name = "pontis"
version = "0.1.0"
edition = "2024_07"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.9.1"
openzeppelin_token = "0.20.0"
openzeppelin_access = "0.20.0"

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.34.0" }
assert_macros = "2.9.1"

[[target.starknet-contract]]
sierra = true

[scripts]
test = "snforge test"

# Visit https://foundry-rs.github.io/starknet-foundry/appendix/scarb-toml.html for more information

# [tool.snforge] # Define `snforge` tool section
# exit_first = true # Stop tests execution immediately upon the first failure
# fuzzer_runs = 1234 # Number of runs of the random fuzzer
# fuzzer_seed = 1111 # Seed for the random fuzzer

# [[tool.snforge.fork]] # Used for fork testing
# name = "SOME_NAME" # Fork name
# url = "http://your.rpc.url" # Url of the RPC provider
# block_id.tag = "latest" # Block to fork from (block tag)

# [[tool.snforge.fork]]
# name = "SOME_SECOND_NAME"
# url = "http://your.second.rpc.url"
# block_id.number = "123" # Block to fork from (block number)

# [[tool.snforge.fork]]
# name = "SOME_THIRD_NAME"
# url = "http://your.third.rpc.url"
# block_id.hash = "0x123" # Block to fork from (block hash)

# [profile.dev.cairo] # Configure Cairo compiler
# unstable-add-statements-code-locations-debug-info = true # Should be used if you want to use coverage
# unstable-add-statements-functions-debug-info = true # Should be used if you want to use coverage/profiler
# inlining-strategy = "avoid" # Should be used if you want to use coverage

# [features] # Used for conditional compilation
# enable_for_tests = [] # Feature name and list of other features that should be enabled with it
11 changes: 11 additions & 0 deletions l2/snfoundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Visit https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html
# and https://foundry-rs.github.io/starknet-foundry/projects/configuration.html for more information

# [sncast.default] # Define a profile name
# url = "https://free-rpc.nethermind.io/sepolia-juno/v0_7" # Url of the RPC provider
# accounts-file = "../account-file" # Path to the file with the account data
# account = "mainuser" # Account from `accounts_file` or default account file that will be used for the transactions
# keystore = "~/keystore" # Path to the keystore file
# wait-params = { timeout = 300, retry-interval = 10 } # Wait for submitted transaction parameters
# block-explorer = "StarkScan" # Block explorer service used to display links to transaction details
# show-explorer-links = true # Print links pointing to pages with transaction details in the chosen block explorer
Loading
Loading