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
#!/bin/sh | |
# make sure requirements.txt is up to date with every commit | |
# by comparing the output of pip freeze | |
pip freeze | diff requirements.txt - > /dev/null | |
if [ $? != 0 ] | |
then | |
echo "Missing python module dependencies in requirements.txt. Run 'pip freeze > requirements.txt' to update." | |
exit 1 | |
fi |
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
import json | |
import os | |
import time | |
import uuid | |
import boto3 | |
def set_connection_header(request, operation_name, **kwargs): | |
# request.headers['Connection'] = 'keep-alive' |
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
import { PrismaClient } from '@prisma/client' | |
import Shopify from '@shopify/shopify-api' | |
import { Session } from '@shopify/shopify-api/dist/auth/session'; | |
const prisma = new PrismaClient({ log: ['info', 'warn', 'error'] }) | |
async function storeCallback(session: Session): Promise<boolean> { | |
const payload: { [key: string]: any } = { ...session } | |
return prisma.appSession.upsert({ | |
create: { id: session.id, payload: payload }, |
NewerOlder