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

Commit

Permalink
Use opcode number from ctx and remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Nov 1, 2023
1 parent a56279f commit 94db972
Show file tree
Hide file tree
Showing 9 changed files with 316 additions and 637 deletions.
2 changes: 1 addition & 1 deletion scripts/utils/kakarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ async def get_eoa(private_key=None, amount=10) -> Account:

async def eth_send_transaction(
to: Union[int, str],
gas: int,
data: Union[str, bytes],
gas: int = 21_000,
value: Union[int, str] = 0,
caller_eoa: Optional[Account] = None,
max_fee: Optional[int] = None,
Expand Down
24 changes: 24 additions & 0 deletions src/kakarot/errors.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -475,4 +475,28 @@ namespace Errors {
dw 'o';
dw 'n';
}

func outOfGas() -> (error_len: felt, error: felt*) {
let (error) = get_label_location(oog_error_message);
return (17, error);

Check warning on line 481 in src/kakarot/errors.cairo

View check run for this annotation

Codecov / codecov/patch

src/kakarot/errors.cairo#L480-L481

Added lines #L480 - L481 were not covered by tests
oog_error_message:
dw 'K';
dw 'a';
dw 'k';
dw 'a';
dw 'r';
dw 'o';
dw 't';
dw ':';
dw ' ';
dw 'o';
dw 'u';
dw 't';
dw 'O';
dw 'f';
dw 'G';
dw 'a';
dw 's';

Check warning on line 500 in src/kakarot/errors.cairo

View check run for this annotation

Codecov / codecov/patch

src/kakarot/errors.cairo#L484-L500

Added lines #L484 - L500 were not covered by tests
}
}
22 changes: 11 additions & 11 deletions src/kakarot/evm.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,27 @@ namespace EVM {
jmp rel offset;
call StopAndArithmeticOperations.exec_stop; // 0x0
ret;
call StopAndArithmeticOperations.exec_add; // 0x1
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x1
ret;
call StopAndArithmeticOperations.exec_mul; // 0x2
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x2
ret;
call StopAndArithmeticOperations.exec_sub; // 0x3
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x3
ret;
call StopAndArithmeticOperations.exec_div; // 0x4
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x4
ret;
call StopAndArithmeticOperations.exec_sdiv; // 0x5
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x5
ret;
call StopAndArithmeticOperations.exec_mod; // 0x6
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x6
ret;
call StopAndArithmeticOperations.exec_smod; // 0x7
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x7
ret;
call StopAndArithmeticOperations.exec_addmod; // 0x8
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x8
ret;
call StopAndArithmeticOperations.exec_mulmod; // 0x9
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0x9
ret;
call StopAndArithmeticOperations.exec_exp; // 0xa
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0xa
ret;
call StopAndArithmeticOperations.exec_signextend; // 0xb
call StopAndArithmeticOperations.exec_arithmetic_operation; // 0xb
ret;
call unknown_opcode; // 0xc
ret;
Expand Down
Loading

0 comments on commit 94db972

Please sign in to comment.