From b640df8fbb964da7538eef268dffc125b081a82f Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 19 Jul 2017 22:29:58 +0200 Subject: [PATCH] Fix initialisation bug. (#6102) --- js/src/contracts/code/wallet.js | 2 +- js/src/contracts/snippets/enhanced-wallet.sol | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/contracts/code/wallet.js b/js/src/contracts/code/wallet.js index 06142308a..3f92357f4 100644 --- a/js/src/contracts/code/wallet.js +++ b/js/src/contracts/code/wallet.js @@ -22,7 +22,7 @@ export const walletCompiler = 'v0.4.9+commit.364da425'; export const walletSource = 'https://github.com/paritytech/parity/blob/c4196a5de31e0b97ec42d5263d9db404cea4a776/js/src/contracts/snippets/enhanced-wallet.sol'; export const wallet = '0x6060604052341561000c57fe5b60405161048538038061048583398101604090815281516020830151918301519201915b604080517f696e697457616c6c657428616464726573735b5d2c75696e743235362c75696e81527f7432353629000000000000000000000000000000000000000000000000000000602080830191909152915190819003602501902084516000829052909173_____________WalletLibrary______________91600281019160049182010290819038829003903960006000600483016000866127105a03f45b505050505050505b61039d806100e86000396000f300606060405236156100725763ffffffff60e060020a6000350416632f54bf6e811461012d5780634123cb6b1461015d578063523750931461017f578063659010e7146101a1578063746c9171146101c3578063c2cf7326146101e5578063c41a360a14610218578063f1736d8614610247575b61012b5b60003411156100c75760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1610127565b60003611156101275773_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561012457fe5b50505b5b5b565b005b341561013557fe5b610149600160a060020a0360043516610269565b604080519115158252519081900360200190f35b341561016557fe5b61016d6102cd565b60408051918252519081900360200190f35b341561018757fe5b61016d6102d3565b60408051918252519081900360200190f35b34156101a957fe5b61016d6102d9565b60408051918252519081900360200190f35b34156101cb57fe5b61016d6102df565b60408051918252519081900360200190f35b34156101ed57fe5b610149600435600160a060020a03602435166102e5565b604080519115158252519081900360200190f35b341561022057fe5b61022b60043561034a565b60408051600160a060020a039092168252519081900360200190f35b341561024f57fe5b61016d61036b565b60408051918252519081900360200190f35b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f415156102bf57fe5b50506040515190505b919050565b60015481565b60045481565b60035481565b60005481565b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561033b57fe5b50506040515190505b92915050565b6000600560018301610100811061035d57fe5b0160005b505490505b919050565b600254815600a165627a7a723058204a75c2f5c8009054bd9e9998e8bb6f4bca0b201484709f357b482793957c47130029'; -export const walletLibrary = '0x6060604052341561000c57fe5b5b6116d88061001c6000396000f300606060405236156101015763ffffffff60e060020a600035041663173825d981146101575780632f54bf6e146101755780634123cb6b146101a557806352375093146101c75780635c52c2f5146101e9578063659010e7146101fb5780637065cb481461021d578063746c91711461023b578063797af6271461025d5780639da5e0eb14610284578063b20d30a914610299578063b61d27f6146102ae578063b75c7dc6146102ec578063ba51a6df14610301578063c2cf732614610316578063c41a360a14610349578063c57c5f6014610378578063cbf0b0c0146103cf578063e46dcfeb146103ed578063f00d4b5d14610449578063f1736d861461046d575b6101555b60003411156101525760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b5b565b005b341561015f57fe5b610155600160a060020a036004351661048f565b005b341561017d57fe5b610191600160a060020a036004351661057d565b604080519115158252519081900360200190f35b34156101ad57fe5b6101b561059e565b60408051918252519081900360200190f35b34156101cf57fe5b6101b56105a4565b60408051918252519081900360200190f35b34156101f157fe5b6101556105aa565b005b341561020357fe5b6101b56105e1565b60408051918252519081900360200190f35b341561022557fe5b610155600160a060020a03600435166105e7565b005b341561024357fe5b6101b56106d7565b60408051918252519081900360200190f35b341561026557fe5b6101916004356106dd565b604080519115158252519081900360200190f35b341561028c57fe5b610155600435610a2f565b005b34156102a157fe5b610155600435610a43565b005b34156102b657fe5b6101b560048035600160a060020a0316906024803591604435918201910135610a7b565b60408051918252519081900360200190f35b34156102f457fe5b610155600435610d5d565b005b341561030957fe5b610155600435610e08565b005b341561031e57fe5b610191600435600160a060020a0360243516610e8a565b604080519115158252519081900360200190f35b341561035157fe5b61035c600435610edf565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505093359350610f0092505050565b005b34156103d757fe5b610155600160a060020a0360043516610fd4565b005b34156103f557fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505084359460200135935061101292505050565b005b341561045157fe5b610155600160a060020a036004358116906024351661102b565b005b341561047557fe5b6101b5611125565b60408051918252519081900360200190f35b60006000366040518083838082843782019150509250505060405180910390206104b88161112b565b1561057657600160a060020a0383166000908152610105602052604090205491508115156104e557610576565b60016001540360005411156104f957610576565b6000600583610100811061050957fe5b0160005b5055600160a060020a03831660009081526101056020526040812055610531611296565b610539611386565b60408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b5b5b505050565b600160a060020a03811660009081526101056020526040812054115b919050565b60015481565b60045481565b6000366040518083838082843782019150509250505060405180910390206105d18161112b565b156105dc5760006003555b5b5b50565b60035481565b60003660405180838380828437820191505092505050604051809103902061060e8161112b565b156106d15761061c8261057d565b15610626576106d1565b61062e611296565b60015460fa901061064157610641611386565b5b60015460fa9010610652576106d1565b60018054810190819055600160a060020a03831690600590610100811061067557fe5b0160005b5055600154600160a060020a03831660008181526101056020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5b5b5050565b60005481565b60006000826106eb8161112b565b15610a255760008481526101086020526040902054600160a060020a031615158061072757506000848152610108602052604090206001015415155b80610754575060008481526101086020526040902060029081015461010060018216150260001901160415155b15610a255760008481526101086020526040902054600160a060020a0316151561082c57600084815261010860209081526040918290206001808201546002928301805486516000199482161561010002949094011693909304601f810185900485028301850190955284825261082594909391929183018282801561081b5780601f106107f05761010080835404028352916020019161081b565b820191906000526020600020905b8154815290600101906020018083116107fe57829003601f168201915b50505050506114c2565b91506108e3565b60008481526101086020526040908190208054600180830154935160029384018054600160a060020a0390941695949093919283928592918116156101000260001901160480156108be5780601f10610893576101008083540402835291602001916108be565b820191906000526020600020905b8154815290600101906020018083116108a157829003601f168201915b505091505060006040518083038185876185025a03f19250505015156108e357610000565b5b6000848152610108602090815260409182902060018082015482548551600160a060020a033381811683529682018c90529681018390529086166060820181905295881660a082015260c06080820181815260029586018054958616156101000260001901909516959095049082018190527fe3a3a4111a84df27d76b68dc721e65c7711605ea5eee4afd3a9c58195217365c968b959394909390928a9290919060e0830190859080156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b505097505050505050505060405180910390a16000848152610108602052604081208054600160a060020a03191681556001810182905590610a1e6002830182611557565b5050600192505b5b5b5b5050919050565b6002819055610a3c6114dc565b6004555b50565b600036604051808383808284378201915050925050506040518091039020610a6a8161112b565b156106d15760028290555b5b5b5050565b60006000610a883361057d565b15610d505782158015610a9f5750610a9f856114eb565b5b80610aad57506000546001145b15610bef57600160a060020a0386161515610b0357610afc8585858080601f016020809104026020016040519081016040528093929190818152602001838380828437506114c2945050505050565b9050610b43565b85600160a060020a03168585856040518083838082843782019150509250505060006040518083038185876185025a03f1925050501515610b4357610000565b5b7f9738cd1a8777c86b011f7b01d87d484217dc6ab5154a9d41eda5d14af8caf2923386888787866040518087600160a060020a0316600160a060020a0316815260200186815260200185600160a060020a0316600160a060020a031681526020018060200183600160a060020a0316600160a060020a0316815260200182810382528585828181526020019250808284376040519201829003995090975050505050505050a1610d50565b600036436040518084848082843791909101928352505060408051602092819003830190206000818152610108909352912054909450600160a060020a0316159150508015610c4e575060008281526101086020526040902060010154155b8015610c7b5750600082815261010860205260409020600290810154610100600182161502600019011604155b15610cbf576000828152610108602052604090208054600160a060020a031916600160a060020a03881617815560018101869055610cbd90600201858561159f565b505b610cc8826106dd565b1515610d505760408051838152600160a060020a033381811660208401529282018890528816606082015260a0608082018181529082018690527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32928592909189918b918a918a9160c082018484808284376040519201829003995090975050505050505050a15b5b5b5b5b50949350505050565b600160a060020a033316600090815261010560205260408120549080821515610d8557610e01565b50506000828152610106602052604081206001810154600284900a929083161115610e015780546001908101825581018054839003905560408051600160a060020a03331681526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5b50505050565b600036604051808383808284378201915050925050506040518091039020610e2f8161112b565b156106d157600154821115610e43576106d1565b6000829055610e50611296565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15b5b5b5050565b600082815261010660209081526040808320600160a060020a038516845261010590925282205482811515610ec25760009350610ed6565b8160020a9050808360010154166000141593505b50505092915050565b60006005600183016101008110610ef257fe5b0160005b505490505b919050565b815160019081018155600090600160a060020a033316906005905b0160005b505550600160a060020a033316600090815261010560205260408120600190555b8251811015610fc9578281815181101515610f5757fe5b60209081029091010151600160a060020a03166005600283016101008110610f7b57fe5b0160005b50819055508060020161010560008584815181101515610f9b57fe5b90602001906020020151600160a060020a03168152602001908152602001600020819055505b600101610f40565b60008290555b505050565b600036604051808383808284378201915050925050506040518091039020610ffb8161112b565b156106d15781600160a060020a0316ff5b5b5b5050565b61101b81610a2f565b6105768383610f00565b5b505050565b60006000366040518083838082843782019150509250505060405180910390206110548161112b565b15610e01576110628361057d565b1561106c57610e01565b600160a060020a03841660009081526101056020526040902054915081151561109457610e01565b61109c611296565b600160a060020a03831660058361010081106110b457fe5b0160005b5055600160a060020a0380851660008181526101056020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b5b5b50505050565b60025481565b600160a060020a0333166000908152610105602052604081205481808215156111535761128c565b600085815261010660205260409020805490925015156111b65760008054835560018084019190915561010780549161118e9190830161161e565b60028301819055610107805487929081106111a557fe5b906000526020600020900160005b50555b8260020a9050808260010154166000141561128c5760408051600160a060020a03331681526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a181546001901161127957600085815261010660205260409020600201546101078054909190811061123c57fe5b906000526020600020900160005b50600090819055858152610106602052604081208181556001808201839055600290910191909155935061128c565b8154600019018255600182018054821790555b5b5b505050919050565b6101075460005b81811015611374576101086000610107838154811015156112ba57fe5b906000526020600020900160005b50548152602081019190915260400160009081208054600160a060020a031916815560018101829055906112ff6002830182611557565b505061010780548290811061131057fe5b906000526020600020900160005b50541561136b5761010660006101078381548110151561133a57fe5b906000526020600020900160005b505481526020810191909152604001600090812081815560018101829055600201555b5b60010161129d565b6106d16101076000611648565b5b5050565b60015b6001548110156105dc575b600154811080156113b7575060058161010081106113ae57fe5b0160005b505415155b156113c457600101611394565b5b60016001541180156113eb575060015460059061010081106113e357fe5b0160005b5054155b156113ff57600180546000190190556113c4565b600154811080156114255750600154600590610100811061141c57fe5b0160005b505415155b80156114425750600581610100811061143a57fe5b0160005b5054155b156114b957600154600590610100811061145857fe5b0160005b5054600582610100811061146c57fe5b0160005b5055806101056000600583610100811061148657fe5b0160005b505481526020019081526020016000208190555060006005600154610100811015156114b257fe5b0160005b50555b611389565b5b50565b600081516020830184f09050803b15610000575b92915050565b600062015180425b0490505b90565b60006114f63361057d565b15610599576004546115066114dc565b111561151d5760006003556115196114dc565b6004555b600354828101108015906115375750600254826003540111155b1561154c575060038054820190556001610599565b5060005b5b5b919050565b50805460018160011615610100020316600290046000825580601f1061157d57506105dc565b601f0160209004906000526020600020908101906105dc919061166a565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115e05782800160ff1982351617855561160d565b8280016001018555821561160d579182015b8281111561160d5782358255916020019190600101906115f2565b5b5061161a92915061166a565b5090565b8154818355818115116105765760008381526020902061057691810190830161166a565b5b505050565b50805460008255906000526020600020908101906105dc919061166a565b5b50565b6114e891905b8082111561161a5760008155600101611670565b5090565b90565b6114e891905b8082111561161a5760008155600101611670565b5090565b905600a165627a7a723058206560ca68304798da7e3be68397368a30b63db1453ff138ff8f765e80080025af0029'; +export const walletLibrary = '0x6060604052341561000c57fe5b5b6116678061001c6000396000f300606060405236156100eb5763ffffffff60e060020a600035041663173825d981146101415780632f54bf6e1461015f5780634123cb6b1461018f57806352375093146101b15780635c52c2f5146101d3578063659010e7146101e55780637065cb4814610207578063746c917114610225578063797af62714610247578063b20d30a91461026e578063b61d27f614610283578063b75c7dc6146102c1578063ba51a6df146102d6578063c2cf7326146102eb578063c41a360a1461031e578063cbf0b0c01461034d578063e46dcfeb1461036b578063f00d4b5d146103c7578063f1736d86146103eb575b61013f5b600034111561013c5760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b5b565b005b341561014957fe5b61013f600160a060020a036004351661040d565b005b341561016757fe5b61017b600160a060020a03600435166104fb565b604080519115158252519081900360200190f35b341561019757fe5b61019f61051c565b60408051918252519081900360200190f35b34156101b957fe5b61019f610522565b60408051918252519081900360200190f35b34156101db57fe5b61013f610528565b005b34156101ed57fe5b61019f61055f565b60408051918252519081900360200190f35b341561020f57fe5b61013f600160a060020a0360043516610565565b005b341561022d57fe5b61019f610655565b60408051918252519081900360200190f35b341561024f57fe5b61017b60043561065b565b604080519115158252519081900360200190f35b341561027657fe5b61013f6004356109ad565b005b341561028b57fe5b61019f60048035600160a060020a03169060248035916044359182019101356109e5565b60408051918252519081900360200190f35b34156102c957fe5b61013f600435610cc7565b005b34156102de57fe5b61013f600435610d72565b005b34156102f357fe5b61017b600435600160a060020a0360243516610df4565b604080519115158252519081900360200190f35b341561032657fe5b610331600435610e49565b60408051600160a060020a039092168252519081900360200190f35b341561035557fe5b61013f600160a060020a0360043516610e6a565b005b341561037357fe5b61013f60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965050843594602001359350610ea892505050565b005b34156103cf57fe5b61013f600160a060020a0360043581169060243516610ed2565b005b34156103f357fe5b61019f610fcc565b60408051918252519081900360200190f35b600060003660405180838380828437820191505092505050604051809103902061043681610fd2565b156104f457600160a060020a038316600090815261010560205260409020549150811515610463576104f4565b6001600154036000541115610477576104f4565b6000600583610100811061048757fe5b0160005b5055600160a060020a038316600090815261010560205260408120556104af61113d565b6104b761122d565b60408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b5b5b505050565b600160a060020a03811660009081526101056020526040812054115b919050565b60015481565b60045481565b60003660405180838380828437820191505092505050604051809103902061054f81610fd2565b1561055a5760006003555b5b5b50565b60035481565b60003660405180838380828437820191505092505050604051809103902061058c81610fd2565b1561064f5761059a826104fb565b156105a45761064f565b6105ac61113d565b60015460fa90106105bf576105bf61122d565b5b60015460fa90106105d05761064f565b60018054810190819055600160a060020a0383169060059061010081106105f357fe5b0160005b5055600154600160a060020a03831660008181526101056020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5b5b5050565b60005481565b600060008261066981610fd2565b156109a35760008481526101086020526040902054600160a060020a03161515806106a557506000848152610108602052604090206001015415155b806106d2575060008481526101086020526040902060029081015461010060018216150260001901160415155b156109a35760008481526101086020526040902054600160a060020a031615156107aa57600084815261010860209081526040918290206001808201546002928301805486516000199482161561010002949094011693909304601f81018590048502830185019095528482526107a39490939192918301828280156107995780601f1061076e57610100808354040283529160200191610799565b820191906000526020600020905b81548152906001019060200180831161077c57829003601f168201915b5050505050611369565b9150610861565b60008481526101086020526040908190208054600180830154935160029384018054600160a060020a03909416959490939192839285929181161561010002600019011604801561083c5780601f106108115761010080835404028352916020019161083c565b820191906000526020600020905b81548152906001019060200180831161081f57829003601f168201915b505091505060006040518083038185876185025a03f192505050151561086157610000565b5b6000848152610108602090815260409182902060018082015482548551600160a060020a033381811683529682018c90529681018390529086166060820181905295881660a082015260c06080820181815260029586018054958616156101000260001901909516959095049082018190527fe3a3a4111a84df27d76b68dc721e65c7711605ea5eee4afd3a9c58195217365c968b959394909390928a9290919060e0830190859080156109575780601f1061092c57610100808354040283529160200191610957565b820191906000526020600020905b81548152906001019060200180831161093a57829003601f168201915b505097505050505050505060405180910390a16000848152610108602052604081208054600160a060020a0319168155600181018290559061099c60028301826114e6565b5050600192505b5b5b5b5050919050565b6000366040518083838082843782019150509250505060405180910390206109d481610fd2565b1561064f5760028290555b5b5b5050565b600060006109f2336104fb565b15610cba5782158015610a095750610a0985611383565b5b80610a1757506000546001145b15610b5957600160a060020a0386161515610a6d57610a668585858080601f01602080910402602001604051908101604052809392919081815260200183838082843750611369945050505050565b9050610aad565b85600160a060020a03168585856040518083838082843782019150509250505060006040518083038185876185025a03f1925050501515610aad57610000565b5b7f9738cd1a8777c86b011f7b01d87d484217dc6ab5154a9d41eda5d14af8caf2923386888787866040518087600160a060020a0316600160a060020a0316815260200186815260200185600160a060020a0316600160a060020a031681526020018060200183600160a060020a0316600160a060020a0316815260200182810382528585828181526020019250808284376040519201829003995090975050505050505050a1610cba565b600036436040518084848082843791909101928352505060408051602092819003830190206000818152610108909352912054909450600160a060020a0316159150508015610bb8575060008281526101086020526040902060010154155b8015610be55750600082815261010860205260409020600290810154610100600182161502600019011604155b15610c29576000828152610108602052604090208054600160a060020a031916600160a060020a03881617815560018101869055610c2790600201858561152e565b505b610c328261065b565b1515610cba5760408051838152600160a060020a033381811660208401529282018890528816606082015260a0608082018181529082018690527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32928592909189918b918a918a9160c082018484808284376040519201829003995090975050505050505050a15b5b5b5b5b50949350505050565b600160a060020a033316600090815261010560205260408120549080821515610cef57610d6b565b50506000828152610106602052604081206001810154600284900a929083161115610d6b5780546001908101825581018054839003905560408051600160a060020a03331681526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5b50505050565b600036604051808383808284378201915050925050506040518091039020610d9981610fd2565b1561064f57600154821115610dad5761064f565b6000829055610dba61113d565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15b5b5b5050565b600082815261010660209081526040808320600160a060020a038516845261010590925282205482811515610e2c5760009350610e40565b8160020a9050808360010154166000141593505b50505092915050565b60006005600183016101008110610e5c57fe5b0160005b505490505b919050565b600036604051808383808284378201915050925050506040518091039020610e9181610fd2565b1561064f5781600160a060020a0316ff5b5b5b5050565b60006001541115610eb857610000565b610ec1816113ef565b6104f48383611403565b5b5b505050565b6000600036604051808383808284378201915050925050506040518091039020610efb81610fd2565b15610d6b57610f09836104fb565b15610f1357610d6b565b600160a060020a038416600090815261010560205260409020549150811515610f3b57610d6b565b610f4361113d565b600160a060020a0383166005836101008110610f5b57fe5b0160005b5055600160a060020a0380851660008181526101056020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b5b5b50505050565b60025481565b600160a060020a033316600090815261010560205260408120548180821515610ffa57611133565b6000858152610106602052604090208054909250151561105d57600080548355600180840191909155610107805491611035919083016115ad565b600283018190556101078054879290811061104c57fe5b906000526020600020900160005b50555b8260020a905080826001015416600014156111335760408051600160a060020a03331681526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18154600190116111205760008581526101066020526040902060020154610107805490919081106110e357fe5b906000526020600020900160005b506000908190558581526101066020526040812081815560018082018390556002909101919091559350611133565b8154600019018255600182018054821790555b5b5b505050919050565b6101075460005b8181101561121b5761010860006101078381548110151561116157fe5b906000526020600020900160005b50548152602081019190915260400160009081208054600160a060020a031916815560018101829055906111a660028301826114e6565b50506101078054829081106111b757fe5b906000526020600020900160005b505415611212576101066000610107838154811015156111e157fe5b906000526020600020900160005b505481526020810191909152604001600090812081815560018101829055600201555b5b600101611144565b61064f61010760006115d7565b5b5050565b60015b60015481101561055a575b6001548110801561125e5750600581610100811061125557fe5b0160005b505415155b1561126b5760010161123b565b5b60016001541180156112925750600154600590610100811061128a57fe5b0160005b5054155b156112a6576001805460001901905561126b565b600154811080156112cc575060015460059061010081106112c357fe5b0160005b505415155b80156112e9575060058161010081106112e157fe5b0160005b5054155b156113605760015460059061010081106112ff57fe5b0160005b5054600582610100811061131357fe5b0160005b5055806101056000600583610100811061132d57fe5b0160005b5054815260200190815260200160002081905550600060056001546101008110151561135957fe5b0160005b50555b611230565b5b50565b600081516020830184f09050803b15610000575b92915050565b600061138e336104fb565b156105175760045461139e6114d7565b11156113b55760006003556113b16114d7565b6004555b600354828101108015906113cf5750600254826003540111155b156113e4575060038054820190556001610517565b5060005b5b5b919050565b60028190556113fc6114d7565b6004555b50565b815160019081018155600090600160a060020a033316906005905b0160005b505550600160a060020a033316600090815261010560205260408120600190555b82518110156114cc57828181518110151561145a57fe5b60209081029091010151600160a060020a0316600560028301610100811061147e57fe5b0160005b5081905550806002016101056000858481518110151561149e57fe5b90602001906020020151600160a060020a03168152602001908152602001600020819055505b600101611443565b60008290555b505050565b600062015180425b0490505b90565b50805460018160011615610100020316600290046000825580601f1061150c575061055a565b601f01602090049060005260206000209081019061055a91906115f9565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061156f5782800160ff1982351617855561159c565b8280016001018555821561159c579182015b8281111561159c578235825591602001919060010190611581565b5b506115a99291506115f9565b5090565b8154818355818115116104f4576000838152602090206104f49181019083016115f9565b5b505050565b508054600082559060005260206000209081019061055a91906115f9565b5b50565b6114e391905b808211156115a957600081556001016115ff565b5090565b90565b6114e391905b808211156115a957600081556001016115ff565b5090565b905600a165627a7a723058207296694b137a46ac1e299a15d35dab9cbf96bdb4abb012bae1bfb8c16088fbee0029'; export const walletLibraryABI = '[{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"removeOwner","outputs":[],"payable":false,"type":"function"},{"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":false,"inputs":[],"name":"resetSpentToday","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_spentToday","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"addOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_required","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_h","type":"bytes32"}],"name":"confirm","outputs":[{"name":"o_success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_limit","type":"uint256"}],"name":"initDaylimit","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newLimit","type":"uint256"}],"name":"setDailyLimit","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"o_hash","type":"bytes32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_operation","type":"bytes32"}],"name":"revoke","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newRequired","type":"uint256"}],"name":"changeRequirement","outputs":[],"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":false,"inputs":[{"name":"_owners","type":"address[]"},{"name":"_required","type":"uint256"}],"name":"initMultiowned","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owners","type":"address[]"},{"name":"_required","type":"uint256"},{"name":"_daylimit","type":"uint256"}],"name":"initWallet","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_dailyLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"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"}]'; export const walletSourceURL = 'https://github.com/paritytech/parity/blob/c4196a5de31e0b97ec42d5263d9db404cea4a776/js/src/contracts/snippets/enhanced-wallet.sol'; export const walletLibraryRegKey = 'walletLibrary.v.2'; diff --git a/js/src/contracts/snippets/enhanced-wallet.sol b/js/src/contracts/snippets/enhanced-wallet.sol index 1f89b1f6f..5cbec5c12 100644 --- a/js/src/contracts/snippets/enhanced-wallet.sol +++ b/js/src/contracts/snippets/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) internal { 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) internal { 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); }