Skip to content

Instantly share code, notes, and snippets.

View jin10086's full-sized avatar
🏠
Working from home

gaojin jin10086

🏠
Working from home
View GitHub Profile
@jin10086
jin10086 / vt.sol
Created May 19, 2019 16:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.4.25;
contract SccInterface {
function transfer(address _to, uint256 _amount) returns(bool success);
function balanceOf(address owner) external view returns (uint256);
}
contract sunContract{
constructor(){
pragma solidity ^0.5.1;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
pragma solidity ^ 0.5 .1;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
import hashlib
def get_winner(min_n, max_n, num_win, key):
res = key
winners = set()
while len(winners) < num_win:
res = hashlib.sha256(res.encode("utf8")).hexdigest()
winners.add(int(res, 16) % (max_n - min_n + 1) + min_n)
return winners

Keybase proof

I hereby claim:

  • I am jin10086 on github.
  • I am gaojin (https://keybase.io/gaojin) on keybase.
  • I have a public key ASDjynKFLfowWWUgjLoyLDO8XSjQ-k9SL2nPDIBjd_se3go

To claim this, I am signing this object:

@jin10086
jin10086 / testonerror.hpp
Created November 12, 2019 13:27
测试 触发延时操作
#include <eosio/eosio.hpp>
#include <eosio/asset.hpp>
#include <eosio/singleton.hpp>
#include <eosio/transaction.hpp>
using namespace std;
using namespace eosio;
pragma solidity ^0.5.1;
contract EIP20NonStandardInterface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
from hashlib import md5
def Hash(context):
result = md5(bytes(context, "utf8"))
for i in range(0, 10000000):
result = md5(result.digest())
return result.hexdigest()
import requests
import time
from web3.auto import w3
headers = {
"authority": "ethernodes.org",
"accept": "application/json, text/javascript, */*; q=0.01",
"x-requested-with": "XMLHttpRequest",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
"referer": "https://ethernodes.org/nodes",
@jin10086
jin10086 / Controller.sol
Created August 4, 2020 02:34
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=true&gist=
/**
*Submitted for verification at Etherscan.io on 2020-07-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint256);