Skip to content

Instantly share code, notes, and snippets.

View sherlock-shi-x's full-sized avatar
🤠
Hoooooa

Sherlock sherlock-shi-x

🤠
Hoooooa
View GitHub Profile
pragma solidity ^0.5.1;
contract ERC20 {
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
pragma solidity ^0.4.25;
contract TokenRelay03 {
using SafeMath for uint256;
uint256 constant Ilen = 5;
struct Interval {
uint256 start;
address contractAddr;
/**
* 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:
@sherlock-shi-x
sherlock-shi-x / CoinFairCoin.sol
Last active June 14, 2018 15:37
CoinFairCoin
pragma solidity ^0.4.24;
contract ERC20 {
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
pragma solidity ^0.4.21;
contract Convert {
address owner;
address public fromContractAddr;
address public toContractAddr;
mapping (uint => bool) public isConvert;
@sherlock-shi-x
sherlock-shi-x / LuckyETH02.sol
Last active March 23, 2018 07:26
LuckyETH02
pragma solidity ^0.4.20;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
@sherlock-shi-x
sherlock-shi-x / CryptoThreeKingdomsTokenPackage.sol
Last active February 12, 2020 00:14 — forked from lychees/CryptoThreeKingdomsTokenPackage.sol
CryptoThreeKingdomsTokenPackage.sol
pragma solidity ^0.4.20;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
pragma solidity ^0.4.20;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
@sherlock-shi-x
sherlock-shi-x / CryptoThreeKingdomsTokenPackage721WithOracle.sol
Last active March 22, 2018 01:18
CryptoThreeKingdomsTokenPackage721WithOracle
pragma solidity ^0.4.20;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
@sherlock-shi-x
sherlock-shi-x / CryptoThreeKingdomsTokenPackageWithOracle.sol
Last active March 11, 2018 11:34
CryptoThreeKingdomsTokenPackageWithOracle
pragma solidity ^0.4.20;
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {