This file contains 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
thread 'tokio-runtime-worker' panicked at crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/syscall_hooks.rs:21:28: | |
called `Option::unwrap()` on a `None` value | |
stack backtrace: | |
0: 0x1053f1c2c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb478ebbfb46e27ce | |
1: 0x1054132bc - core::fmt::write::he4d5fa2daff1f531 | |
2: 0x1053eec58 - std::io::Write::write_fmt::hc5a47a68eba63d9f | |
3: 0x1053f1a60 - std::sys_common::backtrace::print::h79bd952cc5812e7a | |
4: 0x1053f3574 - std::panicking::default_hook::{{closure}}::h82301f6222887737 | |
5: 0x1053f32bc - std::panicking::default_hook::h1e49abbb3f1d7dbf | |
6: 0x1053f39bc - std::panicking::rust_panic_with_hook::h1e70c5d905e30e9d |
This file contains 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
use starknet::ContractAddress; | |
#[starknet::interface] | |
trait IERC20<TContractState> { | |
fn name(self: @TContractState) -> ByteArray; | |
fn symbol(self: @TContractState) -> ByteArray; | |
fn decimals(self: @TContractState) -> u8; | |
} |
This file contains 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
fn pow_old(base: u128, mut exp: u128) -> u128 { | |
if exp == 0 { | |
1 | |
} else { | |
base * pow_old(base, exp - 1) | |
} | |
} | |
fn pow_new(base: u128, exp: u128) -> u128 { |
This file contains 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
[ | |
{ | |
"data": [ | |
{ | |
"name": "address", | |
"type": "felt" | |
}, | |
{ | |
"name": "deployer", | |
"type": "felt" |
This file contains 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
use starknet::StorageAccess; | |
use starknet::StorageBaseAddress; | |
use starknet::SyscallResult; | |
use starknet::storage_read_syscall; | |
use starknet::storage_write_syscall; | |
use starknet::storage_address_from_base_and_offset; | |
use traits::Into; | |
use traits::TryInto; | |
use option::OptionTrait; |
This file contains 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] | |
mod FighterComponent { | |
use option::OptionTrait; | |
use starknet::SyscallResult; | |
use traits::Into; | |
use traits::TryInto; | |
#[derive(Copy, Drop)] | |
struct Fighter { | |
attack: u16, |
This file contains 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
// https://slugs.do-api.dev/ | |
resource "digitalocean_droplet" "sn_devnet" { | |
image = "docker-20-04" | |
name = "starknet-devnet" | |
region = "ams3" | |
size = "s-1vcpu-1gb" | |
ssh_keys = [ | |
data.digitalocean_ssh_key.tf_ssh_key.id | |
] |
This file contains 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
func pow10(i) -> (res): | |
let (p) = get_label_location(data) | |
return ([p + i]) | |
data: | |
dw 10 ** 0 | |
dw 10 ** 1 | |
dw 10 ** 2 | |
dw 10 ** 3 | |
dw 10 ** 4 |
This file contains 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 openzeppelin.access.ownable import Ownable | |
# this import brings public function from ownable_external.cairo | |
# into this contract; the OWNABLE is just a placeholder, because | |
# something has to be imported, Cairo doesn't support | |
# `from foo import *` nor `import foo` | |
from contracts.ownable_external import OWNABLE |
This file contains 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
name: Cairo static analysis | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test: |
NewerOlder