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

feat: MulticallCairo precompile #1503

Merged
merged 12 commits into from
Oct 15, 2024
14 changes: 14 additions & 0 deletions cairo_zero/kakarot/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ namespace Constants {

// See https://gist.github.com/rekmarks/a47bd5f2525936c4b8eee31a16345553
const MAX_SAFE_CHAIN_ID = 4503599627370476;

// PRECOMPILES

// Rollup precompiles
const P256VERIFY_PRECOMPILE = 0x100;

// Kakarot precompiles
const CAIRO_CALL_PRECOMPILE = 0x75001;
const CAIRO_MESSAGING_PRECOMPILE = 0x75002;
const CAIRO_BATCH_CALL_PRECOMPILE = 0x75003;

// FIELD PRIME
const FELT252_PRIME_HIGH = 0x8000000000000110000000000000000;
const FELT252_PRIME_LOW = 0x1;
}

// See model.Opcode:
Expand Down
12 changes: 5 additions & 7 deletions cairo_zero/kakarot/errors.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ namespace Errors {
return (35, error);
}

func invalidCairoSelector() -> (error_len: felt, error: felt*) {
func invalidEvmSelector() -> (error_len: felt, error: felt*) {
let (error) = get_label_location(invalid_cairo_selector_message);
return (29, error);
return (27, error);

invalid_cairo_selector_message:
dw 'K';
Expand All @@ -531,11 +531,9 @@ namespace Errors {
dw 'l';
dw 'i';
dw 'd';
dw 'C';
dw 'a';
dw 'i';
dw 'r';
dw 'o';
dw 'E';
dw 'V';
dw 'M';
dw 'S';
dw 'e';
dw 'l';
Expand Down
1 change: 1 addition & 0 deletions cairo_zero/kakarot/interpreter.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
evm.message.calldata,
caller_code_address,
caller_address,
evm.message.address.evm,

Check warning on line 85 in cairo_zero/kakarot/interpreter.cairo

View check run for this annotation

Codecov / codecov/patch

cairo_zero/kakarot/interpreter.cairo#L85

Added line #L85 was not covered by tests
);

let precompile_reverted = is_not_zero(revert_code);
Expand Down
Loading
Loading