Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
move lib/starknet to src/starknet (foundry issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Jun 12, 2024
1 parent 83ef0f7 commit 5189669
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 3 additions & 4 deletions src/kakarot/precompiles/kakarot_precompiles.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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{
Expand All @@ -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:
Expand All @@ -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);
}
}

0 comments on commit 5189669

Please sign in to comment.