Skip to content

Commit ea2cdf8

Browse files
authoredMay 14, 2024
feat: mcr contracts
ENG-317 implement mcr contracts
2 parents 4c7bd16 + f5f369d commit ea2cdf8

30 files changed

+887
-630
lines changed
 

‎.github/workflows/checks.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ jobs:
2424
- name: Install Nix
2525
uses: DeterminateSystems/nix-installer-action@main
2626

27-
- name: Run test in nix environment
27+
- name: Run MCR tests in nix environment
28+
run: nix develop --command bash -c "just mcr-contract-tests"
29+
30+
- name: Run Cargo Check in nix environment
2831
run: nix develop --command bash -c "cargo check"
2932

30-
- name: Run test in nix environment
33+
- name: Run M1 DA Light Node tests in nix environment
3134
run: nix develop --command bash -c "just m1-da-light-node test.local -t=false"
3235

33-
- name: Run test in nix environment
36+
- name: Run monza tests in nix environment
3437
run: nix develop --command bash -c "just monza-full-node test.local -t=false"

‎.gitmodules

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[submodule "protocol-units/dispute/lib/forge-std"]
2-
path = protocol-units/dispute/lib/forge-std
3-
url = https://github.com/foundry-rs/forge-std
4-
[submodule "protocol-units/eth-settlement/contracts/lib/openzeppelin-contracts"]
5-
path = protocol-units/dispute/contracts/lib/openzeppelin-contracts
6-
url = https://github.com/OpenZeppelin/openzeppelin-contracts
7-
[submodule "protocol-units/eth-settlement/lib/openzeppelin-contracts"]
8-
path = protocol-units/eth-settlement/lib/openzeppelin-contracts
9-
url = https://github.com/OpenZeppelin/openzeppelin-contracts
2+
path = protocol-units/settlement/mcr/contracts/lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std
4+
[submodule "protocol-units/dispute/lib/openzeppelin-contracts"]
5+
path = protocol-units/settlement/mcr/contracts/lib/openzeppelin-contracts
6+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
7+
[submodule "protocol-units/dispute/lib/murky"]
8+
path = protocol-units/settlement/mcr/contracts/lib/murky
9+
url = https://github.com/dmfxyz/murky
10+

‎flake.lock

+54-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix

+26-19
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
nixpkgs.url = "github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714";
44
rust-overlay.url = "github:oxalica/rust-overlay";
55
flake-utils.url = "github:numtide/flake-utils";
6+
foundry.url = "github:shazow/foundry.nix/monthly";
67
};
78

89
outputs = {
910
self,
1011
nixpkgs,
1112
rust-overlay,
1213
flake-utils,
14+
foundry,
1315
...
1416
}:
1517
flake-utils.lib.eachSystem ["aarch64-darwin" "x86_64-darwin" "x86_64-linux" "aarch64-linux"] (
@@ -18,32 +20,20 @@
1820

1921
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
2022

21-
overlays = [(import rust-overlay)];
23+
overlays = [
24+
(import rust-overlay)
25+
foundry.overlay
26+
];
2227

2328
pkgs = import nixpkgs {
2429
inherit system overlays;
2530
};
2631

2732
frameworks = pkgs.darwin.apple_sdk.frameworks;
2833

29-
# celestia-node
30-
celestia-node = import ./celestia-node.nix { inherit pkgs; };
31-
32-
# celestia-app
33-
celestia-app = import ./celestia-app.nix { inherit pkgs; };
34-
35-
# monza-aptos
36-
monza-aptos = import ./monza-aptos.nix { inherit pkgs; };
37-
38-
# Specific version of toolchain
39-
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
40-
41-
rustPlatform = pkgs.makeRustPlatform {
42-
cargo = rust;
43-
rustc = rust;
44-
};
45-
46-
dependencies = with pkgs; [
34+
dependencies = with pkgs; [
35+
foundry-bin
36+
solc
4737
llvmPackages.bintools
4838
openssl
4939
openssl.dev
@@ -75,6 +65,22 @@
7565
systemd
7666
];
7767

68+
# Specific version of toolchain
69+
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
70+
71+
rustPlatform = pkgs.makeRustPlatform {
72+
cargo = rust;
73+
rustc = rust;
74+
};
75+
76+
# celestia-node
77+
celestia-node = import ./nix/celestia-node.nix { inherit pkgs; };
78+
79+
# celestia-app
80+
celestia-app = import ./nix/celestia-app.nix { inherit pkgs; };
81+
82+
# monza-aptos
83+
monza-aptos = import ./nix/monza-aptos.nix { inherit pkgs; };
7884

7985
in
8086
with pkgs; {
@@ -93,6 +99,7 @@
9399
shellHook = ''
94100
#!/bin/bash
95101
export MONZA_APTOS_PATH=$(nix path-info -r .#monza-aptos | tail -n 1)
102+
install-foundry
96103
cat <<'EOF'
97104
_ _ __ _ _ ____ _ _ ____ __ _ ____
98105
( \/ ) / \ / )( \( __)( \/ )( __)( ( \(_ _)

‎justfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ m1-da-light-node FEATURES *ARGS:
22
cargo build -p m1-da-light-node
33
scripts/movement/run m1-da-light-node {{ FEATURES }} {{ ARGS }}
44
monza-full-node FEATURES *ARGS:
5-
scripts/movement/run monza-full-node {{ FEATURES }} {{ ARGS }}
5+
scripts/movement/run monza-full-node {{ FEATURES }} {{ ARGS }}
6+
mcr-contract-tests:
7+
cd ./protocol-units/settlement/mcr/contracts && forge test
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎protocol-units/dispute/.github/workflows/test.yml

-34
This file was deleted.

‎protocol-units/dispute/Cargo.toml

-30
This file was deleted.

‎protocol-units/dispute/README.md

-66
This file was deleted.

‎protocol-units/dispute/foundry.toml

-7
This file was deleted.

‎protocol-units/dispute/src/Dispute.sol

-14
This file was deleted.

0 commit comments

Comments
 (0)