diff --git a/contracts/enhanced-wallet.sol b/contracts/enhanced-wallet.sol index ed87d11..12e8373 100644 --- a/contracts/enhanced-wallet.sol +++ b/contracts/enhanced-wallet.sol @@ -104,7 +104,7 @@ contract WalletLibrary is WalletEvents { // 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) { + 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; @@ -198,7 +198,7 @@ contract WalletLibrary is WalletEvents { } // constructor - stores initial daily limit and records the present day's index. - function initDaylimit(uint _limit) { + function initDaylimit(uint _limit) only_uninitialized { m_dailyLimit = _limit; m_lastDay = today(); } @@ -211,9 +211,12 @@ contract WalletLibrary is WalletEvents { 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) { + function initWallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized { initDaylimit(_daylimit); initMultiowned(_owners, _required); } @@ -367,7 +370,7 @@ contract WalletLibrary is WalletEvents { } // FIELDS - address constant _walletLibrary = 0xC0FfEE0505d21342Cd503BC57ed33fC2CeC7f225; + address constant _walletLibrary = 0xcafecafecafecafecafecafecafecafecafecafe; // the number of owners that must confirm the same operation before it is run. uint public m_required; @@ -445,7 +448,7 @@ contract Wallet is WalletEvents { } // FIELDS - address constant _walletLibrary = 0xC0FfEE0505d21342Cd503BC57ed33fC2CeC7f225; + address constant _walletLibrary = 0x863df6bfa4469f3ead0be8f9f2aae51c91a907b4; // the number of owners that must confirm the same operation before it is run. uint public m_required; @@ -458,4 +461,4 @@ contract Wallet is WalletEvents { // list of owners uint[256] m_owners; -} \ No newline at end of file +}