Sponsored Link:   Buy your 1st Ethereum in 5 minutes. Trusted by more than 100k buyers.
Contract Overview | Polkadot-Multisig
ETH Balance: 306,276.272251399926202 Ether
ETH USD Value: $104,841,430.75 (@ $342.31/ETH)
No Of Transactions: 115 txns
  Latest 25 txns from a total Of 115 transactions View All

TxHash Age From To Value [TxFee]
0xa810b26567ab785a5710519615a94aaa5e1c76b2683917c32c1d489d816a19c02 days 13 hrs ago0x00a7ca00471d62dece1b52ab409b8307836072c3  IN   Polkadot-Multisig0 Ether0.000023831
0xa05603894c86ce02a9876ab4db8b863098237c4d1f8c1e711a3c8de394bcbcc59 days 13 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.000191672
0x9d21a2ce47145e334c865817c0b423a6c102d2bccd06a32eced063403fa9b4139 days 22 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00045096
0x0b34d46932dba8a291e18ae632c0c33146acea97cf7a354d22b355213cf142dd9 days 22 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00045096
0x674f47c7f17eb2eb0ee218ec59676ce7630807892ab33ae53661872db27ceab39 days 22 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00049746
0x45098c39ec0d97238847b001004f67f25cbf346c0475720208b5099e7c419f929 days 23 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00047918
0x6b19bb5b0de5334e0e7e5b14440bc26ff659dcf51ad4ec464dc8e325d07adca29 days 23 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00049234
0xd0c60780292ca12a8372d1ed326976c5e07f76b3a5a317c4434fa0b7e6df3de79 days 23 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00048978
0xe0e15b227db864b8a961e30c075732632d9f813daa0be5ccd37835f3ca08f1079 days 23 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00050618
0x9a7b4943158005664f3c6a282ecc8a984efcb7a3c2ce77313fdcff819f4475539 days 23 hrs ago0x4253dc9945b45eb96a55161e42d805814e2cea84  IN   Polkadot-Multisig0 Ether0.00045096
0xe64184e3a96a328c3eb7a00a6e90a91f000ca4cd8f8ced2f8f7cdd893385a52410 days 11 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000044199512
0x98e08ad41d04438c566f0a8e886c688e15e27d3a56edc940f445fc67262a019e10 days 12 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000049454
0x0a739790679efa66667a2cb5f55ee6f37794b0ee50a2214d1a868ee475a0c2d710 days 12 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000042826712
0x1eb291924442bdf83a0e4062d2b29252722fcd2c704aa7cb68960da3988ed5fd10 days 12 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000044700012
0x9b4093d5c7e733828b6ef88ad07ce4a3365b8333a9e174c4a0e31501b9d13f5510 days 12 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000039879125
0x9fbe9301e70426361d9d007bf3991818d245f42fe49774dcf4abe9ad6bb9e94310 days 13 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000042826712
0x14c3f32216930dbb14cb5d838916202e764f6ee54c7a00bc25a6b2d0a097168110 days 13 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000044013612
0x50bcb92744d4af5fc039ae808dd52ff0d2b8a6932b97fd6beb926a9b48dbe8ea10 days 13 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000042826712
0x67d9539bc7111296c9348c8858c8023f95741d55c7750670ec146b8543877ee810 days 13 hrs ago0x74da6f6c32ff8f0f61a7ae487811ff77d32be10d  IN   Polkadot-Multisig0 Ether0.000066785712
0x4199ba8ef6744eff01c83910072986b876fdd4c33d63294e5370f98645c8582510 days 14 hrs ago0x00d29a21429ad90230ace2b9a1b25fa35bb288b8  IN   Polkadot-Multisig0 Ether0.000546365
0x1f9eb856baf34caa2b1acf87c9e9e93cf4f8f13631c02aa38541bd85a409c9ee10 days 15 hrs ago0x00d29a21429ad90230ace2b9a1b25fa35bb288b8  IN   Polkadot-Multisig0 Ether0.000583579
0x211f034435cc219983d4ae84219ac7d2d64faddbca338b97c1916e295e3f0c7710 days 21 hrs ago0x0bbbbe4330e30fda1b7e3b48ccdc812eefc1be57  IN   Polkadot-Multisig0 Ether0.000023959
0x79586d73ac106e486afea8595062fdf7226189d341272065fcf4682f1083814a11 days 2 hrs ago0xcc3a2770fde645cefa3ffaa8f6bcbe040905cfef  IN   Polkadot-Multisig0 Ether0.000517083
0xbf13ed4c9af0e56b066f368f09d102be0d185d309f491a19c84bda0ae95ec9fa12 days 5 hrs ago0xae7168deb525862f4fee37d987a971b385b96952  IN   Polkadot-Multisig0 Ether0.00025007
0x78edf1af08862c567f76d083f2e6329cc70172d42271c6411f5dfa392f00146412 days 5 hrs ago0xae7168deb525862f4fee37d987a971b385b96952  IN   Polkadot-Multisig0 Ether0.00025007
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0xd16eda411a4be5efea60050d13e0d13eb6184b25c23a58511026b463342c9df1443781422 days 14 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff16540258450 Ether
0x59370b45a0412754de7f8016c5f09f4bcc0425d56b0d9f5754a037af0fc7aeb1443779622 days 14 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025838 Ether
0xfe56776b3949a3265e48633739245bc029f317dd4facadffda237fa784d6bd19443777122 days 14 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402581 Ether
0x37fc6abded327765ca89abb298972d330a65552dc023f32d6ed1feaa7456f4f8443775822 days 14 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402589.6 Ether
0xeecac3e6fa2768a88d63bfb52dc2be9e7fc49d74ef77399f398113bcbf9b99bc443773622 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402581.89 Ether
0x311e2b7c2ab38281ef41bed57ffd570f3f866278c5a3ed614a7c5f2ae9471d50443769922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402582 Ether
0xdc095ccf24dd812d7bd70ad51f19e725a22e058fee0db6e112b76ac4228efc6e443769022 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025810 Ether
0x650f45adb9fea348e4b5e6f9338505a3fd7905ca83732859ce2e43960137cc7a443767922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402581.09 Ether
0xd8f6dcda56f1620eb918eeaa5886721410a1d177361bb18b846eeb045c015f0c443767922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402582.4 Ether
0x9c5c79022fc6801fcf6c6c9b304486301dd4636492fa7698bf716cdd488552c5443767322 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025815.505 Ether
0x623767b5d74cb678c5f29b744279e80acee5270cdbf482301cad6331f27a178e443765822 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402581.885 Ether
0x04c32ec11f5f092a9814b62bfe8304f0faab10eb7113ae9009cb8b73f8959fe2443765122 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.45595 Ether
0xae5df495076e64f767edea5fa460c3fd0c093c79c7cad0a1b6d38492fdabfda8443763422 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.8 Ether
0xa2abe840e3c0d5b8c7b73d7b7d00ae8e7d9955cf962194b3ae291cc28d6cdf8a443762622 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.13 Ether
0x7bcfa60e7bee83a3e1462ca90cb468c906773d932b5bb6c210fe5199a06905b3443762322 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402582.5 Ether
0x832d1b9ddff437353c2d25e106e8a65393e2ff29186b55744e4c93d8a8879ac9443762022 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025835 Ether
0x4f7b7747f38f819281ea6ca5261aa6b1c318ff26e9ee5b5758454e6ea8ee1022443761622 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402582 Ether
0x95e9bfef693a3e6a662d00f8a812a571c5f8b96043c959ee3a05bbf385c6ef4b443761022 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025812.3220816 Ether
0x2dcaad273f33b67f077d1f4bcc29f682cdcb360f2627a04c919ff80cdc8c210b443760722 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402584 Ether
0x6f92ae71e5ce6b74d10216d8b58289e32599c46f8bd11d74a30f49eaa97e13b0443760222 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff1654025825 Ether
0x35eb5a3b4d5dfd99176fc630ef44c8ea4335f96ce0cd819dec1d68828ddcae85443759922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.09 Ether
0xae95d0ae544bd38cf50d35418ceed7c8c70fa448b1e1feae0debdaa8d852b59b443758922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.01 Ether
0xdcd7c4e68cc34d168cf17c83002c7c497661ed83dbbef3bbb63fdfacda5645f6443758722 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402582 Ether
0xa23396d8970b11df108b1eb753ffb59b15bb4bae6d178c02737f9cbad4dc8c20443757722 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402580.051 Ether
0x799f8fe05cb03cfa02d0450e7f0d0311a319a5b16382803df032bf1551391de1443754922 days 15 hrs ago0x54a2d42a40f51259dedd1978f6c118a0f0eff0780x3bfc20f0b9afcace800d73d2191166ff165402589.9 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity), SkipEmptyStringLiteral (low-severity), ConstantOptimizerSubtraction (low-severity) Solidity compiler bugs.

Contract Source Code Verified
Note: Displaying matching verified source code at contract 0xc16ba0bf101682e0e7fcbd0b7bc160a8e2e59471
Contract Name: Wallet
Compiler Version: v0.4.10+commit.f0d539ae
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
//sol Wallet
// Multi-sig, daily-limited account proxy/wallet.
// @authors:
// Gav Wood <g@ethdev.com>
// inheritable "property" contract that enables methods to be protected by requiring the acquiescence of either a
// single, or, crucially, each of a number of, designated owners.
// usage:
// use modifiers onlyowner (just own owned) or onlymanyowners(hash), whereby the same hash must be provided by
// some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the
// interior is executed.

pragma solidity ^0.4.9;

contract WalletEvents {
  // EVENTS

  // this contract only has six types of events: it can accept a confirmation, in which case
  // we record owner and operation (hash) alongside it.
  event Confirmation(address owner, bytes32 operation);
  event Revoke(address owner, bytes32 operation);

  // some others are in the case of an owner changing.
  event OwnerChanged(address oldOwner, address newOwner);
  event OwnerAdded(address newOwner);
  event OwnerRemoved(address oldOwner);

  // the last one is emitted if the required signatures change
  event RequirementChanged(uint newRequirement);

  // Funds has arrived into the wallet (record how much).
  event Deposit(address _from, uint value);
  // Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going).
  event SingleTransact(address owner, uint value, address to, bytes data, address created);
  // Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going).
  event MultiTransact(address owner, bytes32 operation, uint value, address to, bytes data, address created);
  // Confirmation still needed for a transaction.
  event ConfirmationNeeded(bytes32 operation, address initiator, uint value, address to, bytes data);
}

contract WalletAbi {
  // Revokes a prior confirmation of the given operation
  function revoke(bytes32 _operation) external;

  // Replaces an owner `_from` with another `_to`.
  function changeOwner(address _from, address _to) external;

  function addOwner(address _owner) external;

  function removeOwner(address _owner) external;

  function changeRequirement(uint _newRequired) external;

  function isOwner(address _addr) constant returns (bool);

  function hasConfirmed(bytes32 _operation, address _owner) external constant returns (bool);

  // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
  function setDailyLimit(uint _newLimit) external;

  function execute(address _to, uint _value, bytes _data) external returns (bytes32 o_hash);
  function confirm(bytes32 _h) returns (bool o_success);
}

contract WalletLibrary is WalletEvents {
  // TYPES

  // struct for the status of a pending operation.
  struct PendingState {
    uint yetNeeded;
    uint ownersDone;
    uint index;
  }

  // Transaction structure to remember details of transaction lest it need be saved for a later call.
  struct Transaction {
    address to;
    uint value;
    bytes data;
  }

  // MODIFIERS

  // simple single-sig function modifier.
  modifier onlyowner {
    if (isOwner(msg.sender))
      _;
  }
  // multi-sig function modifier: the operation must have an intrinsic hash in order
  // that later attempts can be realised as the same underlying operation and
  // thus count as confirmations.
  modifier onlymanyowners(bytes32 _operation) {
    if (confirmAndCheck(_operation))
      _;
  }

  // METHODS

  // gets called when no other function matches
  function() payable {
    // just being sent some cash?
    if (msg.value > 0)
      Deposit(msg.sender, msg.value);
  }

  // constructor is given number of sigs required to do protected "onlymanyowners" transactions
  // as well as the selection of addresses capable of confirming them.
  function initMultiowned(address[] _owners, uint _required) only_uninitialized {
    m_numOwners = _owners.length + 1;
    m_owners[1] = uint(msg.sender);
    m_ownerIndex[uint(msg.sender)] = 1;
    for (uint i = 0; i < _owners.length; ++i)
    {
      m_owners[2 + i] = uint(_owners[i]);
      m_ownerIndex[uint(_owners[i])] = 2 + i;
    }
    m_required = _required;
  }

  // Revokes a prior confirmation of the given operation
  function revoke(bytes32 _operation) external {
    uint ownerIndex = m_ownerIndex[uint(msg.sender)];
    // make sure they're an owner
    if (ownerIndex == 0) return;
    uint ownerIndexBit = 2**ownerIndex;
    var pending = m_pending[_operation];
    if (pending.ownersDone & ownerIndexBit > 0) {
      pending.yetNeeded++;
      pending.ownersDone -= ownerIndexBit;
      Revoke(msg.sender, _operation);
    }
  }

  // Replaces an owner `_from` with another `_to`.
  function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external {
    if (isOwner(_to)) return;
    uint ownerIndex = m_ownerIndex[uint(_from)];
    if (ownerIndex == 0) return;

    clearPending();
    m_owners[ownerIndex] = uint(_to);
    m_ownerIndex[uint(_from)] = 0;
    m_ownerIndex[uint(_to)] = ownerIndex;
    OwnerChanged(_from, _to);
  }

  function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
    if (isOwner(_owner)) return;

    clearPending();
    if (m_numOwners >= c_maxOwners)
      reorganizeOwners();
    if (m_numOwners >= c_maxOwners)
      return;
    m_numOwners++;
    m_owners[m_numOwners] = uint(_owner);
    m_ownerIndex[uint(_owner)] = m_numOwners;
    OwnerAdded(_owner);
  }

  function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
    uint ownerIndex = m_ownerIndex[uint(_owner)];
    if (ownerIndex == 0) return;
    if (m_required > m_numOwners - 1) return;

    m_owners[ownerIndex] = 0;
    m_ownerIndex[uint(_owner)] = 0;
    clearPending();
    reorganizeOwners(); //make sure m_numOwner is equal to the number of owners and always points to the optimal free slot
    OwnerRemoved(_owner);
  }

  function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external {
    if (_newRequired > m_numOwners) return;
    m_required = _newRequired;
    clearPending();
    RequirementChanged(_newRequired);
  }

  // Gets an owner by 0-indexed position (using numOwners as the count)
  function getOwner(uint ownerIndex) external constant returns (address) {
    return address(m_owners[ownerIndex + 1]);
  }

  function isOwner(address _addr) constant returns (bool) {
    return m_ownerIndex[uint(_addr)] > 0;
  }

  function hasConfirmed(bytes32 _operation, address _owner) external constant returns (bool) {
    var pending = m_pending[_operation];
    uint ownerIndex = m_ownerIndex[uint(_owner)];

    // make sure they're an owner
    if (ownerIndex == 0) return false;

    // determine the bit to set for this owner.
    uint ownerIndexBit = 2**ownerIndex;
    return !(pending.ownersDone & ownerIndexBit == 0);
  }

  // constructor - stores initial daily limit and records the present day's index.
  function initDaylimit(uint _limit) only_uninitialized {
    m_dailyLimit = _limit;
    m_lastDay = today();
  }
  // (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
  function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external {
    m_dailyLimit = _newLimit;
  }
  // resets the amount already spent today. needs many of the owners to confirm.
  function resetSpentToday() onlymanyowners(sha3(msg.data)) external {
    m_spentToday = 0;
  }

  // throw unless the contract is not yet initialized.
  modifier only_uninitialized { if (m_numOwners > 0) throw; _; }

  // constructor - just pass on the owner array to the multiowned and
  // the limit to daylimit
  function initWallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized {
    initDaylimit(_daylimit);
    initMultiowned(_owners, _required);
  }

  // kills the contract sending everything to `_to`.
  function kill(address _to) onlymanyowners(sha3(msg.data)) external {
    suicide(_to);
  }

  // Outside-visible transact entry point. Executes transaction immediately if below daily spend limit.
  // If not, goes into multisig process. We provide a hash on return to allow the sender to provide
  // shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value
  // and _data arguments). They still get the option of using them if they want, anyways.
  function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 o_hash) {
    // first, take the opportunity to check that we're under the daily limit.
    if ((_data.length == 0 && underLimit(_value)) || m_required == 1) {
      // yes - just execute the call.
      address created;
      if (_to == 0) {
        created = create(_value, _data);
      } else {
        if (!_to.call.value(_value)(_data))
          throw;
      }
      SingleTransact(msg.sender, _value, _to, _data, created);
    } else {
      // determine our operation hash.
      o_hash = sha3(msg.data, block.number);
      // store if it's new
      if (m_txs[o_hash].to == 0 && m_txs[o_hash].value == 0 && m_txs[o_hash].data.length == 0) {
        m_txs[o_hash].to = _to;
        m_txs[o_hash].value = _value;
        m_txs[o_hash].data = _data;
      }
      if (!confirm(o_hash)) {
        ConfirmationNeeded(o_hash, msg.sender, _value, _to, _data);
      }
    }
  }

  function create(uint _value, bytes _code) internal returns (address o_addr) {
    assembly {
      o_addr := create(_value, add(_code, 0x20), mload(_code))
      jumpi(invalidJumpLabel, iszero(extcodesize(o_addr)))
    }
  }

  // confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order
  // to determine the body of the transaction from the hash provided.
  function confirm(bytes32 _h) onlymanyowners(_h) returns (bool o_success) {
    if (m_txs[_h].to != 0 || m_txs[_h].value != 0 || m_txs[_h].data.length != 0) {
      address created;
      if (m_txs[_h].to == 0) {
        created = create(m_txs[_h].value, m_txs[_h].data);
      } else {
        if (!m_txs[_h].to.call.value(m_txs[_h].value)(m_txs[_h].data))
          throw;
      }

      MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to, m_txs[_h].data, created);
      delete m_txs[_h];
      return true;
    }
  }

  // INTERNAL METHODS

  function confirmAndCheck(bytes32 _operation) internal returns (bool) {
    // determine what index the present sender is:
    uint ownerIndex = m_ownerIndex[uint(msg.sender)];
    // make sure they're an owner
    if (ownerIndex == 0) return;

    var pending = m_pending[_operation];
    // if we're not yet working on this operation, switch over and reset the confirmation status.
    if (pending.yetNeeded == 0) {
      // reset count of confirmations needed.
      pending.yetNeeded = m_required;
      // reset which owners have confirmed (none) - set our bitmap to 0.
      pending.ownersDone = 0;
      pending.index = m_pendingIndex.length++;
      m_pendingIndex[pending.index] = _operation;
    }
    // determine the bit to set for this owner.
    uint ownerIndexBit = 2**ownerIndex;
    // make sure we (the message sender) haven't confirmed this operation previously.
    if (pending.ownersDone & ownerIndexBit == 0) {
      Confirmation(msg.sender, _operation);
      // ok - check if count is enough to go ahead.
      if (pending.yetNeeded <= 1) {
        // enough confirmations: reset and run interior.
        delete m_pendingIndex[m_pending[_operation].index];
        delete m_pending[_operation];
        return true;
      }
      else
      {
        // not enough: record that this owner in particular confirmed.
        pending.yetNeeded--;
        pending.ownersDone |= ownerIndexBit;
      }
    }
  }

  function reorganizeOwners() private {
    uint free = 1;
    while (free < m_numOwners)
    {
      while (free < m_numOwners && m_owners[free] != 0) free++;
      while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--;
      if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0)
      {
        m_owners[free] = m_owners[m_numOwners];
        m_ownerIndex[m_owners[free]] = free;
        m_owners[m_numOwners] = 0;
      }
    }
  }

  // checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and
  // returns true. otherwise just returns false.
  function underLimit(uint _value) internal onlyowner returns (bool) {
    // reset the spend limit if we're on a different day to last time.
    if (today() > m_lastDay) {
      m_spentToday = 0;
      m_lastDay = today();
    }
    // check to see if there's enough left - if so, subtract and return true.
    // overflow protection                    // dailyLimit check
    if (m_spentToday + _value >= m_spentToday && m_spentToday + _value <= m_dailyLimit) {
      m_spentToday += _value;
      return true;
    }
    return false;
  }

  // determines today's index.
  function today() private constant returns (uint) { return now / 1 days; }

  function clearPending() internal {
    uint length = m_pendingIndex.length;

    for (uint i = 0; i < length; ++i) {
      delete m_txs[m_pendingIndex[i]];

      if (m_pendingIndex[i] != 0)
        delete m_pending[m_pendingIndex[i]];
    }

    delete m_pendingIndex;
  }

  // FIELDS
  address constant _walletLibrary = 0xcafecafecafecafecafecafecafecafecafecafe;

  // the number of owners that must confirm the same operation before it is run.
  uint public m_required;
  // pointer used to find a free slot in m_owners
  uint public m_numOwners;

  uint public m_dailyLimit;
  uint public m_spentToday;
  uint public m_lastDay;

  // list of owners
  uint[256] m_owners;

  uint constant c_maxOwners = 250;
  // index on the list of owners to allow reverse lookup
  mapping(uint => uint) m_ownerIndex;
  // the ongoing operations.
  mapping(bytes32 => PendingState) m_pending;
  bytes32[] m_pendingIndex;

  // pending transactions we have at present.
  mapping (bytes32 => Transaction) m_txs;
}

contract Wallet is WalletEvents {

  // WALLET CONSTRUCTOR
  //   calls the `initWallet` method of the Library in this context
  function Wallet(address[] _owners, uint _required, uint _daylimit) {
    // Signature of the Wallet Library's init function
    bytes4 sig = bytes4(sha3("initWallet(address[],uint256,uint256)"));
    address target = _walletLibrary;

    // Compute the size of the call data : arrays has 2
    // 32bytes for offset and length, plus 32bytes per element ;
    // plus 2 32bytes for each uint
    uint argarraysize = (2 + _owners.length);
    uint argsize = (2 + argarraysize) * 32;

    assembly {
      // Add the signature first to memory
      mstore(0x0, sig)
      // Add the call data, which is at the end of the
      // code
      codecopy(0x4,  sub(codesize, argsize), argsize)
      // Delegate call to the library
      delegatecall(sub(gas, 10000), target, 0x0, add(argsize, 0x4), 0x0, 0x0)
    }
  }

  // METHODS

  // gets called when no other function matches
  function() payable {
    // just being sent some cash?
    if (msg.value > 0)
      Deposit(msg.sender, msg.value);
    else if (msg.data.length > 0)
      _walletLibrary.delegatecall(msg.data);
  }

  // Gets an owner by 0-indexed position (using numOwners as the count)
  function getOwner(uint ownerIndex) constant returns (address) {
    return address(m_owners[ownerIndex + 1]);
  }

  // As return statement unavailable in fallback, explicit the method here

  function hasConfirmed(bytes32 _operation, address _owner) external constant returns (bool) {
    return _walletLibrary.delegatecall(msg.data);
  }

  function isOwner(address _addr) constant returns (bool) {
    return _walletLibrary.delegatecall(msg.data);
  }

  // FIELDS
  address constant _walletLibrary = 0x863df6bfa4469f3ead0be8f9f2aae51c91a907b4;

  // the number of owners that must confirm the same operation before it is run.
  uint public m_required;
  // pointer used to find a free slot in m_owners
  uint public m_numOwners;

  uint public m_dailyLimit;
  uint public m_spentToday;
  uint public m_lastDay;

  // list of owners
  uint[256] m_owners;
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_numOwners","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_lastDay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_spentToday","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_required","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_operation","type":"bytes32"},{"name":"_owner","type":"address"}],"name":"hasConfirmed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"ownerIndex","type":"uint256"}],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_dailyLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"_owners","type":"address[]"},{"name":"_required","type":"uint256"},{"name":"_daylimit","type":"uint256"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"}],"name":"Confirmation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"}],"name":"Revoke","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"}],"name":"OwnerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newRequirement","type":"uint256"}],"name":"RequirementChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"created","type":"address"}],"name":"SingleTransact","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"created","type":"address"}],"name":"MultiTransact","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"operation","type":"bytes32"},{"indexed":false,"name":"initiator","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"}],"name":"ConfirmationNeeded","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000c57fe5b60405161048538038061048583398101604090815281516020830151918301519201915b604080517f696e697457616c6c657428616464726573735b5d2c75696e743235362c75696e81527f7432353629000000000000000000000000000000000000000000000000000000602080830191909152915190819003602501902084516000829052909173863df6bfa4469f3ead0be8f9f2aae51c91a907b491600281019160049182010290819038829003903960006000600483016000866127105a03f45b505050505050505b61039d806100e86000396000f300606060405236156100725763ffffffff60e060020a6000350416632f54bf6e811461012d5780634123cb6b1461015d578063523750931461017f578063659010e7146101a1578063746c9171146101c3578063c2cf7326146101e5578063c41a360a14610218578063f1736d8614610247575b61012b5b60003411156100c75760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1610127565b60003611156101275773863df6bfa4469f3ead0be8f9f2aae51c91a907b4600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561012457fe5b50505b5b5b565b005b341561013557fe5b610149600160a060020a0360043516610269565b604080519115158252519081900360200190f35b341561016557fe5b61016d6102cd565b60408051918252519081900360200190f35b341561018757fe5b61016d6102d3565b60408051918252519081900360200190f35b34156101a957fe5b61016d6102d9565b60408051918252519081900360200190f35b34156101cb57fe5b61016d6102df565b60408051918252519081900360200190f35b34156101ed57fe5b610149600435600160a060020a03602435166102e5565b604080519115158252519081900360200190f35b341561022057fe5b61022b60043561034a565b60408051600160a060020a039092168252519081900360200190f35b341561024f57fe5b61016d61036b565b60408051918252519081900360200190f35b600073863df6bfa4469f3ead0be8f9f2aae51c91a907b4600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f415156102bf57fe5b50506040515190505b919050565b60015481565b60045481565b60035481565b60005481565b600073863df6bfa4469f3ead0be8f9f2aae51c91a907b4600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561033b57fe5b50506040515190505b92915050565b6000600560018301610100811061035d57fe5b0160005b505490505b919050565b600254815600a165627a7a72305820c20a8475c42598c198f6629bada37e1b234da85ac2c0cbac3d96089030b180400029000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000

   Swarm Source:
bzzr://c20a8475c42598c198f6629bada37e1b234da85ac2c0cbac3d96089030b18040
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.