Address Contract Partially Verified
Address
0x2e286dA6Ee6E8e0Afb2c1CfADb1B74669a3cD642
Balance
0.050000 ETH
Nonce
1
Code Size
8902 bytes
Creator
0x1D70bd64...5575 at tx 0x603ea201...9cbf43
Indexed Transactions
0
Contract Bytecode
8902 bytes
0x60606040523615610152576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105eb578063b5dc40c314610683578063b77bf600146106fc578063ba51a6df14610725578063c01a8c8414610748578063c64274741461076b578063cea0862114610804578063d74f8edd14610827578063dc8452cd14610850578063e20056e614610879578063ee22610b146108d1578063f059cf2b146108f4575b5b60003411156101ab573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b005b34156101b957600080fd5b6101cf600480803590602001909190505061091d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061095d565b005b341561025557600080fd5b61026b6004808035906020019091905050610c00565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dac565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dcc565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dfb565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e38565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ecc565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ed2565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ed8565b005b341561041b57600080fd5b61043160048080359060200190919050506110e9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111d1565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a360048080359060200190919050506112a0565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d75780820151818401525b6020810190506105bb565b505050509050019250505060405180910390f35b34156105f657600080fd5b61062b600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611391565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066f5780820151818401525b602081019050610653565b505050509050019250505060405180910390f35b341561068e57600080fd5b6106a460048080359060200190919050506114f2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e85780820151818401525b6020810190506106cc565b505050509050019250505060405180910390f35b341561070757600080fd5b61070f611723565b6040518082815260200191505060405180910390f35b341561073057600080fd5b6107466004808035906020019091905050611729565b005b341561075357600080fd5b61076960048080359060200190919050506117ef565b005b341561077657600080fd5b6107ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119d0565b6040518082815260200191505060405180910390f35b341561080f57600080fd5b61082560048080359060200190919050506119f0565b005b341561083257600080fd5b61083a611a6d565b6040518082815260200191505060405180910390f35b341561085b57600080fd5b610863611a72565b6040518082815260200191505060405180910390f35b341561088457600080fd5b6108cf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a78565b005b34156108dc57600080fd5b6108f26004808035906020019091905050611d96565b005b34156108ff57600080fd5b610907611fc9565b6040518082815260200191505060405180910390f35b60038181548110151561092c57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099957600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109f257600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b7e578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8557fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b70576003600160038054905003815481101515610ae557fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b2157fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b7e565b5b8180600101925050610a4f565b6001600381818054905003915081610b969190612175565b506003805490506004541115610bb557610bb4600380549050611729565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5957600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cc457600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610cf457600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e16576006549050610e35565b6008546006541015610e2b5760009050610e35565b6008546006540390505b90565b600080600090505b600554811015610ec457838015610e77575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610eaa5750828015610ea9575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610eb6576001820191505b5b8080600101915050610e40565b5b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1257600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f6c57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f9357600080fd5b60016003805490500160045460328211151515610faf57600080fd5b818111151515610fbe57600080fd5b60008114151515610fce57600080fd5b60008214151515610fde57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003805480600101828161104a91906121a1565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b6000806000809150600090505b6003805490508110156111c95760016000858152602001908152602001600020600060038381548110151561112757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111a8576001820191505b6004548214156111bb57600192506111ca565b5b80806001019150506110f6565b5b5050919050565b600080600090505b6003805490508110156112995760016000848152602001908152602001600020600060038381548110151561120a57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561128b576001820191505b5b80806001019150506111d9565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6113046121cd565b600380548060200260200160405190810160405280929190818152602001828054801561138657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161133c575b505050505090505b90565b6113996121e1565b6113a16121e1565b6000806005546040518059106113b45750595b908082528060200260200182016040525b50925060009150600090505b60055481101561147257858015611408575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061143b575084801561143a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114645780838381518110151561144f57fe5b90602001906020020181815250506001820191505b5b80806001019150506113d1565b8787036040518059106114825750595b908082528060200260200182016040525b5093508790505b868110156114e65782818151811015156114b057fe5b90602001906020020151848983038151811015156114ca57fe5b90602001906020020181815250505b808060010191505061149a565b5b505050949350505050565b6114fa6121cd565b6115026121cd565b6000806003805490506040518059106115185750595b908082528060200260200182016040525b50925060009150600090505b60038054905081101561167b5760016000868152602001908152602001600020600060038381548110151561156657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561166d576003818154811015156115ef57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561162a57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b8080600101915050611535565b816040518059106116895750595b908082528060200260200182016040525b509350600090505b8181101561171a5782818151811015156116b857fe5b9060200190602002015184828151811015156116d057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b80806001019150506116a2565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176357600080fd5b600380549050816032821115151561177a57600080fd5b81811115151561178957600080fd5b6000811415151561179957600080fd5b600082141515156117a957600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561184857600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156118a457600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561191057600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a36119c585611d96565b5b5b50505b505b5050565b60006119dd848484611fcf565b90506119e8816117ef565b5b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a2a57600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a15b5b50565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ab457600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b0d57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b6757600080fd5b600092505b600380549050831015611c55578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b9f57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c475783600384815481101515611bf857fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c55565b5b8280600101935050611b6c565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b6000808260008082815260200190815260200160002060030160009054906101000a900460ff16151515611dc957600080fd5b6000808581526020019081526020016000209250611de6846110e9565b91508180611e215750600083600201805460018160011615610100020316600290049050148015611e205750611e1f8360010154612123565b5b5b15611fc15760018360030160006101000a81548160ff021916908315150217905550811515611e5f5782600101546008600082825401925050819055505b8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010154846002016040518082805460018160011615610100020316600290048015611f085780601f10611edd57610100808354040283529160200191611f08565b820191906000526020600020905b815481529060010190602001808311611eeb57829003601f168201915b505091505060006040518083038185876187965a03f19250505015611f5957837f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611fc0565b837f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008360030160006101000a81548160ff021916908315150217905550811515611fbf5782600101546008600082825403925050819055505b5b5b5b5b50505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611ff857600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906120b79291906121f5565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b60006201518060075401421115612144574260078190555060006008819055505b6006548260085401118061215d57506008548260085401105b1561216b5760009050612170565b600190505b919050565b81548183558181151161219c5781836000526020600020918201910161219b9190612275565b5b505050565b8154818355818115116121c8578183600052602060002091820191016121c79190612275565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061223657805160ff1916838001178555612264565b82800160010185558215612264579182015b82811115612263578251825591602001919060010190612248565b5b5090506122719190612275565b5090565b61229791905b8082111561229357600081600090555060010161227b565b5090565b905600a165627a7a72305820dba6718f3ce0c9bf4e4142c7d2122e1d09a5bdbd877c4b14dbdb5921760b6b050029
Verified Source Code Partial Match
Compiler: v0.4.15+commit.bbb8e64f
Optimization: No
MultiSigWalletWithDailyLimit.sol 452 lines
pragma solidity 0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { require (msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require (!isOwner[owner]); _; } modifier ownerExists(address owner) { require (isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require (transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require (confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require (!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require (!transactions[transactionId].executed); _; } modifier notNull(address _address) { require (_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require (ownerCount <= MAX_OWNER_COUNT); require (_required <= ownerCount); require (_required != 0); require (ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require ( !isOwner[_owners[i]]); require (_owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <[email protected]> contract MultiSigWalletWithDailyLimit is MultiSigWallet { event DailyLimitChange(uint dailyLimit); uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool confirmed = isConfirmed(transactionId); if (confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; if (!confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
Write Contract 26 functions
These functions modify contract state and require a wallet transaction to execute.
MAX_OWNER_COUNT 0xd74f8edd
No parameters
returns: uint256
addOwner 0x7065cb48
address owner
calcMaxWithdraw 0x4bc9fdc2
No parameters
returns: uint256
changeDailyLimit 0xcea08621
uint256 _dailyLimit
changeRequirement 0xba51a6df
uint256 _required
confirmTransaction 0xc01a8c84
uint256 transactionId
confirmations 0x3411c81c
uint256
address
returns: bool
dailyLimit 0x67eeba0c
No parameters
returns: uint256
executeTransaction 0xee22610b
uint256 transactionId
getConfirmationCount 0x8b51d13f
uint256 transactionId
returns: uint256
getConfirmations 0xb5dc40c3
uint256 transactionId
returns: address[]
getOwners 0xa0e67e2b
No parameters
returns: address[]
getTransactionCount 0x54741525
bool pending
bool executed
returns: uint256
getTransactionIds 0xa8abe69a
uint256 from
uint256 to
bool pending
bool executed
returns: uint256[]
isConfirmed 0x784547a7
uint256 transactionId
returns: bool
isOwner 0x2f54bf6e
address
returns: bool
lastDay 0x6b0c932d
No parameters
returns: uint256
owners 0x025e7c27
uint256
returns: address
removeOwner 0x173825d9
address owner
replaceOwner 0xe20056e6
address owner
address newOwner
required 0xdc8452cd
No parameters
returns: uint256
revokeConfirmation 0x20ea8d86
uint256 transactionId
spentToday 0xf059cf2b
No parameters
returns: uint256
submitTransaction 0xc6427474
address destination
uint256 value
bytes data
returns: uint256
transactionCount 0xb77bf600
No parameters
returns: uint256
transactions 0x9ace38c2
uint256
returns: address, uint256, bytes, bool
Recent Transactions
No transactions found for this address