From 5530b7dd391f01c2115be704d01d6a9ff8a9ad5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Walter?= Date: Wed, 28 Aug 2024 15:57:34 +0200 Subject: [PATCH] Fix pr review and scarb not found --- .github/workflows/ci.yml | 1 + Makefile | 4 ++-- cairo1_contracts/utils/Scarb.lock | 2 +- cairo1_contracts/utils/Scarb.toml | 2 +- .../src/CairoPrecompiles/EthStarknetBridge.sol | 10 +++++----- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 217fd5a3b..2571b4422 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,6 +154,7 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: nightly + - uses: asdf-vm/actions/install@v3 - name: Load cached katana id: cached-katana uses: actions/cache@v4 diff --git a/Makefile b/Makefile index 757ef1a65..6e6ba2a7f 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ fetch-ssj-artifacts: setup: fetch-ssj-artifacts poetry install -test: build-sol deploy +test: deploy poetry run pytest tests/src -m "not NoCI" --log-cli-level=INFO -n logical --seed 42 poetry run pytest tests/end_to_end --seed 42 @@ -46,7 +46,7 @@ test-unit: build-sol poetry run pytest tests/src -m "not NoCI" -n logical --seed 42 # run make run-nodes in other terminal -test-end-to-end: build-sol deploy +test-end-to-end: deploy poetry run pytest tests/end_to_end --seed 42 deploy: build build-sol diff --git a/cairo1_contracts/utils/Scarb.lock b/cairo1_contracts/utils/Scarb.lock index 8cb270f10..abda56939 100644 --- a/cairo1_contracts/utils/Scarb.lock +++ b/cairo1_contracts/utils/Scarb.lock @@ -2,5 +2,5 @@ version = 1 [[package]] -name = "library_call" +name = "utils" version = "0.1.0" diff --git a/cairo1_contracts/utils/Scarb.toml b/cairo1_contracts/utils/Scarb.toml index f559ff841..084e2cea0 100644 --- a/cairo1_contracts/utils/Scarb.toml +++ b/cairo1_contracts/utils/Scarb.toml @@ -1,5 +1,5 @@ [package] -name = "library_call" +name = "utils" version = "0.1.0" edition = "2023_11" diff --git a/solidity_contracts/src/CairoPrecompiles/EthStarknetBridge.sol b/solidity_contracts/src/CairoPrecompiles/EthStarknetBridge.sol index a6b640b4c..bead05a28 100644 --- a/solidity_contracts/src/CairoPrecompiles/EthStarknetBridge.sol +++ b/solidity_contracts/src/CairoPrecompiles/EthStarknetBridge.sol @@ -6,8 +6,12 @@ import {CairoLib} from "kakarot-lib/CairoLib.sol"; using CairoLib for uint256; contract EthStarknetBridge { + /// @dev The cairo contract to call + uint256 constant starknetEth = 0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7; + uint256 constant TRANSFER_SELECTOR = uint256(keccak256("transfer")) % 2 ** 250; + // State variable to store the owner of the contract - address public owner; + address immutable owner; // Constructor sets the owner of the contract constructor() { @@ -20,10 +24,6 @@ contract EthStarknetBridge { _; } - /// @dev The cairo contract to call - uint256 constant starknetEth = 0x49D36570D4E46F48E99674BD3FCC84644DDD6B96F7C741B1562B82F9E004DC7; - uint256 constant TRANSFER_SELECTOR = uint256(keccak256("transfer")) % 2 ** 250; - /// @notice Withdraws ETH from the contract to a Starknet address function withdraw(uint256 toStarknetAddress) external onlyOwner { uint256 balance = address(this).balance;