Skip to content

Commit

Permalink
Merge pull request #9 from anshalshukla/starkgate
Browse files Browse the repository at this point in the history
Eth/ERC20 Bridge related contracts
  • Loading branch information
apoorvsadana authored Apr 10, 2024
2 parents 9fe4217 + 06d35f4 commit 55511ad
Show file tree
Hide file tree
Showing 63 changed files with 1,387 additions and 185 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ docs/
# Dotenv file
.env

script/anvil.json
script/anvil.json

.idea
120 changes: 107 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2"
members = [
"crates/starknet-core-contract-client",
"crates/sandbox",
"crates/ethereum-instance", "crates/starknet-eth-bridge-client", "crates/starknet-token-bridge-client", "crates/starkgate-manager-client", "crates/utils", "crates/starknet-erc20-client", "crates/starkgate-registry-client", "crates/starknet-proxy-client",
]

[workspace.package]
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
.PHONY: artifacts

artifacts:
mkdir crates/sandbox/artifacts || true
mkdir crates/starknet-proxy-client/src/artifacts || true
mkdir crates/starknet-core-contract-client/src/artifacts || true
forge build
cp out/UnsafeProxy.sol/UnsafeProxy.json crates/sandbox/artifacts/
cp out/StarknetSovereign.sol/Starknet.json crates/sandbox/artifacts/
cp out/UnsafeProxy.sol/UnsafeProxy.json crates/starknet-proxy-client/src/artifacts/
cp out/StarknetSovereign.sol/Starknet.json crates/starknet-core-contract-client/src/artifacts/
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,57 @@
# Zaun
A development environment for Starknet Solidity contracts.

### Setup:
This repository contains interfaces and functions to interact with starknet solidity contracts.

## Setup

```bash
curl -L https://foundry.paradigm.xyz | bash
foundryup
```

### Testing:
## Testing

Unit

```bash
forge test -vv
```

### Devnet

Start Avnvil as background process w/ Core Contracts and STARK token:
Start Anvil as background process w/ Core Contracts and STARK token:

```bash
./script/sn-base-dev.sh
```

Kill Anvil deployment:

```bash
./script/sn-base-kill.sh
```

### Artifacts
## Artifacts

Zaun sandbox crate can be used as dev dependency in external projects for integration testing.
If any changes made to the Solidity contracts, one has to re-generate Ethers bindings (this won't be done automatically).
Zaun sandbox crate can be used as dev dependency in external projects. If any changes made to the Solidity contracts, one has to re-generate Ethers bindings (this won't be done automatically).

```bash
make artifacts
```

### StarkNet Consensus Protocol Contracts
## Bridge Contracts Sources

StarknetEthBridge.sol - https://etherscan.io/address/0x455603AD9ae671F6c1f0f746F24d7904cA603581#code
StarknetTokenBridge.sol (Starkgate v2.0.1) - https://github.com/starknet-io/starkgate-contracts/blob/5a10fd263d29cd032b7229691d043520edae0737/src/solidity/StarknetTokenBridge.sol

## StarkNet Consensus Protocol Contracts

PoC solidity implementation of the following Starknet Decentralized Protocol proposal:

- [I - Introduction](https://community.starknet.io/t/starknet-decentralized-protocol-i-introduction/2671/1)
- [II - Candidate for Leader Elections](https://community.starknet.io/t/starknet-decentralized-protocol-ii-candidate-for-leader-elections/4751)
- [III - Consensus](https://community.starknet.io/t/starknet-decentralized-protocol-iii-consensus/5386)
- [IV - Proofs in the Protocol](https://community.starknet.io/t/starknet-decentralized-protocol-iv-proofs-in-the-protocol/6030)
- [V - Checkpoints for Fast Finality](https://community.starknet.io/t/starknet-decentralized-protocol-v-checkpoints-for-fast-finality/6032)
- [VI - The Buffer Problem](https://community.starknet.io/t/starknet-decentralized-protocol-vi-the-buffer-problem/7098)
- [VII - Chained Proof Protocols & Braiding](https://community.starknet.io/t/starknet-decentralized-protocol-vii-chained-proof-protocols-braiding/18831)
- [VII - Chained Proof Protocols & Braiding](https://community.starknet.io/t/starknet-decentralized-protocol-vii-chained-proof-protocols-braiding/18831)
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "sandbox"
name = "ethereum-instance"
edition.workspace = true
version.workspace = true
authors.workspace = true

[dependencies]
starknet-core-contract-client = { path = "../starknet-core-contract-client" }
ethers = { workspace = true }
dirs = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
hex = { workspace = true }
utils = { path = "../utils" }

[dev-dependencies]
tokio = { version = "1.29.1", features = ["rt", "macros", "parking_lot"] }
Loading

0 comments on commit 55511ad

Please sign in to comment.