Skip to content

Instantly share code, notes, and snippets.

View kalloc's full-sized avatar
🌋

kalloc kalloc

🌋
View GitHub Profile
@kalloc
kalloc / nft.sol
Last active August 25, 2022 19:36
/*
_// _// _//
_// _// _// _//
_// _// _/_/ _/ _// _/// _// _//_// _//_/ _// _//// _//
_// _// _// _// _// _// _// _// _// _// _// _// _/ _// _// _/ _//
_// _// _// _// _// _//_// _// _// _// _/// _/ _// _/// _///// _//
_// _//_// _// _// _// _// _// _// _// _// _// _// _// _//_/
_//// _// _/// _// _// _/// _// _///_/// _// _// _// _// _////
_// _//
struct Foo {
value: String,
}
impl Foo {
#[cfg(not(target_os = "macos"))]
fn xxx(&mut self) {
self.value.push_str(".not macOS.")
}
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
[package]
name = "lola-nft"
version = "0.1.4"
authors = ["Nikita Kuznetsov <n@8gen.team>"]
edition = "2018"
[dependencies]
near-sdk = "4.0.0"
# near-sdk-sim = "4.0.0-pre.9"
near-contract-standards = "4.0.0"
running 1 test
test test_claim ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 23.04s
import os
import tornado.ioloop
import tornado.web
from eth_account.messages import encode_defunct
from eth_account.account import Account
PRIVATE_KEY = os.environ.get("PRIVATE_KEY")
#!/usr/bin/env python
import sys
import csv
import typing
import requests
all_owners: typing.List[str] = []
contract_id = None
#!/usr/bin/env python2
# encoding: utf-8
import math
import socket
import threading
from time import sleep, time
from hashlib import sha1
from random import randint
from struct import pack, unpack
from socket import inet_ntoa
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LookupMap, UnorderedSet};
use near_sdk::json_types::Base64VecU8;
use near_sdk::{near_bindgen, BorshStorageKey, PanicOnDefault, env};
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)]
pub struct Contract {
key1: LookupMap<u8, UnorderedSet<u8>>,
key2: LookupMap<u8, UnorderedSet<u8>>,
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract Test {
address[] public routers;
address[] public connectors;