From 3ab45bfcf516895eb1d1fd9058f6cd72202375af Mon Sep 17 00:00:00 2001 From: teddy Date: Sun, 27 Oct 2024 20:08:42 -0300 Subject: [PATCH] feat: bigger merkle tree --- .../balance-claimer/generate-random-tree.sh | 7 +- .../balance-claimer/setup/ClaimList.t.sol | 1021 ++++++++++++++++- 2 files changed, 965 insertions(+), 63 deletions(-) diff --git a/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/generate-random-tree.sh b/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/generate-random-tree.sh index c990095b76ae8..fd0b1530f8789 100755 --- a/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/generate-random-tree.sh +++ b/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/generate-random-tree.sh @@ -1,9 +1,9 @@ #!/bin/sh claims_file=./setup/ClaimList.t.sol -claims_amount=10 +claims_amount=100 +users_amount=100 -# Claims format: random_int() { # 2^ 64 - 2 , max range for shuf, == 18e18, not ideal. echo "$(shuf -n 1 -i 0-18446744073709551614)" @@ -35,7 +35,8 @@ contract ClaimsList { // remaining randomly-generated claims EOF for i in $(seq "$claims_amount") ; do - recipient="0x00000000000000000000000000000000000$(shuf -n 1 -i 1-3)0000"; + # have some overlap with medusa's actors + recipient="address($(shuf -n 1 -i 1-${users_amount}) << 16)"; ethAmount=$(random_int) daiAmount=$(random_int) gtcAmount=$(random_int) diff --git a/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/setup/ClaimList.t.sol b/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/setup/ClaimList.t.sol index c98034f9df1b3..c139579d377c2 100644 --- a/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/setup/ClaimList.t.sol +++ b/packages/contracts-bedrock/contracts/test/invariants/balance-claimer/setup/ClaimList.t.sol @@ -20,104 +20,1005 @@ contract ClaimsList { randomClaims.push(ClaimEntry(0x0000000000000000000000000000000000020000, 1e18, 0, 0, 0, 0)); // one zero-eth claim randomClaims.push(ClaimEntry(0x0000000000000000000000000000000000030000, 0, 100e18, 0, 0, 0)); + // remaining randomly-generated claims randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000030000, - 9442594401935741782, - 11901244139354080108, - 13034395906028205758, - 14494630961717971958, - 3773450247660804885 + address(58 << 16), + 6730548794470647054, + 11590444157502602728, + 12718023387281120710, + 15066971329122909045, + 8820709711312173557 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000030000, - 4694717721911071785, - 9072233776912562064, - 10007013470124878249, - 13977123373349480626, - 3123519601107771501 + address(64 << 16), + 15561172962793446325, + 5285671925472856417, + 924720487668030360, + 1064832390704925156, + 5056209461176779386 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000010000, - 14266416892864208634, - 8580538105174847223, - 14731233270561667132, - 126638942134251360, - 4524545499261119545 + address(20 << 16), + 3602196738687461481, + 6851055749942573882, + 8354592451108227467, + 5852873411239234870, + 4286387593946153737 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000010000, - 17511529532347301955, - 2324497894761583228, - 2574762439082265027, - 12393835604326280406, - 2591351414006014078 + address(84 << 16), + 6730933948483637014, + 7189442107796078484, + 12555775610064000468, + 6077367579688492778, + 16022904295749462917 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000030000, - 17581272837660761741, - 2267263863461659451, - 13682289284212318613, - 14967679879697078430, - 203249877540974660 + address(35 << 16), + 8759816169088970866, + 8263669773086519817, + 17023768597823748627, + 5642433543192774562, + 319907188341182673 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000030000, - 14403829444975700537, - 11454012423748569402, - 8370001396309240453, - 3632565751919169613, - 6597380810063878885 + address(32 << 16), + 9020334892007210643, + 10200376871403360512, + 2423426020243093192, + 14510923783430848551, + 10682919184931676947 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000020000, - 16467533769046993520, - 1755596457014432261, - 17248885019407800183, - 4533765110809883044, - 11099500753946426971 + address(34 << 16), + 12146180231029406196, + 6897599405845347946, + 14296963053537753412, + 1241056186264142820, + 8879246414264288818 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000010000, - 12301549074973393074, - 8014100137890403849, - 11242406388610558189, - 8747705723942889672, - 16738466662177075426 + address(35 << 16), + 7836781376844525429, + 2973632641337605725, + 18001226978949409707, + 12378854783874049163, + 13756077465320121861 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000010000, - 9769288961446256345, - 13197314342921890596, - 12432946982518314520, - 10850145908072278748, - 7426871865091561750 + address(27 << 16), + 11427329298092932351, + 4044901496082122835, + 3518707381618188388, + 8343643285970905388, + 17529876161015459938 ) ); randomClaims.push( ClaimEntry( - 0x0000000000000000000000000000000000030000, - 10048504529853809584, - 4403680087153135047, - 4784904346700385855, - 6186398335837605947, - 9805424328841553669 + address(93 << 16), + 2829278826529874407, + 8680171942432455501, + 15883475889218011334, + 10293426862146047361, + 16258106758572985876 + ) + ); + randomClaims.push( + ClaimEntry( + address(81 << 16), + 14809941383446709497, + 6474071144312482108, + 17578412448185719782, + 3436241048006164571, + 6962856914927072898 + ) + ); + randomClaims.push( + ClaimEntry( + address(19 << 16), + 15747431535556623097, + 10702281674943337989, + 14051548048460736844, + 8820546307697287841, + 11357871712906728191 + ) + ); + randomClaims.push( + ClaimEntry( + address(72 << 16), + 6313796466892837256, + 8633634166440308026, + 8419432183472092720, + 833472199440874845, + 124990967265372867 + ) + ); + randomClaims.push( + ClaimEntry( + address(12 << 16), + 6923375162002914455, + 16078456798750557177, + 9376290650393048127, + 8708335392232160468, + 9856821932335832759 + ) + ); + randomClaims.push( + ClaimEntry( + address(62 << 16), + 2286688976258567834, + 11198176954525898917, + 18178659418749650667, + 2241067523133487187, + 15064555168678745278 + ) + ); + randomClaims.push( + ClaimEntry( + address(49 << 16), + 1266260567438679408, + 6344195984854902142, + 2470253479332366925, + 13155090495437305322, + 1700351010839223894 + ) + ); + randomClaims.push( + ClaimEntry( + address(59 << 16), + 17931824126475362974, + 10339878294238491739, + 6240498709022299814, + 2663930736862012266, + 11545183156242371529 + ) + ); + randomClaims.push( + ClaimEntry( + address(82 << 16), + 3586384026540702637, + 8788277384624799874, + 2388394860881857615, + 4472072750868512813, + 7835000128660158113 + ) + ); + randomClaims.push( + ClaimEntry( + address(95 << 16), + 14382274015200284791, + 14229905540989308418, + 710094442548238055, + 7890463888209452368, + 461926064715800449 + ) + ); + randomClaims.push( + ClaimEntry( + address(41 << 16), + 8395278580780384348, + 10778616130984974263, + 12100280527978849308, + 7008202694430902069, + 6277280893621629917 + ) + ); + randomClaims.push( + ClaimEntry( + address(90 << 16), + 18391562002426052441, + 17953947944404571802, + 6575660734345139687, + 10567667875948322545, + 2026142355328382484 + ) + ); + randomClaims.push( + ClaimEntry( + address(19 << 16), + 8835034446485897092, + 117303103927106414, + 6484065707509377506, + 5018484248220058231, + 10035061173727331153 + ) + ); + randomClaims.push( + ClaimEntry( + address(78 << 16), + 2779007702621846423, + 18051529713183364473, + 14348153712742138195, + 5833515127382793971, + 15223234183045160290 + ) + ); + randomClaims.push( + ClaimEntry( + address(66 << 16), + 6902883944192340072, + 1219212419868657970, + 256472194390452575, + 3211312617382142736, + 16556175338934371697 + ) + ); + randomClaims.push( + ClaimEntry( + address(15 << 16), + 9413848360619842005, + 1848388194797941476, + 1092136547107789555, + 8705556206303592799, + 15999819157697647160 + ) + ); + randomClaims.push( + ClaimEntry( + address(26 << 16), + 672645744000059842, + 13430813432556345595, + 17786375652660549998, + 4376136487576586554, + 10170467751333448030 + ) + ); + randomClaims.push( + ClaimEntry( + address(94 << 16), + 2705283529850304203, + 13052147649295292691, + 3835508965528733660, + 15192411817994193826, + 10681167391035461325 + ) + ); + randomClaims.push( + ClaimEntry( + address(74 << 16), + 7148818553736733656, + 15074703528112525159, + 1965542821577860939, + 15476800120190248525, + 3348686387884439768 + ) + ); + randomClaims.push( + ClaimEntry( + address(70 << 16), + 15678966676811378539, + 5423960188385936224, + 5003710716602516664, + 7692543749078985041, + 5362056456869640736 + ) + ); + randomClaims.push( + ClaimEntry( + address(87 << 16), + 14817630203176812574, + 503526727322245351, + 4059338467137868721, + 10112421545559953705, + 5837194449423449575 + ) + ); + randomClaims.push( + ClaimEntry( + address(67 << 16), + 7543805440160233478, + 15054450753295705996, + 5155390228511331418, + 16722319020821063341, + 9132011666829000169 + ) + ); + randomClaims.push( + ClaimEntry( + address(67 << 16), + 15998074163280964488, + 18158321488912104994, + 2057679474114036997, + 17238548404746514704, + 853057595120638316 + ) + ); + randomClaims.push( + ClaimEntry( + address(13 << 16), + 7453724124951284729, + 8364570297310971736, + 12644186918887786658, + 6179621561062748718, + 14496746087684046748 + ) + ); + randomClaims.push( + ClaimEntry( + address(15 << 16), + 4840775977436637593, + 10614790424971986499, + 18257898706811476987, + 1491735796947689365, + 1079822045265180695 + ) + ); + randomClaims.push( + ClaimEntry( + address(84 << 16), + 16879424448964050380, + 11743876131003135594, + 6646514961938110802, + 9103931153290148962, + 18776131854192907 + ) + ); + randomClaims.push( + ClaimEntry( + address(88 << 16), + 15761026339663648264, + 2828843287786216071, + 10315728031397944987, + 7878165044412799469, + 4404176146679168554 + ) + ); + randomClaims.push( + ClaimEntry( + address(89 << 16), + 11926823301204826185, + 5845662057693731083, + 8321105571244724107, + 4744902759608137251, + 14053142543127688700 + ) + ); + randomClaims.push( + ClaimEntry( + address(33 << 16), + 10837098187373127545, + 12015766705931175589, + 15648895658053045957, + 11594527027449832348, + 1158164103844743382 + ) + ); + randomClaims.push( + ClaimEntry( + address(69 << 16), + 7033629636164677878, + 9311853035696735935, + 16030223432509916909, + 18005670389652616876, + 10994264202998992503 + ) + ); + randomClaims.push( + ClaimEntry( + address(89 << 16), + 2785398103629794652, + 14269989510024848011, + 16722156125176124965, + 17788857644351982787, + 15370102514278796256 + ) + ); + randomClaims.push( + ClaimEntry( + address(92 << 16), + 1948575994653353402, + 14621743015455474634, + 1005399802880780294, + 8722413296034691235, + 12338105798675713423 + ) + ); + randomClaims.push( + ClaimEntry( + address(93 << 16), + 12945666235941741016, + 10283925825776441244, + 10246432485988708709, + 7923534839072644056, + 2892750692993414030 + ) + ); + randomClaims.push( + ClaimEntry( + address(84 << 16), + 12845405114670765294, + 737053958595926510, + 12220736228543910728, + 1180890550923769405, + 9954275572638453282 + ) + ); + randomClaims.push( + ClaimEntry( + address(46 << 16), + 16917594245934963098, + 1785132637082259216, + 15079349038427336897, + 13455857009033125846, + 15137378925380838081 + ) + ); + randomClaims.push( + ClaimEntry( + address(61 << 16), + 16420337504541216552, + 4991518354292595219, + 10556128247750617480, + 7292620161557115277, + 11104896797722827464 + ) + ); + randomClaims.push( + ClaimEntry( + address(95 << 16), + 5855730631247509005, + 11612948854830762133, + 7830960392298256048, + 10044442255100202362, + 8400616345112124510 + ) + ); + randomClaims.push( + ClaimEntry( + address(45 << 16), + 8158107937172917953, + 14886425612411481351, + 289867399293123352, + 6671996176692833651, + 8110141707249251462 + ) + ); + randomClaims.push( + ClaimEntry( + address(72 << 16), + 4979864138349892357, + 10357567632910888883, + 694171787162609944, + 3838372284072534168, + 5446321078271231966 + ) + ); + randomClaims.push( + ClaimEntry( + address(81 << 16), + 13339477162259186997, + 14718949516239657983, + 18442347215033816767, + 6292031354592698085, + 12324330736320425906 + ) + ); + randomClaims.push( + ClaimEntry( + address(40 << 16), + 17024595786874595226, + 639950442210659288, + 16868397532792750275, + 15072056807923799797, + 3804358699897335824 + ) + ); + randomClaims.push( + ClaimEntry( + address(99 << 16), + 8760391947441090918, + 6116408106790747066, + 16468540711100345110, + 9554061742456496605, + 4867917447661548260 + ) + ); + randomClaims.push( + ClaimEntry( + address(44 << 16), + 2240397348628051821, + 7741561510606949399, + 3311597273640103804, + 15436672972877559583, + 17269076238050435481 + ) + ); + randomClaims.push( + ClaimEntry( + address(54 << 16), + 16328458181494001875, + 7539821938746592457, + 6192472348433905383, + 9676446196409567604, + 8366968231866322859 + ) + ); + randomClaims.push( + ClaimEntry( + address(32 << 16), + 7075693572695076452, + 8654866182183330574, + 18428121373973279043, + 15198012025129939443, + 6410247552350806306 + ) + ); + randomClaims.push( + ClaimEntry( + address(81 << 16), + 10814332091607766452, + 13940416788872955635, + 14101072599079722090, + 6151809175738891177, + 6263450240761624586 + ) + ); + randomClaims.push( + ClaimEntry( + address(60 << 16), + 12564228909539957559, + 6872940206780545238, + 16419642327331552360, + 6360879523469504656, + 6440336581599807161 + ) + ); + randomClaims.push( + ClaimEntry( + address(11 << 16), + 17222820319814584807, + 11403419322835755299, + 14424802217807224636, + 3364497948563064611, + 1467087561855014115 + ) + ); + randomClaims.push( + ClaimEntry( + address(73 << 16), + 14943315206222294557, + 4241908955520980916, + 17953647779998597219, + 8977963811462385162, + 4742349844301327604 + ) + ); + randomClaims.push( + ClaimEntry( + address(62 << 16), + 4619922866959096912, + 14876728902659428260, + 17123852543099709293, + 4003786024576069823, + 16069555635417598006 + ) + ); + randomClaims.push( + ClaimEntry( + address(21 << 16), + 15274695665847822543, + 9766374136009093599, + 1502803245754839083, + 11613562929608798423, + 16616073195667801257 + ) + ); + randomClaims.push( + ClaimEntry( + address(70 << 16), + 1533889398960637892, + 14665510426740312288, + 14327847561247406345, + 17637093252930238232, + 10088752342699793298 + ) + ); + randomClaims.push( + ClaimEntry( + address(87 << 16), + 17076838425139048883, + 16130247730596826480, + 9681201085079980778, + 3054587787296933248, + 8712048764360872602 + ) + ); + randomClaims.push( + ClaimEntry( + address(64 << 16), + 11479600612206828807, + 3094535672188074034, + 3061924033292083102, + 8339575361656367103, + 6142754310725618201 + ) + ); + randomClaims.push( + ClaimEntry( + address(40 << 16), + 8757983834309990758, + 9357826176113078096, + 2608601147696096656, + 13798905767246844431, + 6459134516418437566 + ) + ); + randomClaims.push( + ClaimEntry( + address(44 << 16), + 8331374121054561794, + 7305270096480504581, + 2083834107345704914, + 12474293212516353173, + 2711844442419601250 + ) + ); + randomClaims.push( + ClaimEntry( + address(95 << 16), + 8986907264241700742, + 8822071077499484596, + 13026247440276933379, + 14817763143343065087, + 4965570458529963555 + ) + ); + randomClaims.push( + ClaimEntry( + address(32 << 16), + 7285700089515597105, + 11209150719202362854, + 17569286151091815970, + 4935633266002551551, + 11244469769918192837 + ) + ); + randomClaims.push( + ClaimEntry( + address(71 << 16), + 1064233312795633922, + 9253656315877624360, + 2608263268358534684, + 3473135356786538677, + 15226195291283398179 + ) + ); + randomClaims.push( + ClaimEntry( + address(30 << 16), + 14095093428666017234, + 6831967188837333813, + 1050362786401479748, + 5086264138006094024, + 998873954610492462 + ) + ); + randomClaims.push( + ClaimEntry( + address(54 << 16), + 12921335492687864947, + 4450797639166345318, + 11265462418675663066, + 41031479149291068, + 9360514369646791999 + ) + ); + randomClaims.push( + ClaimEntry( + address(31 << 16), + 1094074149580457033, + 16153992259578095334, + 5897434698266212269, + 10224713067493172508, + 12760569634693829989 + ) + ); + randomClaims.push( + ClaimEntry( + address(40 << 16), + 13557954242821440957, + 17759191274629226719, + 17413452097710401724, + 521689703780557705, + 16155133588308086220 + ) + ); + randomClaims.push( + ClaimEntry( + address(27 << 16), + 12462688076163751874, + 8162527743430546661, + 18383432283495814504, + 5521207905376356565, + 3633290866039822514 + ) + ); + randomClaims.push( + ClaimEntry( + address(76 << 16), + 2002539417156955124, + 5416436240969275501, + 5316939805656298205, + 2653303370010262435, + 15160000651313754426 + ) + ); + randomClaims.push( + ClaimEntry( + address(27 << 16), + 15218917621826075749, + 12193549995351476952, + 12223123748078269333, + 10493681658368677595, + 13248110266809347975 + ) + ); + randomClaims.push( + ClaimEntry( + address(93 << 16), + 17156691416585807934, + 1473069383880918075, + 13461811891861917244, + 2430949648809188229, + 8687215518593307665 + ) + ); + randomClaims.push( + ClaimEntry( + address(41 << 16), + 17638289046717257747, + 16869986067038028310, + 15429674485810369936, + 4016345587237925745, + 862021245789620898 + ) + ); + randomClaims.push( + ClaimEntry( + address(26 << 16), + 9405294816536306433, + 16620418099193207662, + 14930472809554335022, + 15656360011858688935, + 14533091744678324817 + ) + ); + randomClaims.push( + ClaimEntry( + address(32 << 16), + 10407847198752187822, + 2185885134019546640, + 3314875989787258350, + 6789454442130257801, + 10797086471863671245 + ) + ); + randomClaims.push( + ClaimEntry( + address(95 << 16), + 13283705175140709446, + 975128651364650534, + 4350243887038674290, + 4272963650879643466, + 3670240771407124682 + ) + ); + randomClaims.push( + ClaimEntry( + address(13 << 16), + 13150297155000266768, + 18067851345433930451, + 13688224040906629579, + 6663882427073853557, + 16223390050383328106 + ) + ); + randomClaims.push( + ClaimEntry( + address(19 << 16), + 8792012456351943787, + 5066652927846300965, + 12887396847071645064, + 2211893323662368591, + 55350042886918230 + ) + ); + randomClaims.push( + ClaimEntry( + address(99 << 16), + 8259977086395525064, + 59034514685236556, + 6454957681690303466, + 17838040203442642985, + 4744562417162321981 + ) + ); + randomClaims.push( + ClaimEntry( + address(82 << 16), + 5849452704894603240, + 769623176447363982, + 1743283437234176137, + 7665813740157474241, + 2514220609466582774 + ) + ); + randomClaims.push( + ClaimEntry( + address(4 << 16), + 15526679096097524349, + 17046010514238249409, + 17904738424416909343, + 1273070789328741953, + 5694310115151634032 + ) + ); + randomClaims.push( + ClaimEntry( + address(69 << 16), + 15938139359953495130, + 15286353416804559363, + 1764827933084375793, + 2683092045320269485, + 10525469194728501526 + ) + ); + randomClaims.push( + ClaimEntry( + address(45 << 16), + 1500225872735785463, + 16468542125371468652, + 8654790792345365382, + 10395952939107531734, + 5058638574636002383 + ) + ); + randomClaims.push( + ClaimEntry( + address(43 << 16), + 11395868052738996726, + 10590029349447262851, + 11335015515226909995, + 12307980527888312272, + 6076498901804599065 + ) + ); + randomClaims.push( + ClaimEntry( + address(37 << 16), + 10198397269586317903, + 3035090291233345309, + 18406513221316689580, + 2274944392845699735, + 1167704103629102221 + ) + ); + randomClaims.push( + ClaimEntry( + address(55 << 16), + 5533907063086050842, + 841648246974449445, + 11059780425040299860, + 968595211215821051, + 18185735933654264947 + ) + ); + randomClaims.push( + ClaimEntry( + address(42 << 16), + 5453673792119155517, + 17138896487781972498, + 2000793481051869175, + 16471077403695194399, + 11784401144667903876 + ) + ); + randomClaims.push( + ClaimEntry( + address(26 << 16), + 16765775724055081834, + 9752134412801783826, + 4593881883058382069, + 13863538197481282601, + 16737522984891317582 + ) + ); + randomClaims.push( + ClaimEntry( + address(75 << 16), + 8765170513342008046, + 4805361948656878403, + 15601665519157974314, + 1122510209689477185, + 3167538201352716996 + ) + ); + randomClaims.push( + ClaimEntry( + address(89 << 16), + 13180864841340254748, + 3839752719736903127, + 10703989493067728969, + 13265542791415536161, + 13801704403344964650 + ) + ); + randomClaims.push( + ClaimEntry( + address(4 << 16), + 991093458338024834, + 14582056275495054459, + 718205587074859053, + 8204083335484354957, + 3452232817466342398 + ) + ); + randomClaims.push( + ClaimEntry( + address(64 << 16), + 13621972015809528226, + 16915799983457212609, + 17970161347797215730, + 11614515126414258769, + 13812130817853624206 + ) + ); + randomClaims.push( + ClaimEntry( + address(6 << 16), + 12554050826864822332, + 4697804786400624415, + 15464067415077195965, + 2407611996857905171, + 8970558984714933393 + ) + ); + randomClaims.push( + ClaimEntry( + address(19 << 16), + 17518449123409007948, + 7984358523050028226, + 8339164329290630615, + 1035108422326142263, + 8523972490349369094 + ) + ); + randomClaims.push( + ClaimEntry( + address(20 << 16), + 8482600047956052867, + 16699433128888042182, + 5427656832405124207, + 14615113890335933842, + 15374003245748057962 + ) + ); + randomClaims.push( + ClaimEntry( + address(20 << 16), + 17180658570558610977, + 17254530005366517512, + 12231865090606123935, + 1448790249175993420, + 18134697859674075755 ) ); }