Sponsored Link: Crowdsale has finished. Check out the KICKICO platform to find new ICOs to start.
Contract Overview
ETH Balance: 0.02 Ether
ETH USD Value: $5.38 (@ $269.24/ETH)
No Of Transactions: 7 txns
  Latest 7 txns

TxHash Age From To Value [TxFee]
0xd897b9ea1be334851feeea040043736dd4e3b21a1790ac603d28454ca62bb2ef8 days 5 hrs ago0xa4834bb804652aeb62c96fc29ded4bdd023d39d9  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460.02 Ether0.000145007
0x35965f348954fa0100d7328dedb0857f0c1bd43766717a0619a15c11197b65878 days 6 hrs ago0xa4834bb804652aeb62c96fc29ded4bdd023d39d9  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460 Ether0.000040357
0x3530c574a37ba3c83252ff8dcae54d8764e129d95e464e46ad35c2ae870fb74b8 days 6 hrs ago0xa9417270666614c41a1f1163abb9a00878173aa5  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460 Ether0.000013427
0xaf448896502ee5408a0ab3f5cac61e7d2660c038ebe8d12334bd3116422425f98 days 6 hrs ago0xa9417270666614c41a1f1163abb9a00878173aa5  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460 Ether0.000041917
0x6f3d20c9e1f00308c947ab176e089fff3c95716c56019d15ff277b0562ee141d8 days 6 hrs ago0xa4834bb804652aeb62c96fc29ded4bdd023d39d9  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460 Ether0.000028766
0xf8576ce1743c463a412206598dcf50a274300e11cae02ee7d22ad7142c1ce9bb8 days 6 hrs ago0xa4834bb804652aeb62c96fc29ded4bdd023d39d9  IN   0x5274a2293dbe075a82d41e873bb927403a9dce460.001 Ether0.000195168
0x925b219be6dec8802f256a37a4c71d53a3561047a3a35bcebd449b2a75d52bc38 days 6 hrs ago0xa4834bb804652aeb62c96fc29ded4bdd023d39d9  IN    Contract Creation0 Ether0.003668908
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0x35965f348954fa0100d7328dedb0857f0c1bd43766717a0619a15c11197b658742690578 days 6 hrs ago0x5274a2293dbe075a82d41e873bb927403a9dce460xa4834bb804652aeb62c96fc29ded4bdd023d39d90.001 Ether
[ Download CSV Export  ] 
Contract Source Code Verified
Contract Name: EthCapsule
Compiler Version: v0.4.16+commit.d7661dd9
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.11;

contract Ownable {
  address public owner;

  function Ownable() {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  function transferOwnership(address newOwner) onlyOwner {
    require(newOwner != address(0));
    owner = newOwner;
  }
}

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

contract EthCapsule is Ownable {
  struct Depositor {
    uint numCapsules;
    mapping (uint => Capsule) capsules;
  }

  mapping (address => Depositor) depositors;

  struct Capsule {
    uint value;
    uint id;
    uint lockTime;
    uint unlockTime;
    uint withdrawnTime;
  }

  uint public minDeposit = 1000000000000000;
  uint public minDuration = 0;
  uint public maxDuration = 157680000;
  uint public totalCapsules;
  uint public totalValue;
  uint public totalBuriedCapsules;

  function bury(uint unlockTime) payable {
    require(msg.value >= minDeposit);
    require(unlockTime <= block.timestamp + maxDuration);

    if (unlockTime < block.timestamp + minDuration) {
      unlockTime = SafeMath.add(block.timestamp, minDuration);
    }

    if (depositors[msg.sender].numCapsules <= 0) {
        depositors[msg.sender] = Depositor({ numCapsules: 0 });
    }

    Depositor storage depositor = depositors[msg.sender];

    depositor.numCapsules++;
    depositor.capsules[depositor.numCapsules] = Capsule({
        value: msg.value,
        id: depositors[msg.sender].numCapsules,
        lockTime: block.timestamp,
        unlockTime: unlockTime,
        withdrawnTime: 0
    });

    totalBuriedCapsules++;
    totalCapsules++;
    totalValue = SafeMath.add(totalValue, msg.value);
  }

  function dig(uint capsuleNumber) {
    Capsule storage capsule = depositors[msg.sender].capsules[capsuleNumber];

    require(capsule.unlockTime <= block.timestamp);
    require(capsule.withdrawnTime == 0);

    totalBuriedCapsules--;
    capsule.withdrawnTime = block.timestamp;
    msg.sender.transfer(capsule.value);
  }

  function setMinDeposit(uint min) onlyOwner {
    minDeposit = min;
  }

  function setMinDuration(uint min) onlyOwner {
    minDuration = min;
  }

  function setMaxDuration(uint max) onlyOwner {
    maxDuration = max;
  }
  
  function getCapsuleInfo(uint capsuleNum) constant returns (uint, uint, uint, uint, uint) {
    return (
        depositors[msg.sender].capsules[capsuleNum].value,
        depositors[msg.sender].capsules[capsuleNum].id,
        depositors[msg.sender].capsules[capsuleNum].lockTime,
        depositors[msg.sender].capsules[capsuleNum].unlockTime,
        depositors[msg.sender].capsules[capsuleNum].withdrawnTime
    );
  }

  function getNumberOfCapsules() constant returns (uint) {
    return depositors[msg.sender].numCapsules;
  }

  function totalBuriedValue() constant returns (uint) {
    return this.balance;
  }
}

  Contract ABI  
[{"constant":false,"inputs":[{"name":"min","type":"uint256"}],"name":"setMinDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalBuriedValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"capsuleNum","type":"uint256"}],"name":"getCapsuleInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBuriedCapsules","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNumberOfCapsules","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"capsuleNumber","type":"uint256"}],"name":"dig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"minDeposit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxDuration","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":false,"inputs":[{"name":"min","type":"uint256"}],"name":"setMinDeposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"unlockTime","type":"uint256"}],"name":"bury","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"totalCapsules","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"max","type":"uint256"}],"name":"setMaxDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

  Contract Creation Code Switch To Opcodes View
606060405266038d7ea4c68000600255600060035563096601806004555b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b610bab8061006e6000396000f300606060405236156100e4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631674bade146100e957806316ea07281461010c5780632987ace51461013557806339900dcc1461018857806339a89c1a146101b157806340517083146101da57806341b3d185146101fd57806356715761146102265780636db5c8fd1461024f5780638da5cb5b146102785780638fcc9cfb146102cd578063abf74d5f146102f0578063b49ce17f14610308578063cf0f34c414610331578063d4c3eea014610354578063f2fde38b1461037d575b600080fd5b34156100f457600080fd5b61010a60048080359060200190919050506103b6565b005b341561011757600080fd5b61011f61041d565b6040518082815260200191505060405180910390f35b341561014057600080fd5b610156600480803590602001909190505061043d565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b341561019357600080fd5b61019b61060c565b6040518082815260200191505060405180910390f35b34156101bc57600080fd5b6101c4610612565b6040518082815260200191505060405180910390f35b34156101e557600080fd5b6101fb600480803590602001909190505061065d565b005b341561020857600080fd5b61021061073f565b6040518082815260200191505060405180910390f35b341561023157600080fd5b610239610745565b6040518082815260200191505060405180910390f35b341561025a57600080fd5b61026261074b565b6040518082815260200191505060405180910390f35b341561028357600080fd5b61028b610751565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610776565b005b61030660048080359060200190919050506107dd565b005b341561031357600080fd5b61031b610a11565b6040518082815260200191505060405180910390f35b341561033c57600080fd5b6103526004808035906020019091905050610a17565b005b341561035f57600080fd5b610367610a7e565b6040518082815260200191505060405180910390f35b341561038857600080fd5b6103b4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a84565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041157600080fd5b806003819055505b5b50565b60003073ffffffffffffffffffffffffffffffffffffffff163190505b90565b6000806000806000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600087815260200190815260200160002060000154600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600088815260200190815260200160002060010154600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600089815260200190815260200160002060020154600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008a815260200190815260200160002060030154600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008b815260200190815260200160002060040154945094509450945094505b91939590929450565b60075481565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015490505b90565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008381526020019081526020016000209050428160030154111515156106c757600080fd5b600081600401541415156106da57600080fd5b600760008154809291906001900391905055504281600401819055503373ffffffffffffffffffffffffffffffffffffffff166108fc82600001549081150290604051600060405180830381858888f19350505050151561073a57600080fd5b5b5050565b60025481565b60035481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107d157600080fd5b806002819055505b5b50565b600060025434101515156107f057600080fd5b6004544201821115151561080357600080fd5b600354420182101561081e5761081b42600354610b60565b91505b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541115156108c8576020604051908101604052806000815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001559050505b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806000016000815480929190600101919050555060a060405190810160405280348152602001600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015481526020014281526020018381526020016000815250816001016000836000015481526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040155905050600760008154809291906001019190505550600560008154809291906001019190505550610a0660065434610b60565b6006819055505b5050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a7257600080fd5b806004819055505b5b50565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610adf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b1b57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000808284019050838110151515610b7457fe5b8091505b50929150505600a165627a7a72305820b2bb2f30ea1bd629178a1efc6c985f3dc9781e5591c859add632e779eb10a60b0029

   Swarm Source:
bzzr://b2bb2f30ea1bd629178a1efc6c985f3dc9781e5591c859add632e779eb10a60b
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.