Skip to content

Instantly share code, notes, and snippets.

View 0xNonCents's full-sized avatar

Non 0xNonCents

View GitHub Profile
@0xNonCents
0xNonCents / gist:5e93e036b6579869d93030c8d0f3cc53
Created February 3, 2024 20:46
create multiple accounts logs
2024-02-03T20:44:14.281599Z DEBUG server: method="starknet_addInvokeTransaction"
2024-02-03T20:44:14.282720Z INFO txpool: Transaction received | Hash: 0x134d7dc2b805c3d90fd0f9f5319c2e6a555f9f725c75c739de56538efed06ac
2024-02-03T20:44:14.321642Z TRACE executor: Transaction resource usage: Steps: 6933 | Ec Op Builtin: 3 | L1 Gas: 3672 | Pedersen: 20 | Range Checks: 164
2024-02-03T20:44:14.321662Z TRACE executor: Event emitted keys=[0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9]
2024-02-03T20:44:14.321925Z INFO backend: ⛏️ Block 20 mined with 1 transactions
2024-02-03T20:44:14.595534Z DEBUG server: method="starknet_blockHashAndNumber"
2024-02-03T20:44:14.596279Z DEBUG server: method="starknet_getBlockWithTxs"
2024-02-03T20:44:14.597079Z DEBUG server: method="starknet_getStateUpdate"
2024-02-03T20:44:14.597211Z DEBUG server: method="starknet_getTransactionReceipt"
2024-02-03T20:44:15.290591Z DEBUG server: method="starknet_getTransactionStatus"
@0xNonCents
0xNonCents / gist:14c25221e5483ebeb6e95fe3a4cbb719
Created December 13, 2023 18:08
Dependency for wait-timeout in anvil
wait-timeout v0.2.0
└── rusty-fork v0.3.0
└── proptest v1.4.0
├── alloy-dyn-abi v0.5.2
│ ├── foundry-cheatcodes v0.2.0 (/Users/matt/dev/foundry/crates/cheatcodes)
│ │ └── foundry-evm v0.2.0 (/Users/matt/dev/foundry/crates/evm/evm)
│ │ ├── anvil v0.2.0 (/Users/matt/dev/foundry/crates/anvil)
│ │ └── anvil-core v0.2.0 (/Users/matt/dev/foundry/crates/anvil/core)
│ │ └── anvil v0.2.0 (/Users/matt/dev/foundry/crates/anvil)
│ ├── foundry-common v0.2.0 (/Users/matt/dev/foundry/crates/common)
@0xNonCents
0xNonCents / error-beacon
Created May 11, 2023 18:22
beacon error
Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (transactionHash="0x05f3c9a1441f0ee2d4b644e28b48f0ea53991da488c5d86ca119ca42d143343c", transaction={"type":2,"chainId":42161,"nonce":11259,"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x07735940"},"maxFeePerGas":{"type":"BigNumber","hex":"0x07735940"},"gasPrice":null,"gasLimit":{"type":"BigNumber","hex":"0x989680"},"to":"0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF","value":{"type":"BigNumber","hex":"0x00"},"data":"0xae54fdde0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000178c1d16a434dc76fe45e121b6e7872de21e4263000000000000000000000000574ab6dc4b09ccbeb9445a095dac94007dbb781f0000000000000000000000002efeaa908fe18ab3a2ca8cf0740a77488acc3097000000000000000000000000cf5bf9f46fab2f8efc9e4118aaedebdf44092536000000000000000000000000000000000000000000000000000000000000882200000000000000000000000000000000000000000000000000152ca22a930cc0000000000000000000000000000000000000000000000000000012309ce
{
"0": 120,
"1": 1,
"2": 0,
"3": 0,
"4": 1,
"5": 0,
"6": 0,
"7": 4,
"8": 1,
// Create your own language definition here
// You can safely look at other samples without losing modifications.
// Modifications are not saved on browser refresh/close though -- copy often!
return {
// Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid',
variables: [
`SelfX`,
"SelfY",
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted", method="estimateGas", transaction={"from":"0xCf5BF9F46FAb2F8EFC9e4118AAEDeBDF44092536","to":"0x5b8bB80f2d72D0C85caB8fB169e8170A05C94bAF","data":"0x84efbaa10000000000000000000000000000000000000000000000000000000000000001","accessList":null}, error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":47,\"error\":{\"code\":3,\"message\":\"execution reverted\",\"data\":\"0x4e487b710000000000000000000000000000000000000000000000000000000000000011\"}}","error":{"code":3,"data":"0x4e487b710000000000000000000000000000000000000000000000000000000000000011"},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0xcf5bf9f46fab2f8efc9e4118aaedebdf44092536\",\"to\":\"0x5b8bb80f2d72d0c85cab8fb169e8170a05c94baf\",\"data\":\"0x84efbaa1000000000000000000000000000000000000000000000000000000000
Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":74946,\"error\":{\"code\":-32000,\"message\":\"nonce too low: address 0xCf5BF9F46FAb2F8EFC9e4118AAEDeBDF44092536, tx: 54 state: 55\"}}","error":{"code":-32000},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f9037483066eed3684077359408407735940839896809457f7a8aa8291a04b325f3f0d2c4d03353d3ef25f80b903048beb33280000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f227873abf28cf0e50732cefd31f0d0a6f9d761c000000000000000000000000574ab6dc4b09ccbeb9445a095dac94007dbb781f000000000000000000000000cf5bf9f46fab2f8efc9e4118aaedebdf440925360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002900000000000000000000000000000000000000000000000000009e9daa0c80000000000000000000000000000000000000000000000000
Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":74946,\"error\":{\"code\":-32000,\"message\":\"nonce too low: address 0xCf5BF9F46FAb2F8EFC9e4118AAEDeBDF44092536, tx: 54 state: 55\"}}","error":{"code":-32000},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f9037483066eed3684077359408407735940839896809457f7a8aa8291a04b325f3f0d2c4d03353d3ef25f80b903048beb33280000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f227873abf28cf0e50732cefd31f0d0a6f9d761c000000000000000000000000574ab6dc4b09ccbeb9445a095dac94007dbb781f000000000000000000000000cf5bf9f46fab2f8efc9e4118aaedebdf440925360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002900000000000000000000000000000000000000000000000000009e9daa0c80000000000000000000000000000000000000000000000000
for file in lib/*
do
cairo-migrate -i "$file"
done
for file in contracts/*
do
cairo-migrate -i "$file"
done
@0xNonCents
0xNonCents / run_cairo_wo_step_limit.py
Created June 1, 2022 21:38
Running Cairo Tests without step limit and allowing hints
import asyncio
import os
import pytest
from starkware.starknet.testing.starknet import Starknet
from starkware.starknet.compiler.compile import compile_starknet_files
from starkware.starknet.definitions.general_config import build_general_config, default_general_config
CONTRACT = os.path.join("contracts", "contract_name.cairo")
@pytest.fixture(scope="module")