Skip to content

Instantly share code, notes, and snippets.

View Skyge's full-sized avatar

skyge Skyge

  • China
View GitHub Profile
pragma solidity ^0.4.25;
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 / sabre.js
Last active August 23, 2019 11:39
#!/usr/bin/env node
const armlet = require('armlet');
const solc = require('solc');
const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
const ora = require('ora');
const helpers = require('./lib/helpers');
const releases = require('./lib/releases');
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;
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.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.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
[
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "allocateRound",
"type": "uint256"
},
{
@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
@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 / 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: