Skip to content

Instantly share code, notes, and snippets.

Avail

System Overview

  • Data Hosting and Ordering: Recieves transaction data , orders without execution (Celestia , Avail)
  • Execution: Takes ordered transactions for DA Layer and executes them.
  • Verification / Dispute Resolution: Setllement Layer : Responsible for accepting only valid state transitions occur.
require('dotenv').config();
const { ChainId, Fetcher, WETH, Route, Trade, TokenAmount, TradeType, Percent } = require('@uniswap/sdk');
const ethers = require('ethers');
const util = require('util');
const url = process.env.URL;
console.log("url: " + url);
// ABI imports
const uniswapV2ExchangeAddress = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D';
thread 'rustc' panicked at 'index out of bounds: the len is 69 but the index is 70', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/ena-0.14.0/src/snapshot_vec.rs:199:10
stack backtrace:
0: 0x10dbc0bf5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h845e2516a8268840
1: 0x10dc17fda - core::fmt::write::h2af047ddbf03b6f3
2: 0x10dbb2efc - std::io::Write::write_fmt::h11c7ec25ade65885
3: 0x10dbc3c3b - std::panicking::default_hook::{{closure}}::h954849597ff6e027
4: 0x10dbc3947 - std::panicking::default_hook::he544962a4ecf6825
5: 0x1166171ca - rustc_driver[7f9484eaa0472288]::DEFAULT_HOOK::{closure#0}::{closure#0}
6: 0x10dbc436e - std::panicking::rust_panic_with_hook::h20ce40c0ef43a05d
7: 0x10dbc4213 - std::panicking::begin_panic_handler::{{closure}}::h26d76aec31ea2608
Compilation warnings/errors on contracts/src/random.sol:
Warning: Contract code size is 29156 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
--> contracts/src/random.sol:114:2:
|
114 | contract FlokiGrow is Context, IERC20, Ownable {
| ^ (Relevant source part starts here and spans across multiple lines).

FlokiGrow.addLiquidity(uint256,uint256) (contracts/src/random.sol#578-591) sends eth to arbitrary user
@Genysys
Genysys / Test.sol
Created June 20, 2022 21:19
foundry console.error
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ds-test/test.sol";
import "forge-std/Test.sol";
import "forge-std/Vm.sol";
import "../LandNFT.sol";
import "../SwapToken.sol";
contract LandNFTTest is Test {
@Genysys
Genysys / error.sh
Created June 19, 2022 16:05
Graphql error
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
GQLClient Error: Look at json field for more details
Message: syntax error before: "metric"
', src/main.rs:48:61
@Genysys
Genysys / error.sh
Created May 27, 2022 16:27
local ethers test failure
Finished test [unoptimized + debuginfo] target(s) in 0.84s
Running unittests (target/debug/deps/ethers_addressbook-1f8d784a768dcebc)
running 2 tests
test tests::test_tokens ... ok
test tests::test_addrs ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests (target/debug/deps/ethers_contract-b2ad9f47546827da)
@Genysys
Genysys / advisory.txt
Last active May 27, 2022 16:03
ethers advisories
 Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
 Loaded 416 security advisories (from /Users/samueldare/.cargo/advisory-db)
 Updating crates.io index
 Scanning Cargo.lock for vulnerabilities (430 crate dependencies)
Crate:  block-buffer
Version:  0.10.0
Warning:  yanked
Dependency tree:
block-buffer 0.10.0
@Genysys
Genysys / model.rs
Created May 27, 2022 11:38
Casting Ethereum Types Diesel
use super::schema::ethbalances;
use bigdecimal::{BigDecimal, FromPrimitive, ToPrimitive};
use chrono::NaiveDateTime;
use diesel::deserialize::{self, FromSql};
use diesel::pg::Pg;
use diesel::serialize::{self, IsNull, Output, ToSql};
use diesel::sql_types::*;
use diesel::{backend::Backend, expression::AsExpression};
#[macro_use]
extern crate dotenv;
use reqwest::header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE};
use reqwest::Error as ReqwestError;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]