Contract 0xfbadbf0a1296d2da94e59d76107c61581d393196

 

TxHash Block Age From To Value [TxFee]
0x968d2ffaf39e931f8dafd4be67939242a660951fb443cd4ec0f3a8910132a12f5942810226 days 18 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.000716016
0x96b4a5f53de44898c34853b3c6f718e65625363bea00ad8c6314db45db9e35ce5942794226 days 18 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.000567147
0x6ee6c096af6615ccffb824d809f0e4179a23a4c42d84a2644e693fb3bc74a8875942778226 days 18 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.000952007
0x9ce35dc3e4dbdfe39ffc0d372e5006e3bde51753bfee29a677b02ce870d048625926036229 days 15 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.001329744
0xc4116f40d783a139b1d4bffaca31e8c4fd184733e7e0895de929a7ad480b8de55671879273 days 21 hrs ago0x7c793310d4a37941d7876bf60a0aa3f294949f61 IN  GreedVesting0 Ether0.000484344
0xb093b61ec691a6fed18c904a7a556e2f7fdac3d8bf9075f15bdb1ca98d7b6e885671780273 days 21 hrs ago0xc11b9b76d4a30285c246c884a723298e1eea208e IN  GreedVesting0 Ether0.000484344
0xf574b765f76a7245d095f4344732958b3f64bf80c4185302a95c6813b4b1f71f5661264275 days 18 hrs ago0x1a600d92949055bcd79ea63ce95c76af9993c02e IN  GreedVesting0 Ether0.000726516
0x0888bbcf5e197c06c7a6654a495f30fdb2df168006475df6bf807cc28dfb52685641453279 days 6 hrs ago0xffeb93ab1ed92ff89725e0b15ec615e01f39f07f IN  GreedVesting0 Ether0.000726516
0x5e1f8f24df22d56c6ca962eac3a2e7aceaf4f6e25f4c89b5ef0185c2b0d7b98f5610242284 days 18 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.000405105
0x80f00d32b07e06b2aea1d41d65ac8c94ae5bf3347a9cfd6885dc8171fc5ccdf54725017436 days 12 hrs ago0xb9465ba038f053b11df83f72ffcba4955a174fe3 IN  GreedVesting0 Ether0.000484344
0x710fccf0b2dc538bc0ae269f5d76af997514c86a8eb40e1eb02e339be2a390f24533394468 days 6 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000136257
0xcc6b8bd84e4425bcf9288d6d5ce5f9499cbc80231941e7c5666436f57e7cb5274533367468 days 6 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000136321
0xfeb73e3cece97747f0045b977dbc017b27cc94510fb75b919c24d83967df00264533264468 days 7 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000121129
0xc92f175c8250d419d507e8c522f4f2d585a546ad3424e27c226e49d7bdec823c4533201468 days 7 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000121257
0x1b4c473cad7868192a1d07b82c18ef4aaf46471353622aeebd847790cb1b8d424533134468 days 7 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000121193
0xa64d1ff9ddc0ac9421f8c73fcea145b9127fb30f795710c6c4a83e01711ee51c4533052468 days 7 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000121065
0xcbb5e30192ab1403b0adb804912723dd777a2972865e5c1a0bcef6b14fe51ab94532964468 days 8 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000121065
0x91f951e89892e0770f9cd564dbb32fcf04f4b5148f52aa040412a3829a4bf8b74532918468 days 8 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  GreedVesting0 Ether0.0000136193
0x20afd3b650e36677e206f60c0108ff3e4d310310faefac54118378fd7053bc084500544473 days 13 hrs ago0x8dd9c21a83c6ccc9325a146d9a2ff22919eee06f IN  Contract Creation0 Ether0.0000808038
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: GreedVesting
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.11;

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  uint256 public totalSupply;
  function balanceOf(address who) public constant returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) public constant returns (uint256);
  function transferFrom(address from, address to, uint256 value) public returns (bool);
  function approve(address spender, uint256 value) public returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
  function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
    assert(token.transfer(to, value));
  }

  function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
    assert(token.transferFrom(from, to, value));
  }

  function safeApprove(ERC20 token, address spender, uint256 value) internal {
    assert(token.approve(spender, value));
  }
}

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    owner = msg.sender;
  }


  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }


  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

/**
 * @title Math
 * @dev Assorted math operations
 */

library Math {
  function max64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a >= b ? a : b;
  }

  function min64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a < b ? a : b;
  }

  function max256(uint256 a, uint256 b) internal constant returns (uint256) {
    return a >= b ? a : b;
  }

  function min256(uint256 a, uint256 b) internal constant returns (uint256) {
    return a < b ? a : b;
  }
}

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal constant returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint256 a, uint256 b) internal constant returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

/**
 * @title GreedVesting
 * @dev A vesting contract for greed tokens that can release its token balance gradually like a
 * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the
 * owner. In this contract, you add vesting to a particular wallet, release and revoke the vesting.
 */
 
contract GreedVesting is Ownable {
  using SafeMath for uint256;
  using SafeERC20 for ERC20Basic;

  event Released(address beneficiary, uint256 amount);
  event Revoked(address beneficiary);

  uint256 public totalVesting;
  mapping (address => uint256) public released;
  mapping (address => bool) public revoked;
  mapping (address => bool) public revocables;
  mapping (address => uint256) public durations;
  mapping (address => uint256) public starts;
  mapping (address => uint256) public cliffs; 
  mapping (address => uint256) public amounts; 
  mapping (address => uint256) public refunded; 
       
  /**
   * @dev Creates a vesting contract that vests its balance of any ERC20 token to the
   * _beneficiary, gradually in a linear fashion until _start + _duration. By then all
   * of the balance will have vested.
   * @param greed address of greed token contract
   * @param _beneficiary address of the beneficiary to whom vested tokens are transferred
   * @param _cliff duration in seconds of the cliff in which tokens will begin to vest
   * @param _duration duration in seconds of the period in which the tokens will vest
   * @param _amount amount to be vested
   * @param _revocable whether the vesting is revocable or not
   */
  function addVesting(ERC20Basic greed, address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, uint256 _amount, bool _revocable) public onlyOwner {
    require(_beneficiary != 0x0);
    require(_amount > 0);
    // Make sure that a single address can be granted tokens only once.
    require(starts[_beneficiary] == 0);
    // Check for date inconsistencies that may cause unexpected behavior.
    require(_cliff <= _duration);
    // Check that this grant doesn't exceed the total amount of tokens currently available for vesting.
    require(totalVesting.add(_amount) <= greed.balanceOf(address(this)));

	revocables[_beneficiary] = _revocable;
    durations[_beneficiary] = _duration;
    cliffs[_beneficiary] = _start.add(_cliff);
    starts[_beneficiary] = _start;
    amounts[_beneficiary] = _amount;
    totalVesting = totalVesting.add(_amount);
  }

  /**
   * @notice Transfers vested tokens to beneficiary.
   * @param beneficiary address of the beneficiary to whom vested tokens are transferred
   * @param greed address of greed token contract
   */
  function release(address beneficiary, ERC20Basic greed) public {
      
    require(msg.sender == beneficiary || msg.sender == owner);

    uint256 unreleased = releasableAmount(beneficiary);
    
    require(unreleased > 0);

    released[beneficiary] = released[beneficiary].add(unreleased);

    greed.safeTransfer(beneficiary, unreleased);

    Released(beneficiary, unreleased);
  }

  /**
   * @notice Allows the owner to revoke the vesting. Tokens already vested
   * remain in the contract, the rest are returned to the owner.
   * @param beneficiary address of the beneficiary to whom vested tokens are transferred
   * @param greed address of greed token contract
    */
  function revoke(address beneficiary, ERC20Basic greed) public onlyOwner {
    require(revocables[beneficiary]);
    require(!revoked[beneficiary]);

    uint256 balance = amounts[beneficiary].sub(released[beneficiary]);

    uint256 unreleased = releasableAmount(beneficiary);
    uint256 refund = balance.sub(unreleased);

    revoked[beneficiary] = true;
    if (refund != 0) { 
		greed.safeTransfer(owner, refund);
		refunded[beneficiary] = refunded[beneficiary].add(refund);
	}
    Revoked(beneficiary);
  }

  /**
   * @dev Calculates the amount that has already vested but hasn't been released yet.
   * @param beneficiary address of the beneficiary to whom vested tokens are transferred
   * 
   */
  function releasableAmount(address beneficiary) public constant returns (uint256) {
    return vestedAmount(beneficiary).sub(released[beneficiary]);
  }

  /**
   * @dev Calculates the amount that has already vested.
   * @param beneficiary address of the beneficiary to whom vested tokens are transferred
   */
  function vestedAmount(address beneficiary) public constant returns (uint256) {
    uint256 totalBalance = amounts[beneficiary].sub(refunded[beneficiary]);

    if (now < cliffs[beneficiary]) {
      return 0;
    } else if (now >= starts[beneficiary] + durations[beneficiary] || revoked[beneficiary]) {
      return totalBalance;
    } else {
      return totalBalance.mul(now - starts[beneficiary]).div(durations[beneficiary]);
    }
  }
}

Contract ABI
[{"constant":false,"inputs":[{"name":"greed","type":"address"},{"name":"_beneficiary","type":"address"},{"name":"_start","type":"uint256"},{"name":"_cliff","type":"uint256"},{"name":"_duration","type":"uint256"},{"name":"_amount","type":"uint256"},{"name":"_revocable","type":"bool"}],"name":"addVesting","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"beneficiary","type":"address"}],"name":"releasableAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"beneficiary","type":"address"}],"name":"vestedAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"greed","type":"address"}],"name":"release","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"amounts","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalVesting","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"released","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"durations","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"starts","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"revocables","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"refunded","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"cliffs","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"greed","type":"address"}],"name":"revoke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"revoked","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"beneficiary","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Released","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"beneficiary","type":"address"}],"name":"Revoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
606060405260008054600160a060020a033316600160a060020a0319909116179055610abd806100306000396000f3006060604052600436106100cc5763ffffffff60e060020a60003504166301b5ffcf81146100d15780631726cbc814610109578063384711cc1461013a57806348b750441461015957806355a3b2c11461017e5780637c17357d1461019d5780638da5cb5b146101b05780639852595c146101df578063af6bd8ce146101fe578063b6c238b51461021d578063b72d0be51461023c578063c033a4901461026f578063cbbacd481461028e578063dcf3fb2a146102ad578063f2fde38b146102d2578063fa01dc06146102f1575b600080fd5b34156100dc57600080fd5b610107600160a060020a036004358116906024351660443560643560843560a43560c4351515610310565b005b341561011457600080fd5b610128600160a060020a0360043516610499565b60405190815260200160405180910390f35b341561014557600080fd5b610128600160a060020a03600435166104d1565b341561016457600080fd5b610107600160a060020a03600435811690602435166105de565b341561018957600080fd5b610128600160a060020a03600435166106d3565b34156101a857600080fd5b6101286106e5565b34156101bb57600080fd5b6101c36106eb565b604051600160a060020a03909116815260200160405180910390f35b34156101ea57600080fd5b610128600160a060020a03600435166106fa565b341561020957600080fd5b610128600160a060020a036004351661070c565b341561022857600080fd5b610128600160a060020a036004351661071e565b341561024757600080fd5b61025b600160a060020a0360043516610730565b604051901515815260200160405180910390f35b341561027a57600080fd5b610128600160a060020a0360043516610745565b341561029957600080fd5b610128600160a060020a0360043516610757565b34156102b857600080fd5b610107600160a060020a0360043581169060243516610769565b34156102dd57600080fd5b610107600160a060020a03600435166108f9565b34156102fc57600080fd5b61025b600160a060020a0360043516610994565b60005433600160a060020a0390811691161461032b57600080fd5b600160a060020a038616151561034057600080fd5b6000821161034d57600080fd5b600160a060020a0386166000908152600660205260409020541561037057600080fd5b8284111561037d57600080fd5b86600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156103d457600080fd5b6102c65a03f115156103e557600080fd5b5050506040518051600154909150610403908463ffffffff6109a916565b111561040e57600080fd5b600160a060020a0386166000908152600460209081526040808320805460ff19168515151790556005909152902083905561044985856109a9565b600160a060020a03871660009081526007602090815260408083209390935560068152828220889055600890522082905560015461048d908363ffffffff6109a916565b60015550505050505050565b600160a060020a0381166000908152600260205260408120546104cb906104bf846104d1565b9063ffffffff6109bf16565b92915050565b600160a060020a03811660009081526009602090815260408083205460089092528220548291610507919063ffffffff6109bf16565b600160a060020a03841660009081526007602052604090205490915042101561053357600091506105d8565b600160a060020a038316600090815260056020908152604080832054600690925290912054014210158061057f5750600160a060020a03831660009081526003602052604090205460ff165b1561058c578091506105d8565b600160a060020a0383166000908152600560209081526040808320546006909252909120546105d591906105c9908490420363ffffffff6109d116565b9063ffffffff6109f516565b91505b50919050565b600082600160a060020a031633600160a060020a0316148061060e575060005433600160a060020a039081169116145b151561061957600080fd5b61062283610499565b90506000811161063157600080fd5b600160a060020a03831660009081526002602052604090205461065a908263ffffffff6109a916565b600160a060020a0380851660009081526002602052604090209190915561068a908316848363ffffffff610a0c16565b7fb21fb52d5749b80f3182f8c6992236b5e5576681880914484d7f4c9b062e619e8382604051600160a060020a03909216825260208201526040908101905180910390a1505050565b60086020526000908152604090205481565b60015481565b600054600160a060020a031681565b60026020526000908152604090205481565b60056020526000908152604090205481565b60066020526000908152604090205481565b60046020526000908152604090205460ff1681565b60096020526000908152604090205481565b60076020526000908152604090205481565b600080548190819033600160a060020a0390811691161461078957600080fd5b600160a060020a03851660009081526004602052604090205460ff1615156107b057600080fd5b600160a060020a03851660009081526003602052604090205460ff16156107d657600080fd5b600160a060020a03851660009081526002602090815260408083205460089092529091205461080a9163ffffffff6109bf16565b925061081585610499565b9150610827838363ffffffff6109bf16565b600160a060020a0386166000908152600360205260409020805460ff19166001179055905080156108b55760005461087290600160a060020a0386811691168363ffffffff610a0c16565b600160a060020a03851660009081526009602052604090205461089b908263ffffffff6109a916565b600160a060020a0386166000908152600960205260409020555b7fb6fa8b8bd5eab60f292eca876e3ef90722275b785309d84b1de113ce0b8c4e7485604051600160a060020a03909116815260200160405180910390a15050505050565b60005433600160a060020a0390811691161461091457600080fd5b600160a060020a038116151561092957600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60036020526000908152604090205460ff1681565b6000828201838110156109b857fe5b9392505050565b6000828211156109cb57fe5b50900390565b60008282028315806109ed57508284828115156109ea57fe5b04145b15156109b857fe5b6000808284811515610a0357fe5b04949350505050565b82600160a060020a031663a9059cbb838360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a6957600080fd5b6102c65a03f11515610a7a57600080fd5b505050604051805190501515610a8c57fe5b5050505600a165627a7a723058200061e9193e518a6faffdc0876e4d75e4d2356c2af13109bb9065997f83b525110029


   Swarm Source:
bzzr://0061e9193e518a6faffdc0876e4d75e4d2356c2af13109bb9065997f83b52511
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.