ETH Price: $2,410.71 (-8.03%)

Transaction Decoder

Block:
6405690 at Sep-26-2018 11:10:12 PM +UTC
Transaction Fee:
0.02314085 ETH $55.79
Gas Used:
2,314,085 Gas / 10 Gwei

Account State Difference:

  Address   Before After State Difference Code
0x449E0B55...Ea8C08ad5
73.063818241 Eth
Nonce: 41
73.040677391 Eth
Nonce: 42
0.02314085
(Nanopool)
8,122.540667083830332105 Eth8,122.563807933830332105 Eth0.02314085
0x6e95C8E8...dC012763f
(Gnosis: MultiSig)
0xe011fA2a...0103aA352
(Origin: Multisig)
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 20345020050211293262012054614512806685203835463409782258292728386271707363221601885363342549124490175788871831576756804960783380112500337451466437078352455120259666768455253023094352959952932868220581817094169629992243407403914114431622074406530453532216325526956215276788393945896570412978221611206107657973962464943506893827507180056822750806523286111520942192244596428910482343892072264186069391848966558284934777727330004038526159548263574498573303036364984011181745881450701955647788402728823087180541783534583405489469459961583940348363646591079786776363633593708843292277288216880520159001127575775443901268255650660391116474907495135708368414019902214908207109309170400983468155258531404338320471664275270253382961733525315916837563277395737429580177370645022593708389130572706033395657516411348354250844827768057013491391556778104474573886560491309126070199929901018004355261519950101265935352188616507542908957175839777443788479827606113132325205499581328855175592730430020303363500238720073395719784318165531022637871573306794870615904117146829516572837862430861812543846990994593831331110857742585210617860745934497964104971593797097464735536244137247005915009625138255657356280268746613463343536915483427397308915572621164789358819357991214229606248802245580890231509056119410890091901288760385049775453087834173851788385220495431923773023133090212044582380117520656344684597139830365670310367612362188284669835645843646675623072633580979639425050611026060508799328486597243694538367432518343139599321873151168592123217512706625480658651652159835462615154731597302502099626099562916540160009571090028916332286051040962123307378071936730393292875334440717602093825469447212563342199800214342332295805492088599578918184745602162745543631784560282495764133797387540756531124333027837595421734617695483734907256016160132164515870312567174723106621202567756749928397628652150927796458377292307506050017707824766048678210952426247842739185568138403199566905953603700770114107592666851551246050893623640513815478669289017232811539018292486662466544182472451653107047957713246901139060670584358086579848220829370245834155783498317880749021510543911517400078892087554567192684587657581023439273831119863780913520568519146150803469259004762483413343980482015201102209500678507071940603554717185354896639553149395115077545682931364268035277367214979808117804161249145686723636021477232579778607823512343716672069820327077531431260273127883128634355695976162505841429549932528183044636181913716967038855376842181406589752370562614848070138528670377998627177393732652758235096584370406529691209464202985787801849615423851854728095702751109316450107133636404691299419925013615638734768483115686294427796082451863487241773588890365366201051871383317952204043423540870562938921869404409561415614514891865991116447569968147135774951818963699718255133732088114926865931355579366177693331764114139705492362575740879964694435845883583013339295470249469268887147730208432094708344764736815441727464876907837631373061986252619783259112481110686780157076730501519708255844217246166370214947554303493969724577937387143642127916790268120009100266953731548142624225084293788628458819151242388181156797806243732410672053394438915245267061807066490011500450851666696687832065094620743630210589047868166432797931172091556648503469991159984433192568409944470573608759296148141791565328620951978269565990781341072695087701165352638508665439705821718322329593535707663897166406792072665663436426796443327071342210189558920985364872008712891198350119074873984084591478854843848884318099144040812131040601579220197491485079762502588868469413112906473746550010877543311641718718260691557654951822279825269533084702607287282224308223744299146823238210524310690054759274738444678377438003466901203691634928017718830054746402774131864452569784123535422273974649830167828322475996050959122994997568197376091022503359704736371728611492747052964602199688338482031756880842909012898489273892437206795904074310981634208500209140032569773925144045962706594127380871955972003734123643911859609320377502484649134454395009145805047499486479201165722824173807541549935556079559184143687649727855400264367346364136805426507147635119866206296905211711575115119010847090002926336958388905747398855182385649873145245132322226737572250206645227249805715662261819267956006230636945791994116600571221366190373273915953977415930996716534963778872043219185761856640967950790996857127181258767457320113144793054080024692299174381515876254773453994011642328776835451478508592674525202000510673612299800612394635293296852675729257107739866040868465592655291523318575087076314228886245064433375766223924816999658617459908791540106805521062343715711521266357017081178170313957866107037678101129935008016524518978409482609237052962256985574212193612633730964979032536555215903665172186072504477119099947637142687437978304705668146909552911340114843706358005363266263504016958541974081929638469372639776317474279407463300164143309797301886275699226922129741100788259505375241984294452111214780064031200193994318208013071926605191227847734298964580383161883523264738214819120238152720479418520473063652816366145644848581521872744233830842739260191472951119206615669077638764511570280422736465104666178388649835301038913566002006314524754241950099051160809254884267105685193485076045396620140623692681951237550359636491423136917163749273755055706645199564625950073470713862926635042305157637334016364511472614835998822314328073287107965587432333527067752816102454003126952868790391905942409650290601263450999627437798354534592436080686383547415468363056054162963131114497984422726988738819700129254290394259215745246607749934747849328421890809556373446575997570362118166067119140743983056684633783966262406224094195863941666939475347905017835198658656101037319588474933610992468863266893196074641959395836497989675980546104653835014304367524329193951126319593809510423440823529714612640864003210597075859123593034905713541347258771706434447888440469535467555241893747552000671545379633266267470809205955841162732909126260930293814130726510607059386101514831651399819776340926266921546842625444312723189367795936077622270563521594296352071859541038099166242685819872754787663928071633752272535674643129009290830941909198996328635762949359854681052127710934205355580986019107500789270114571130094061724352223344110803452134427476690314589314350747564307618526593752390572039128995894555461814598592864839728111746944930287652242410963127748043097184021690299715261770907284757776936819631352676444945861057949456419939220122653800400884877657885282557449550373776574318818080073701511136002591316721350138050583143641971459359944723359446027068162243585353041458972746605556261084174144053392346817460236485314793153124246727682761414244099197380798824797131193262285549693261813623747719311435453299806253757483194924337679100453092249182311077999846660001632235865923418708991248080572101284929461183062417880532454069239839992208218127546996385752074914437439100286277936513964807084238483720700157324448864261971032817140436595331957396280667357233872538676289201224369617590669452795384830440665458323748493862217395787205095555921034946119733227874985584984026289404296605108913618840047182304178915803977662099534444619348290392245606751025296767038231566424417581792023751338620956570080396579254365641494088334801941751707716461119292853375899275227268489016796971285693428251151652338872856829733622221750804940210093404875579188075054469881087444324132755271033956983232433756906546347112573865390412921182312657161588107367529103790729325984645024260678417411495258678561046895640940467491131385890663136859798478107526480972043206242357035244575173733312214429087061258129935691631828156098084264676905434520071903193002127296248825788406627979888447799270525049001265603393396362166050887517727645310880406807458395224992797006993766668373327640844110900763613298900586412180656954418319219367325054535799026685558042542219908903179927891359137373038923227723010526734973679803955496896147694304543696179170939575328285844107712376458781275638771927391603540995240814601444010503407685403183101131489434852540675749301693299368843742251765345682347053179567607432837416280178287794241644893141537160318138250901413405725675092823017733795775048666541990642969655110278207410494807092426429923859557645127970120322492744408981116086229268983709435167173955716588652154617250798009171851373666813092683833371207349042749757211377811105430281493602003268117501231224700218210950628378298429844014329425533767927605691710508619979969437191890105132465631161780982455121603124274773715581269561667556488798135415036179759685349773074148755858791984544123677013240710860299684126263249488002402153698105093495025925768143251996783715770145528246281322846235163642843026937472295896542141038015082557210763691021561258457864835896087898927145273654506104979868493986826032596840980921268877121816112371865936243044150166927147594318623408592235316812806840424772056971704758071844770193297225161218486191574194753148580547638230417025224448863886377339585903307582919049737386050716107218276170230036785675981505260291362922707650003763843837307118376320098675780006727402128082042508011661691588892697175733423277467707176733314624602646076050115326209266529243776643004562093467423181153276910842097632409476858147438939823146035854815342954053935736141077022903790792420058668030685244476548702043269339151476130788707500939880226160087895609330295612886178448066335085301334923143107973988849058816160121044276839660389466351000536503317729633812873277482708711048653919373237993171682453051263174489265576918882872070600195997389783849662644217534445185695546123928283282774190733499260832431776401879070660118542207341547099604645064536634176810025859668867241466471061975949739492578069771526649307784135381795237643436189910229379360259108197241564393157854430545008586611406208535696457882345098513925203847607873742387794686331978513209705564533795182380286842715121427854579465006934036511911348411658105107994109028778037646621729502235069945250926661573005482847989035643678242982978895311621707168171861057101970073607338916165606600861912902510616072667230784036979262414285945715641755285560505358000653758001275650522886522517803750269189184857892069915434793732069753042409167737700875386628421024631004416399098989204009725367328688470019333345760246625321998356431285554861401390769498436411396457618233613003045866287502663344292925094430434785100968632276351156280853060059292936548983337982116959778409794643468795205369009521944368915693981184854540293989269220882342737005013167190515422831657857452921855708244545979470737686878628777770435090743155154770913263742947500890986610667468843726399128488412799547909966072299949884639080186860939081479046297683068324780048531259650659893133943114299909873831005614291433775775487704227907825322755515328505192175366354329515692283102948268554216271659284697343144647563015293103788977808878438999163469507871265231195093380575914244593496397207226551798373886318583099860831659165302734784838563278241246399959204392743401550343299152558549976092632813093232338855223762956621229906782306403005418063425321270494153607430018007723519758730262908673035192173964576693318267692186127161993513370750246023439549623974648349801955773477715378965650871126595744140536594003753640694717093792166583969093625294593021432939883459334904176327974898912427340378221722303214143068908884571077693875025107401415290908650511883839480810854935510505270659894972175873691494828294455275264776207914028338369020851348688883750843462073805296053183462689047879158600814773093178742753536443293904047950514501693195784052513852966493048507044769232875826042700402298117851222763673545398821975474789934903181740404219742802167631641670702965085530765285112521928679357615216331796136103453548106226614702910204921262150375184891404124152232856011747361461297828477288972603584001072742210275575179621168941478479497085428444839930886752444986314486369796231004173909942625421620976734692679053486537814866371117110427721130334563787762098077192119512219888695541015890511133928900895304934846710242402087598681657935485114373331406599449983851795493695535847936680191545053965081550655236989619572931731525523313649496304822398060590436727410032393011081816157711990703053464295769179661756210883438474318085868678287926628948059886807276692455294862990861148667627226320508831595863847846058328184302076817827732597023301684749234770031058986637654816146166331299210955782883095426347094188979199287989992796908785010776842336258965278831815412020057180300902604509268216901804494395824688803275598048923344511253945745339543665699922006956842505871985602141243410880517491183818945384225062150687012822839753203736389052697595135440837997777322421387001500512295703051559296112499281983202632032048037685913116376370892974532495193729719856796178244987441122023855731088547848422158319588044900132205321255744729357009586649824667642178642382688951163978878706001511418063439107919247539144300173126255061169037806532933499226110762468013293492222393956264701820572368861859934517882705650988659948559205754841186334531670868927276306908279967192605512916970597053557377743202525780657147428642374729920324227704720837563056809946969430949051217840673701758629298692801224605228537902470533826068491731092687364042569674078265144350481453886516638434234650767974753404175201608593167464275886004887901954091018334592592150674477102247066532909658881200612548376089964697980764587605226591942437832754966062333005622853724831689100339623519534717567919204710005927395970660871138585850763626252350726442844661919060934098146601296029735795315622840367947996369779681645266007404259669416871460206120411759864918283923104800822583567839090577214118718060849893305613246905895730731593068049761392589024558506282673188453785389682624749920259383113474000536581340830320593721363031523716712763571892463540068190737452575183223445808707728125924679160611081096499342647794228664157446881339032797469121031325003824434340688069693347280141138268007021786315529718929545968399956619116243539859197867605858191038533653271472408714023507768364367135438733304739177107614884302890221321828858087131759232564329371089715862722849602537523405171845704178597590400376648654111453991260617186991944428729057133502014926453254700632313556616988111194471105995052203841614804761107285448434029443013077295461437356626879214591360898359899859161268379007111991860297396095008090058189372938868751286524686076962552502542748370049552789679956392782315004404382662432345892622343948631004075692674097732845454775379854710594419964943299561078952410168713048387626064953521968056998817031038151950323395035649300712128822215076781308437740535169737631353417983394116130800375705355924098454446948176001819373661256084257850911505114666595356242699348887336261138292586952451711069469502869974116902801690882025470063128423390669813766005591228037590133919007564522010694139895696892635661022107233985938748909488501647571488530305495344701010714995544967575877352877594483852738324167802566207715236656200333589254156831025838837675460065177713363881651175804712996653022185825817447107781761062308798826380806039582045026703418623313342884788179572420680314332516598135292276729940432891836051311100345819092724085566506189050098256602840336982919779211876042120492062053316929595706097201712429514829288176990636301137125070355265225672283877006070524579844696130956466332228041556938073265573907273690305551233279939747789963682341677482680347661191333229034402868324135141199903889700153559729208589083680522977998158646743143376211075942860617867074885411596706000885654227433819760262886287312274346194841802863203416626742885405963204607864835047372541510630725837671231859781764419326361497788516748333369975835796213273117930482313311831690629633175211337291655206361361462132787107425023500888318911061683788322242214002048317346524613187091423238717800173699523185296225613724991604712436043431199431562760822969368454554915049475826890203052189371875030649793056212287410923695841023271116078305393328269016782610003232279366938437443167579203197893401317944539949366326817059162437513618466657467797637528332915458287306404113701868793436718789413759112058283415097438813025798978459712708836134604939722041266096828452655340140453817045243046212701860685490501975224244024650299870785084570243303340781364068611970422139666396267314095178574848969838740767195774577350505505880433989670788678512642180683499242593897287922712185883036787443026197849152775882078793065671728415567156756790909709865479733532058863169282763650241521935129864423979470731567013463968295155469859168738312058923491802820740164716734619145649601483582932705447221117736926083861796737953106594805437198986323016653786901069745672481270730536276291754216354208968278015914885174863606446185983997803075014790560275844914162127230868417416586623550128299381053614062954681539619923128889796503107782463344660005322821750345434191843212467234344606830903774690883951296275362674952155676431069496959759876173433095067375271524712869737225611903019339339461535064803983120766477074300941663751482331696504196439723096308853342202050311041013070826491878077787482165700964138752740967957652590394585196472500469893290449351759828795998830979177838861537045574558880887558759497180437254373048083632328924507674303456092104513467330320019431204137098883465710411533588341079127078973158649825350576724438264692942852643724391948374903800139726609653077073216439548013985660897244720239756787174655527131170009912539692406531411943359156027511092737230773494829526849800062744339344272619686524745403231933688375198464458114126265656571279692110012211575332685355318246717786759895602926537859583230058581307345588146845519787752334151447020640528202803890129621175734836579643180450668532602013829441970669086116510091145827580523206900189947004096771657921475505793755406321751136761956040181154203907828773205332141825175996549708690172793536782593974335177708257449094082980057595987258979822213892592454033110719522996087549379102113375681170695104353384628426140259178686551982316748531432222239427731405060543190904136643328490527686730640588173246719617315875679062571048197176643709058321056810853273079916129588082130335448260520260396324888493991027654182457763447630604941940705146840274476407664168011755414473263428337802476096135207894379348004501937045304518216521504276429466816891627078240719462474242685254435061051770288553992889140718938611185928456254524166491074191765342193281578430743566256007345684083797297562502941821858284454887021456552565588654500122310537257695861583392607604740203858359870187763469962585757198982261610437523779005779282541734776641743649959256357259896091425804299748309818691846041394430512301720118216703692957206901044869180207508414891302230325933453888082591403672966608938207881997543512230732809989061386478662462883648114333574765537355525447147786072704361565442729593202912768805365382819926079264388685456158040304084769521310478033453956931875021329986615354879525207315368107755257742797166057707322970061662724613685811460711291199882253917155886929171433501435194390226065973252379252591754200800832034565044869465038357431460051326218333085748920056567905323248830471578987424622348165412919036794011124921729285661294453870578400665953473868285357195172523418765938957315928365837103845576157668797645998066620662704344398609778715242053887139474372237289693675211035858505598120588567957325957685423174491559004221996845762552751001234853691467001744870346044916215957902890576683885019771766780548912414892581781524566807333207813237889767563553458026314963858791098628609353768813216336486352582230037772992044191075026232554116081216039405488736021444124879917976744309979707297319635873004185113046301129326628890127529884086222528500016342430982277248241573482489581419052461080251660058946611359156747842559011246540409293377147981623617428514542878057321484898910373779812577248883292028377910988993985816688779499649152219031183039395315672965554550356717538844645279047348323579577398232741853749992330257723789157843754641209080094361868745977554630101520893092496050406678982991539725656362883795260042272881505351162880090830777756410070482725345071614131302285234256549868480042872207162276049608219148308720621285963313536013421665026127388953538871976449225179034955956308428397103775841338301346961598352482837893649752241169501346370925914143298125592933907754521602966850088036496319355069710048172583434345897747914651429035763946253957402426149591002150986341042621024796241201770164724046126746852681676827897564186407887492267917359460504952320138410530599545553891835339299075720869255511249088152772365183729243313553977130592553663164010046804744003125592641670757971479837501402083002611473745097748610007672193251672561420862331032595722148501790599982590795004364524364551628500189119002219067655356976376379571054015557878424655661364659946369100671310883868145037586876523359275568414863549797012760292372805826174551670080389603737994857473324670420761260633523694104430844362669077678534464015455363364628866062902704087085282343840370732685189462639271815804261829110040722944895642043975380823009050869254116934616219252942049253836088519862599293081351137206801210347534892212074939786194162867699174807952285720123915355976940773077941382587036344729088160548256454950168414148558539799333279791891502272946878624532936560355121451313975170178474017160249364675874535394189553482970130904474353231909644637928259796205302959519680103709212713

Execution Trace

MultiSigWalletWithDailyLimitFactory.create( _owners=[0x8F86f475b315365819F0E11E6A4E247356824EC3, 0x67039Ae444B53AF92E6658827b32E388B9544cBd, 0x73A815c1c060d15cdbBc6fE72098712A9D3F3F13, 0xB9e7313e4596Ab40d54Ae81C2893ECeF44773A8a, 0xb2FE3A7D01DBD8BF4ce655311c41359a57AbAb37, 0xDFF50220651289d8d01A0f1BCb0B376d12dE337d, 0xbCe126B3C96247D483d81aE34c8D258b02C93775, 0xe5888Ed7EB24C7884e821b4283472b49832E02f2], _required=5, _dailyLimit=0 ) => ( wallet=0xe011fA2a6Df98c69383457d87a056Ed0103aA352 )
  • MultiSigWalletWithDailyLimit.60606040( )
    File 1 of 2: MultiSigWalletWithDailyLimitFactory
    contract Factory {
    
        /*
         *  Events
         */
        event ContractInstantiation(address sender, address instantiation);
    
        /*
         *  Storage
         */
        mapping(address => bool) public isInstantiation;
        mapping(address => address[]) public instantiations;
    
        /*
         * Public functions
         */
        /// @dev Returns number of instantiations by creator.
        /// @param creator Contract creator.
        /// @return Returns number of instantiations by creator.
        function getInstantiationCount(address creator)
            public
            constant
            returns (uint)
        {
            return instantiations[creator].length;
        }
    
        /*
         * Internal functions
         */
        /// @dev Registers contract in factory registry.
        /// @param instantiation Address of contract instantiation.
        function register(address instantiation)
            internal
        {
            isInstantiation[instantiation] = true;
            instantiations[msg.sender].push(instantiation);
            ContractInstantiation(msg.sender, instantiation);
        }
    }
    
    /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
    /// @author Stefan George - <[email protected]>
    contract MultiSigWallet {
    
        /*
         *  Events
         */
        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);
    
        /*
         *  Constants
         */
        uint constant public MAX_OWNER_COUNT = 50;
    
        /*
         *  Storage
         */
        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;
        }
    
        /*
         *  Modifiers
         */
        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
                && _required <= ownerCount
                && _required != 0
                && 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]] && _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 newOwner 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
            ownerExists(msg.sender)
            confirmed(transactionId, msg.sender)
            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 {
    
        /*
         *  Events
         */
        event DailyLimitChange(uint dailyLimit);
    
        /*
         *  Storage
         */
        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
            ownerExists(msg.sender)
            confirmed(transactionId, msg.sender)
            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;
        }
    }
    
    /// @title Multisignature wallet factory for daily limit version - Allows creation of multisig wallet.
    /// @author Stefan George - <[email protected]>
    contract MultiSigWalletWithDailyLimitFactory is Factory {
    
        /*
         * Public functions
         */
        /// @dev Allows verified creation of multisignature wallet.
        /// @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.
        /// @return Returns wallet address.
        function create(address[] _owners, uint _required, uint _dailyLimit)
            public
            returns (address wallet)
        {
            wallet = new MultiSigWalletWithDailyLimit(_owners, _required, _dailyLimit);
            register(wallet);
        }
    }

    File 2 of 2: MultiSigWalletWithDailyLimit
    contract Factory {
    
        /*
         *  Events
         */
        event ContractInstantiation(address sender, address instantiation);
    
        /*
         *  Storage
         */
        mapping(address => bool) public isInstantiation;
        mapping(address => address[]) public instantiations;
    
        /*
         * Public functions
         */
        /// @dev Returns number of instantiations by creator.
        /// @param creator Contract creator.
        /// @return Returns number of instantiations by creator.
        function getInstantiationCount(address creator)
            public
            constant
            returns (uint)
        {
            return instantiations[creator].length;
        }
    
        /*
         * Internal functions
         */
        /// @dev Registers contract in factory registry.
        /// @param instantiation Address of contract instantiation.
        function register(address instantiation)
            internal
        {
            isInstantiation[instantiation] = true;
            instantiations[msg.sender].push(instantiation);
            ContractInstantiation(msg.sender, instantiation);
        }
    }
    
    /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
    /// @author Stefan George - <[email protected]>
    contract MultiSigWallet {
    
        /*
         *  Events
         */
        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);
    
        /*
         *  Constants
         */
        uint constant public MAX_OWNER_COUNT = 50;
    
        /*
         *  Storage
         */
        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;
        }
    
        /*
         *  Modifiers
         */
        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
                && _required <= ownerCount
                && _required != 0
                && 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]] && _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 newOwner 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
            ownerExists(msg.sender)
            confirmed(transactionId, msg.sender)
            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 {
    
        /*
         *  Events
         */
        event DailyLimitChange(uint dailyLimit);
    
        /*
         *  Storage
         */
        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
            ownerExists(msg.sender)
            confirmed(transactionId, msg.sender)
            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;
        }
    }