From 518966991daa1c85a2b819ba24a227faf3710888 Mon Sep 17 00:00:00 2001 From: enitrat Date: Wed, 12 Jun 2024 16:26:22 +0200 Subject: [PATCH] move lib/starknet to src/starknet (foundry issues) --- .../src/L1L2Messaging/MessageConsumerTest.sol | 2 +- .../src/L1L2Messaging/StarknetMessagingLocal.sol | 2 +- .../src}/starknet/IStarknetMessaging.sol | 0 .../src}/starknet/IStarknetMessagingEvents.sol | 0 {lib => solidity_contracts/src}/starknet/NamedStorage.sol | 0 .../src}/starknet/StarknetMessaging.sol | 0 src/kakarot/precompiles/kakarot_precompiles.cairo | 7 +++---- 7 files changed, 5 insertions(+), 6 deletions(-) rename {lib => solidity_contracts/src}/starknet/IStarknetMessaging.sol (100%) rename {lib => solidity_contracts/src}/starknet/IStarknetMessagingEvents.sol (100%) rename {lib => solidity_contracts/src}/starknet/NamedStorage.sol (100%) rename {lib => solidity_contracts/src}/starknet/StarknetMessaging.sol (100%) diff --git a/solidity_contracts/src/L1L2Messaging/MessageConsumerTest.sol b/solidity_contracts/src/L1L2Messaging/MessageConsumerTest.sol index 3f6289878..55ee13d0f 100644 --- a/solidity_contracts/src/L1L2Messaging/MessageConsumerTest.sol +++ b/solidity_contracts/src/L1L2Messaging/MessageConsumerTest.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; -import "starknet/IStarknetMessaging.sol"; +import "../starknet/IStarknetMessaging.sol"; // Define some custom error as an example. // It saves a lot's of space to use those custom error instead of strings. diff --git a/solidity_contracts/src/L1L2Messaging/StarknetMessagingLocal.sol b/solidity_contracts/src/L1L2Messaging/StarknetMessagingLocal.sol index 51f929f18..1e5718f92 100644 --- a/solidity_contracts/src/L1L2Messaging/StarknetMessagingLocal.sol +++ b/solidity_contracts/src/L1L2Messaging/StarknetMessagingLocal.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.8.0; -import "starknet/StarknetMessaging.sol"; +import "../starknet/StarknetMessaging.sol"; /** @notice Interface related to local messaging for Starknet. diff --git a/lib/starknet/IStarknetMessaging.sol b/solidity_contracts/src/starknet/IStarknetMessaging.sol similarity index 100% rename from lib/starknet/IStarknetMessaging.sol rename to solidity_contracts/src/starknet/IStarknetMessaging.sol diff --git a/lib/starknet/IStarknetMessagingEvents.sol b/solidity_contracts/src/starknet/IStarknetMessagingEvents.sol similarity index 100% rename from lib/starknet/IStarknetMessagingEvents.sol rename to solidity_contracts/src/starknet/IStarknetMessagingEvents.sol diff --git a/lib/starknet/NamedStorage.sol b/solidity_contracts/src/starknet/NamedStorage.sol similarity index 100% rename from lib/starknet/NamedStorage.sol rename to solidity_contracts/src/starknet/NamedStorage.sol diff --git a/lib/starknet/StarknetMessaging.sol b/solidity_contracts/src/starknet/StarknetMessaging.sol similarity index 100% rename from lib/starknet/StarknetMessaging.sol rename to solidity_contracts/src/starknet/StarknetMessaging.sol diff --git a/src/kakarot/precompiles/kakarot_precompiles.cairo b/src/kakarot/precompiles/kakarot_precompiles.cairo index ace48a7f9..536df56f2 100644 --- a/src/kakarot/precompiles/kakarot_precompiles.cairo +++ b/src/kakarot/precompiles/kakarot_precompiles.cairo @@ -3,7 +3,6 @@ from starkware.cairo.common.cairo_builtins import HashBuiltin, BitwiseBuiltin from starkware.cairo.common.math_cmp import is_le from starkware.cairo.common.alloc import alloc -from starkware.cairo.common.bool import TRUE, FALSE from starkware.starknet.common.syscalls import call_contract, library_call from starkware.starknet.common.messages import send_message_to_l1 @@ -91,7 +90,7 @@ namespace KakarotPrecompiles { } let (revert_reason_len, revert_reason) = Errors.invalidCairoSelector(); - return (revert_reason_len, revert_reason, CAIRO_PRECOMPILE_GAS, 1); + return (revert_reason_len, revert_reason, CAIRO_PRECOMPILE_GAS, Errors.EXCEPTIONAL_HALT); } func cairo_message{ @@ -108,7 +107,7 @@ namespace KakarotPrecompiles { let is_input_invalid = is_le(input_len, 95); if (is_input_invalid != 0) { let (revert_reason_len, revert_reason) = Errors.outOfBoundsRead(); - return (revert_reason_len, revert_reason, CAIRO_MESSAGE_GAS, TRUE); + return (revert_reason_len, revert_reason, CAIRO_MESSAGE_GAS, Errors.EXCEPTIONAL_HALT); } // Input is formatted as: @@ -130,6 +129,6 @@ namespace KakarotPrecompiles { send_message_to_l1(target_address, data_words_len, data); let (output) = alloc(); - return (0, output, CAIRO_PRECOMPILE_GAS, FALSE); + return (0, output, CAIRO_PRECOMPILE_GAS, Errors.EXCEPTIONAL_HALT); } }