Contract Overview
ETH Balance: 0 Ether
No Of Transactions: 2 txns
  Latest 2 txns

TxHash Age From To Value [TxFee]
0xc187f523d14df8e3af9bdea12e1b0ddfb82bc738929f2e49a7169c18148e9dd910 days 23 hrs ago0x5cc7d2c1b1c126fe78f49811eb485cf440168364  IN   0xd7fd8ffd93f0d03478f99224f27c7ad1398ab3ce0 Ether0.000833872
0x69ccb9b83bf40c04219bd3a5e36ad200f48a56988faa891ca935aa2c2c47bd1211 days 1 min ago0x5cc7d2c1b1c126fe78f49811eb485cf440168364  IN    Contract Creation0 Ether0.051821208
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity), SkipEmptyStringLiteral (low-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: C20Vesting
Compiler Version: v0.4.11+commit.68ef5810
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity 0.4.11;

  contract SafeMath {

    function safeMul(uint a, uint b) internal returns (uint) {
      uint c = a * b;
      assert(a == 0 || c / a == b);
      return c;
    }
    function safeSub(uint a, uint b) internal returns (uint) {
      assert(b <= a);
      return a - b;
    }
    function safeAdd(uint a, uint b) internal returns (uint) {
      uint c = a + b;
      assert(c>=a && c>=b);
      return c;
    }

    // mitigate short address attack
    // thanks to https://github.com/numerai/contract/blob/c182465f82e50ced8dacb3977ec374a892f5fa8c/contracts/Safe.sol#L30-L34.
    // TODO: doublecheck implication of >= compared to ==
    modifier onlyPayloadSize(uint numWords) {
       assert(msg.data.length >= numWords * 32 + 4);
       _;
    }

  }

  contract Token { // ERC20 standard

      function balanceOf(address _owner) constant returns (uint256 balance);
      function transfer(address _to, uint256 _value) returns (bool success);
      function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
      function approve(address _spender, uint256 _value) returns (bool success);
      function allowance(address _owner, address _spender) constant returns (uint256 remaining);
      event Transfer(address indexed _from, address indexed _to, uint256 _value);
      event Approval(address indexed _owner, address indexed _spender, uint256 _value);

  }

   contract C20Vesting is SafeMath {

      address public beneficiary;
      uint256 public fundingEndBlock;

      bool private initClaim = false; // state tracking variables

      uint256 public firstRelease; // vesting times
      bool private firstDone = false;
      uint256 public secondRelease;
      bool private secondDone = false;
      uint256 public thirdRelease;
      bool private thirdDone = false;
      uint256 public fourthRelease;

      Token public ERC20Token; // ERC20 basic token contract to hold

      enum Stages {
          initClaim,
          firstRelease,
          secondRelease,
          thirdRelease,
          fourthRelease
      }

      Stages public stage = Stages.initClaim;

      modifier atStage(Stages _stage) {
          if(stage == _stage) _;
      }

      function C20Vesting(address _token, uint256 fundingEndBlockInput) {
          require(_token != address(0));
          beneficiary = msg.sender;
          fundingEndBlock = fundingEndBlockInput;
          ERC20Token = Token(_token);
      }

      function changeBeneficiary(address newBeneficiary) external {
          require(newBeneficiary != address(0));
          require(msg.sender == beneficiary);
          beneficiary = newBeneficiary;
      }

      function updateFundingEndBlock(uint256 newFundingEndBlock) {
          require(msg.sender == beneficiary);
          require(block.number < fundingEndBlock);
          require(block.number < newFundingEndBlock);
          fundingEndBlock = newFundingEndBlock;
      }

      function checkBalance() constant returns (uint256 tokenBalance) {
          return ERC20Token.balanceOf(this);
      }

      // in total 13% of C20 tokens will be sent to this contract
      // EXPENSE ALLOCATION: 5.5%       | TEAM ALLOCATION: 7.5% (vest over 2 years)
      //   2.5% - Marketing             | initalPayment: 1.5%
      //   1% - Security                | firstRelease: 1.5%
      //   1% - legal                   | secondRelease: 1.5%
      //   0.5% - Advisors              | thirdRelease: 1.5%
      //   0.5% - Boutnty               | fourthRelease: 1.5%
      // initial claim is tot expenses + initial team payment
      // initial claim is thus (5.5 + 1.5)/13 = 53.846153846% of C20 tokens sent here
      // each other release (for team) is 11.538461538% of tokens sent here

      function claim() external {
          require(msg.sender == beneficiary);
          require(block.number > fundingEndBlock);
          uint256 balance = ERC20Token.balanceOf(this);
          // in reverse order so stages changes don't carry within one claim
          fourth_release(balance);
          third_release(balance);
          second_release(balance);
          first_release(balance);
          init_claim(balance);
      }

      function nextStage() private {
          stage = Stages(uint256(stage) + 1);
      }

      function init_claim(uint256 balance) private atStage(Stages.initClaim) {
          firstRelease = now + 26 weeks; // assign 4 claiming times
          secondRelease = firstRelease + 26 weeks;
          thirdRelease = secondRelease + 26 weeks;
          fourthRelease = thirdRelease + 26 weeks;
          uint256 amountToTransfer = safeMul(balance, 53846153846) / 100000000000;
          ERC20Token.transfer(beneficiary, amountToTransfer); // now 46.153846154% tokens left
          nextStage();
      }
      function first_release(uint256 balance) private atStage(Stages.firstRelease) {
          require(now > firstRelease);
          uint256 amountToTransfer = balance / 4;
          ERC20Token.transfer(beneficiary, amountToTransfer); // send 25 % of team releases
          nextStage();
      }
      function second_release(uint256 balance) private atStage(Stages.secondRelease) {
          require(now > secondRelease);
          uint256 amountToTransfer = balance / 3;
          ERC20Token.transfer(beneficiary, amountToTransfer); // send 25 % of team releases
          nextStage();
      }
      function third_release(uint256 balance) private atStage(Stages.thirdRelease) {
          require(now > thirdRelease);
          uint256 amountToTransfer = balance / 2;
          ERC20Token.transfer(beneficiary, amountToTransfer); // send 25 % of team releases
          nextStage();
      }
      function fourth_release(uint256 balance) private atStage(Stages.fourthRelease) {
          require(now > fourthRelease);
          ERC20Token.transfer(beneficiary, balance); // send remaining 25 % of team releases
      }

      function claimOtherTokens(address _token) external {
          require(msg.sender == beneficiary);
          require(_token != address(0));
          Token token = Token(_token);
          require(token != ERC20Token);
          uint256 balance = token.balanceOf(this);
          token.transfer(beneficiary, balance);
       }

   }

    Contract ABI  
[{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"claimOtherTokens","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"claim","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"secondRelease","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"ERC20Token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"fundingEndBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"thirdRelease","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"fourthRelease","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"stage","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"checkBalance","outputs":[{"name":"tokenBalance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"firstRelease","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newBeneficiary","type":"address"}],"name":"changeBeneficiary","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newFundingEndBlock","type":"uint256"}],"name":"updateFundingEndBlock","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"fundingEndBlockInput","type":"uint256"}],"payable":false,"type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
60606040526000600260006101000a81548160ff0219169083151502179055506000600460006101000a81548160ff0219169083151502179055506000600660006101000a81548160ff0219169083151502179055506000600860006101000a81548160ff0219169083151502179055506000600a60146101000a81548160ff0219169083600481111561008f57fe5b0217905550341561009c57fe5b604051604080611369833981016040528080519060200190919080519060200190919050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156100ff5760006000fd5b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060018190555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50505b6111ce8061019b6000396000f300606060405236156100c3576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806338af3eed146100c5578063405a66da146101175780634e71d92d1461014d578063695ec7931461015f5780637a80760e1461018557806391b43d13146101d7578063a777deca146101fd578063b73f1e5214610223578063c040e6b814610249578063c71daccb1461027d578063da5db748146102a3578063dc070657146102c9578063e28b0d9a146102ff575bfe5b34156100cd57fe5b6100d561031f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561011f57fe5b61014b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610345565b005b341561015557fe5b61015d6105e7565b005b341561016757fe5b61016f610764565b6040518082815260200191505060405180910390f35b341561018d57fe5b61019561076a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101df57fe5b6101e7610790565b6040518082815260200191505060405180910390f35b341561020557fe5b61020d610796565b6040518082815260200191505060405180910390f35b341561022b57fe5b61023361079c565b6040518082815260200191505060405180910390f35b341561025157fe5b6102596107a2565b6040518082600481111561026957fe5b60ff16815260200191505060405180910390f35b341561028557fe5b61028d6107b5565b6040518082815260200191505060405180910390f35b34156102ab57fe5b6102b3610897565b6040518082815260200191505060405180910390f35b34156102d157fe5b6102fd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061089d565b005b341561030757fe5b61031d600480803590602001909190505061097c565b005b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156103a65760006000fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156103e35760006000fd5b829150600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156104445760006000fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156104e457fe5b6102c65a03f115156104f257fe5b5050506040518051905090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156105c857fe5b6102c65a03f115156105d657fe5b50505060405180519050505b505050565b6000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106465760006000fd5b600154431115156106575760006000fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561071957fe5b6102c65a03f1151561072757fe5b50505060405180519050905061073c81610a04565b61074581610b50565b61074e81610cb6565b61075781610e1c565b61076081610f82565b5b50565b60055481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b60075481565b60095481565b600a60149054906101000a900460ff1681565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561087957fe5b6102c65a03f1151561088757fe5b5050506040518051905090505b90565b60035481565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156108da5760006000fd5b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109375760006000fd5b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109d95760006000fd5b600154431015156109ea5760006000fd5b80431015156109f95760006000fd5b806001819055505b50565b6004806004811115610a1257fe5b600a60149054906101000a900460ff166004811115610a2d57fe5b1415610b4b5760095442111515610a445760006000fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610b3057fe5b6102c65a03f11515610b3e57fe5b50505060405180519050505b5b5b5050565b60006003806004811115610b6057fe5b600a60149054906101000a900460ff166004811115610b7b57fe5b1415610cb05760075442111515610b925760006000fd5b600283811515610b9e57fe5b049150600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610c8d57fe5b6102c65a03f11515610c9b57fe5b5050506040518051905050610cae61111f565b5b5b5b505050565b60006002806004811115610cc657fe5b600a60149054906101000a900460ff166004811115610ce157fe5b1415610e165760055442111515610cf85760006000fd5b600383811515610d0457fe5b049150600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610df357fe5b6102c65a03f11515610e0157fe5b5050506040518051905050610e1461111f565b5b5b5b505050565b60006001806004811115610e2c57fe5b600a60149054906101000a900460ff166004811115610e4757fe5b1415610f7c5760035442111515610e5e5760006000fd5b600483811515610e6a57fe5b049150600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610f5957fe5b6102c65a03f11515610f6757fe5b5050506040518051905050610f7a61111f565b5b5b5b505050565b60006000806004811115610f9257fe5b600a60149054906101000a900460ff166004811115610fad57fe5b14156111195762eff100420160038190555062eff1006003540160058190555062eff1006005540160078190555062eff1006007540160098190555064174876e800610ffe84640c897b1a7661116d565b81151561100757fe5b049150600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156110f657fe5b6102c65a03f1151561110457fe5b505050604051805190505061111761111f565b5b5b5b505050565b6001600a60149054906101000a900460ff16600481111561113c57fe5b01600481111561114857fe5b600a60146101000a81548160ff0219169083600481111561116557fe5b02179055505b565b600060008284029050600084148061118f575082848281151561118c57fe5b04145b151561119757fe5b8091505b50929150505600a165627a7a723058207dbf1c81d3ca5dcc06388170743035ede774b96cd41b7d3ba261b2b5efde63eb00290000000000000000000000007356855cbd2e532b25ad107d6154abdbc670e807000000000000000000000000000000000000000000000000000000000010c8e0

    Constructor Arguments (ABI-encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007356855cbd2e532b25ad107d6154abdbc670e807000000000000000000000000000000000000000000000000000000000010c8e0

-----Decoded View---------------
Found 2 constructor arguments :
Arg [0] : 0000000000000000000000007356855cbd2e532b25ad107d6154abdbc670e807
Arg [1] : 000000000000000000000000000000000000000000000000000000000010c8e0


   Swarm Source:
bzzr://7dbf1c81d3ca5dcc06388170743035ede774b96cd41b7d3ba261b2b5efde63eb
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward