Skip to content

Instantly share code, notes, and snippets.

View kalloc's full-sized avatar
🌋

kalloc kalloc

🌋
View GitHub Profile
const Web3 = require('web3');
const web3 = new Web3(new Web3.providers.WebsocketProvider(process.env.ENDPOINT));
const transferSignature = Web3.utils.keccak256("Transfer(address,address,uint256)");
// Listen for Transfer events from all contracts
web3.eth.subscribe('logs', {
topics: [transferSignature]
}, (error, event) => {
if (error) {
@kalloc
kalloc / x.py
Created December 31, 2022 09:49
from telethon import TelegramClient, events, sync
import numpy as np
import asyncio
import random
from telethon.tl.functions.account import UpdateProfileRequest
from telethon.tl.functions.messages import SendReactionRequest
from telethon.tl.types import IpPort, ReactionEmoji
import torch
import os
import sys
@kalloc
kalloc / composer.json
Last active September 19, 2022 08:17
Ethereum Message Signing on PHP
{
"minimum-stability":"dev",
"autoload": {
"psr-4": {
"Ethereum\\": "src/"
}
},
"repositories": [
{
"type": "git",
@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 <[email protected]>"]
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