This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract C { | |
function test() public returns (uint256) { | |
// Note that this only works because computation on literals is done using | |
// unbounded integers. | |
if ((2**255 + 2**255) % 7 != addmod(2**255, 2**255, 7)) return 1; | |
if ((2**255 + 2**255) % 7 != addmod(2**255, 2**255, 7)) return 2; | |
return 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract test { | |
function f(bool cond) public returns (uint) { | |
uint8 x = 0xcd; | |
uint16 y = 0xabab; | |
return cond ? x : y; | |
} | |
} | |
// ==== | |
// compileToEwasm: also | |
// compileViaYul: also |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%lang starknet | |
from starkware.cairo.common.alloc import alloc | |
from starkware.cairo.common.cairo_builtins import BitwiseBuiltin | |
from starkware.cairo.common.cairo_keccak.keccak import keccak_uint256s, finalize_keccak, keccak_uint256s_bigend | |
rom starkware.cairo.common.math import split_felt | |
from starkware.cairo.common.math_cmp import is_le_felt | |
from starkware.cairo.common.uint256 import Uint256, uint256_shl, uint256_add | |
func felt_to_uint256{range_check_ptr}(x) -> (x_ : Uint256): |
OlderNewer