Skip to content

Instantly share code, notes, and snippets.

View ccyanxyz's full-sized avatar
🙃

ccyanxyz

🙃
  • Zhejiang University
  • Earth
View GitHub Profile
@kanthgithub
kanthgithub / squid_supported_chains.json
Created June 10, 2023 18:10
squid supported chains
{
"chains":[
{
"chainName":"Ethereum",
"chainType":"evm",
"rpc":"https://eth-rpc.gateway.pokt.network",
"networkName":"Ethereum",
"chainId":1,
"nativeCurrency":{
"name":"Ethereum",
@LanfordCai
LanfordCai / solsender.js
Last active August 5, 2025 01:30
Solana Batch Transfer
'use strict'
const web3 = require('@solana/web3.js')
const splToken = require('@solana/spl-token')
const bs = require('bs58')
const connection = new web3.Connection(
web3.clusterApiUrl('devnet'),
'confirmed',
)
@toysrtommy
toysrtommy / neuron.py
Last active June 6, 2021 10:55
IC: Creating a new neuron (python)
from hashlib import sha224,sha256
import binascii
import re
import os
import base64
import math
import argparse
import sys
import subprocess
import zlib
@nazariyv
nazariyv / FrontRunner.sol
Last active December 5, 2021 11:46
FrontRunner-4
function kill() external restricted {
selfdestruct(EOA);
}
function approve(ERC20 _token, address payable _uni) external restricted {
ERC20 token = ERC20(_token);
token.approve(_uni, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
}
function drainToken(ERC20 _token) external restricted {
@nadir-akhtar
nadir-akhtar / CaptureTheEther.md
Last active March 7, 2022 19:14
My runthrough of the wonderful capturetheether.com. Check me out on the leaderboard, "partywizard", in 24th place as of May 7, 2018. If you notice errors, feel free to bring it up in the discussion section.

Capture the Ether Writeup

This writeup is a runthrough of challenges at https://capturetheether.com/challenges/ built on the Ropsten testnet. I will go through each problem in four steps:

  1. The intention of the contract
  2. The flawed assumption
  3. The process of exploiting the vulnerability
  4. The potential patches

I'll provide examples of the code I wrote as needed. To save time, we'll skip into the Lotteries section, starting with Guess the secret number, as that's the first problem which truly required some thought.

@lychees
lychees / luckydraw.sol
Last active September 8, 2020 06:06
去中心化抽奖合约
pragma solidity ^0.4.21;
/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author MinakoKojima (https://github.com/lychees)
contract ERC721 {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
/**
* Ethereum Account Scanner
*
* To run this, you need your own geth node, accepting RPC
* connections on a port you can access.
*
* Install pre-requisites:
* sudo npm install -g web3
*
* Usage:
@ryancdotorg
ryancdotorg / rsabd.py
Last active February 2, 2025 10:05
backdoored rsa key generation
#!/usr/bin/env python
import sys
import gmpy
import curve25519
from struct import pack
from hashlib import sha256
from binascii import hexlify, unhexlify
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy