Skip to content

Instantly share code, notes, and snippets.

View Skyge's full-sized avatar

skyge Skyge

  • China
View GitHub Profile
const Web3 = require('web3');
const daiABI = [{ "inputs": [{ "internalType": "uint256", "name": "chainId_", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "src", "type": "address" }, { "indexed": true, "internalType": "address", "name": "guy", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "wad", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": true, "inputs": [{ "indexed": true, "internalType": "bytes4", "name": "sig", "type": "bytes4" }, { "indexed": true, "internalType": "address", "name": "usr", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "arg1", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "arg2", "type": "bytes32" }, { "indexed": false, "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "LogNote", "type": "event" }, { "anonymous": fal
@Skyge
Skyge / result.md
Last active June 30, 2020 13:18
For gitcoin bounty.

Result is at here:

result

@Skyge
Skyge / smart_contract.py
Last active March 4, 2020 09:06
python deploy contact.
import sys
import os
import time
import pprint
from solc import compile_standard
class SmartContract:
# TODO:
@Skyge
Skyge / Token.sol
Last active November 16, 2019 01:23
pragma solidity ^0.5.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
@Skyge
Skyge / ERC20.sol
Last active November 14, 2019 14:26
pragma solidity ^0.4.24;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
[
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "allocateRound",
"type": "uint256"
},
{
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol";
import "./ERC677Receiver.sol";
/**
* @title ERC20Custom token
pragma solidity ^0.4.24;
/**
* @dev This contract represents the interface of a registry contract
*/
interface IRegistry {
event ProxyCreated(address proxy);
event VersionAdded(string version, address implementation);
function addVersion(string version, address implementation) public;
pragma solidity 0.4.23;
contract Vulnerablitity {
/**
* @dev This is a common method.
*/
function getBalance(address _account) public view returns (uint256) {
return address(_account).balance;
}
pragma solidity 0.4.23;
import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FIFO is Ownable {
using SafeMath for uint256;
address private _endAddress;
address private _toRemoveAddress;
uint256 private _total;