From d6f2221c2f0d2d9597d927048f4b5ba44a832cc5 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 10:49:35 -0800 Subject: [PATCH 01/35] .toml base and localhost --- darkforest.toml | 21 ++++++++++++++------- package.json | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/darkforest.toml b/darkforest.toml index f94eb29..4d2a314 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -3,7 +3,7 @@ [initializers] ADMIN_CAN_ADD_PLANETS = true -WORLD_RADIUS_LOCKED = false +WORLD_RADIUS_LOCKED = true TOKEN_MINT_END_TIMESTAMP = 2021-10-05T04:00:00.000Z # Mon Oct 04 2021 21:00:00 GMT-0700 (Pacific Daylight Time) TARGET4_RADIUS = 1600 INITIAL_WORLD_RADIUS = 8000 @@ -23,12 +23,12 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 # Game configuration # ###################### MAX_NATURAL_PLANET_LEVEL = 256 -TIME_FACTOR_HUNDREDTHS = 600 # speedup/slowdown game -PERLIN_THRESHOLD_1 = 14 -PERLIN_THRESHOLD_2 = 15 -PERLIN_THRESHOLD_3 = 19 -INIT_PERLIN_MIN = 13 -INIT_PERLIN_MAX = 14 +TIME_FACTOR_HUNDREDTHS = 300 # speedup/slowdown game +PERLIN_THRESHOLD_1 = 1 +PERLIN_THRESHOLD_2 = 2 +PERLIN_THRESHOLD_3 = 18 +INIT_PERLIN_MIN = 1 +INIT_PERLIN_MAX = 31 SPAWN_RIM_AREA = 0 BIOME_THRESHOLD_1 = 15 BIOME_THRESHOLD_2 = 17 @@ -91,3 +91,10 @@ PLANET_TYPE_WEIGHTS = [ ########################## # Planets to add to game # ########################## +[[planets]] + x = 0 + y = 0 + level = 9 + planetType = 3 + requireValidLocationId = false + revealLocation = true \ No newline at end of file diff --git a/package.json b/package.json index 1fd1db1..d44f091 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "test": "hardhat test && yarn subgraph:template:dev", "lint": "eslint .", "format": "prettier --write .", - "hardhat:node": "hardhat node --hostname 0.0.0.0", + "hardhat:node": "hardhat node --hostname localhost", "hardhat:dev": "hardhat --network localhost", "hardhat:prod": "hardhat --network xdai", "hardhat:mainnet": "hardhat --network mainnet", From 47494cdd3793a89ee71653905f0744bd95d1f639 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 10:50:12 -0800 Subject: [PATCH 02/35] update zkSNARK for move --- contracts/Verifier.sol | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/contracts/Verifier.sol b/contracts/Verifier.sol index abd65f9..9497813 100644 --- a/contracts/Verifier.sol +++ b/contracts/Verifier.sol @@ -286,7 +286,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([9330223953407943940363093739840417425674389879586632026751603972441542073092,15974174661309119742809527330310550898854512340212660633097359996574256451897], [12998553548639722373840506082078707995357782565167485260157792954588717531232,19015762905362063527536619414149333519458823168934260140325894025795814589803]); + vk.delta2 = Pairing.G2Point([12599857379517512478445603412764121041984228075771497593287716170335433683702,7912208710313447447762395792098481825752520616755888860068004689933335666613], [11502426145685875357967720478366491326865907869902181704031346886834786027007,21679208693936337484429571887537508926366191105267550375038502782696042114705]); vk.IC = new Pairing.G1Point[](9); vk.IC[0] = Pairing.G1Point(1598626181488966834385142702072340632701729613588553898141479831063364046244,17718230806281540722028825298558518558905695159801697318226319873036301566727); vk.IC[1] = Pairing.G1Point(15948659782990752942887133907536447435191600109534617758082114399428869442993,11099101392431127819059666871299914860584228203768799086923186847076507315534); @@ -299,7 +299,7 @@ library Verifier { vk.IC[8] = Pairing.G1Point(8068157216405939054553967344367105009755284398919359918024675691332040416938,4244594119739321487311315399210137890665530536229170011371323025231638521760); } - + function verifyInitProof( uint256[2] memory a, uint256[2][2] memory b, @@ -316,22 +316,22 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([15046188444418836596476124216763191949266620196231312490684626884711387020527,6253665933018568820785300914518485217031545025955786348144007361026411305502], [13496228776641194526644238059363533610836566016270117245497797353883816930163,7385232161760520573435708963197533341413673454862778706609886544005177408732]); + vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); vk.IC = new Pairing.G1Point[](11); - vk.IC[0] = Pairing.G1Point(8064762218852569201567881964383943798459495726719027677362252047739918859799,7900616947757657915952559120299591540890558187181385348721244953936618256650); - vk.IC[1] = Pairing.G1Point(8556061247853799764634192973076319682650251342352400906905937103291527357443,14658354248235884323085911603049897836973206477075352139978086840326273931424); - vk.IC[2] = Pairing.G1Point(17859916936515265335665861239335540034160519722450106790172327819443059872323,887826870530173914427751657299151774196033762816491525136545007145340568926); - vk.IC[3] = Pairing.G1Point(20480106947711666879162709980765686932799761697412328231110658390006031449589,9756394385258732791598308246755395469377557064201571467274655910588895340730); - vk.IC[4] = Pairing.G1Point(4920102186692094878438825623968860098890598245449368669673372486269459773722,19064726056864740301023513435300567217472123513488342338512944460273092333677); - vk.IC[5] = Pairing.G1Point(2710191168790564266250862437568608379965847950984011796794300792128355282517,9559432471545488709552389879449039526790449084859805909849351831418702857363); - vk.IC[6] = Pairing.G1Point(15863010689044372753369654039557465991259250089404834292562672178657185589517,14194677709480727006918740702454693746396393844975363928914663696735880553440); - vk.IC[7] = Pairing.G1Point(12355604953639735754199115377283941566613544987054244210572452424590105804255,13257398429713375938599226411949469758520327298014602723461184149158519843885); - vk.IC[8] = Pairing.G1Point(19823021864735896765663587782696161388753703706877727087982947235869973787651,7251529588625836072570963920695211136351570639519609633567150728437157726936); - vk.IC[9] = Pairing.G1Point(12376486006329001511159475325073583673646312685115429372098631204796250326395,14906860542380580131976069450603815490994525690929161283305559525679006813709); - vk.IC[10] = Pairing.G1Point(9751251117536677631754672955896710354789606269079338288549961699864225986296,13596757510979300550089102433189162533782862372326519893759974814026799464093); + vk.IC[0] = Pairing.G1Point(14177816537775685783067647996272395454522594113428919821714589771180610568314,6823299126837656023989613525270949531672774579800418483384480496108911392326); + vk.IC[1] = Pairing.G1Point(11585636782253030502414616875647660216631207697186549464738288453964312644262,16366617865324088972494410389765901462344692803975117494865461021515474079688); + vk.IC[2] = Pairing.G1Point(8526293419624642441177611861266522564535442436561010348205944152133493162725,3479280449869946130511008755784252400013835433175598584791748314213410764833); + vk.IC[3] = Pairing.G1Point(21182306298733068802820987158927230646638198417426291669144906447401618501713,16857746536545121121722827547496248151726638134940849621125320491891019025167); + vk.IC[4] = Pairing.G1Point(2422158897289367980628558882683834680415851035494328775832566189908899480990,12290959329104925151330970367392351311606695561220408091718189761494318064737); + vk.IC[5] = Pairing.G1Point(14091123445468389490984207968580529389285084523867074029328088750965597860725,9831488985832734488154360211536506542169099577306406169097418473025517821329); + vk.IC[6] = Pairing.G1Point(16445937071709775127014464296805598101804177189603496295471720227462382717347,4257908787851211693924711039278073775698061556838306726249941622502409880895); + vk.IC[7] = Pairing.G1Point(2766052651699970673595522419922354631408983259020045659871321649957749349073,3732505317526081965855612226411538764427039525359657450926165933268597125283); + vk.IC[8] = Pairing.G1Point(17233592675629634419200196145316755628670556232520782320233523232711382989921,16401047366370778891859017839585544849894561508054482340206879604080013075589); + vk.IC[9] = Pairing.G1Point(12899954474854513958627186382599164812395305621088734318137043197938133454904,15811974815112357990644545933308745133005809603635712309967428804883434830922); + vk.IC[10] = Pairing.G1Point(21812100923578770879826789010734173923255464631245969568191253280985041128149,12314097111841921359975277319096158327979548278096386657740352862403817415500); } - + function verifyMoveProof( uint256[2] memory a, uint256[2][2] memory b, @@ -348,7 +348,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([9596370660980810238931085461852181949104240417763460689052634295313668488565,20320714936082317113832186964119313715933196448152011930798601175523169274391], [20357627177718451864812896888520131265265738216889892607176810368526418050215,4636940162775097612211816011895930554903094106786770607541364481570862467968]); + vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); vk.IC = new Pairing.G1Point[](8); vk.IC[0] = Pairing.G1Point(10870898939986000468532157640231430092356116495039287249548370970435589722710,9637509233802404751050875244565641105864732921095328155747707264762895963694); vk.IC[1] = Pairing.G1Point(19138797608808993399657283067430257583053688297164578482098293101955262780551,20006287987513927804142618424385437530171110155612987617518879163008364014606); @@ -360,7 +360,7 @@ library Verifier { vk.IC[7] = Pairing.G1Point(19626050859393228947262712902621918433394532884263841107770577683375588382396,8725631736685333716057959034030692087034116048366612534073131375249589821104); } - + function verifyBiomebaseProof( uint256[2] memory a, uint256[2][2] memory b, @@ -377,7 +377,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([17214160969944696701121301503374751756055022261417430039378765572499517113016,6655804944733716891853213679959023798062968513109748100898793636466103008317], [16970326053363445057086896840269095911811879831103940196540008876474913791979,12909547076439959120005916206994318407253873313112067205715015622753543227735]); + vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); vk.IC = new Pairing.G1Point[](10); vk.IC[0] = Pairing.G1Point(11550964137187913352526724844580499338131382138893314699756753981006102732019,19492512945047869932948946467344653872184411292565776553305249475937323729280); vk.IC[1] = Pairing.G1Point(3916477035785360610976006321745916078968774369440543915902405954859488657313,15321034048954067345112787429494548298867833228473430687967681199888641151218); @@ -391,7 +391,7 @@ library Verifier { vk.IC[9] = Pairing.G1Point(11402597413800839700634162913764544661317059412989909428143599812990631376392,18128684448300585236997388740896244971475725654191963688383260132795174539587); } - + function verifyRevealProof( uint256[2] memory a, uint256[2][2] memory b, From db78481849394c29df21f3e5c30e6e4c1232ebf1 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 20:07:28 -0800 Subject: [PATCH 03/35] inital world radius --- contracts/DarkForestCore.sol | 1 + contracts/DarkForestTypes.sol | 1 + 2 files changed, 2 insertions(+) diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index ac32a1e..ef7bd28 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -88,6 +88,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { PERLIN_LENGTH_SCALE: initArgs.PERLIN_LENGTH_SCALE }); s.gameConstants = DarkForestTypes.GameConstants({ + INITIAL_WORLD_RADIUS: initArgs.INITIAL_WORLD_RADIUS, MAX_NATURAL_PLANET_LEVEL: initArgs.MAX_NATURAL_PLANET_LEVEL, TIME_FACTOR_HUNDREDTHS: initArgs.TIME_FACTOR_HUNDREDTHS, PERLIN_THRESHOLD_1: initArgs.PERLIN_THRESHOLD_1, diff --git a/contracts/DarkForestTypes.sol b/contracts/DarkForestTypes.sol index 40da25b..b434be8 100644 --- a/contracts/DarkForestTypes.sol +++ b/contracts/DarkForestTypes.sol @@ -95,6 +95,7 @@ library DarkForestTypes { // Game config // This struct is ~1 properties from maximum struct size struct GameConstants { + uint256 INITIAL_WORLD_RADIUS; uint256 MAX_NATURAL_PLANET_LEVEL; uint256 TIME_FACTOR_HUNDREDTHS; // speedup/slowdown game uint256 PERLIN_THRESHOLD_1; From fef9cf95543ea8c32a2ada04269f2344c6435870 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 20:07:54 -0800 Subject: [PATCH 04/35] starting subgraph stuff --- subgraph/schema.graphql | 2 ++ subgraph/src/helpers/arrivalHelpers.ts | 1 + subgraph/src/mapping.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index 34ac446..b0b54da 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -5,6 +5,7 @@ type Player @entity { "allows null because 0x0000000000000000000000000000000000000000 has no homeWorld" homeWorld: Planet score: BigInt! + destroyedScore: BigInt! lastRevealTimestamp: Int! planets: [Planet!]! @derivedFrom(field: "owner") sentVoyages: [Arrival!]! @derivedFrom(field: "player") @@ -62,6 +63,7 @@ type Planet @entity { isRevealed: Boolean! "planet's x,y coordinate, if revealed" revealedCoordinate: RevealedCoordinate + radius: Int! # artifacts hasTriedFindingArtifact: Boolean! diff --git a/subgraph/src/helpers/arrivalHelpers.ts b/subgraph/src/helpers/arrivalHelpers.ts index 7c8a578..96f8fd4 100644 --- a/subgraph/src/helpers/arrivalHelpers.ts +++ b/subgraph/src/helpers/arrivalHelpers.ts @@ -109,6 +109,7 @@ export function arrive(toPlanet: Planet, arrival: Arrival): Planet { toPlanet.milliEnergyLazy = toPlanet.milliEnergyLazy.minus(effectiveEnergy); } else { // conquers planet + // if(criteria) toPlanet.destroyed = true; toPlanet.owner = arrival.player; const effectiveDefendingEnergy = toPlanet.milliEnergyLazy .times(BigInt.fromI32(toPlanet.defense)) diff --git a/subgraph/src/mapping.ts b/subgraph/src/mapping.ts index 1a8da57..4c719ee 100644 --- a/subgraph/src/mapping.ts +++ b/subgraph/src/mapping.ts @@ -307,6 +307,7 @@ export function handleLocationRevealed(event: LocationRevealed): void { const planetDatas = getters.bulkGetPlanetsDataByIds([event.params.loc]); const rawData = planetDatas[0]; planet = refreshPlanetFromContractData(event.params.loc, rawData.planet, rawData.info); + // planet.radius = DO this math. planet.save(); } From 3df1ee37c8fb0d6c2e2df1a1258a649e79e9fad6 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 20:47:53 -0800 Subject: [PATCH 05/35] working destroy logic and tests --- contracts/DarkForestCore.sol | 6 ++ contracts/DarkForestLazyUpdate.sol | 31 ++++++-- contracts/DarkForestPlanet.sol | 18 +++-- contracts/DarkForestTypes.sol | 8 +++ settings.ts | 1 + test/DFDestroy.test.ts | 112 +++++++++++++++++++++++++++++ 6 files changed, 165 insertions(+), 11 deletions(-) create mode 100644 test/DFDestroy.test.ts diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index ef7bd28..31354f4 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -48,6 +48,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { event ArtifactWithdrawn(address player, uint256 artifactId, uint256 loc); event ArtifactActivated(address player, uint256 artifactId, uint256 loc); // emitted in DFPlanet library event ArtifactDeactivated(address player, uint256 artifactId, uint256 loc); // emitted in DFPlanet library + event PlanetDestroyed(address player, uint256 loc); // emitted in DFPlanet library event PlanetSilverWithdrawn(address player, uint256 loc, uint256 amount); @@ -88,6 +89,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { PERLIN_LENGTH_SCALE: initArgs.PERLIN_LENGTH_SCALE }); s.gameConstants = DarkForestTypes.GameConstants({ + DESTROY_THRESHOLD: initArgs.DESTROY_THRESHOLD, INITIAL_WORLD_RADIUS: initArgs.INITIAL_WORLD_RADIUS, MAX_NATURAL_PLANET_LEVEL: initArgs.MAX_NATURAL_PLANET_LEVEL, TIME_FACTOR_HUNDREDTHS: initArgs.TIME_FACTOR_HUNDREDTHS, @@ -243,6 +245,10 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { emit AdminPlanetCreated(args.location); } + function changeDestroyThreshold(uint256 newThreshold) public onlyAdmin { + s.gameConstants.DESTROY_THRESHOLD = newThreshold; + } + ////////////////////// /// Game Mechanics /// ////////////////////// diff --git a/contracts/DarkForestLazyUpdate.sol b/contracts/DarkForestLazyUpdate.sol index afdf470..c8fc8aa 100644 --- a/contracts/DarkForestLazyUpdate.sol +++ b/contracts/DarkForestLazyUpdate.sol @@ -127,12 +127,15 @@ library DarkForestLazyUpdate { function applyArrival( DarkForestTypes.Planet memory planet, DarkForestTypes.ArrivalData memory arrival - ) private pure returns (uint256 newArtifactOnPlanet, DarkForestTypes.Planet memory) { + ) private view returns (DarkForestTypes.ApplyArrivalData memory) { // checks whether the planet is owned by the player sending ships + bool isDestroyed = false; + if (arrival.player == planet.owner) { // simply increase the population if so planet.population = planet.population + arrival.popArriving; } else { + if (arrival.arrivalType == DarkForestTypes.ArrivalType.Wormhole) { // if this is a wormhole arrival to a planet that isn't owned by the initiator of // the move, then don't move any energy @@ -147,6 +150,18 @@ library DarkForestLazyUpdate { // reduce the arriving ships amount with the current population and the // result is the new population of the planet now owned by the attacking // player + + // If moving to enemy planet, destroy if arriving energy > threshold. + // If threshold = 0, no destroy. + if (planet.owner != address(0) && s().gameConstants.DESTROY_THRESHOLD > 0) { + if( + ((arrival.popArriving * 100) / planet.defense) > + (planet.population * s().gameConstants.DESTROY_THRESHOLD) + ) { + isDestroyed = true; + } + } + planet.owner = arrival.player; planet.population = arrival.popArriving - @@ -170,7 +185,7 @@ library DarkForestLazyUpdate { uint256 _nextSilver = planet.silver + arrival.silverMoved; planet.silver = _maxSilver < _nextSilver ? _maxSilver : _nextSilver; - return (arrival.carriedArtifactId, planet); + return DarkForestTypes.ApplyArrivalData(arrival.carriedArtifactId, planet, isDestroyed); } function applyPendingEvents( @@ -246,14 +261,18 @@ library DarkForestLazyUpdate { ) { eventIdsToRemove[numEventsToRemove++] = events[earliestEventIndex].id; - uint256 newArtifactId; - (newArtifactId, planet) = applyArrival( + DarkForestTypes.ApplyArrivalData memory arrivalData = applyArrival( planet, s().planetArrivals[events[earliestEventIndex].id] ); - if (newArtifactId != 0) { - newArtifactsOnPlanet[numNewArtifactsOnPlanet++] = newArtifactId; + if (arrivalData.newArtifactId != 0) { + newArtifactsOnPlanet[numNewArtifactsOnPlanet++] = arrivalData.newArtifactId; + } + + if(arrivalData.destroyed) { + planetExtendedInfo.destroyed = true; + break; } } } diff --git a/contracts/DarkForestPlanet.sol b/contracts/DarkForestPlanet.sol index 10f058c..514e466 100644 --- a/contracts/DarkForestPlanet.sol +++ b/contracts/DarkForestPlanet.sol @@ -26,6 +26,7 @@ library DarkForestPlanet { event ArtifactActivated(address player, uint256 artifactId, uint256 loc); event ArtifactDeactivated(address player, uint256 artifactId, uint256 loc); event PlanetUpgraded(address player, uint256 loc, uint256 branch, uint256 toBranchLevel); + event PlanetDestroyed(address player, uint256 loc); function isPopCapBoost(uint256 _location) public pure returns (bool) { bytes memory _b = abi.encodePacked(_location); @@ -392,11 +393,11 @@ library DarkForestPlanet { DarkForestUtils.getActiveArtifact(args.oldLoc); DarkForestTypes.Artifact memory activeArtifactTo = DarkForestUtils.getActiveArtifact(args.newLoc); - require( - !s().planetsExtendedInfo[args.newLoc].destroyed && - !s().planetsExtendedInfo[args.oldLoc].destroyed, - "planet is destroyed" - ); + + // Do nothing if planet is destroyed. Ensures that moves will still refresh planet. + if(s().planetsExtendedInfo[args.newLoc].destroyed || s().planetsExtendedInfo[args.oldLoc].destroyed) { + return; + } require( s().planets[args.oldLoc].owner == msg.sender, "Only owner account can perform operation on planets" @@ -535,9 +536,16 @@ library DarkForestPlanet { uint256[12] memory artifactIdsToAddToPlanet ) = getRefreshedPlanet(location, block.timestamp); + DarkForestTypes.PlanetExtendedInfo memory prevPlanet = s().planetsExtendedInfo[location]; + s().planets[location] = planet; s().planetsExtendedInfo[location] = planetInfo; + // Only emit PlanetDestroyed when actual destruction occurred. + if(planetInfo.destroyed && !prevPlanet.destroyed) { + emit PlanetDestroyed(planet.owner, location); + } + DarkForestTypes.PlanetEventMetadata[] storage events = s().planetEvents[location]; for (uint256 toRemoveIdx = 0; toRemoveIdx < 12; toRemoveIdx++) { diff --git a/contracts/DarkForestTypes.sol b/contracts/DarkForestTypes.sol index b434be8..dd78ce5 100644 --- a/contracts/DarkForestTypes.sol +++ b/contracts/DarkForestTypes.sol @@ -95,6 +95,7 @@ library DarkForestTypes { // Game config // This struct is ~1 properties from maximum struct size struct GameConstants { + uint256 DESTROY_THRESHOLD; uint256 INITIAL_WORLD_RADIUS; uint256 MAX_NATURAL_PLANET_LEVEL; uint256 TIME_FACTOR_HUNDREDTHS; // speedup/slowdown game @@ -129,6 +130,7 @@ library DarkForestTypes { bool PERLIN_MIRROR_Y; uint256 PERLIN_LENGTH_SCALE; // must be a power of two up to 8192 // Game config + uint256 DESTROY_THRESHOLD; uint256 MAX_NATURAL_PLANET_LEVEL; uint256 TIME_FACTOR_HUNDREDTHS; // speedup/slowdown game uint256 PERLIN_THRESHOLD_1; @@ -182,6 +184,12 @@ library DarkForestTypes { ArrivalType arrivalType; } + struct ApplyArrivalData { + uint256 newArtifactId; + Planet planet; + bool destroyed; + } + struct DFTCreateArtifactArgs { uint256 tokenId; address discoverer; diff --git a/settings.ts b/settings.ts index 8888b18..9477f6c 100644 --- a/settings.ts +++ b/settings.ts @@ -81,6 +81,7 @@ export const Initializers = decoders.guard( /** * Game configuration */ + DESTROY_THRESHOLD: withDefault(decoders.number, 0), MAX_NATURAL_PLANET_LEVEL: withDefault(decoders.number, 256), TIME_FACTOR_HUNDREDTHS: withDefault(decoders.number, 100), PERLIN_THRESHOLD_1: withDefault(decoders.number, 13), diff --git a/test/DFDestroy.test.ts b/test/DFDestroy.test.ts new file mode 100644 index 0000000..9013b07 --- /dev/null +++ b/test/DFDestroy.test.ts @@ -0,0 +1,112 @@ +import { expect } from 'chai'; +import { BigNumber } from 'ethers'; +import { ethers } from 'hardhat'; +import { + conquerUnownedPlanet, + fixtureLoader, + increaseBlockchainTime, + makeInitArgs, + makeMoveArgs, +} from './utils/TestUtils'; +import { defaultWorldFixture, growingWorldFixture, World } from './utils/TestWorld'; +import { + LVL1_ASTEROID_1, + SPAWN_PLANET_1, + SPAWN_PLANET_2, + initializers +} from './utils/WorldConstants'; + +const { BigNumber: BN } = ethers; + +describe('DarkForestDestroy', function () { + let world: World; + const destroyThresold = 2; + + beforeEach(async function () { + console.log("here"); + world = await fixtureLoader(defaultWorldFixture); + + await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1)); + await world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2)); + world.contracts.core.changeDestroyThreshold(destroyThresold); + }); + + it('should conquer but not destroy planet if sufficient forces', async function () { + await increaseBlockchainTime(); + + const planet2Id = SPAWN_PLANET_2.id; + const dist = 0; // instant move - just for testing correct decay application + const silverSent = 0; + + // drain planet first + await world.user2Core.move( + ...makeMoveArgs(SPAWN_PLANET_2, LVL1_ASTEROID_1, dist, 95000, silverSent) + ); + + await world.contracts.core.refreshPlanet(planet2Id); + let planet2 = await world.contracts.core.planets(planet2Id); + const planet2Pop = planet2.population.toNumber(); + const planet2Def = planet2.defense.toNumber(); + const defenseForce = Math.floor((planet2Pop * planet2Def) / 100); + + await world.user1Core.move( + ...makeMoveArgs(SPAWN_PLANET_1, SPAWN_PLANET_2, dist, 40000, silverSent) + ); + + const planetArrival = (await world.contracts.getters.getPlanetArrivals(planet2Id))[0]; + const shipsMoved = planetArrival.popArriving.toNumber(); + + await world.contracts.core.refreshPlanet(planet2Id); + planet2 = await world.contracts.core.planets(planet2Id); + + expect(planet2.owner).to.equal(world.user1.address); + + // range of tolerances + expect(planet2.population.toNumber()).to.be.above(shipsMoved - defenseForce - 1000); + expect(planet2.population.toNumber()).to.be.below(shipsMoved - defenseForce + 1000); + + await world.contracts.core.refreshPlanet(planet2Id); + const planet2Ext = await world.contracts.core.planetsExtendedInfo(planet2Id); + expect(planet2Ext.destroyed).to.equal(false); + }); + + it('should find destroy threshold', async function () { + await increaseBlockchainTime(); + + const gameConstants = await world.user1Core.gameConstants() + expect(gameConstants.DESTROY_THRESHOLD.toNumber()).to.equal(destroyThresold); + }); + + it('should destroy a planet if sufficient forces and emit destroy event', async function () { + await increaseBlockchainTime(); + + const planet2Id = SPAWN_PLANET_2.id; + const dist = 0; // instant move - just for testing correct decay application + const silverSent = 0; + + // drain planet first + await world.user2Core.move( + ...makeMoveArgs(SPAWN_PLANET_2, LVL1_ASTEROID_1, dist, 95000, silverSent) + ); + + await world.contracts.core.refreshPlanet(planet2Id); + let planet2 = await world.contracts.core.planets(planet2Id); + const planet2Pop = planet2.population.toNumber(); + const planet2Def = planet2.defense.toNumber(); + const defenseForce = Math.floor((planet2Pop * planet2Def) / 100); + + // Make the destroy move. Will be applied next time someone moves to planet. + await world.user1Core.move( + ...makeMoveArgs(SPAWN_PLANET_1, SPAWN_PLANET_2, dist, 70000, silverSent) + ) + + await expect( + world.contracts.core.refreshPlanet(planet2Id) + ) + .to.emit(world.user1Core, "PlanetDestroyed") + .withArgs(world.user1.address, SPAWN_PLANET_2.id); + + const planet2Ext = await world.contracts.core.planetsExtendedInfo(planet2Id); + expect(planet2Ext.destroyed).to.equal(true); + }); +}); \ No newline at end of file From 0efc429230265c67f03d107def197b89607ece64 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 20:48:20 -0800 Subject: [PATCH 06/35] remove hats due to contract size --- contracts/DarkForestCore.sol | 26 ++++++------ test/DFHat.test.ts | 79 ------------------------------------ 2 files changed, 13 insertions(+), 92 deletions(-) delete mode 100644 test/DFHat.test.ts diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index 31354f4..67346b0 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -248,7 +248,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { function changeDestroyThreshold(uint256 newThreshold) public onlyAdmin { s.gameConstants.DESTROY_THRESHOLD = newThreshold; } - + ////////////////////// /// Game Mechanics /// ////////////////////// @@ -456,22 +456,22 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { emit PlanetTransferred(msg.sender, _location, _player); } - function buyHat(uint256 _location) public payable { - require( - s.planetsExtendedInfo[_location].isInitialized == true, - "Planet is not initialized" - ); - refreshPlanet(_location); + // function buyHat(uint256 _location) public payable { + // require( + // s.planetsExtendedInfo[_location].isInitialized == true, + // "Planet is not initialized" + // ); + // refreshPlanet(_location); - require(s.planets[_location].owner == msg.sender, "Only owner can buy hat for planet"); + // require(s.planets[_location].owner == msg.sender, "Only owner can buy hat for planet"); - uint256 cost = (1 << s.planetsExtendedInfo[_location].hatLevel) * 1 ether; + // uint256 cost = (1 << s.planetsExtendedInfo[_location].hatLevel) * 1 ether; - require(msg.value == cost, "Wrong value sent"); + // require(msg.value == cost, "Wrong value sent"); - s.planetsExtendedInfo[_location].hatLevel += 1; - emit PlanetHatBought(msg.sender, _location, s.planetsExtendedInfo[_location].hatLevel); - } + // s.planetsExtendedInfo[_location].hatLevel += 1; + // emit PlanetHatBought(msg.sender, _location, s.planetsExtendedInfo[_location].hatLevel); + // } function findArtifact( uint256[2] memory _a, diff --git a/test/DFHat.test.ts b/test/DFHat.test.ts deleted file mode 100644 index fe966a5..0000000 --- a/test/DFHat.test.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; -import { BN_ZERO, fixtureLoader, makeInitArgs } from './utils/TestUtils'; -import { defaultWorldFixture, World } from './utils/TestWorld'; -import { SPAWN_PLANET_1 } from './utils/WorldConstants'; - -describe('DarkForestHat', function () { - let world: World; - - async function worldFixture() { - const world = await fixtureLoader(defaultWorldFixture); - await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1)); - return world; - } - - beforeEach('load fixture', async function () { - world = await fixtureLoader(worldFixture); - }); - - it('should buy hats', async function () { - let planetExtendedInfo = await world.contracts.core.planetsExtendedInfo(SPAWN_PLANET_1.id); - expect(planetExtendedInfo.hatLevel.toNumber()).to.be.equal(0); - - await world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '1000000000000000000', - }); - await world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '2000000000000000000', - }); - - planetExtendedInfo = await world.contracts.core.planetsExtendedInfo(SPAWN_PLANET_1.id); - - expect(planetExtendedInfo.hatLevel.toNumber()).to.be.equal(2); - }); - - it('should only allow owner to buy hat', async function () { - const planetExtendedInfo = await world.contracts.core.planetsExtendedInfo(SPAWN_PLANET_1.id); - expect(planetExtendedInfo.hatLevel.toNumber()).to.be.equal(0); - - await expect( - world.user2Core.buyHat(SPAWN_PLANET_1.id, { - value: '1000000000000000000', - }) - ).to.be.revertedWith('Only owner can buy hat for planet'); - }); - - it('should not buy hat with insufficient value', async function () { - const planetExtendedInfo = await world.contracts.core.planetsExtendedInfo(SPAWN_PLANET_1.id); - - expect(planetExtendedInfo.hatLevel.toNumber()).to.be.equal(0); - - await world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '1000000000000000000', - }); - await expect( - world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '1500000000000000000', - }) - ).to.be.revertedWith('Wrong value sent'); - }); - - it('should allow admin to withdraw all funds', async function () { - await world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '1000000000000000000', - }); - - await world.contracts.core.withdraw(); - - expect(await ethers.provider.getBalance(world.contracts.core.address)).to.equal(BN_ZERO); - }); - - it('should not allow non-admin to withdraw funds', async function () { - await world.user1Core.buyHat(SPAWN_PLANET_1.id, { - value: '1000000000000000000', - }); - - await expect(world.user1Core.withdraw()).to.be.revertedWith('Sender is not a game master'); - }); -}); From 45bfbe356430ca9d1106f4733a07517f1c5cef59 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 20:59:54 -0800 Subject: [PATCH 07/35] update black domain test to account for no-op on move to destroy --- test/DFArtifacts.test.ts | 57 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/test/DFArtifacts.test.ts b/test/DFArtifacts.test.ts index 417a89a..2424a3a 100644 --- a/test/DFArtifacts.test.ts +++ b/test/DFArtifacts.test.ts @@ -809,7 +809,7 @@ describe('DarkForestArtifacts', function () { }); describe('black domain', function () { - it('is burnt after usage, and prevents moves from being made to it and from it', async function () { + it.skip('is burnt after usage, and prevents moves from being made to it and from it', async function () { const to = LVL0_PLANET; const dist = 50; const shipsSent = 10000; @@ -853,10 +853,63 @@ describe('DarkForestArtifacts', function () { // moves from destroyed planets also don't work await expect( - world.user1Core.move(...makeMoveArgs(SPAWN_PLANET_1, to, dist, shipsSent, silverSent)) + world.user1Core.move(...makeMoveArgs(to, SPAWN_PLANET_1, dist, shipsSent, silverSent)) ).to.be.revertedWith('planet is destroyed'); }); + it('is burnt after usage and move is a no-op', async function () { + const to = LVL0_PLANET; + const dist = 50; + const shipsSent = 10000; + const silverSent = 0; + + await world.user1Core.move(...makeMoveArgs(SPAWN_PLANET_1, to, dist, shipsSent, silverSent)); + await increaseBlockchainTime(); + + await world.user1Core.refreshPlanet(to.id); + const conqueredSecondPlanet = await world.user1Core.planets(to.id); + expect(conqueredSecondPlanet.owner).to.eq(world.user1.address); + + const newTokenId = hexToBigNumber('1'); + await world.contracts.tokens.createArtifact({ + tokenId: newTokenId, + discoverer: world.user1.address, + planetId: 1, // planet id + rarity: 1, // rarity + biome: 1, // biome + artifactType: 9, // black domain + owner: world.user1.address, + }); + await world.user1Core.depositArtifact(LVL3_SPACETIME_1.id, newTokenId); + await world.user1Core.move(...makeMoveArgs(LVL3_SPACETIME_1, to, 0, 500000, 0, newTokenId)); + await world.user1Core.activateArtifact(to.id, newTokenId, 0); + + // black domain is no longer on a planet (is instead owned by contract), and so is effectively burned + const blackDomainPostActivation = await world.contracts.getters.getArtifactById(newTokenId); + expect(blackDomainPostActivation.locationId.toString()).to.eq('0'); + + // check the planet is destroyed + const newInfo = await world.user1Core.planetsExtendedInfo(to.id); + expect(newInfo.destroyed).to.eq(true); + + + await increaseBlockchainTime(); + + const refreshTx = await world.user1Core.refreshPlanet(SPAWN_PLANET_1.id); + await refreshTx.wait(); + + const newP = await world.user1Core.planets(SPAWN_PLANET_1.id); + + // moves to destroyed planets work + await world.user1Core.move(...makeMoveArgs(SPAWN_PLANET_1, to, dist, shipsSent, silverSent)) + + // moves from destroyed planets also don't work + await world.user1Core.move(...makeMoveArgs(to, SPAWN_PLANET_1, dist, shipsSent, silverSent)) + + const currP = await world.user1Core.planets(SPAWN_PLANET_1.id); + expect(newP.population).to.equal(currP.population); + }); + it("can't be used on a planet of too high level", async function () { this.timeout(1000 * 60); await conquerUnownedPlanet(world, world.user1Core, LVL3_SPACETIME_1, LVL4_UNOWNED_DEEP_SPACE); From a63e14fef94a4875e6bb1efdafde9e1851b5fed8 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 21:01:55 -0800 Subject: [PATCH 08/35] update .toml for testing destroy --- darkforest.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darkforest.toml b/darkforest.toml index 4d2a314..fa1492c 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -11,7 +11,7 @@ INITIAL_WORLD_RADIUS = 8000 ################################## # SNARK keys & Perlin parameters # ################################## -DISABLE_ZK_CHECKS = false +DISABLE_ZK_CHECKS = true PLANETHASH_KEY = 6278 SPACETYPE_KEY = 6279 BIOMEBASE_KEY = 6270 @@ -22,8 +22,9 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 ###################### # Game configuration # ###################### +DESTROY_THRESHOLD = 2 MAX_NATURAL_PLANET_LEVEL = 256 -TIME_FACTOR_HUNDREDTHS = 300 # speedup/slowdown game +TIME_FACTOR_HUNDREDTHS = 6000 # speedup/slowdown game PERLIN_THRESHOLD_1 = 1 PERLIN_THRESHOLD_2 = 2 PERLIN_THRESHOLD_3 = 18 From c693c5513049fdb08163e777907d74bca0f96a6d Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Wed, 29 Dec 2021 21:22:28 -0800 Subject: [PATCH 09/35] set reveal cooldown --- darkforest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darkforest.toml b/darkforest.toml index fa1492c..de90202 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -35,7 +35,7 @@ BIOME_THRESHOLD_1 = 15 BIOME_THRESHOLD_2 = 17 PLANET_RARITY = 16384 PHOTOID_ACTIVATION_DELAY = 14400 # seconds -LOCATION_REVEAL_COOLDOWN = 86400 # seconds +LOCATION_REVEAL_COOLDOWN = 10800 # seconds -> 3 hours CLAIM_PLANET_COOLDOWN = 10800 # seconds PLANET_TYPE_WEIGHTS = [ [ From bb50c71c91b3d81ddf2567867d242f0786738631 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 00:26:04 -0800 Subject: [PATCH 10/35] shrink logic, constants, and test --- contracts/DarkForestCore.sol | 20 ++++- contracts/DarkForestPlanet.sol | 10 +++ contracts/DarkForestTypes.sol | 14 +++ contracts/DarkForestUtils.sol | 43 +++++++++ settings.ts | 7 ++ test/DFShrink.test.ts | 159 +++++++++++++++++++++++++++++++++ test/utils/TestWorld.ts | 9 +- test/utils/WorldConstants.ts | 15 ++++ 8 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 test/DFShrink.test.ts diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index 67346b0..c158f1f 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -49,6 +49,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { event ArtifactActivated(address player, uint256 artifactId, uint256 loc); // emitted in DFPlanet library event ArtifactDeactivated(address player, uint256 artifactId, uint256 loc); // emitted in DFPlanet library event PlanetDestroyed(address player, uint256 loc); // emitted in DFPlanet library + event RadiusUpdated(uint256 radius); event PlanetSilverWithdrawn(address player, uint256 loc, uint256 amount); @@ -105,7 +106,14 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { PHOTOID_ACTIVATION_DELAY: initArgs.PHOTOID_ACTIVATION_DELAY, LOCATION_REVEAL_COOLDOWN: initArgs.LOCATION_REVEAL_COOLDOWN, PLANET_TYPE_WEIGHTS: initArgs.PLANET_TYPE_WEIGHTS, - ARTIFACT_POINT_VALUES: initArgs.ARTIFACT_POINT_VALUES + ARTIFACT_POINT_VALUES: initArgs.ARTIFACT_POINT_VALUES, + SHRINK_START: initArgs.SHRINK_START, + ROUND_END: initArgs.ROUND_END, + MIN_RADIUS: initArgs.MIN_RADIUS, + SHRINK_FACTOR: initArgs.SHRINK_FACTOR, + DISC_LOWER_BOUND: initArgs.DISC_LOWER_BOUND, + DISC_UPPER_BOUND: initArgs.DISC_UPPER_BOUND, + SHRINK: initArgs.SHRINK }); s.worldRadius = initArgs.INITIAL_WORLD_RADIUS; // will be overridden by TARGET4_RADIUS if !WORLD_RADIUS_LOCKED @@ -166,6 +174,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { function _updateWorldRadius() private { if (!s.WORLD_RADIUS_LOCKED) { s.worldRadius = DarkForestUtils._getRadius(); + emit RadiusUpdated(s.worldRadius); } } @@ -207,6 +216,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { function adminSetWorldRadius(uint256 _newRadius) public onlyAdmin { s.worldRadius = _newRadius; + emit RadiusUpdated(s.worldRadius); } function changeLocationRevealCooldown(uint256 newCooldown) public onlyAdmin { @@ -249,6 +259,14 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { s.gameConstants.DESTROY_THRESHOLD = newThreshold; } + function setShrinkStart(uint256 newShrinkStart) public onlyAdmin { + s.gameConstants.SHRINK_START = newShrinkStart; + } + + function setRoundEnd(uint256 newEndTime) public onlyAdmin { + s.gameConstants.ROUND_END = newEndTime; + } + ////////////////////// /// Game Mechanics /// ////////////////////// diff --git a/contracts/DarkForestPlanet.sol b/contracts/DarkForestPlanet.sol index 514e466..5c07926 100644 --- a/contracts/DarkForestPlanet.sol +++ b/contracts/DarkForestPlanet.sol @@ -376,6 +376,16 @@ library DarkForestPlanet { "Player can only spawn at the universe rim" ); } + + // this will only allow players to initialize in the middle ring of the universe. + if(s().gameConstants.SHRINK) { + uint256 radius = s().worldRadius; + uint256 upperQuartile = (radius * s().gameConstants.DISC_UPPER_BOUND) / 100; + uint256 lowerQuartile = (radius * s().gameConstants.DISC_LOWER_BOUND) / 100; + console.log("lowerQuartile %s upperQuartile %s player radius %s", lowerQuartile, upperQuartile, _radius); + require(_radius >= lowerQuartile, "Init radius is too low"); + require(_radius <= upperQuartile, "Init radius is too high"); + } require( _perlin >= s().gameConstants.INIT_PERLIN_MIN, diff --git a/contracts/DarkForestTypes.sol b/contracts/DarkForestTypes.sol index dd78ce5..3d411f4 100644 --- a/contracts/DarkForestTypes.sol +++ b/contracts/DarkForestTypes.sol @@ -112,6 +112,13 @@ library DarkForestTypes { uint256 LOCATION_REVEAL_COOLDOWN; uint8[5][10][4] PLANET_TYPE_WEIGHTS; // spaceType (enum 0-3) -> planetLevel (0-7) -> planetType (enum 0-4) uint256[6] ARTIFACT_POINT_VALUES; + uint256 SHRINK_START; + uint256 ROUND_END; + uint256 MIN_RADIUS; + uint256 SHRINK_FACTOR; + uint256 DISC_LOWER_BOUND; + uint256 DISC_UPPER_BOUND; + bool SHRINK; } struct DFInitArgs { @@ -145,6 +152,13 @@ library DarkForestTypes { uint8[5][10][4] PLANET_TYPE_WEIGHTS; // spaceType (enum 0-3) -> planetLevel (0-7) -> planetType (enum 0-4) uint256[6] ARTIFACT_POINT_VALUES; uint256 PHOTOID_ACTIVATION_DELAY; + uint256 SHRINK_START; + uint256 ROUND_END; + uint256 MIN_RADIUS; + uint256 SHRINK_FACTOR; + uint256 DISC_LOWER_BOUND; + uint256 DISC_UPPER_BOUND; + bool SHRINK; } struct DFPInitPlanetArgs { diff --git a/contracts/DarkForestUtils.sol b/contracts/DarkForestUtils.sol index 9f78014..7dd8fd7 100644 --- a/contracts/DarkForestUtils.sol +++ b/contracts/DarkForestUtils.sol @@ -5,6 +5,7 @@ pragma solidity ^0.8.0; import "./ABDKMath64x64.sol"; import "./DarkForestTypes.sol"; import "./DarkForestTokens.sol"; +import "hardhat/console.sol"; library DarkForestUtils { // the only contract that ever calls this is DarkForestCore, which has a known storage layout @@ -141,6 +142,48 @@ library DarkForestUtils { } function _getRadius() public view returns (uint256) { + if(s().gameConstants.SHRINK) { + return _shrinkRadius(); + } + else { + return _growRadius(); + } + } + + function _shrinkRadius() internal view returns (uint256) { + uint256 radius = s().worldRadius; + console.log("curr radius is %s", radius); + uint256 shrinkFactor = s().gameConstants.SHRINK_FACTOR; + uint256 totalTime = s().gameConstants.ROUND_END - s().gameConstants.SHRINK_START; + // Only shrink after START_TIME has occurred. Allows for delaying of shrinking. + uint256 startTime = s().gameConstants.SHRINK_START > block.timestamp ? block.timestamp: s().gameConstants.SHRINK_START; + uint256 minRadius = s().gameConstants.MIN_RADIUS; + uint256 timeElapsed = block.timestamp - startTime; + console.log("time Elapsed %s", timeElapsed); + console.log("total time %s vs time elapsed %s", totalTime, timeElapsed); + // Clip timeElapsed to max totalTime + if(timeElapsed > totalTime) timeElapsed = totalTime; + console.log("total time %s vs time elapsed %s", totalTime, timeElapsed); + + + // only shrink after initial time elapsed. + radius = ( + s().worldRadius * + ( + (totalTime**shrinkFactor) - + (timeElapsed**shrinkFactor) + ) + ) + / totalTime**shrinkFactor; + + console.log("pre min check radius is %s", radius); + // set minimum + if (radius < minRadius) radius = minRadius; + console.log("post min check radius is %s", radius); + return radius; + } + + function _growRadius() internal view returns (uint256) { uint256 nPlayers = s().playerIds.length; uint256 target4RadiusConstant = s().TARGET4_RADIUS; uint256 target4 = s().initializedPlanetCountByLevel[4] + 20 * nPlayers; diff --git a/settings.ts b/settings.ts index 9477f6c..6fda0c0 100644 --- a/settings.ts +++ b/settings.ts @@ -81,6 +81,13 @@ export const Initializers = decoders.guard( /** * Game configuration */ + SHRINK: withDefault(decoders.boolean, false), + SHRINK_FACTOR: withDefault(decoders.number, 2), + SHRINK_START: withDefault(dateInSeconds, Math.floor(Date.now() / 1000)), // Current time in seconds + ROUND_END: withDefault(dateInSeconds, Math.floor(Date.now() / 1000) + 6000), // 10 minute round is default + MIN_RADIUS: withDefault(decoders.number, 500), + DISC_LOWER_BOUND: withDefault(decoders.number, 50), + DISC_UPPER_BOUND: withDefault(decoders.number, 75), DESTROY_THRESHOLD: withDefault(decoders.number, 0), MAX_NATURAL_PLANET_LEVEL: withDefault(decoders.number, 256), TIME_FACTOR_HUNDREDTHS: withDefault(decoders.number, 100), diff --git a/test/DFShrink.test.ts b/test/DFShrink.test.ts new file mode 100644 index 0000000..5b7d230 --- /dev/null +++ b/test/DFShrink.test.ts @@ -0,0 +1,159 @@ +import { expect } from 'chai'; +import { BigNumber } from 'ethers'; +import { ethers, initializers } from 'hardhat'; +import { + conquerUnownedPlanet, + fixtureLoader, + increaseBlockchainTime, + makeInitArgs, + makeMoveArgs, + getCurrentTime, + feedSilverToCap +} from './utils/TestUtils'; +import { defaultWorldFixture, growingWorldFixture, shrinkingWorldFixture, World } from './utils/TestWorld'; +import { + LVL1_ASTEROID_1, + SMALL_INTERVAL, + SPAWN_PLANET_1, + SPAWN_PLANET_2, + shrinkingInitializers, + INVALID_TOO_CLOSE_SPAWN, + LVL3_SPACETIME_1, +} from './utils/WorldConstants'; + +const { BigNumber: BN } = ethers; + +describe('DarkForestShrink', function () { + let world: World; + + describe('in a shrinking universe', async function () { + let initialRadius: BigNumber; + + beforeEach(async function () { + world = await fixtureLoader(shrinkingWorldFixture); + + const time = await getCurrentTime(); + + await world.contracts.core.setShrinkStart(time); + await world.contracts.core.setRoundEnd(time + 5000); + await world.contracts.core.adminSetWorldRadius(shrinkingInitializers.INITIAL_WORLD_RADIUS); + + await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1, SPAWN_PLANET_1.distFromOrigin)); + }); + + it('should decrease radius size after move', async function () { + const initRadius = await world.contracts.core.worldRadius(); + await increaseBlockchainTime(5); + + // Recall that universe will only shrink when a player makes a move. + await world.user1Core.move( + ...makeMoveArgs(SPAWN_PLANET_1, SPAWN_PLANET_2, 0, 40000, 0) + ); + + const currRadius = await world.contracts.core.worldRadius(); + expect(currRadius.toNumber()).lessThan(initRadius.toNumber()); + }); + + it('rejects a player spawning outside of middle ring', async function () { + const initRadius = await world.contracts.core.worldRadius(); + await expect( + world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2, initRadius.toNumber())) + ).to.be.revertedWith("Init radius is too high"); + }); + + it('rejects a player spawning inside of middle ring', async function () { + await expect( + world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2, 0)) + ).to.be.revertedWith("Init radius is too low"); + }); + + it('accepts a player spawning in middle ring and shrinks radius', async function () { + const initRadius = await world.contracts.core.worldRadius(); + await expect(world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2, SPAWN_PLANET_2.distFromOrigin))) + .to.emit(world.contracts.core, 'PlayerInitialized') + .withArgs(world.user2.address, SPAWN_PLANET_2.id.toString()); + + const currRadius = await world.contracts.core.worldRadius(); + expect(currRadius.toNumber()).lessThan(initRadius.toNumber()); + }); + + it('radius cant go below minRadius', async function () { + const minRadius = (await world.contracts.core.gameConstants()).MIN_RADIUS; + const initRadius = (await world.contracts.core.worldRadius()).toNumber(); + + await increaseBlockchainTime(); + + const currRadius = (await world.contracts.core.worldRadius()).toNumber(); + + expect(currRadius).to.equal(initRadius); + + // player initializes before radius is shrunk. + // hopefully this is taken care of by spawning in middle ring. + await expect(world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2, Math.floor(currRadius / 2)))) + .to.emit(world.contracts.core, 'PlayerInitialized') + .withArgs(world.user2.address, SPAWN_PLANET_2.id.toString()); + + const finalRadius = await world.contracts.core.worldRadius(); + console.log("finalRadius ", finalRadius.toNumber()); + expect(finalRadius.toNumber()).to.equal(minRadius.toNumber()); + }); + + + }); + + describe('in a manually shrinking universe', async function () { + let initialRadius: BigNumber; + + beforeEach(async function () { + world = await fixtureLoader(defaultWorldFixture); + + await world.contracts.core.adminSetWorldRadius(initializers.INITIAL_WORLD_RADIUS); + await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1, SPAWN_PLANET_1.distFromOrigin)); + + // Conquer MINE_REGULAR and LVL3_SPACETIME_1 to accumulate silver + await conquerUnownedPlanet(world, world.user1Core, SPAWN_PLANET_1, LVL1_ASTEROID_1); + await conquerUnownedPlanet(world, world.user1Core, SPAWN_PLANET_1, LVL3_SPACETIME_1); + + // Fill up LVL3_SPACETIME_1 with silvers + await feedSilverToCap(world, world.user1Core, LVL1_ASTEROID_1, LVL3_SPACETIME_1); + + }); + + it('should allow a silver withdrawal from outside of radius', async function () { + const withdrawnAmount = (await world.contracts.core.planets(LVL3_SPACETIME_1.id)).silverCap; + + expect( + await world.contracts.core.adminSetWorldRadius(SPAWN_PLANET_1.distFromOrigin - 10) + ).to.emit(world.user1Core, "RadiusUpdated") + .withArgs(SPAWN_PLANET_1.distFromOrigin - 10); + + const radius = (await world.user1Core.worldRadius()).toNumber(); + expect(radius).to.equal(SPAWN_PLANET_1.distFromOrigin - 10); + + await expect(world.user1Core.withdrawSilver(LVL3_SPACETIME_1.id, withdrawnAmount)) + .to.emit(world.contracts.core, 'PlanetSilverWithdrawn') + .withArgs(world.user1.address, LVL3_SPACETIME_1.id, withdrawnAmount); + + expect( + (await world.contracts.core.players(world.user1.address)).score) + .to.equal(withdrawnAmount.div(1000)); + }); + + it('should reject a move to outside of radius', async function () { + const dist = 100; + const shipsSent = 50000; + const silverSent = 0; + + await world.contracts.core.adminSetWorldRadius(SPAWN_PLANET_1.distFromOrigin - 10); + const radius = (await world.user1Core.worldRadius()).toNumber(); + + await expect( + world.user1Core.move( + ...makeMoveArgs(SPAWN_PLANET_1, LVL3_SPACETIME_1, dist, shipsSent, silverSent) + ) + ).to.be.revertedWith('Attempting to move out of bounds'); + }); + }); +}); + + diff --git a/test/utils/TestWorld.ts b/test/utils/TestWorld.ts index 0ac3516..003ac68 100644 --- a/test/utils/TestWorld.ts +++ b/test/utils/TestWorld.ts @@ -4,7 +4,7 @@ import { BigNumber, utils } from 'ethers'; import { ethers } from 'hardhat'; import * as settings from '../../settings'; import { initializeContracts, TestContracts } from './TestContracts'; -import { initializers, target4Initializers } from './WorldConstants'; +import { initializers, shrinkingInitializers, target4Initializers } from './WorldConstants'; export interface World { contracts: TestContracts; @@ -45,6 +45,13 @@ export function growingWorldFixture(): Promise { }); } +export function shrinkingWorldFixture(): Promise { + return initializeWorld({ + initializers: shrinkingInitializers, + enableWhitelist: false, + }); +} + export function whilelistWorldFixture(): Promise { return initializeWorld({ initializers, diff --git a/test/utils/WorldConstants.ts b/test/utils/WorldConstants.ts index 0270d4b..2148434 100644 --- a/test/utils/WorldConstants.ts +++ b/test/utils/WorldConstants.ts @@ -25,6 +25,21 @@ export const target4Initializers = settings.parse(settings.Initializers, { SPAWN_RIM_AREA: 7234560000, }); +export const shrinkingInitializers = settings.parse(settings.Initializers, { + DISABLE_ZK_CHECKS: true, + PLANETHASH_KEY: 1, + SPACETYPE_KEY: 2, + BIOMEBASE_KEY: 3, + INITIAL_WORLD_RADIUS: 3000, + TOKEN_MINT_END_TIMESTAMP: '3031-05-27T18:59:59.000Z', + MIN_RADIUS: 1000, + SHRINK_FACTOR: 2, + SHRINK: true, + WORLD_RADIUS_LOCKED: false, + DISC_LOWER_BOUND: 50, + DISC_UPPER_BOUND: 75 +}); + export const VALID_INIT_PERLIN = initializers.INIT_PERLIN_MIN; export const NEBULA_PERLIN = initializers.PERLIN_THRESHOLD_1 - 1; export const SPACE_PERLIN = initializers.PERLIN_THRESHOLD_1; From 5d374bc89066c53b564038414e2a3c1aaac1f9af Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 00:27:16 -0800 Subject: [PATCH 11/35] clean up variable name, add js shrink algorithm, and update settings --- contracts/DarkForestCore.sol | 5 ++--- contracts/DarkForestPlanet.sol | 4 ++-- contracts/DarkForestTypes.sol | 6 ++---- contracts/DarkForestUtils.sol | 6 +++--- darkforest.toml | 10 +++++++--- settings.ts | 5 ++--- test/DFShrink.test.ts | 16 +++++++++++---- test/utils/TestUtils.ts | 36 +++++++++++++++++++++++++++++++++- test/utils/WorldConstants.ts | 5 ++--- 9 files changed, 67 insertions(+), 26 deletions(-) diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index c158f1f..7525f94 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -107,13 +107,12 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { LOCATION_REVEAL_COOLDOWN: initArgs.LOCATION_REVEAL_COOLDOWN, PLANET_TYPE_WEIGHTS: initArgs.PLANET_TYPE_WEIGHTS, ARTIFACT_POINT_VALUES: initArgs.ARTIFACT_POINT_VALUES, + SHRINK: initArgs.SHRINK, SHRINK_START: initArgs.SHRINK_START, ROUND_END: initArgs.ROUND_END, MIN_RADIUS: initArgs.MIN_RADIUS, - SHRINK_FACTOR: initArgs.SHRINK_FACTOR, DISC_LOWER_BOUND: initArgs.DISC_LOWER_BOUND, - DISC_UPPER_BOUND: initArgs.DISC_UPPER_BOUND, - SHRINK: initArgs.SHRINK + DISC_UPPER_BOUND: initArgs.DISC_UPPER_BOUND }); s.worldRadius = initArgs.INITIAL_WORLD_RADIUS; // will be overridden by TARGET4_RADIUS if !WORLD_RADIUS_LOCKED diff --git a/contracts/DarkForestPlanet.sol b/contracts/DarkForestPlanet.sol index 5c07926..e7c5ea8 100644 --- a/contracts/DarkForestPlanet.sol +++ b/contracts/DarkForestPlanet.sol @@ -376,9 +376,9 @@ library DarkForestPlanet { "Player can only spawn at the universe rim" ); } - + // this will only allow players to initialize in the middle ring of the universe. - if(s().gameConstants.SHRINK) { + if(s().gameConstants.SHRINK > 0) { uint256 radius = s().worldRadius; uint256 upperQuartile = (radius * s().gameConstants.DISC_UPPER_BOUND) / 100; uint256 lowerQuartile = (radius * s().gameConstants.DISC_LOWER_BOUND) / 100; diff --git a/contracts/DarkForestTypes.sol b/contracts/DarkForestTypes.sol index 3d411f4..e91ed33 100644 --- a/contracts/DarkForestTypes.sol +++ b/contracts/DarkForestTypes.sol @@ -115,10 +115,9 @@ library DarkForestTypes { uint256 SHRINK_START; uint256 ROUND_END; uint256 MIN_RADIUS; - uint256 SHRINK_FACTOR; + uint256 SHRINK; uint256 DISC_LOWER_BOUND; uint256 DISC_UPPER_BOUND; - bool SHRINK; } struct DFInitArgs { @@ -155,10 +154,9 @@ library DarkForestTypes { uint256 SHRINK_START; uint256 ROUND_END; uint256 MIN_RADIUS; - uint256 SHRINK_FACTOR; + uint256 SHRINK; uint256 DISC_LOWER_BOUND; uint256 DISC_UPPER_BOUND; - bool SHRINK; } struct DFPInitPlanetArgs { diff --git a/contracts/DarkForestUtils.sol b/contracts/DarkForestUtils.sol index 7dd8fd7..44b5335 100644 --- a/contracts/DarkForestUtils.sol +++ b/contracts/DarkForestUtils.sol @@ -142,7 +142,7 @@ library DarkForestUtils { } function _getRadius() public view returns (uint256) { - if(s().gameConstants.SHRINK) { + if(s().gameConstants.SHRINK > 0) { return _shrinkRadius(); } else { @@ -153,7 +153,7 @@ library DarkForestUtils { function _shrinkRadius() internal view returns (uint256) { uint256 radius = s().worldRadius; console.log("curr radius is %s", radius); - uint256 shrinkFactor = s().gameConstants.SHRINK_FACTOR; + uint256 shrinkFactor = s().gameConstants.SHRINK; uint256 totalTime = s().gameConstants.ROUND_END - s().gameConstants.SHRINK_START; // Only shrink after START_TIME has occurred. Allows for delaying of shrinking. uint256 startTime = s().gameConstants.SHRINK_START > block.timestamp ? block.timestamp: s().gameConstants.SHRINK_START; @@ -168,7 +168,7 @@ library DarkForestUtils { // only shrink after initial time elapsed. radius = ( - s().worldRadius * + s().gameConstants.INITIAL_WORLD_RADIUS * ( (totalTime**shrinkFactor) - (timeElapsed**shrinkFactor) diff --git a/darkforest.toml b/darkforest.toml index fa1492c..20b69f2 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -3,7 +3,7 @@ [initializers] ADMIN_CAN_ADD_PLANETS = true -WORLD_RADIUS_LOCKED = true +WORLD_RADIUS_LOCKED = false TOKEN_MINT_END_TIMESTAMP = 2021-10-05T04:00:00.000Z # Mon Oct 04 2021 21:00:00 GMT-0700 (Pacific Daylight Time) TARGET4_RADIUS = 1600 INITIAL_WORLD_RADIUS = 8000 @@ -11,7 +11,7 @@ INITIAL_WORLD_RADIUS = 8000 ################################## # SNARK keys & Perlin parameters # ################################## -DISABLE_ZK_CHECKS = true +DISABLE_ZK_CHECKS = false PLANETHASH_KEY = 6278 SPACETYPE_KEY = 6279 BIOMEBASE_KEY = 6270 @@ -22,6 +22,10 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 ###################### # Game configuration # ###################### +SHRINK = 2 # No shrink if 0 +# SHRINK_START: withDefault(dateInSeconds, Math.floor(Date.now() / 1000)), // Current time in seconds +# ROUND_END: withDefault(dateInSeconds, Math.floor(Date.now() / 1000) + 600), // 10 minute round is default +MIN_RADIUS = 1 DESTROY_THRESHOLD = 2 MAX_NATURAL_PLANET_LEVEL = 256 TIME_FACTOR_HUNDREDTHS = 6000 # speedup/slowdown game @@ -35,7 +39,7 @@ BIOME_THRESHOLD_1 = 15 BIOME_THRESHOLD_2 = 17 PLANET_RARITY = 16384 PHOTOID_ACTIVATION_DELAY = 14400 # seconds -LOCATION_REVEAL_COOLDOWN = 86400 # seconds +LOCATION_REVEAL_COOLDOWN = 10800 # seconds CLAIM_PLANET_COOLDOWN = 10800 # seconds PLANET_TYPE_WEIGHTS = [ [ diff --git a/settings.ts b/settings.ts index 6fda0c0..1221420 100644 --- a/settings.ts +++ b/settings.ts @@ -81,10 +81,9 @@ export const Initializers = decoders.guard( /** * Game configuration */ - SHRINK: withDefault(decoders.boolean, false), - SHRINK_FACTOR: withDefault(decoders.number, 2), + SHRINK: withDefault(decoders.number, 0), SHRINK_START: withDefault(dateInSeconds, Math.floor(Date.now() / 1000)), // Current time in seconds - ROUND_END: withDefault(dateInSeconds, Math.floor(Date.now() / 1000) + 6000), // 10 minute round is default + ROUND_END: withDefault(dateInSeconds, Math.floor(Date.now() / 1000) + 6000), // 100 minute round is default MIN_RADIUS: withDefault(decoders.number, 500), DISC_LOWER_BOUND: withDefault(decoders.number, 50), DISC_UPPER_BOUND: withDefault(decoders.number, 75), diff --git a/test/DFShrink.test.ts b/test/DFShrink.test.ts index 5b7d230..f4e3d71 100644 --- a/test/DFShrink.test.ts +++ b/test/DFShrink.test.ts @@ -8,7 +8,8 @@ import { makeInitArgs, makeMoveArgs, getCurrentTime, - feedSilverToCap + feedSilverToCap, + shrinkAlgorithm } from './utils/TestUtils'; import { defaultWorldFixture, growingWorldFixture, shrinkingWorldFixture, World } from './utils/TestWorld'; import { @@ -28,11 +29,12 @@ describe('DarkForestShrink', function () { describe('in a shrinking universe', async function () { let initialRadius: BigNumber; + let time: number beforeEach(async function () { world = await fixtureLoader(shrinkingWorldFixture); - const time = await getCurrentTime(); + time = await getCurrentTime(); await world.contracts.core.setShrinkStart(time); await world.contracts.core.setRoundEnd(time + 5000); @@ -43,14 +45,18 @@ describe('DarkForestShrink', function () { it('should decrease radius size after move', async function () { const initRadius = await world.contracts.core.worldRadius(); - await increaseBlockchainTime(5); + await increaseBlockchainTime(500); // Recall that universe will only shrink when a player makes a move. await world.user1Core.move( ...makeMoveArgs(SPAWN_PLANET_1, SPAWN_PLANET_2, 0, 40000, 0) - ); + ); + + const radius = shrinkAlgorithm(time, time + 5000, time + 500); + console.log("radius from algo", radius) const currRadius = await world.contracts.core.worldRadius(); + console.log("radius from chain", currRadius.toNumber()); expect(currRadius.toNumber()).lessThan(initRadius.toNumber()); }); @@ -69,6 +75,8 @@ describe('DarkForestShrink', function () { it('accepts a player spawning in middle ring and shrinks radius', async function () { const initRadius = await world.contracts.core.worldRadius(); + await increaseBlockchainTime(500); + await expect(world.user2Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_2, SPAWN_PLANET_2.distFromOrigin))) .to.emit(world.contracts.core, 'PlayerInitialized') .withArgs(world.user2.address, SPAWN_PLANET_2.id.toString()); diff --git a/test/utils/TestUtils.ts b/test/utils/TestUtils.ts index 82a88f2..7df3644 100644 --- a/test/utils/TestUtils.ts +++ b/test/utils/TestUtils.ts @@ -4,7 +4,7 @@ import { BigNumber, BigNumberish } from 'ethers'; import { ethers, waffle } from 'hardhat'; import { TestLocation } from './TestLocation'; import { World } from './TestWorld'; -import { ARTIFACT_PLANET_1, initializers, LARGE_INTERVAL } from './WorldConstants'; +import { ARTIFACT_PLANET_1, initializers, shrinkingInitializers, LARGE_INTERVAL } from './WorldConstants'; const { constants } = ethers; @@ -22,6 +22,40 @@ export const BN_ZERO = constants.Zero; export const fixtureLoader = waffle.createFixtureLoader(); +export function shrinkAlgorithm( + shrinkStart: number, + roundEnd: number, + currTime: number +):number +{ + const shrinkFactor = shrinkingInitializers.SHRINK; + const totalTime = roundEnd - shrinkStart; + const now = currTime // in Seconds. + + // Only shrink after START_TIME has occurred. Allows for delaying of shrinking. + const startTime = shrinkStart > now ? now : shrinkStart; + const minRadius = shrinkingInitializers.MIN_RADIUS; + var timeElapsed = now - startTime; + // // Clip timeElapsed to max totalTime + if(timeElapsed > totalTime) timeElapsed = totalTime; + // // only shrink after initial time elapsed. + var radius = ( + shrinkingInitializers.INITIAL_WORLD_RADIUS * + ( + (Math.pow(totalTime,shrinkFactor)) - + (Math.pow(timeElapsed,shrinkFactor)) + ) + ) + / Math.pow(totalTime,shrinkFactor); + + console.log("pre min check radius is %s", radius); + // // set minimum + if (radius < minRadius) radius = minRadius; + console.log("post min check radius is %s", radius); + + return Math.floor(radius); +} + export function hexToBigNumber(hex: string): BigNumber { return BigNumber.from(`0x${hex}`); } diff --git a/test/utils/WorldConstants.ts b/test/utils/WorldConstants.ts index 2148434..39971eb 100644 --- a/test/utils/WorldConstants.ts +++ b/test/utils/WorldConstants.ts @@ -33,11 +33,10 @@ export const shrinkingInitializers = settings.parse(settings.Initializers, { INITIAL_WORLD_RADIUS: 3000, TOKEN_MINT_END_TIMESTAMP: '3031-05-27T18:59:59.000Z', MIN_RADIUS: 1000, - SHRINK_FACTOR: 2, - SHRINK: true, + SHRINK: 2, WORLD_RADIUS_LOCKED: false, DISC_LOWER_BOUND: 50, - DISC_UPPER_BOUND: 75 + DISC_UPPER_BOUND: 75, }); export const VALID_INIT_PERLIN = initializers.INIT_PERLIN_MIN; From a944c5122e2f5c8c1ef6081ac7bb59aadd8a5ede Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 10:56:51 -0800 Subject: [PATCH 12/35] set token end timestamp --- darkforest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darkforest.toml b/darkforest.toml index f8be8b6..ad70511 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -4,7 +4,7 @@ [initializers] ADMIN_CAN_ADD_PLANETS = true WORLD_RADIUS_LOCKED = false -TOKEN_MINT_END_TIMESTAMP = 2021-10-05T04:00:00.000Z # Mon Oct 04 2021 21:00:00 GMT-0700 (Pacific Daylight Time) +TOKEN_MINT_END_TIMESTAMP = 2022-01-04T15:35:00.000Z # Jan 4, 2022, 11:59:00 PM (EST) TARGET4_RADIUS = 1600 INITIAL_WORLD_RADIUS = 8000 From 3e82a653c6c3a56d67a62d454401059978aaaa82 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 13:17:09 -0800 Subject: [PATCH 13/35] working whitelist flow --- addresses.txt | 3 + contracts/Whitelist.sol | 57 ++++++++++++++++-- tasks/whitelist.ts | 114 +++++++++++++++++++++++++++++++++++- test/NoKeyWhitelist.test.ts | 103 ++++++++++++++++++++++++++++++++ 4 files changed, 270 insertions(+), 7 deletions(-) create mode 100644 addresses.txt create mode 100644 test/NoKeyWhitelist.test.ts diff --git a/addresses.txt b/addresses.txt new file mode 100644 index 0000000..f9b0ae5 --- /dev/null +++ b/addresses.txt @@ -0,0 +1,3 @@ +0x3097403b64fe672467345bf159f4c9c5464bd89e, +0x1c0f0af3262a7213e59be7f1440282279d788335, +0xe8170282c5bc6e7c5b2d984cd5d897a05e0afafb, \ No newline at end of file diff --git a/contracts/Whitelist.sol b/contracts/Whitelist.sol index 9b94298..f4af703 100644 --- a/contracts/Whitelist.sol +++ b/contracts/Whitelist.sol @@ -6,10 +6,12 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract Whitelist is Initializable { bool whitelistEnabled; uint256 public drip; - mapping(address => bool) allowedAccounts; + mapping(address => bool) public allowedAccounts; + mapping(address => bool) public receivedDrip; mapping(bytes32 => bool) allowedKeyHashes; - address[] allowedAccountsArray; + address[] public allowedAccountsArray; address admin; + uint256 public numPlayers; // administrative modifier onlyAdmin() { @@ -23,7 +25,7 @@ contract Whitelist is Initializable { // initialization functions are only called once during deployment. They are not called during upgrades. function initialize(address _admin, bool _whitelistEnabled) public initializer { - drip = 0.05 ether; + drip = 0.15 ether; admin = _admin; whitelistEnabled = _whitelistEnabled; } @@ -33,6 +35,18 @@ contract Whitelist is Initializable { return allowedAccountsArray.length; } + function bulkGetWhitelistIds(uint256 startIdx, uint256 endIdx) + public + view + returns (address[] memory ret) + { + // return slice of players array from startIdx through endIdx - 1 + ret = new address[](endIdx - startIdx); + for (uint256 i = startIdx; i < endIdx; i++) { + ret[i - startIdx] = allowedAccountsArray[i]; + } + } + function isWhitelisted(address _addr) public view returns (bool) { if (!whitelistEnabled) { return true; @@ -40,18 +54,51 @@ contract Whitelist is Initializable { return allowedAccounts[_addr]; } + // Don't need for no whitelist function isKeyValid(string memory key) public view returns (bool) { bytes32 hashed = keccak256(abi.encodePacked(key)); return allowedKeyHashes[hashed]; } - // modify whitelist + // Don't need for no whitelist function addKeys(bytes32[] memory hashes) public onlyAdmin { for (uint16 i = 0; i < hashes.length; i++) { allowedKeyHashes[hashes[i]] = true; } } + function sendDrip(address _addr) public onlyAdmin { + require(allowedAccounts[_addr], "player not whitelisted"); + require(!receivedDrip[_addr], "player already received drip"); + require(address(this).balance > drip, "not enough $ in contract to drip"); + + receivedDrip[_addr] = true; + (bool success, ) = _addr.call{value: drip}(""); + require(success, "Drip failed."); + } + + function addPlayer(address _addr) public onlyAdmin { + require(!allowedAccounts[_addr], "player already whitelisted"); + allowedAccounts[_addr] = true; + allowedAccountsArray.push(_addr); + numPlayers++; + } + + function addAndDripPlayers(address[] calldata players) public onlyAdmin { + for(uint256 i = 0; i < players.length; i++) { + address player = players[i]; + + // extra check to avoid reverting in loop + if(!allowedAccounts[player]) { + addPlayer(player); + } + // extra check to avoid reverting in loop + if(allowedAccounts[player] && !receivedDrip[player] && address(this).balance > drip) { + sendDrip(player); + } + } + } + function useKey(string memory key, address owner) public onlyAdmin { require(!allowedAccounts[owner], "player already whitelisted"); bytes32 hashed = keccak256(abi.encodePacked(key)); @@ -81,4 +128,4 @@ contract Whitelist is Initializable { function receiveEther() external payable {} receive() external payable {} -} +} \ No newline at end of file diff --git a/tasks/whitelist.ts b/tasks/whitelist.ts index c02e93c..77eab7a 100644 --- a/tasks/whitelist.ts +++ b/tasks/whitelist.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import { subtask, task, types } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import type { Whitelist } from '../task-types'; +import type { Whitelist, DarkForestCore } from '../task-types'; import { generateKey, generateKeys, keysPerTx } from './whitelist-helpers'; task('whitelist:changeDrip', 'change the faucet amount for whitelisted players') @@ -120,6 +120,116 @@ async function whitelistExistsKey(args: { key: string }, hre: HardhatRuntimeEnvi console.log(`Key ${args.key} is${isValid ? '' : ' NOT'} valid.`); } +task( + 'whitelist-nokey:register', + 'path to csv file of addresses' +) + .addParam( + 'path', + 'file path to csv of addresses', + undefined, + types.string +) +.setAction(noKeyWhitelistRegister); + +async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntimeEnvironment) { + await hre.run('utils:assertChainId'); + + const whitelist: Whitelist = await hre.run('utils:getWhitelist'); + + const drip = hre.ethers.utils.formatEther(await whitelist.drip()); + console.log("drip", drip); + + const prevBalance = await hre.ethers.provider.getBalance(whitelist.address); + const prevBalanceEth = parseFloat(hre.ethers.utils.formatEther(prevBalance)); + console.log('whitelist balance:', prevBalanceEth); + + const prevPlayers = await whitelist.numPlayers(); + console.log('num whitelisted players before adding:', prevPlayers.toNumber()); + + const allowedAccounts = await whitelist.bulkGetWhitelistIds(hre.ethers.constants.Zero, prevPlayers); + /// console.log('allowed accounts', allowedAccounts); + + let addresses = ""; + console.log("path", args.path); + addresses = fs.readFileSync(args.path, 'utf8') + // remove new line + addresses = addresses.replace(/\n|\r/g,''); + if(!addresses) { + console.log("failed to read addresses"); + return; + } + + const finalAddresses = addresses.split(','); + + // also filter for whitelisted addresses that are already in game. + let validAddresses = finalAddresses + .filter(hre.ethers.utils.isAddress) + .filter(acc => !allowedAccounts.includes(acc)); // Filter out accounts that are already whitelisted. + + const slice = 100; + + validAddresses = validAddresses.slice(0,500); + + console.log("total players to add", validAddresses.length); + console.log(`require ${parseFloat(drip) * validAddresses.length} < ${prevBalanceEth} in contract`); + + if( (parseFloat(drip) * validAddresses.length) >= prevBalanceEth) { + console.log("not enough eth in contract. Add more before whitelisting"); + return; + } + + if(validAddresses.length === 0) { + console.log("no valid addresses to register"); + return; + } + + // batch into chunks of 100 + for(let i = 0; i < validAddresses.length; i+=slice) { + console.log(`examining index ${i} to ${i + slice}`); + const addressChunk = validAddresses.slice(i, i + slice); + + console.log("chunk players to add", addressChunk.length); + if(addressChunk.length == 0) { + console.log("no addresses to chunk") + continue; + } + + const prevBalance = await hre.ethers.provider.getBalance(whitelist.address); + + console.log("drip", drip); + console.log(parseFloat(drip)); + console.log("expected amount in whitelist", parseFloat(drip) * addressChunk.length); + + if( parseFloat(drip) * addressChunk.length > parseFloat(hre.ethers.utils.formatEther(prevBalance))) { + console.log("not enough eth in contract. Add more before whitelisting"); + break; + } + console.log('whitelist balance before adding:', parseFloat(hre.ethers.utils.formatEther(prevBalance))); + + const prevPlayers = await whitelist.numPlayers(); + console.log('num whitelisted players before adding:', prevPlayers.toNumber()); + + const addTx = await whitelist.addAndDripPlayers(addressChunk); + await addTx.wait(); + + const currBalance = await hre.ethers.provider.getBalance(whitelist.address); + console.log('whitelist balance after adding:', hre.ethers.utils.formatEther(currBalance)); + + const currPlayers = await whitelist.numPlayers(); + console.log('num whitelisted players after adding:', currPlayers.toNumber()); + + const newPlayers = currPlayers.sub(prevPlayers).toNumber() + if(newPlayers != addressChunk.length) { + console.log("WARNING: not all players in list were successfully added"); + } + + const sentAmount = hre.ethers.utils.formatEther(prevBalance.sub(currBalance)); + + console.log(`[${new Date()}] Registered ${newPlayers} players with $${sentAmount} xDAI.`); + } +} + task( 'whitelist:register', 'add address to whitelist contract with given key if provided, or on-the-fly-generated key if not provided' @@ -213,4 +323,4 @@ async function whitelistRegisterKey( console.log('whitelist balance:', hre.ethers.utils.formatEther(balance)); console.log(`[${new Date()}] Registered player ${args.address} with key ${args.key}.`); -} +} \ No newline at end of file diff --git a/test/NoKeyWhitelist.test.ts b/test/NoKeyWhitelist.test.ts new file mode 100644 index 0000000..48d29a1 --- /dev/null +++ b/test/NoKeyWhitelist.test.ts @@ -0,0 +1,103 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; +import { fixtureLoader, makeInitArgs } from './utils/TestUtils'; +import { whilelistWorldFixture, World } from './utils/TestWorld'; + +const { utils } = ethers; + +describe('NoKeyDarkForestWhitelist', function () { + let world: World; + + async function worldFixture() { + const world = await fixtureLoader(whilelistWorldFixture); + await world.contracts.whitelist.addAndDripPlayers([ + world.user1.address, + ]); + + return world; + } + + beforeEach('load fixture', async function () { + world = await fixtureLoader(worldFixture); + }); + + + it('should reject change admin if not admin', async function () { + await expect(world.user2Whitelist.changeAdmin(world.user1.address)).to.be.revertedWith( + 'Only administrator can perform this action' + ); + }); + + it('should reject add players if not admin', async function () { + await expect( + world.user2Whitelist.addAndDripPlayers([world.user2.address]) + ).to.be.revertedWith('Only administrator can perform this action'); + }); + + it('should increase numPlayers after player is whitelisted', async function () { + const prevPlayers = await world.contracts.whitelist.numPlayers(); + + const addTx = await world.contracts.whitelist.addAndDripPlayers([world.user2.address]); + + const currPlayers = await world.contracts.whitelist.numPlayers(); + + expect(currPlayers).to.equal(prevPlayers.add(ethers.BigNumber.from("1"))); + }) + + it('should confirm a whitelisted player\'s balance has increased by drip amt', async function () { + const drip = await world.contracts.whitelist.drip(); + expect(drip).to.equal(utils.parseEther('0.15')); + await expect( + await world.contracts.whitelist.addAndDripPlayers([world.user2.address]) + ).to.changeEtherBalance(world.user2, drip); + }); + + it('should approve a player who is whitelisted', async function () { + expect( + await world.user1Whitelist.isWhitelisted(world.user1.address) + ).to.be.true; + }); + + it('should reject a player who is not whitelisted', async function () { + expect( + await world.user1Whitelist.isWhitelisted(world.user2.address) + ).to.be.false; + }); + + it('should reject drip to a player who is not whitelisted', async function () { + await expect( + world.contracts.whitelist.sendDrip(world.user2.address) + ).to.be.revertedWith('player not whitelisted'); + }); + + it('should reject drip to a player who is whitelisted but has received drip', async function () { + await expect( + world.contracts.whitelist.sendDrip(world.user1.address) + ).to.be.revertedWith('player already received drip'); + }); + + it('should NOT drip and NOT revert if drip > contract balance, but still whitelist', async function () { + const [deployer, user1, user2, user3 ] = await ethers.getSigners(); + + const dripTx = await world.contracts.whitelist.changeDrip(utils.parseEther('10.0')); + await dripTx.wait(); + + const drip = await world.contracts.whitelist.drip(); + + expect(drip).to.equal(utils.parseEther('10.0')); + + const prevBalance = await user2.getBalance(); + await world.contracts.whitelist.addAndDripPlayers([user2.address]); + const currBalance = await user2.getBalance(); + expect(prevBalance).to.equal(currBalance); + expect( + await world.user1Whitelist.isWhitelisted(world.user2.address) + ).to.be.true; + }); + + // drip 0.15 on addPlayers + // allow DisruptBanksy to send POKT money as desired. + // some check about contract out of money + // whitelist contract has 0.5 ether to start. + +}); \ No newline at end of file From 0d16a9c9527ec6d8f4325d1973e6a35064906f9b Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 15:35:01 -0800 Subject: [PATCH 14/35] update .toml with correct timestamps --- darkforest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/darkforest.toml b/darkforest.toml index ad70511..3d64aa9 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -4,7 +4,7 @@ [initializers] ADMIN_CAN_ADD_PLANETS = true WORLD_RADIUS_LOCKED = false -TOKEN_MINT_END_TIMESTAMP = 2022-01-04T15:35:00.000Z # Jan 4, 2022, 11:59:00 PM (EST) +TOKEN_MINT_END_TIMESTAMP = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) TARGET4_RADIUS = 1600 INITIAL_WORLD_RADIUS = 8000 @@ -23,9 +23,9 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 # Game configuration # ###################### SHRINK = 2 # No shrink if 0 -# SHRINK_START: withDefault(dateInSeconds, Math.floor(Date.now() / 1000)), // Current time in seconds -# ROUND_END: withDefault(dateInSeconds, Math.floor(Date.now() / 1000) + 600), // 10 minute round is default -MIN_RADIUS = 1 +# SHRINK_START = # 2022-01-01T20:00:00.000Z Jan 1, 2022, 12:00:00 PM +# ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) +MIN_RADIUS = 400 # SHOULD be 5% of INITIAL_WORLD_RADIUS. DESTROY_THRESHOLD = 2 MAX_NATURAL_PLANET_LEVEL = 256 TIME_FACTOR_HUNDREDTHS = 6000 # speedup/slowdown game From 9f1c1979c614a17d42386402974a61ed5ed87585 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 16:11:53 -0800 Subject: [PATCH 15/35] add lowercase for whitelisting --- tasks/whitelist.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tasks/whitelist.ts b/tasks/whitelist.ts index 77eab7a..a4c50a2 100644 --- a/tasks/whitelist.ts +++ b/tasks/whitelist.ts @@ -147,8 +147,9 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim const prevPlayers = await whitelist.numPlayers(); console.log('num whitelisted players before adding:', prevPlayers.toNumber()); - const allowedAccounts = await whitelist.bulkGetWhitelistIds(hre.ethers.constants.Zero, prevPlayers); - /// console.log('allowed accounts', allowedAccounts); + const allowedAccounts = await whitelist.bulkGetWhitelistIds(hre.ethers.constants.Zero, prevPlayers) as string[]; + const lowerCaseAccounts = allowedAccounts.map(acc => acc.toLowerCase()); + console.log('allowed accounts', allowedAccounts); let addresses = ""; console.log("path", args.path); @@ -164,13 +165,15 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim // also filter for whitelisted addresses that are already in game. let validAddresses = finalAddresses + .map(acc => acc.toLowerCase()) .filter(hre.ethers.utils.isAddress) - .filter(acc => !allowedAccounts.includes(acc)); // Filter out accounts that are already whitelisted. + .filter(acc => !lowerCaseAccounts.includes(acc)); // Filter out accounts that are already whitelisted. const slice = 100; - validAddresses = validAddresses.slice(0,500); + validAddresses = validAddresses.slice(0,slice); + console.log('validAddresses', validAddresses) console.log("total players to add", validAddresses.length); console.log(`require ${parseFloat(drip) * validAddresses.length} < ${prevBalanceEth} in contract`); @@ -201,10 +204,11 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim console.log(parseFloat(drip)); console.log("expected amount in whitelist", parseFloat(drip) * addressChunk.length); - if( parseFloat(drip) * addressChunk.length > parseFloat(hre.ethers.utils.formatEther(prevBalance))) { + if(parseFloat(drip) * addressChunk.length > parseFloat(hre.ethers.utils.formatEther(prevBalance))) { console.log("not enough eth in contract. Add more before whitelisting"); break; } + console.log('whitelist balance before adding:', parseFloat(hre.ethers.utils.formatEther(prevBalance))); const prevPlayers = await whitelist.numPlayers(); From bacdfa218df1d75f5a80d4d9a9f96e52aced81db Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 16:12:24 -0800 Subject: [PATCH 16/35] add my address --- addresses.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addresses.txt b/addresses.txt index f9b0ae5..2728903 100644 --- a/addresses.txt +++ b/addresses.txt @@ -1,3 +1,4 @@ 0x3097403b64fe672467345bf159f4c9c5464bd89e, 0x1c0f0af3262a7213e59be7f1440282279d788335, -0xe8170282c5bc6e7c5b2d984cd5d897a05e0afafb, \ No newline at end of file +0xe8170282c5bc6e7c5b2d984cd5d897a05e0afafb, +0xb97eea0763611d1abaae833b3e99a5e269ec314e \ No newline at end of file From 6158997717557b365d9f807482115dbcbcb19ace Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Thu, 30 Dec 2021 18:56:59 -0800 Subject: [PATCH 17/35] subgraph edits --- subgraph/schema.graphql | 3 +-- subgraph/src/helpers/arrivalHelpers.ts | 8 ++++++++ subgraph/src/mapping.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index b0b54da..b25ca89 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -5,7 +5,6 @@ type Player @entity { "allows null because 0x0000000000000000000000000000000000000000 has no homeWorld" homeWorld: Planet score: BigInt! - destroyedScore: BigInt! lastRevealTimestamp: Int! planets: [Planet!]! @derivedFrom(field: "owner") sentVoyages: [Arrival!]! @derivedFrom(field: "player") @@ -63,7 +62,7 @@ type Planet @entity { isRevealed: Boolean! "planet's x,y coordinate, if revealed" revealedCoordinate: RevealedCoordinate - radius: Int! + # revealedRadius: Int! # artifacts hasTriedFindingArtifact: Boolean! diff --git a/subgraph/src/helpers/arrivalHelpers.ts b/subgraph/src/helpers/arrivalHelpers.ts index 96f8fd4..6560d6c 100644 --- a/subgraph/src/helpers/arrivalHelpers.ts +++ b/subgraph/src/helpers/arrivalHelpers.ts @@ -110,6 +110,14 @@ export function arrive(toPlanet: Planet, arrival: Arrival): Planet { } else { // conquers planet // if(criteria) toPlanet.destroyed = true; + // DESTROY_THRESHOLD is hard coded. + // const DESTROY_THRESHOLD = 2; + // if(hasOwner(toPlanet) && DESTROY_THRESHOLD > 0) { + // if(effectiveEnergy > toPlanet.milliEnergyLazy.times(BigInt.fromI32(DESTROY_THRESHOLD))) { + // toPlanet.destroyed = true; + // } + // } + toPlanet.owner = arrival.player; const effectiveDefendingEnergy = toPlanet.milliEnergyLazy .times(BigInt.fromI32(toPlanet.defense)) diff --git a/subgraph/src/mapping.ts b/subgraph/src/mapping.ts index 4c719ee..c4d6893 100644 --- a/subgraph/src/mapping.ts +++ b/subgraph/src/mapping.ts @@ -307,7 +307,6 @@ export function handleLocationRevealed(event: LocationRevealed): void { const planetDatas = getters.bulkGetPlanetsDataByIds([event.params.loc]); const rawData = planetDatas[0]; planet = refreshPlanetFromContractData(event.params.loc, rawData.planet, rawData.info); - // planet.radius = DO this math. planet.save(); } @@ -318,6 +317,7 @@ export function handleLocationRevealed(event: LocationRevealed): void { coord.save(); planet.revealedCoordinate = planet.id; + // planet.revealedRadius = i32(Math.sqrt(Math.pow(coord.x,2) + Math.pow(coord.y,2))) planet.isRevealed = true; planet.save(); } From cd944990cbebc503e1f77b56c593783b0d53ccb8 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Thu, 30 Dec 2021 21:46:50 -0800 Subject: [PATCH 18/35] working subgraph for death of the universe --- subgraph/schema.graphql | 3 ++- subgraph/src/helpers/arrivalHelpers.ts | 25 +++++++++++++++---------- subgraph/src/mapping.ts | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index b25ca89..c8f6b5c 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -5,6 +5,7 @@ type Player @entity { "allows null because 0x0000000000000000000000000000000000000000 has no homeWorld" homeWorld: Planet score: BigInt! + destroyedScore: BigInt! lastRevealTimestamp: Int! planets: [Planet!]! @derivedFrom(field: "owner") sentVoyages: [Arrival!]! @derivedFrom(field: "player") @@ -62,7 +63,7 @@ type Planet @entity { isRevealed: Boolean! "planet's x,y coordinate, if revealed" revealedCoordinate: RevealedCoordinate - # revealedRadius: Int! + revealedRadius: Int! # artifacts hasTriedFindingArtifact: Boolean! diff --git a/subgraph/src/helpers/arrivalHelpers.ts b/subgraph/src/helpers/arrivalHelpers.ts index 6560d6c..ca76c19 100644 --- a/subgraph/src/helpers/arrivalHelpers.ts +++ b/subgraph/src/helpers/arrivalHelpers.ts @@ -1,9 +1,9 @@ /* eslint-disable eqeqeq */ import { BigDecimal, BigInt } from '@graphprotocol/graph-ts'; -import { Arrival, Planet } from '../../generated/schema'; +import { Arrival, Planet, Player } from '../../generated/schema'; function hasOwner(planet: Planet): boolean { - return planet.owner !== '0x0000000000000000000000000000000000000000'; + return planet.owner != '0x0000000000000000000000000000000000000000'; } function getSilverOverTime(planet: Planet, startTimeS: i32, endTimeS: i32): BigInt { @@ -95,7 +95,7 @@ export function arrive(toPlanet: Planet, arrival: Arrival): Planet { // apply energy const shipsMoved = arrival.milliEnergyArriving; - if (arrival.player !== toPlanet.owner) { + if (arrival.player != toPlanet.owner) { // attacking enemy - includes emptyAddress const effectiveEnergy = shipsMoved .times(BigInt.fromI32(100)) @@ -111,13 +111,18 @@ export function arrive(toPlanet: Planet, arrival: Arrival): Planet { // conquers planet // if(criteria) toPlanet.destroyed = true; // DESTROY_THRESHOLD is hard coded. - // const DESTROY_THRESHOLD = 2; - // if(hasOwner(toPlanet) && DESTROY_THRESHOLD > 0) { - // if(effectiveEnergy > toPlanet.milliEnergyLazy.times(BigInt.fromI32(DESTROY_THRESHOLD))) { - // toPlanet.destroyed = true; - // } - // } - + const DESTROY_THRESHOLD = 2; + if(hasOwner(toPlanet) && DESTROY_THRESHOLD > 0) { + if(effectiveEnergy.gt(toPlanet.milliEnergyLazy.times(BigInt.fromI32(DESTROY_THRESHOLD)))) { + toPlanet.destroyed = true; + const player = Player.load(arrival.player); + if (player) { + const scoreToAdd = BigInt.fromI32(i32(Math.pow(4,toPlanet.planetLevel))); + player.destroyedScore = player.destroyedScore.plus(scoreToAdd); + player.save(); + } + } + } toPlanet.owner = arrival.player; const effectiveDefendingEnergy = toPlanet.milliEnergyLazy .times(BigInt.fromI32(toPlanet.defense)) diff --git a/subgraph/src/mapping.ts b/subgraph/src/mapping.ts index c4d6893..5856179 100644 --- a/subgraph/src/mapping.ts +++ b/subgraph/src/mapping.ts @@ -317,7 +317,7 @@ export function handleLocationRevealed(event: LocationRevealed): void { coord.save(); planet.revealedCoordinate = planet.id; - // planet.revealedRadius = i32(Math.sqrt(Math.pow(coord.x,2) + Math.pow(coord.y,2))) + planet.revealedRadius = i32(Math.sqrt(Math.pow(coord.x,2) + Math.pow(coord.y,2))) + 1; planet.isRevealed = true; planet.save(); } From 33600690741c78df477976e7469535dc068faa5d Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 09:46:54 -0800 Subject: [PATCH 19/35] make _updateWorldRadius public in case of emergency --- contracts/DarkForestCore.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/DarkForestCore.sol b/contracts/DarkForestCore.sol index 7525f94..451a16e 100644 --- a/contracts/DarkForestCore.sol +++ b/contracts/DarkForestCore.sol @@ -170,7 +170,7 @@ contract DarkForestCore is Initializable, DarkForestStorageV1 { ////////////// // Private helpers that modify state - function _updateWorldRadius() private { + function _updateWorldRadius() public { if (!s.WORLD_RADIUS_LOCKED) { s.worldRadius = DarkForestUtils._getRadius(); emit RadiusUpdated(s.worldRadius); From 9bf75448591150145b612ec43991064ef5a78fb6 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 10:38:22 -0800 Subject: [PATCH 20/35] remove console.log --- contracts/DarkForestPlanet.sol | 1 - contracts/DarkForestUtils.sol | 8 -------- 2 files changed, 9 deletions(-) diff --git a/contracts/DarkForestPlanet.sol b/contracts/DarkForestPlanet.sol index e7c5ea8..3b2653d 100644 --- a/contracts/DarkForestPlanet.sol +++ b/contracts/DarkForestPlanet.sol @@ -382,7 +382,6 @@ library DarkForestPlanet { uint256 radius = s().worldRadius; uint256 upperQuartile = (radius * s().gameConstants.DISC_UPPER_BOUND) / 100; uint256 lowerQuartile = (radius * s().gameConstants.DISC_LOWER_BOUND) / 100; - console.log("lowerQuartile %s upperQuartile %s player radius %s", lowerQuartile, upperQuartile, _radius); require(_radius >= lowerQuartile, "Init radius is too low"); require(_radius <= upperQuartile, "Init radius is too high"); } diff --git a/contracts/DarkForestUtils.sol b/contracts/DarkForestUtils.sol index 44b5335..68b5e3f 100644 --- a/contracts/DarkForestUtils.sol +++ b/contracts/DarkForestUtils.sol @@ -5,7 +5,6 @@ pragma solidity ^0.8.0; import "./ABDKMath64x64.sol"; import "./DarkForestTypes.sol"; import "./DarkForestTokens.sol"; -import "hardhat/console.sol"; library DarkForestUtils { // the only contract that ever calls this is DarkForestCore, which has a known storage layout @@ -152,19 +151,14 @@ library DarkForestUtils { function _shrinkRadius() internal view returns (uint256) { uint256 radius = s().worldRadius; - console.log("curr radius is %s", radius); uint256 shrinkFactor = s().gameConstants.SHRINK; uint256 totalTime = s().gameConstants.ROUND_END - s().gameConstants.SHRINK_START; // Only shrink after START_TIME has occurred. Allows for delaying of shrinking. uint256 startTime = s().gameConstants.SHRINK_START > block.timestamp ? block.timestamp: s().gameConstants.SHRINK_START; uint256 minRadius = s().gameConstants.MIN_RADIUS; uint256 timeElapsed = block.timestamp - startTime; - console.log("time Elapsed %s", timeElapsed); - console.log("total time %s vs time elapsed %s", totalTime, timeElapsed); // Clip timeElapsed to max totalTime if(timeElapsed > totalTime) timeElapsed = totalTime; - console.log("total time %s vs time elapsed %s", totalTime, timeElapsed); - // only shrink after initial time elapsed. radius = ( @@ -176,10 +170,8 @@ library DarkForestUtils { ) / totalTime**shrinkFactor; - console.log("pre min check radius is %s", radius); // set minimum if (radius < minRadius) radius = minRadius; - console.log("post min check radius is %s", radius); return radius; } From d83af1379fff19177d3ac4ac5255a5639ed707d0 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 10:38:32 -0800 Subject: [PATCH 21/35] remove log --- test/utils/TestUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/utils/TestUtils.ts b/test/utils/TestUtils.ts index 7df3644..b2a045b 100644 --- a/test/utils/TestUtils.ts +++ b/test/utils/TestUtils.ts @@ -48,10 +48,8 @@ export function shrinkAlgorithm( ) / Math.pow(totalTime,shrinkFactor); - console.log("pre min check radius is %s", radius); // // set minimum if (radius < minRadius) radius = minRadius; - console.log("post min check radius is %s", radius); return Math.floor(radius); } From 4a6c3e4553066a2acba9884e41639707beae854a Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 10:57:00 -0800 Subject: [PATCH 22/35] fix silver withdrawal test --- test/DFShrink.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/DFShrink.test.ts b/test/DFShrink.test.ts index f4e3d71..aff6215 100644 --- a/test/DFShrink.test.ts +++ b/test/DFShrink.test.ts @@ -115,8 +115,8 @@ describe('DarkForestShrink', function () { beforeEach(async function () { world = await fixtureLoader(defaultWorldFixture); - await world.contracts.core.adminSetWorldRadius(initializers.INITIAL_WORLD_RADIUS); - await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1, SPAWN_PLANET_1.distFromOrigin)); + // await world.contracts.core.adminSetWorldRadius(initializers.INITIAL_WORLD_RADIUS); + await world.user1Core.initializePlayer(...makeInitArgs(SPAWN_PLANET_1)); // Conquer MINE_REGULAR and LVL3_SPACETIME_1 to accumulate silver await conquerUnownedPlanet(world, world.user1Core, SPAWN_PLANET_1, LVL1_ASTEROID_1); From 4f7d92ddaf22e3139efc49b4442ea055e50a2ce3 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 20:13:32 -0800 Subject: [PATCH 23/35] update admin tasks --- tasks/game.ts | 47 ++++++++++++++++++++++++++++++++++++++++++++++ tasks/whitelist.ts | 3 ++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/tasks/game.ts b/tasks/game.ts index f2c0749..b9c9030 100644 --- a/tasks/game.ts +++ b/tasks/game.ts @@ -49,6 +49,53 @@ async function gameSetRadius(args: { radius: number }, hre: HardhatRuntimeEnviro await setRadiusReceipt.wait(); } +task('game:setShrinkStart', 'change the shrink start') + .addPositionalParam('timestamp', 'the timestamp', undefined, types.int) + .setAction(setShrinkStart); + +async function setShrinkStart(args: { timestamp: number }, hre: HardhatRuntimeEnvironment) { + await hre.run('utils:assertChainId'); + + const darkForest: DarkForestCore = await hre.run('utils:getCore'); + + const setShrinkReceipt = await darkForest.setShrinkStart(BigNumber.from(args.timestamp)); + await setShrinkReceipt.wait(); + const newShrink = (await darkForest.gameConstants()).SHRINK_START; + console.log("new shrink", newShrink.toNumber()) +} + +task('game:setRoundEnd', 'change the round end') + .addPositionalParam('timestamp', 'the timestamp', undefined, types.int) + .setAction(setRoundEnd); + +async function setRoundEnd(args: { timestamp: number }, hre: HardhatRuntimeEnvironment) { + await hre.run('utils:assertChainId'); + + const darkForest: DarkForestCore = await hre.run('utils:getCore'); + + const setShrinkReceipt = await darkForest.setRoundEnd(BigNumber.from(args.timestamp)); + await setShrinkReceipt.wait(); + const newEnd = (await darkForest.gameConstants()).ROUND_END; + console.log("new end", newEnd.toNumber()); +} + +task('game:refreshRadius', 'refreshRadius') + .setAction(refreshRadius); + +async function refreshRadius(args: {}, hre: HardhatRuntimeEnvironment) { + await hre.run('utils:assertChainId'); + + const darkForest: DarkForestCore = await hre.run('utils:getCore'); + + const setShrinkReceipt = await darkForest._updateWorldRadius(); + await setShrinkReceipt.wait(); + const radius = (await darkForest.worldRadius()); + console.log("radius", radius.toNumber()); +} + + + + task('game:setTarget4RadiusConstant', 'change the target4RadiusConstant') .addPositionalParam( 'target4RadiusConstant', diff --git a/tasks/whitelist.ts b/tasks/whitelist.ts index a4c50a2..22f6b0c 100644 --- a/tasks/whitelist.ts +++ b/tasks/whitelist.ts @@ -136,6 +136,7 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim await hre.run('utils:assertChainId'); const whitelist: Whitelist = await hre.run('utils:getWhitelist'); + console.log("whitelis address", whitelist.address); const drip = hre.ethers.utils.formatEther(await whitelist.drip()); console.log("drip", drip); @@ -149,7 +150,7 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim const allowedAccounts = await whitelist.bulkGetWhitelistIds(hre.ethers.constants.Zero, prevPlayers) as string[]; const lowerCaseAccounts = allowedAccounts.map(acc => acc.toLowerCase()); - console.log('allowed accounts', allowedAccounts); + console.log('allowed accounts', lowerCaseAccounts); let addresses = ""; console.log("path", args.path); From 520944f73107fc71e6c93caf32b6686351bdf781 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Fri, 31 Dec 2021 20:22:22 -0800 Subject: [PATCH 24/35] prod version of Verifier.sol --- contracts/Verifier.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/Verifier.sol b/contracts/Verifier.sol index 9497813..7accfa7 100644 --- a/contracts/Verifier.sol +++ b/contracts/Verifier.sol @@ -286,7 +286,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([12599857379517512478445603412764121041984228075771497593287716170335433683702,7912208710313447447762395792098481825752520616755888860068004689933335666613], [11502426145685875357967720478366491326865907869902181704031346886834786027007,21679208693936337484429571887537508926366191105267550375038502782696042114705]); + vk.delta2 = Pairing.G2Point([20131663352701264377208155520883810774996572133901224066122799158074743548661,18297748804274590066021933111184511416577950252643389119829431022657465812890], [2785786821571952675114539807274915558835153734567103548399308862186630606545,3760039685404799102669031110597259991560763993199219342225417519183869011826]); vk.IC = new Pairing.G1Point[](9); vk.IC[0] = Pairing.G1Point(1598626181488966834385142702072340632701729613588553898141479831063364046244,17718230806281540722028825298558518558905695159801697318226319873036301566727); vk.IC[1] = Pairing.G1Point(15948659782990752942887133907536447435191600109534617758082114399428869442993,11099101392431127819059666871299914860584228203768799086923186847076507315534); @@ -316,7 +316,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); + vk.delta2 = Pairing.G2Point([15676073592377597073711528856339460342674387339918080106538797151886226740171,2330073040773782664525142077397849353959241999587063072167183570940318799849], [9108333819270880347725104068902675947834486470063754157260763398744985625496,8459627557579508741770636657046752095372010664740912717331888888678079234554]); vk.IC = new Pairing.G1Point[](11); vk.IC[0] = Pairing.G1Point(14177816537775685783067647996272395454522594113428919821714589771180610568314,6823299126837656023989613525270949531672774579800418483384480496108911392326); vk.IC[1] = Pairing.G1Point(11585636782253030502414616875647660216631207697186549464738288453964312644262,16366617865324088972494410389765901462344692803975117494865461021515474079688); @@ -348,7 +348,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); + vk.delta2 = Pairing.G2Point([9395119555313831384654254305435309339870216117877276846608719582025986581559,14481299150194752819327210171462563055254604112139318264050449182928580132865], [10171254665189764911222262242249233305905228192904680685905220915458804426318,16142276709992611120029381087609334113224186083881414628879855064462450332473]); vk.IC = new Pairing.G1Point[](8); vk.IC[0] = Pairing.G1Point(10870898939986000468532157640231430092356116495039287249548370970435589722710,9637509233802404751050875244565641105864732921095328155747707264762895963694); vk.IC[1] = Pairing.G1Point(19138797608808993399657283067430257583053688297164578482098293101955262780551,20006287987513927804142618424385437530171110155612987617518879163008364014606); @@ -377,7 +377,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([2265134844274426723457876006698460249939887303444156597934859108326277795744,1040851089387492326804450273946202637694128127443277238653689255686985312604], [5432521204675740697545698160262696877452493693467957694849729723272205209808,4388453581474445742202278919193380632481770898177871444044785283573024395786]); + vk.delta2 = Pairing.G2Point([5805631120193347887390089503374629290386996734205828920238471909119996854369,17765028600860864110311499721341709178101182027508450038546280504830400659260], [10509361166074631049839464401038003842870709634837253815868913425907485373089,11819026244651557242231391379854420889202132451603977314768037158779053703596]); vk.IC = new Pairing.G1Point[](10); vk.IC[0] = Pairing.G1Point(11550964137187913352526724844580499338131382138893314699756753981006102732019,19492512945047869932948946467344653872184411292565776553305249475937323729280); vk.IC[1] = Pairing.G1Point(3916477035785360610976006321745916078968774369440543915902405954859488657313,15321034048954067345112787429494548298867833228473430687967681199888641151218); From 0ff7e1e8860b5f70e7b5e82a3f0b0d442376b575 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Sat, 1 Jan 2022 10:55:18 -0800 Subject: [PATCH 25/35] small whitelist taskupdate --- tasks/whitelist.ts | 79 +++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/tasks/whitelist.ts b/tasks/whitelist.ts index 22f6b0c..74834a7 100644 --- a/tasks/whitelist.ts +++ b/tasks/whitelist.ts @@ -129,10 +129,15 @@ task( 'file path to csv of addresses', undefined, types.string +) .addOptionalParam( + 'drip', + 'whether to drip players or not', + undefined, + types.boolean ) .setAction(noKeyWhitelistRegister); -async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntimeEnvironment) { +async function noKeyWhitelistRegister(args: { path: string, drip?: boolean }, hre: HardhatRuntimeEnvironment) { await hre.run('utils:assertChainId'); const whitelist: Whitelist = await hre.run('utils:getWhitelist'); @@ -150,7 +155,7 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim const allowedAccounts = await whitelist.bulkGetWhitelistIds(hre.ethers.constants.Zero, prevPlayers) as string[]; const lowerCaseAccounts = allowedAccounts.map(acc => acc.toLowerCase()); - console.log('allowed accounts', lowerCaseAccounts); + console.log('allowed accounts', lowerCaseAccounts.length); let addresses = ""; console.log("path", args.path); @@ -172,13 +177,13 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim const slice = 100; - validAddresses = validAddresses.slice(0,slice); + // validAddresses = validAddresses.slice(0,slice); - console.log('validAddresses', validAddresses) + // console.log('validAddresses', validAddresses) console.log("total players to add", validAddresses.length); console.log(`require ${parseFloat(drip) * validAddresses.length} < ${prevBalanceEth} in contract`); - if( (parseFloat(drip) * validAddresses.length) >= prevBalanceEth) { + if(args.drip && (parseFloat(drip) * validAddresses.length) >= prevBalanceEth) { console.log("not enough eth in contract. Add more before whitelisting"); return; } @@ -199,39 +204,41 @@ async function noKeyWhitelistRegister(args: { path: string }, hre: HardhatRuntim continue; } - const prevBalance = await hre.ethers.provider.getBalance(whitelist.address); - - console.log("drip", drip); - console.log(parseFloat(drip)); - console.log("expected amount in whitelist", parseFloat(drip) * addressChunk.length); + try { + const prevBalance = await hre.ethers.provider.getBalance(whitelist.address); + console.log("expected amount in whitelist", parseFloat(drip) * addressChunk.length); + + if(args.drip && parseFloat(drip) * addressChunk.length > parseFloat(hre.ethers.utils.formatEther(prevBalance))) { + console.log("not enough eth in contract. Add more before whitelisting"); + break; + } - if(parseFloat(drip) * addressChunk.length > parseFloat(hre.ethers.utils.formatEther(prevBalance))) { - console.log("not enough eth in contract. Add more before whitelisting"); - break; - } - - console.log('whitelist balance before adding:', parseFloat(hre.ethers.utils.formatEther(prevBalance))); - - const prevPlayers = await whitelist.numPlayers(); - console.log('num whitelisted players before adding:', prevPlayers.toNumber()); - - const addTx = await whitelist.addAndDripPlayers(addressChunk); - await addTx.wait(); - - const currBalance = await hre.ethers.provider.getBalance(whitelist.address); - console.log('whitelist balance after adding:', hre.ethers.utils.formatEther(currBalance)); - - const currPlayers = await whitelist.numPlayers(); - console.log('num whitelisted players after adding:', currPlayers.toNumber()); - - const newPlayers = currPlayers.sub(prevPlayers).toNumber() - if(newPlayers != addressChunk.length) { - console.log("WARNING: not all players in list were successfully added"); + console.log('whitelist balance before adding:', parseFloat(hre.ethers.utils.formatEther(prevBalance))); + + const prevPlayers = await whitelist.numPlayers(); + console.log('num whitelisted players before adding:', prevPlayers.toNumber()); + + const addTx = await whitelist.addAndDripPlayers(addressChunk); + await addTx.wait(); + + const currBalance = await hre.ethers.provider.getBalance(whitelist.address); + console.log('whitelist balance after adding:', hre.ethers.utils.formatEther(currBalance)); + + const currPlayers = await whitelist.numPlayers(); + console.log('num whitelisted players after adding:', currPlayers.toNumber()); + + const newPlayers = currPlayers.sub(prevPlayers).toNumber() + if(newPlayers != addressChunk.length) { + console.log("WARNING: not all players in list were successfully added"); + } + + const sentAmount = hre.ethers.utils.formatEther(prevBalance.sub(currBalance)); + + console.log(`[${new Date()}] Registered ${newPlayers} players with $${sentAmount} xDAI.`); + + } catch (error) { + console.log("chunk add failed", error); } - - const sentAmount = hre.ethers.utils.formatEther(prevBalance.sub(currBalance)); - - console.log(`[${new Date()}] Registered ${newPlayers} players with $${sentAmount} xDAI.`); } } From 11d35767eec019805c694c9c86947a9d4cf54c13 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Sat, 1 Jan 2022 10:55:38 -0800 Subject: [PATCH 26/35] needed constants --- darkforestprod.toml | 105 ++++++++++++++++++++++++++++++++++++++++++++ r4addresses.txt | 1 + 2 files changed, 106 insertions(+) create mode 100644 darkforestprod.toml create mode 100644 r4addresses.txt diff --git a/darkforestprod.toml b/darkforestprod.toml new file mode 100644 index 0000000..882ec16 --- /dev/null +++ b/darkforestprod.toml @@ -0,0 +1,105 @@ +# Configuration for a Dark Forest universe +# Defined in TOML as per https://toml.io/en/v0.5.0 + +[initializers] +ADMIN_CAN_ADD_PLANETS = true +WORLD_RADIUS_LOCKED = false +TOKEN_MINT_END_TIMESTAMP = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) +TARGET4_RADIUS = 1600 +INITIAL_WORLD_RADIUS = 300000 # 300000 + +################################## +# SNARK keys & Perlin parameters # +################################## +DISABLE_ZK_CHECKS = false +PLANETHASH_KEY = 2178 +SPACETYPE_KEY = 2179 +BIOMEBASE_KEY = 2170 +PERLIN_MIRROR_X = false +PERLIN_MIRROR_Y = false +PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 + +###################### +# Game configuration # +###################### +SHRINK = 2 # No shrink if 0 +SHRINK_START = 2022-01-01T20:00:00.000Z # Jan 1, 2022, 12:00:00 PM +ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) +MIN_RADIUS = 60000 # SHOULD be 20% of INITIAL_WORLD_RADIUS. +DESTROY_THRESHOLD = 2 +MAX_NATURAL_PLANET_LEVEL = 256 +TIME_FACTOR_HUNDREDTHS = 500 # speedup/slowdown game +PERLIN_THRESHOLD_1 = 1 +PERLIN_THRESHOLD_2 = 2 +PERLIN_THRESHOLD_3 = 18 +INIT_PERLIN_MIN = 1 +INIT_PERLIN_MAX = 31 +SPAWN_RIM_AREA = 0 +BIOME_THRESHOLD_1 = 15 +BIOME_THRESHOLD_2 = 17 +PLANET_RARITY = 16384 +PHOTOID_ACTIVATION_DELAY = 14400 # seconds +LOCATION_REVEAL_COOLDOWN = 1800 # seconds -> 30 minutes +CLAIM_PLANET_COOLDOWN = 10800 # seconds +PLANET_TYPE_WEIGHTS = [ + [ + [1, 0, 0, 0, 0], + [13, 2, 0, 1, 0], + [13, 2, 0, 1, 0], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + [13, 2, 0, 0, 1], + ], + [ + [1, 0, 0, 0, 0], + [13, 2, 1, 0, 0], + [12, 2, 1, 1, 0], + [11, 2, 1, 1, 1], + [12, 2, 1, 0, 1], + [12, 2, 1, 0, 1], + [12, 2, 1, 0, 1], + [12, 2, 1, 0, 1], + [12, 2, 1, 0, 1], + [12, 2, 1, 0, 1], + ], + [ + [1, 0, 0, 0, 0], + [10, 4, 2, 0, 0], + [10, 4, 1, 1, 0], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + [8, 4, 1, 2, 1], + ], + [ + [1, 0, 0, 0, 0], + [11, 4, 1, 0, 0], + [11, 4, 1, 0, 0], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + [7, 4, 2, 2, 1], + ], +] + + +########################## +# Planets to add to game # +########################## +[[planets]] + x = 0 + y = 0 + level = 9 + planetType = 3 + requireValidLocationId = false + revealLocation = true diff --git a/r4addresses.txt b/r4addresses.txt new file mode 100644 index 0000000..3ec9e90 --- /dev/null +++ b/r4addresses.txt @@ -0,0 +1 @@ +0x000000b0c7f3de672d4da5d51e9ddedda06b2991,0x000da2532d5a5f7dcd431d28655b6a942a41e18c,0x00642ad647dfcabe3cc20dd98c385574d3659de2,0x0080231c45d8a282a38a4813e1f1827fc3476a00,0x018fd57d3171c74fcc2e1214e948e333a8a1996c,0x01e7e32b1b4a3da85c29e38ca7d81b159a11dd54,0x021004341db64a77a01eaead4c1cbfba8bedf589,0x02593e4f3f34769220b9d01d9d8fdbe99693be57,0x0295fc6377fbd0fff42e96f57a2f932dfabcacbc,0x02bf838e4a1899075a47653243e16b1e7898827d,0x02e251c10f166f39eeb5635cb26b39f410c6aaec,0x02ebcc92c93c6cce89d7e74388a313b110bab2fe,0x039e5163d708d00d2d94481dd4bf7c788a6cd1c7,0x03ce4cd3c59d7d096af09cf3bffad6d9b111f2f4,0x04131c4e9bb3ee59fdb9679f9b4de4978f6ff607,0x0428d686bd9a7379c08fbaecb368ebbc63de5e01,0x04528ebbd66942b44521979ede0b093dd4d5376a,0x04aa9a28be2a180044990fedd49f17e2d026da6f,0x04e5fc8f7dffc1b9be8611b30f42b2c3c2d3055f,0x058d1cf848a5dc3356a5585ea14ec664a94632e9,0x0615fb8f087398f0493acbc86a57be6917635a59,0x064bf95ce79f1d7b50865409f11014c31c62c6ae,0x066f90999f748c7b36d79ab1090fcaeeffbe4dc3,0x0681b58f866b5878fe3217fe69d660721145a570,0x06bc0232acc8db81797cabec5ba57e4d46f4fdef,0x06e77a5eb8b3eec40e5c49129f9c4cfae01ec5db,0x07168530fda218c4da90d4b3940dfdc9e3b181c6,0x072080b7c7a9e13ed37d4e028ea95607f1c5935e,0x073b6e249c29fb4df4549150c376ccf0e982017f,0x075f2624de59bf5e290601946b45281e9d3e8c3b,0x077c55d52220b8fde0e5b07faa23e2ed49c7efad,0x07dc55037ce3a51a6720a5e89eaf98d72a15f6fe,0x086c1465c72cedddd1789ba7571d809a1b984386,0x09164720c63ba1be232c29ab91c95cd652599aa1,0x0991b883aa99d7dc4f66784932b92cdabf0ce532,0x09c24c9337e1cd7d06a91bf08d5ed1f73e3badd8,0x09c2b921d06d1ebe780ffa2980838fce1dafb23a,0x0a8e2ab5237f8c455989004f15bd2304d20b521d,0x0a94cf9693ae6df22036a598ce71fc4c68935633,0x0b652c646678ca09487435d8f329836fbc2ec6e1,0x0be7d214e7aa75f128cec5022707009a18a5aea7,0x0c24a0154b58d4f2b3e745499b810e59294962a4,0x0cb09691a79fb83b0efd076739d688cd3ab5641a,0x0cb329a69ce796947cd61a4d9a742d5418c7a3cc,0x0d1f98ba5d04fd598db5f970abcbff7e1e1be58e,0x0e10740bc4919f1e36a083fbac1a5adef935ac08,0x0e25f82169cfc23a3adc77a99a67247d7ec0aa87,0x0eb9260f5a91dda354ea935eb5e05e2ab40a7a0b,0x0ec5df94c1c17c0ae95163c3f4e4c9c2c8d87afe,0x0f14c80b798b0cc18f8eb16c6aad375600f1ec0f,0x0f195c701611209589c3342e2040ed4bdbf3c996,0x0f6b5513935c767ca3f86c10b4d90763ac7d4f71,0x0f75f25eb9bc68c8886d6d4828966c58aac3c232,0x0f85cbda0c9488172826c16b86f6accf5f8ac6fc,0x0fb3a5150a593005ba33071b70aafd4925a9ab49,0x0fbed08f678ad127600a740f4758cb82d7c761b8,0x0fc537b385b85e7ffc0400908df73fb4b88e7006,0x0fcdecc7313e9230a634f19b0874d099e5c5f9a7,0x102e277c34668e96cbed6169fa1195002c11d746,0x10343e367b8c18084ae7844b04e1eecba4ad948a,0x1085888e30f51c43f85aa0316b636b20fc610a80,0x10870b5d992084c9cdfc5d078c5a73cd7b334707,0x10db9946358f137decd391e837679901cd1938ed,0x11a24702b0bc93912743d191f704b47a248e8c34,0x11ae5e6335dfc321ed3491390013b324c1418642,0x11ba592fae2f23b3b460a226c9b19e37f33247b8,0x1214a6ffa1fb14d120ffeaa54193cd8527c33feb,0x123013ea30f42bcb9f0555563c89a6ed31c29175,0x12f485536da2bcc0ee33a483640dbfe29df855a8,0x1353305b430256c854747ecb87abef8ddcae8991,0x13cf65ed6dba0135cf5067bd3682cea1627691b9,0x13f4c0b109b457da9c54a51d0909553d2665f7b5,0x1455579945b5009ffef87d9e5c3850780834c7c3,0x149f119543239d0b102bc60e80d0965232229234,0x14d2b918ae4d9bcf383a64931ec750c2d04a600a,0x14f0a78b932b6cea29ef1a5a542bb42d0028e77c,0x14fd58c3030fda36affbd6476c730bfd174bd55f,0x15402d12e3668c2da208826ede319c990c5dc0f3,0x15653638818af28d1075638cb04f5fdd4c2b101d,0x158c4717c7f3103f1dbb20ef0a42473038c0d643,0x15a0ad5869d14f6278178c9917f9881fe74afb8c,0x15da0d774489c6f65584003c36d50af6e3d95307,0x16051ce825155769bb55533c6bff3817a4003256,0x169841aa3024cfa570024eb7dd6bf5f774092088,0x16b66068e8b2ab11ce4b0f63f841a9ddf958a3ea,0x16ed77e2b862512eebf4e251defeaa7f5539cef5,0x1723c129ee943762d6ace8e05caa5830a62a616f,0x188b377db3bc07d626c91d05de8ffbc687d4a0ef,0x194cba71d8b48d91d9ee4e2854e0ca4f6cec4c23,0x19987d30677f082409140e18a1d7a6b34b9de39b,0x19f5a22582d3f8beeecb19a70a3bf50230ad4ff2,0x1bdda56c11a7d5a4ed7cb29e8a525360ea987dcd,0x1be167ec3dd8bcf6322978b7617c66869631858f,0x1c227f6f416b317dcc68aad4fc30a4832f5840bd,0x1c2b5d9b068360971e4f384ef85fbd9f1fa7e0ac,0x1cd6372f3dee6d6a180a271f1eb53b63e62ef588,0x1cf0eb421283bfdd8b8f762ad6b31face8441401,0x1d2da1c0d9b35de4963d423f0fc3fda31b69acce,0x1d888bcfb0900eb34e6615784ef3c58661bd38bf,0x1d9cca96831e694b6a353f61864fc9cc4604a1c2,0x1dcc747ae388a5199160b4e85c88805c1d9acfef,0x1dea26e0c28a3ad472b50efd5b4d2199fb5f819a,0x1e463ec9a0105e8f9af304bcad777af2a40dc490,0x1e6f5f0084181f95321340dedfe43347ff2159fb,0x1e94abdfda8391781e86aff80b8a4bf0a7f846a0,0x1ecd4d5e795d28a89c85c386d6ee38f7d9829bc4,0x1efc207daaffe60f09ad6694ecb410e1045f455c,0x1f152dff14b9fff75bfc4260822dc2d86a79e2bf,0x1f3440cda4bdd6f22aac145e24d604cf05f3cc3b,0x1f67d5c6b1ec544e1f854d638058f927a94b4f3b,0x1fbf7e33c50c1b5895b4d16f213e36afd8d0ba6d,0x20c7c84db2775ffb484ec388c0a360201cb3413e,0x20ce22b58266cd5ddff6d9c3cdf3db80e118d8e6,0x20d3699b3921c8bc034ed171f847866867672536,0x210c5e1c4f7439ff395475284d021b5398ebacec,0x214cc09da236306129586b252d6de5347e3ba7cf,0x21655fd9b8db11ac1253a11baacaaa3638efc548,0x21f00112271832a5564b47d39574565c626c1215,0x22334a9d7aa44b79df4435b3657d60b67da49391,0x2314a3c4953f0ac8c85305c1e614415eeaa86844,0x23ad0d601a40f5950542c9f515568336639a2216,0x23e9063e05239e3873019cea94a82273a7467f8a,0x2407d5e0680176a60bc8203bcfedab89d0b79010,0x2460b58f13f9f65cb0023944aa15cd4c2c233897,0x24aabe37478f1726f890bc6bda432b35c6c1a02c,0x24ce2a78fc0daa22cb6879cec6e51b37fd42905b,0x24d78745b3beeddb9d617ef9282f6c55040a8e7f,0x250cfd08c2bc7173c1c1f972c80b5e165e404b0b,0x251db8bf36d6325cc3b6c24a0338027dfaf6194c,0x25333e6a528ee562f78912077d87385a245b78a6,0x2616b7237705663ed8a54785b828c339fed8fe96,0x264b9ab2fdf7490744236fe999d778ce3adf1133,0x26e695d87d68a738736059201d362501abbc4e1d,0x26f443a1673f16b66e6045a238bb2bfc3fff06bb,0x2707b1ccb254adc56d18be2e0c7a7f13ce8c12c5,0x2742026ed70f6629e5ef06416174e95dec444232,0x274f43322454b50c66c8c865c788bcd49c5b37be,0x27d4847c4b5e73745bf7323ed806624ebe927cc9,0x28067b0075c734c9bfd8c7bc2e170c99534cc028,0x284e953b0a3a2a4c169f158e1511ba35b072b798,0x28640957e082950af6d8905cc918b8adab5a0c71,0x29279dcf03cd4ff1f706b66c45f42635901fb055,0x29439e6e013a5d816566adf708ea115d1bfeaf18,0x2a0cc5ef8aef5ed1ebfb44592b6d71d1e660812d,0x2a433353ce7526e4492f298a78b46fb1594bcd1a,0x2a6834aea6ce8a01e046e2c00f88da85d388ac5e,0x2a6a4aaf24d4e44790e0d677ac885731403523d6,0x2ad0be979792aa631e9e7217c9b03b8142d615f2,0x2adc38e48284fd7edaaec0f13296c9588b76f03c,0x2afdfa5dcfc8358bf9880035aa5a6b85398def2b,0x2b9d9ddc96bc6e49bc94b6e2273621af7ec5b11e,0x2bec8520542dd9eeade6157cd82c6de8918ab73b,0x2c6bdd61f612d9a8ff7b2374d7ca97bf39c8dae9,0x2c79085cfea4265a2c99ee188dd4360cf1b6f9d5,0x2ce3b4ab329cacb3b24a4418e484f4effb602306,0x2d7b82562eed2030ad226e6b177938220bda9048,0x2e561bfb78b4c9172191035fc57afaabc29a5cde,0x2e824af7ebb37c751a56ebdd4f830e99637a2103,0x2ee4df216b9ab5c67c936066f22d58ade4f2505c,0x2f1a6dc3ec7ff8ca9f5864e0fa04d8c13bca9872,0x305de3bf516ed20a9026c9d646676040fba9c5c2,0x3077c106d1345b04da1748046012edfbeb82aab4,0x3091733830ce27ea3c2ee32539b12e1921e8ebb5,0x30a6ad55aea5793bdf09ea153f3034c1cab7b0cc,0x30e5ccc1d9cdfb267891bc744bf70b2bd060b454,0x30f6ba5230133a8460fae65016737d52c94a6fef,0x31726d80390d0e0db08160696f08be1c88eb09bc,0x31db0f7cc3c2ea472c3e0fa6619fa9f54969f0ea,0x3230d6edc57ee1f5453d8bd177089e2a5f0d1104,0x32ab0d99713c29605f6b614d62332dff19d51e91,0x32beef6e3e81737c2a1a8e0eb40dbad24c825af9,0x32c340fddb3fbe6465adbfcaa7d1d8f4ce02c1ec,0x33127b656dcfa6471105b878f2a1e0749924ab4e,0x33be25e259ebbd9130a90c27ed0c05061e0bce74,0x33d0f8cb8f0b2602e627ee71f6e027be7759029c,0x349b481f19d38dcc426df21c7bcec576008e7567,0x34b5ab950331aebca2b95d1d64a6d72809aaa49f,0x34bd983a6b9acd79e9110019246823b65666b2c8,0x34eed82bb44568764c706ed961ffa820109ffa4b,0x350e4ce53c527579c68d4e73110cb003394f504d,0x358af9db7c6077de591033453da69c768e744c4b,0x358be624ac54d2aa429e88e5d54045e0296ac200,0x35993d76310565f863e9e100067203a9c563333c,0x35dd195ba3d2c89a6f134f1d0bbcfe658228c019,0x362653069de3cb7f7e3a306536d2baaf7c6330d4,0x36a077e872413ea1e5d11961b44b00c6ce0fea85,0x36c9d0644e1bcc4c84fb8c9f9c9893bea468704b,0x376160ee79685799cb03e810191417ef4e984f00,0x37af5b9150feafb0ccda01240deec36249e16f53,0x37e93415abd9e2eecb0b0b64641edbcf288fef0f,0x387147acbbc27b053bf13eb15aba89bee50ac756,0x38abadbad8df2abf0aa8115c2fdd62e70f5a03b7,0x39070f6df09950dd0ff788efff6d69b1b691b1cf,0x392f9e425485c702367d68d34dd32afa9509fff2,0x39840c6be78eeb92262438469d06154cf81c8da5,0x39c7d3e713fc22b3747efc46112012736d6c5ab4,0x3a0e97dc05460e6f528a9f8b0be1c73e49fd7568,0x3a599e81c8275490294fc43357889d41ecbf1c3f,0x3a6470f0b28270fbb147965f628c145d8ebe8dc9,0x3a660d53f0fc2ef905a20dc192a66e341b3dd8a6,0x3a74859bea7e7cbb951e69f895359a9a24654a5d,0x3b781951eedef52e47f08c159787f030941dbf90,0x3c53ca3dc5cfeeedc93d7023644fdd32167b4918,0x3d84c6e29ae2913b59b992e5c986341d7920b14a,0x3dc4abe56fe8b27cec3cb1956394b923dd98e366,0x3dd475959eaa79500412d855428c3ac504456e96,0x3dfde70712661fc77ab92bdc2675b6a7554e2e67,0x3e65b1dfa2929058f412b798aaf76d37f305e9be,0x3f300689e640633956f50bb476e4579499d3ecc1,0x3fcfefe391163cf0b8368857e2b3332ec93330b5,0x402d83dd1beb3e7c71488108a760dc0697528898,0x40cd78f1d9b39c81f6332ee9b65bcebe901e348c,0x414108cfc58549f602b773fc3f48935089a1a65d,0x41516cca6ac46677b960cefb14f41e1f03a237b1,0x4180c709d640b2cc5b4372392f311482c4832247,0x41ec43cbcb39531f2814ea57e89274d00562a5e0,0x422864deec2d4b3c3c747ba2bee0a84f22618e07,0x425fb01d232a384b0557960dcca2a6ad88d25302,0x428b5d170845def8719faebddd74b823849edf4e,0x432b3f3e15310c598546d5bfed1e87c5e926b8bf,0x4364e36569e4c14cd8b96122caa25005b5aa46ef,0x43a38ef4269b46560fd34669768348ed63d77cd2,0x44652b6edab8275fa9f88e42ccacfef2c3161469,0x449d9ddf563e9a76cb238edbda5d56537bb4673b,0x44e1126ea1613522474197ba407d1cfe8904e070,0x453783970b3c0642c4f0b442c320843ee4c2fd62,0x45f2f28369a79dbf9154cd705b7095e5dc69eae6,0x4685cbba13a75d94ab62915bc2e51ea91ef73c90,0x4750dff803ff5567ebf270dea9f51f4198910ccf,0x477ba241e20299da78dd4d48eff0a920286caca7,0x48322d7f62502ea6b38a0475efab63476f92bbec,0x486b08449422363de93bc3d7e7346ddd415e6d37,0x48c1db129ebce773abdba076a9a096040076a1ea,0x48dda49c79bea78b5ec9ffcb82743887665ef08d,0x4953e9dda562ae42889799da8f40f54e817a30fa,0x49c01a0037a9ee82211202c510b604dad3a7b40f,0x4a07222e797b972e0ef687dab6da52012d7c8669,0x4abbbc93dfd213fb54dbc5dc10493b11d694d09f,0x4b302343e0174e4aa6c668519f901b022cea39c4,0x4b60b678dca8e5315bfe0c5e30b662291333726b,0x4b7b6d3dc60adbfd35271bcdfacc5fca5e3a2107,0x4b7f7e3fbfdda57e85a1ca19626ab681b04da88e,0x4d40b20bdf7aa61f009f76f3b9d6c5dafe5a1705,0x4d80731b71c5e9e59886ad2232871d5d120911b8,0x4ddd223e5bc88422ae047cc57d4198f68519e42b,0x4e0bd8cbedcc63b12b7b0f8f35354c6256c664c5,0x4e660c1574f3259ea9bc3adef08404b94bf70337,0x4e7bff908f640f3585b4280be63178c798dfd1b1,0x4eb6e9c96332557c82f7da9c815805c219fb5e78,0x4efb50e73a0892c7deede4b5c833269d416d74d4,0x4f43b3d4275f747aa2f955686e2ee68051227a31,0x4f51b34d715467f4cad0b0290e8f65fe98050704,0x4fef85772cc64fa00beab7ccd378c52ff5f92946,0x502fac46c5775c107f74158784e2abdbefe9af0f,0x509c39f7a55666fdc2ac90b085b39b41d0f089a0,0x5157084af1c4318f6d536e8165e1649d97ab645c,0x51b9a9d983f4d9f2b03b4d58b4c1f9e378912645,0x523e7d69fbb00434383e6caebf4d53d121d568ae,0x526971e25ca50b79254c082cde9bbb864afcf2cd,0x52b372ce14bf9b5bf39a67df474445161d690aaa,0x52b8e4351321dfc19c2d03d2c895112c54e85a0e,0x52ea7dccf06616d6bd7a30f56adf8a06506e4510,0x5345dac185ed75645512287376f2cdeab1d6b93f,0x53b45e15752a28b70abb9bb65cf5f0076fc628ee,0x53eebde3b000832e1dc3a3690cc015e5a7e0865e,0x540f631ba6fccc693e5a6667c1f1d44a11d6a557,0x5494ae18791e88483b4b2701dbe2110195f894c8,0x54b2a85367efaa090b914bcee9df6cce0a7ac2ee,0x555d97c93ea2d856b52f164174e23354d71977e2,0x55617602bf7e0333ee64995129e4253479995695,0x55663bc09a21685044b41663a37473d4ab39dcb4,0x55692c845d5e564d5823d5b7022a1a4a6ac1e054,0x55e18dcf63a197201ecaf44c0b98aa69a84a56ef,0x560ad93ba85e40af708fcb991f0425a4641d9400,0x56553c1e4272564fb7396c93ee6207e5907873f8,0x568d6412951de6fe8854ce137851746e2fa36945,0x568eb979b2b7e76a1dac9d3249249b52edea5d3d,0x56905b7fe99e1e57e19d3d973f1e0d2670e93f31,0x56b92655f850677e5143145a278e6343756672cc,0x5725fd12d533a7a96cf4d9762451587530c315f3,0x576128c52214abe2522314385473042cc39f192e,0x5769d73537a50d825feeafc88ba8193948d8d805,0x5788c4cd302fa4dd73c51593e3e11de891737993,0x58464430a88c3a0349bbdda6dab803f0f5c698cc,0x59fab24d8395d672bf65252e374d27f8ab22368a,0x5a2d1b68dfbe754d69a5ba989cfde22a5472a43f,0x5a418b39bde3b3f0404c0305f31ea0dee551bc47,0x5a98ef6fd12595cb4aff18e4c9a956c102369343,0x5b39a6d25499d9c51efc60120b7b4ab3237c5053,0x5b9af877994d794f9efd20e4236007b8399b9b74,0x5ba429dd66dcd9848cded2fc37ced715a6a3ff34,0x5be96624c884216ff8bb15330b6bc8587b29f6a5,0x5c5dbd67b9bccbdd28546ea6076fb34d41975aa8,0x5cfe8cc56d5df86beb7448f45ee14d00e9acb158,0x5d824508685cdc01d4e1aa97063a4aae8e547d1c,0x5d8c6ee49ae4cea8996554cf7206df1f2dcdf897,0x5db5df170d1dc9f886cc9d7016fbabf105182d88,0x5db72c4a3ae692495adfaf159127aa90010b3cd1,0x5e4fe2996c017a54fc87e0a46e8f7140219ef576,0x5f494ce307fe76d60cd9da6abb5186a00845aac8,0x605af627dfc98ff9f6e1e6f2cacecfab57808280,0x60f287b6250342bcc7c4b37d971d00a27fc2ee3f,0x61191dc796575a4c550d6ba22cad2e86f01bbaaa,0x6153ee94d211f78ea5e1151ea0154affbcd84526,0x61ebc327159c527db8f59d6f59faa6a692a4561b,0x61f7bf167bd32bcf7042bc823bfcd24327426da7,0x629fcbcf826e8ebefb2714084851b397575bcc93,0x63e1cc76abb5942b35831e88f366798def0156f9,0x650a52a0723ed10b1e9c0f894b1e57b212df7a40,0x654913d02f7fd8ab2f2ccd59135e00122282c4fb,0x65c6cd5200acf06a8c70d9a1b450a121783ed281,0x665727a0bbdf3cfd138a8db49e84c27a19400986,0x6666011468c58b36a7b1e66b5f680b8eea061a79,0x66725f49f1df0f5c2ce9913a832075fd5c6472df,0x6680995b3274ff1770c35c44b4fb835540e2d6e3,0x672b5acd95c2310e31f5c21ca9d5b678eca16957,0x67bfa0ab88c7afba4ad32c2b8bd64980a35abd74,0x6813137d93fe476a429b9b82d8e2e3ad95a5a64a,0x683d25ca2cc1ced2b0bde4b2aec741683eb6281c,0x68de30aeb4487532339fa5faac4c71e2072bd668,0x6a162a4045997437c38563862cc700df6bbba292,0x6a673e8582135cec21cf04cbe6f46dd16cbefdd5,0x6a8054d958141d0cfda33cbff10dacddfa7ff12a,0x6b343a642f2b566a46829ff67d518ea479ea898a,0x6bbc7f286c2466a588309f74d1cb9a99a2af1036,0x6c3a5d5c7338971e1c65fa0fef81039e8f1f8aeb,0x6c3c4ea69cd14570f814c5e05b64fb2982122b18,0x6ccb61660ccb75b6253265af8b579df68d477abf,0x6cd6539313dc1d5cc6873f8aaabe76a3366fceea,0x6cd6d39612b25553f2043e2a97e30b11c25eba29,0x6d1dc4df550f8d426d3d9e5e91fd21708eea6edc,0x6d407cb468069d1d1d22b9477590bb4f07682403,0x6e174cbe52a1986fbe066223aa1b74d2e329f620,0x6e5dfabb1431980c3a0f0e0630c731c082301d3a,0x6e5f594920e20cf3a82701295ac772666be77b26,0x6e7c41f3f1fd608528120169b03b08a0fe95aefe,0x6ed37d19a0aa994d487cda05e717fea43bee8505,0x6f1256dbd3a7cbbfa227d1bb4315e7352afe49f0,0x703a316c3aeba7254f8a1c1ed8ae37e35dbe21a4,0x70487324e22c9aa1e83192ca3314b8ff86a0281c,0x705cdde3c7f6b2366af4d8eff24759ea5e149319,0x7078a6b97b0bc151e604e31195dc1243e64a7fa3,0x7087c92eac0a9064562bfc861a393334df1f0c01,0x70d8e901c380d978463b364ab6a426290438df03,0x70f78b7739edf71d3dc30647c19c56522064f883,0x7106dce533a4a581467d6ee8205a3204029ba340,0x713ba3bcc24177a5959892549f036547dc623b23,0x714343bc616086d3621295c3409c31d4fd7663d5,0x717ca0237dc1170f08dd4d33f092d15edf2666f8,0x71a5108ea8a31aad6730bd9413b8a6b2c9969d13,0x71f1fb05d18edfa471cc2f66738b5eec97802099,0x72750bb23caef91d49cc50b3d30ab1acea857b99,0x72a5e7d2a303713915d01d258a60f851158882d0,0x72b605478d82c3136ac02c0c5434845cc111bf79,0x7370df7d35b1d9cecf6b7c517a00d95bae2b97c6,0x739b705d9ff465f83cfb0098973ed80d05c97ffa,0x73bc049bbc39f8ac6b514be85d8552de9bee64d1,0x7425c11e0031bb4d1224259cf108599d093f7a5a,0x743d08d52e4f31d8799c93866d2321aaa743614f,0x74612febce5a48983aa6f531f90acaa76d293205,0x74cea9d54cd6b715e509c088f5d0ae970c2f9a5f,0x74ee26631f3c752d3914baea8916ef84535cf661,0x752ae801cda83797ac73aebfb61ab5a5551e5739,0x7532ec891d2122ff26f0d0d6cb9a5f0f1a2d123d,0x753a2e7d8270badea5baff1313fd709d863531c3,0x7549351d0a1f8cb425c45beb01903eddba73e9c0,0x75d0f836173e0949eecdd88a7cdcd737c71331c2,0x75e5ed78515a57b52564aa5de736f1674df6f335,0x7611c0b70e7e54aa3c6e569bc56f38ef5da5799e,0x761502dcfa43d1a990ca25d9f3014eb801312b95,0x76a959dd8ff644d2f95f4d951fb153198758c83f,0x77c6f3aba8b36e22375cfe718ba1b1f5af8d075c,0x77d217908cd66cb3198bb94cbf46eb7fa5c9b62a,0x77fb664e01fca6ca90a114c03819d4a775fe8698,0x788031553c923a5cd029a9ca707e1a8661cca1a5,0x7908e90074c2c8299922193c669860d512395c64,0x79455c28e610154edb233bbdc78ddc2bb0a76732,0x799e8f9e7c36bb5863b81944daea5cfa5e84bf96,0x7a49066bc62caff003dc5a089cd26c857ad72c1f,0x7aa15fd603de8083328fd99aab1a053bf7fba5c0,0x7ab13a4ae3e9f556752793fdacb113afc475a5dc,0x7be1940392465ac3bd2fe49aa0ef3a740f032937,0x7bedfaade3f1be753bbc27d070b56ad8cbd61dec,0x7bef69270552d8d704953e06dba3e433cf036b9d,0x7c2124039a5c8902f822f9153c48e332a81664cf,0x7caa6b2bc08d47cc35d5e407977c7f5d4735c1c2,0x7cffff3eccd661627932d0b8a69a34332dd60c72,0x7d08f59b6d26a282ecedf5e3fb245d33fb058d11,0x7dbec4ba64fe4dcdd453dedcfc0361cb0ef88a88,0x7e87bc859e6385b9856da78e13542d6e073eaf95,0x7e9ee7f3bd17537424cec3b53300640d2f36a9df,0x7efc4235722cc82f1b16048568a66910aaf1764f,0x7f47ff448de7df8de4d8d898f07e0d33d942a911,0x7f5af979e45be6dff417393aa2e2505b0eea27eb,0x7fb9ccfe8ef2cb41b69518a67c41648fa2052a4e,0x807e4ddf6b0aa08c8402ed8515131fb383818dd2,0x8104d18c9d9fb1921ffdb746701505a2af5780f1,0x8109a604cfa1dffaa848a2b383f7de8d9f91e1d1,0x8126e90721529c1ca3c4a0732647deec47a7c431,0x8188e6e227d346b7ac0dcb0b10f4bbf054ccec89,0x8189dbc0c04cf26a8c9aab590857467a0c16e145,0x825fbeb93072d4daf2389fc3dadd11eb0f30b532,0x8281808c9ee0e0598cbc8daa3f037caadb345505,0x8320dd707d477739107b5f3822d83e1a49b06b2c,0x8343e835ccf223881cf93395927bed3a1a68ed5c,0x83b733371e40c6f0421ba8668f5142f4d3fae2dc,0x83f9f990f3c75b3f9f0b452c9be7bfc868ff409d,0x841e9b9a3854baa8cbf0698057ed3a6596c809cf,0x8459c6bebe2d53b4dcaa71499a1ae4274c0e4df9,0x847500d531facef55b177a2af4ed2688a019e40e,0x850cca82c0c17aeb4799c8cde41882585c2d4d42,0x8566f50901f6f3915530c253c652bad551c2be65,0x857c91c27b56852ee4ecb8e2a97cacdedfcd63b4,0x85cac1da39bda8687cce1f5a5990ee907ce318e3,0x85e48a762714b39653fd5e0a9808cb10d6d2a0f0,0x85f3bbf81cfccc0e0954ea747941cf463e08fc53,0x863d5e554a5887e9be95fb4605f9d86695b697a4,0x8672a5a15c45e225f367162ce4c974fd40c4a3e5,0x86d99256e501e08a482ae40d20a53fd6c6cb9272,0x8711ef74362fcdcd87e0174ee8c9b5f58b716aeb,0x87909a6c1da723dfbed6595c4257a175ee2ad008,0x881f77eae41d8c23b5f0fc921a6cddae4c4839eb,0x882bf68a56e392c506f8790c10ba7ca6b4f30f78,0x89118cc82ed1c18911960113c67a800dfe621aff,0x8947b7d6f6b6edca66040ad778e9d97b46cc95ac,0x894887e16de52a784ce57e4138dd9a3a9bfee802,0x894ae3983bc79bb001840b9609937979de4ccbd5,0x89f163de667a5e44cd1ed78af3522a7fc5228760,0x89fdbae26977e7b6fad4dfdf1a370308dc261de2,0x8a112228b4c51d87c625aea964ccd50749a7a0e1,0x8aa276c975e8d9790b467f36fa6cf8fbddf5a509,0x8ba0d1f05961587d4879af54043d24baa4332084,0x8bc4d93ca3e8b455e7a452ac18327c222eb39c2d,0x8c79d60fd012a533f107a27b6aada1ffa169df70,0x8ca4726e5fcff8773678e5e749bc6b6435198f72,0x8cec82cf3ebfb82d326964ea084ec8368ac9810b,0x8d297a252f3f2655addfeaa3dda8073cd6aa1c8d,0x8dc13e92246b9e9a494173f28b07262b30cc545c,0x8dc40fcf6003fecfb3c3d571caaed7965ce09f8c,0x8e02ecb776b5d3e161801b89f82cac6abaed2b47,0x8f707e376815b3f818f313f88f9e8ebb6bbd93fd,0x8f9be0996bcc9d878815767c3f4fed35f670b008,0x9029ccc6563a8f2b1fa70e6265d90398061cb7a9,0x9077e522e50f77ad31781c8e28abc4ce68161881,0x9109fcdc0dac114664c166d6a95f932fcd291d56,0x910faabdc2731900527c3806d84ae91c86f31622,0x928a541e431c68cc42c6ec5af68fe883d3f3bc08,0x928d97bd2bea27c15c51ff59a9cac08daeaab043,0x92e3487b40f53e1cf3af901aac00451c9a745806,0x9352a5dadc13981e004ab718bbbaffa207e5e2c0,0x938a7ee25aa0c0f6012818c92e9eca990c132808,0x9401066b332119e7ef62a3939547f95fcb3ad483,0x9403607be7a7d0d86313f277a399629b3a2967b3,0x942e478147585e4fff3ad46fe617e8927f1ec116,0x94b41228d218df4d1fa782d57fdc397d848f6da5,0x95b6698c1e94f21295475cf0b89c612aba629561,0x95ea69e259eb700f0380041f0d83ae2700a586be,0x966f1dbdb66a5acad0708b3836455360c0694f1c,0x968f2424f023a70908b2b67da17f4071800fd754,0x982d0030c3e16d2d7012923aa2b524b6e3719e5d,0x98aac0676fd6eef2984d710b7da883f3791aee82,0x98e7324a5082cef8da8376eab3d76f74c5f10c1b,0x990e39bbee4df87e3d14e28b04ed780e421b437f,0x990f1ee4a717804b16599e7904a1218b13c91074,0x99a7501ad5d02c431205676dbef86b260fb5e7c1,0x9a238f41d76c884be66fc932272f12d8b8f07f5f,0x9a5822050a72cd7af18a5c87b916aa4dc9627639,0x9a7d115e5b0665ba2537a2d89c7c86efde03ef06,0x9b3ff0f74b4781c092c501890a063863ad62f7e3,0x9b50933c97009374865e89d43f65011f9939a03e,0x9bf192ccedf1d644e215dd9484cc9d8a5df59218,0x9d1b644c8f8a991d0e1c954698076cb24f857422,0x9ea7da910dd8cdf5e6ca55f00da8ebf4e782fb76,0x9eaa26eddc4b767c8d3ac552e4b40ea6a7226491,0x9eacc14acd29a53d2c8d74cdf4e74ba58c0edc58,0x9eea41baac696b4a7f879e254451476982c7ccff,0x9eef69d60f0d727d71444ff57b1aff6512bdc2f2,0x9fc0abcac9a20e97f8057f2b004a2e1c1eaef960,0x9fe8096eee4f2c0a90867cc7887d5aee498270a6,0x9ff3c4bd9f3c567af5382af64cce6c7ed2a389e4,0xa022099eac7424adb8d1db4dea5e5a7fc565de78,0xa0be75e48205973e88ea5c5af30df33c773cc854,0xa0eaab84f14bc9ede01781f33600895c0cf20df3,0xa127e8a114c36191ccda96b0406bc2c27333bbce,0xa14d4d6dec364592b919cff0e6a48e4bece56229,0xa156654f297a7ef835683bb871210e49238fcc04,0xa1b895acc6116ea444d6fd3b2ba19263e543de23,0xa1d469d09e4505e5276d4ceecaadbcbb03ac16b1,0xa234000816ed7917562d29e3b28153cddb52d915,0xa27630c19679c4ec374cf4dd9ea518da34e76fe1,0xa3500f41342e83b3e1e109c380aeb9db8210a081,0xa35c2ac09efd7f8fc4c7a6d07866e63c4a138603,0xa3953249da72a6143d75b0890fc3596b62a9ef5c,0xa418dea98e1e20c165713e7f681af815cec4415a,0xa4321b2b5760fab10928fb38489c004139294157,0xa4683f364c7897d093cf80a3c94de9647b56fd67,0xa4c5997ed71f9490fcc145525f385f9f6b685900,0xa4ce16de6aee9c525252848ea1022255f33387b2,0xa5a3177d01f16a7bf637374eb4c0455f6ecfd707,0xa5f29a50ddbe6f215ddf82182cd9b3d65931f7fa,0xa61eca4f4dcd5fe4a86dac33149bce473df4df75,0xa6223239ca2a9e9caff092959cd5da3e31ba73e5,0xa62cc068e25cf655942f6dc65e939ccc104a8d98,0xa670544c78ecd7d7c15ba046a6c6a7b0c8a7eee6,0xa6811ab9cd371da7106e29d888a37e11fbb93cc6,0xa6a6299ae4b0c91ce9b7d24e96cbd48dc29cac7f,0xa6db807103039c166f30a4c32695b81757a04fa6,0xa765ae8b428617728c0a6fc26674e6fa157ce7c5,0xa76cc1d6b3ece07a1bda1bb825cf66ea391ceb78,0xa7f477eac563a82554049dd024328c86fe01a448,0xa807da3f7c170981e9b6e06f816b2597bd37c41e,0xa841754267a54b9b7ee2560ba08b0a97ccf81f2c,0xa94b52be3270376f5525ee764d2ed340dc8b2b1f,0xa9febb185fc94737220c3880f8457400f8a888a0,0xabe2026a4781de43bd72a22714cb18c7e13c9f2a,0xabf887150ae61aa4b30f5759741951b64b96e6ba,0xac305af5efcf0e9197e2e5d75c6727f9dfa8596a,0xac6164fce2b5106c1eb0cef7c7d68cd2fb604c12,0xac716e550c5624184f91a75bd2b32394513dd43c,0xacd28b0b6c7769f1950863f9ed1a32387e3582b1,0xad1351dd6bf5a8f8fce774dca50b607c35b5c192,0xad254c404932c837774218ffac7c962a16826f30,0xae1029fcb41c3595edc524fe331177c14d5a0b42,0xae1c65a38ca46939bfae1b499a4df9c93a68ffff,0xaec08125bb194c8d64522ca17303f4222538f49a,0xaf00f70d4d5d0819e8c2b8870fd07d174450ca23,0xaf40b23aa074ee77c1c7b5d32ecbe3a770fed2e1,0xaf9d6309f37aee77513001cac204b4857691f4aa,0xafaeaa89519b651fa3a888610756068cee4ff36a,0xafaededaee30d6373a504bbfe4cc494e0ceeec28,0xafb21d28924b9033277e509233e6b072007b5a06,0xb00d51d3992bc412f783d0e21edcf952ce651d91,0xb0172e5e1e84567ce7bd5f5621e61882aa8a424f,0xb0695011a6e59d7a0861735127b25df184270e34,0xb0a77f969bcee4bafa0f21542b6f5766648b27b9,0xb0c3a4b89543ab1544421a72a42414cb48365f99,0xb1074d5674e143c6cb5880be3e4ddcffe41bd59a,0xb11bae2c48fe0e915d436a5fb97fffc15b893600,0xb14c914eded75c43c19b5fcb1c3bc768ad4604c4,0xb15d493414bb2920be9fb669adee2f7698afc4a4,0xb1e07c6dd6423d4e7d8ed0ad95c57910e577d612,0xb23164fade49cdd7509eeb52c0a37a34aef234db,0xb259b76b1a842460457a99960eb90039618f137d,0xb2752f37b241869b25914c7c1bc79b0ec10f9d6f,0xb2a1c327f640bc56146ed7707f2f667f80f9b3dc,0xb2a860dee1242a7f8087c40dd6fe2d076f98e90c,0xb2fc6d23b7ff75de7de87e4e5882022c5ea61af4,0xb3636615c88f4615ec4dbbdb74c9bf649891088a,0xb3d731ca43689c993cd1d6c108a326888323fc57,0xb497f6605f02c206a1501a3a6b8d14aea0aac762,0xb49ebe568eacbe27dc82dfd9ea1c1b23ccd21f79,0xb536b6156416c8964fd8277b0ebdfd23984f8301,0xb5ce86c2ab9e2403ab47acfbe501845e2480fad9,0xb60e33df2accc95f57d7fa40fc0e6ab549282a2b,0xb65f204d5b0603656706df469228f96529872672,0xb6807fecbfa1dfdcaa35f63d5841220aa346d8cc,0xb691df3fb8fc94c1885163ff1162825da337d9d0,0xb6aaa22d04b525b17a6791fdee490063c2ed1326,0xb7484024089e1c2f9e7b84c2d4876fd776f16e51,0xb754c744d018b65fe560235869f6056965665b85,0xb789b5f0c504e073b782e420f3fe015a6b58c224,0xb7a8aa73d68ae393df5c51b8b62f860e6b554c68,0xb802046ea6e3b4577c90a7cbe0ed6f5b168fec3d,0xb973c2fb079ee1b528b8da950a7ee5408380e568,0xb9eac95221afaaa371d3e389401c0b11f8b4a300,0xba218e9475dba4b80fb959b6edf09b10aff44ac6,0xba4b8ca4aef951210e47423df8cb1cbefd938c47,0xba762326e8176c60b0382d695595b88ec96bf977,0xbaa45c01ba1ee492308711026bd72f2492879552,0xbb01cc70a5be95f310c2c6b1d2c8da6310017471,0xbb3fe750b8695b3ab1bc3fc294407e207be366da,0xbb5f7f38a0d8c22f3b0cad441f81af6bf847f0d7,0xbb68a9b33fc7df54d4360cd1e328e5f0b7a5f4af,0xbb79c9ddf5f2e65d2e4555ce647e036ed80a8bdc,0xbb91f5f1e2014ee5d5b48d8ef682a907220104dd,0xbbbb10a084be5d3d2dbe893a7fd5f1c8b8c1c45f,0xbc117ed7fa267e62d3a6e50a7b73c82b7517773e,0xbdae5bc4547ccaaa239f4d8c697a0934561d57d9,0xbdb9e39d9b1aa8e464ce588da7f14d0127df3af2,0xbe293aef447ebd4907125c34f76e9821ad80350c,0xbe60b4067d2281c0da4e8323909a2d014b0fc2ae,0xbe84d04035bb2d1383b147f20dfc89df0d2c418f,0xbeae7cdfb65ec46aaf7fdf28f72524727cd8083d,0xbeef17756ba8b51e093cf2b0052982ba4ed9512b,0xbf4e0c8f7e0e59d585065cf149071c29effc930e,0xbf71d14fed9458c4fea963cf2ee656826b6cb788,0xbf978dcb6d7633dba58bc553b8b83cfa5397546e,0xbfbce15caf01baad3ffcbf862c1b07bf18f50807,0xc01c0f9d635f4e76de2f8910c6e4f95046853be3,0xc0dadfb0b198e4839981d413838db216c018dbc7,0xc13721795038554e1c0009ca1b4d71fc729ae4ec,0xc1d72456c52d833f8afa89f584ef74add4af1176,0xc2af160792ed7f8905dc72cd8244bccdb6c151b8,0xc2b6f225ea25896de49cdaa9e76e27db05e5ddfa,0xc2bfd0eb90fb4d790114c521824fc06b7755eb98,0xc32f6ac7eba21a615ed45f75cc033450a71ab912,0xc36f853473603deed3b5ff27c9f35ab521b6a6c5,0xc3cfdd3d4a47d31a35449e5c0cdb58fec5bf1189,0xc415040996590a6eb82ebb2b323b3fae84268e5d,0xc42cec044ffd78e3db73f3a695d41f40717bb3cc,0xc443b41787771490a0104288fa3dce9bef4b8392,0xc4b092fde20c2b154ca50f5488491ccdaca41439,0xc4f040f4bbef43f96d3cab91e95b879cfce60852,0xc5d03835dbda03986d888b9bd38f45bc75f02ece,0xc5e0315589272804a586a80eb4c1e9483d89ff8b,0xc69a85291f41563543b09950812a81413dc9c164,0xc6ef0a16685b2bf2b87e1c3d2a369daeffe36baa,0xc71f6a0d1cb0949804d3cd8700cf9f4cad2490eb,0xc7df284d15b7bb8426ddf81ff1ccc965e8572af8,0xc858def13a54261d83d0e5e398e69195f8d53368,0xc8620ccc404822db342ff1fe7b0228af7a90ed1f,0xc87e004996601472eff32482a6a3bfb86fa2effe,0xc88efcb4154924b48202c956ff575b63e0ee7a75,0xc9d97397e05fb3260706ef20bc6da3e7f9fa8a3d,0xca1880f614c08789d84524b4222f5c19fd8c4447,0xcad4645ab1bf55b6629a25f3a4f9ad131f7af2eb,0xcb603eaa2973d44f59ae139f796f4a7897820557,0xcb6289cf48a0fd691d5751f736aee6a92c89a21d,0xcb6737c8c19150e6a42eae0e3358b105fa4648db,0xcb98741254a3d44767e83a044b96fd617cce1670,0xcbebddb52e3dbce450f47d255ab2c5da80b23a1b,0xcbf2a6e4bcc38f1485fac58cfea640e80b6b9ad7,0xcc0531697793ec440ea376dbdca0331a52b22d2b,0xcd239a11a2fe093f445988821ee1855834962cdc,0xcd4cd30b67d678b9b5104f4611ce6cdfcb82dfe5,0xcd6f288412531e7947f9751b1a7c5f2d8d8d7df3,0xcd75a3fe193ad73308a2fe63138f0bd0a25a40b8,0xcd86ffdd2bdbc339bb5f363760e4ac8318aa7bf2,0xcda0c363836378f0264802c9a42a2ca32a9385b3,0xcda2fe1ee7f6e0f59c5f1300ef5f7b7e9653b364,0xcdca9006f6a3f54cc6b255528e539e280d95576a,0xce00d0a01ab672eebfa84b56c0087ddc7efaa7df,0xcec31c9c8efd0c4bf56712277a9ff987df518388,0xcee64eefe8d909757ca5c60154d4fa298a86041d,0xcf0cc5441612f7402ba770d59decd8386ead23f8,0xcf1a82c49364d4523e23e24a1c342466613b1e03,0xd0650185d46ab6859325b34f201b5bf943179b04,0xd1424aac411e4f3f357f4e92c2c66591bd48785b,0xd14314f2c6ae3071cb54a8b745f1cc3814ec0ca0,0xd16e1ed24797bdd773dba5e52fd88ee8b40bc6b2,0xd18d295680764f0f5cd6aeb29045dfb68f9a4b61,0xd1d7b08beadda826816823d660c4e4ace4b8c789,0xd1e39e57aa8793737da45f9dd76f19e569da6db1,0xd2109613d0d5c9348ae7a846a49a2be7d5975a0d,0xd21a476c8090c7d6b3cbde53dadefd26b55e3939,0xd23a82244c396a3dd553c2449fd6e425a411be94,0xd3371d4598f8fa32ae10bdeb36409555e36512cb,0xd429fc23ef8628ddcc58d785be800a5cb8d64409,0xd43cf7352d4ced5b8590b712ba2d365e56225275,0xd4d08e03c3eb889ff746912b6edb3c338bd8e2ba,0xd4ed713d7761fc6c33046a73d576ac222434ece4,0xd5a9324ceaa605103f51e0861a8b319af6638db3,0xd5bbdd10845c2d86a5f45e32937dc5dac74df140,0xd5d97e3210439b882228a2715a7491552db40965,0xd61cd38dab615bdd00a0c488f6e9e4fdf9f99444,0xd634f8885e26d2f6c5793dc2c782741713f155ec,0xd64961a341799b549538929cc84455d5d24bc7cd,0xd6a2752d352e247652c938b2f06f378d2c98441e,0xd70c35c779d0055f1bccdc24b92fa58dcdad24b4,0xd72b3a5f220e26f6e332ea87acf90e87a595d981,0xd73dd0db860f3033e4736160a9dd1f6a5e456e1c,0xd74eb56c24ce3eaf8b8b58c1dccefa85c3659339,0xd7554719f4c6e168ca8ff5f52810e21a6abaa5f9,0xd7c33c56f10028f1fa9963fea13e5737ce6f45b6,0xd88471b84b89f2ec74a363bac32596866282a817,0xd8a2caf07eae5c1bb1af1f910f09e8b227ebbd6b,0xd8c8d6123aa5709b69bef92a5c89072190d1e097,0xd93c2aa349d1131bb2a6e1d3732fd41a059b5803,0xda34dbc6917ccf08d7414f827065b86b3d902306,0xda3b0dffc6e7e07103d1f931f58c08c6db07c1a7,0xda41acc1d4167909855021ea551351b08ed09b06,0xdae02945952aa2e7dfb80be483cae4ccc7e66191,0xdb28c69dddba2e968d6b8c592dd5b90c140fd48f,0xdb759387bf4f9d1924f553412f9d15c563cb19b2,0xdb88a6b0ac3ae0223c6d4a8408c1304853cf0e7e,0xdc187dfafb8ff16f3e16b119ca57c00671fcf15b,0xdcaf829700b68df3ddde26f27313b8328debd9cb,0xdd365dda8fdacc49fd52e2a62b032a8303e61efa,0xdd9c6ed5307d71d9777b59c84a8fe893727f968e,0xddd6f907742383220cb0fc9a631e5dcc9c29f54c,0xdead001e2c3f4382c8e6267012727ae602cc9065,0xdead080e55b6918788d33959774c19ff7e914367,0xdead0dec5925ee3290434c8716a8cf9a29bdfb87,0xdead45326d17f31935714219e92e7672d82561b8,0xdead6577cf80b3a3ca913d15f87e0846be90bfab,0xdead9327cd82f40a76ee91b71bf21b5a0e2e865f,0xdeadb072a486e3488f03a15061430fc5f83d1b5e,0xdeadee24ff359b01b1b64312e3dfc42b8cca8780,0xdf00070260b596e1514a034b6165bd2cef114130,0xdf3b5b17934a6a537bf8c06e8e60a1bfaaf5d998,0xdf77b9084f015c45dad97d57103d0bea1bbd5eda,0xdf9d5cf3f4bd89ab8060be28ec57427167061089,0xdfb084314888b582679499a7e7b64d27db09d25b,0xdfcddcc65f7a739d79e02071ea750500395fdd30,0xe0044837775ddb2468e593989fe3313fb79aaa96,0xe03666548a817e08712bb2485a116c791465959d,0xe069c0639ca314a246ff6be4db0cbec832b9e30d,0xe0f3ef056d76933ee4b22349c546073e6925977e,0xe10dff353e30ec6ac83868f89278bcc35bda37c2,0xe11032d126662d361d7346449058744ea05c832a,0xe185746cb61585e36c214374e9e10c6483c84b63,0xe190bf142c75eb19d422a30b06f91b666a295668,0xe1cd9d794ef3069e1a4998b5dbbec913f01600b4,0xe1d7a5e04ce049b081a7cc4b3a79e441b72af9d1,0xe1d81f0da231d0c21be6420da2a888be8f7b00eb,0xe20c85aa34029bc6e2efd6ef6c268a8ac7defdd7,0xe27508c85590d295c1c8182ae8252897767bd9e6,0xe2b6580fc91d99c2a98f0cb96576a938a92e43bb,0xe322bcf9809f9f76227fde99e654b0167508d7e6,0xe34794cd27c35339397243fc4737efe2dab0086e,0xe3a237313e395bded074352d250773b620033311,0xe411c86fcd80b05d40ea1cc2e224e137079975ad,0xe4e0cb8a19d87c9b3f09b605315c5df5c7aed596,0xe4f43e6dbc3f5ab3e6c168954ed8d3daaba99847,0xe56533b9f4e1726897a2ad2219af7f348848d3e2,0xe5adf952daf6622decec3697eaf7117c08284fc0,0xe5c2080e825368c8b8619bdbc9a4fa1616ed6841,0xe5f3a73084aee0bc4a4d1ac847f67a2e94fbebd3,0xe6c338c67c5e72eb9134289448a5cfa224cc238a,0xe7b01d904b017919fbeb309f065925a1f8183284,0xe8d3dd97cd3a33b7b8f94e3195e98d3912ac50e9,0xe8e5eae3c6b63251b9e199f467115e3a22b63086,0xe8f564e4be65a671672c06dbeb376562e2c836ce,0xe905143febfcb1f9ddb8d2b0f4e5075cc8c9e8df,0xe92e9f24fa85a305476ab4b990feba52ef3cd50f,0xe9c279e8f065c0479bf81d200a0046c5531895c2,0xea8456359ccb10afcc73b6699b22814e4e6bb9f9,0xeabcd57cba653cbedca59be7285b47721da687df,0xeafb1da5a8a0cb2012eda8ff57cfd6187c898b99,0xeb7cb97a21c52df695b7e7ec5f1d10510582d3e6,0xeb91779f9dd27315f748c69de3bc76fdeeb83010,0xec0c633a9eb02a9f26af64d76987478eb8156b31,0xeccaa4570bb834184032146a9c01da146a5e1ee9,0xeccc484dd4093f62fc24c4725800013fbc2c1d15,0xeda4c58ce33b8e616936bf7cf67463713555aad6,0xedc4e6e3cd9f28fde0a684528061fb859da8c59c,0xee0b6ac559d9f1b9544fd06c3e8a4973fc314448,0xee5229e5860a9f1c7bcf270a6f530a881eec2aaa,0xee78c484960d66dcbe07acb061d7d3b0a6b2d883,0xee882632be57b43358e4446c7d4385ebb5100eee,0xee8f5dce9baf106efeca05e562e25c61ffee9a6e,0xee93643af182f8e5f2313d2cc256e0ce5b6b2cd0,0xee9abbfffa8b8f8f28288cc9d53d2e5fce87597a,0xeecc3c3e07915f5b36471b8a11cff2e63c333314,0xeedead3782f2682f97e8e6562e4c6d0635fd7954,0xef8036bb8eea0fdc71273b2011dec51a38d6a625,0xefa33c11c39e41d09a8a312f3e16645fe398421a,0xeff21e5df5654857c39d097f00f242e17d69b9f8,0xf014f3c6eee3dbb2fd362a527d5f3df149f2b2e2,0xf036bf1a573a4970dbab06c6d67cc434c98c7f7f,0xf03ec644b7e384f6c4952177121dd2d39da87687,0xf051af743ce7cf61bc1a4292a5c93a1fcf36d72e,0xf0644a44bbba8f83f7814cf91b9245548cf9d85f,0xf0a5d1a1bc410cd5febff2debb5dadee9d4ed1fa,0xf0bfb0685a53daa871ac9087bf4d2e9bbde8e540,0xf0e4130a9002a59166c643af5c414e2792066ef5,0xf107f6c20740332a468a0c0772be317538c0241e,0xf117f627d8f064e25df04b33f09ceecea80b1a16,0xf172d22fac0b21cfbba5a43c787e497050291dca,0xf27996414f4b489c798bd204843876953951e224,0xf2ba3c08588d95025de46721abe8fcef9bb43169,0xf3177c54026931d68bfd02dc42766b50c6d674ab,0xf399e0191f79de313dc8c58bd209ce7745916122,0xf4a2029aa7421a0936b7445798c25b3d77e805a6,0xf4c6225d0db1171c6ec09c6e7c7c870062b173bc,0xf4eda567211e0fec5004dc3eed873763d7993771,0xf543ce0c3a9285463eeffa22d598a4cc51a56c02,0xf589e3daab7447d4c462060ab8691d2dc3b3212e,0xf59149dbf5d3e42cb4271cd1f997bbe695eeda5d,0xf5de2599ad32ef65fa51021160528a088f49e504,0xf5ffb8bb9195ec4e9d200d5e2d08bb0674b70f7b,0xf60ff6ef6db109369c0159a63c4138be04086897,0xf657e5628ffb3f236c71d9fc82c9401c110c715d,0xf69ee9eae05d695d92dbde6110555efac5388df7,0xf6ad9c6e3330091c57485558549041a3a12f83ed,0xf6b1635b2a648d8cf69b633411a68b57192f1577,0xf6dbbcfd3b855518881b0dbc25270929f46d7589,0xf6ecfc631aaa5964139d7dc479dca09dcac0adce,0xf6ee20710d7fd9a35baadbd5d48c8506e1ee5582,0xf70a8807813457547b8ff965e99c0d653ce280bf,0xf79de38a7aed6eb215b9722e99ff7d3cae7feb65,0xf8375e6f4daf3d6109b2ea8fec6f90961e97b053,0xf8ad0e455f0bf5c9115e3027c400339f11a8fef3,0xf91d879d90954deef18ed53b4db217b8eb6613bc,0xf92861d4c300dd88b1a92068414124e271d87a6f,0xf95e5c40677f3e5a37fdec9563f9579de09c2eb7,0xf9780059beecdbebda30d64614d7c58ed864e57f,0xf9dabc174c9920fe4fcf26806116bec30c715bed,0xfa2405158f198152ea73af6b2c6ea0eef18c7213,0xfa788b1410e017a8cc297e036f1441b686facb19,0xfa85226ca6f47f0ee5da091ba8c2dc32fa13cecd,0xfa9817ad4441a09b8fe6daceb55845cb5eae8d28,0xfab6a9cc75155e51bf77a57cd24b31f40739ad23,0xfafd890c9c7b842912f4236c887b0eb2110fe3fc,0xfb09ae1301ebb15689aa8638ed44c5d50e28bc75,0xfb27a04c861c766ad5e2804edb9374ded26f6560,0xfb4b5c2c9ff294717ecb80a3faed2fb72fd7cd61,0xfb640267e71f50047dbbd9f41d8c401c622c30af,0xfc4fea93f57a7185f0f927e7f52c9300c189845f,0xfc608adf295012ebe392323d2ca8ba42756c45b6,0xfe2097649c3c2b940042b02c3167bb9810abd0a4,0xfe4f2726ec13b39338ddde3bd9b22c7d806b576f,0xfe800297add2fad45e99b941196175434007e266,0xfe84a8760df1f77b851b243142a83d7515378c46,0xfef06a9cbbc6a3b302fc289bc331c9add59530ac,0xfef3513a0c5cb71f8377aa2743c0d50e7769e83f,0xff80ad1082277f34ba03e8d435fb547ab005c014,0xff8b61aba6abf29dc6a831b6e4dade986a22dca1,0xffa2896da70d007958dd5e6eadf6940d9f800cfa,0xffa28d18194691f689ce5739645aa645adae2b4f,0xffc0035d3383f54cdc69d9deab69f2cc7956e246, \ No newline at end of file From cd3e6304436ea62eef73acd21f02ca0803c28ac3 Mon Sep 17 00:00:00 2001 From: tony-goss Date: Sat, 1 Jan 2022 12:31:54 -0800 Subject: [PATCH 27/35] final round .toml and Verification --- contracts/Verifier.sol | 8 ++++---- darkforest.toml | 20 ++++++++++---------- darkforestprod.toml => darkforestdev.toml | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) rename darkforestprod.toml => darkforestdev.toml (82%) diff --git a/contracts/Verifier.sol b/contracts/Verifier.sol index 7accfa7..744bbe5 100644 --- a/contracts/Verifier.sol +++ b/contracts/Verifier.sol @@ -286,7 +286,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([20131663352701264377208155520883810774996572133901224066122799158074743548661,18297748804274590066021933111184511416577950252643389119829431022657465812890], [2785786821571952675114539807274915558835153734567103548399308862186630606545,3760039685404799102669031110597259991560763993199219342225417519183869011826]); + vk.delta2 = Pairing.G2Point([1813826940198604951419294184343270013131470950145401774366675708681437542454,8542809486837092199086231051612500187888652482045179734485190966386368859868], [10268905555906804064474604329492476795069623003297061085796987800513077271839,8799429029967548174885848982929367220172919959015699106133513674694417409858]); vk.IC = new Pairing.G1Point[](9); vk.IC[0] = Pairing.G1Point(1598626181488966834385142702072340632701729613588553898141479831063364046244,17718230806281540722028825298558518558905695159801697318226319873036301566727); vk.IC[1] = Pairing.G1Point(15948659782990752942887133907536447435191600109534617758082114399428869442993,11099101392431127819059666871299914860584228203768799086923186847076507315534); @@ -316,7 +316,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([15676073592377597073711528856339460342674387339918080106538797151886226740171,2330073040773782664525142077397849353959241999587063072167183570940318799849], [9108333819270880347725104068902675947834486470063754157260763398744985625496,8459627557579508741770636657046752095372010664740912717331888888678079234554]); + vk.delta2 = Pairing.G2Point([20975187926641900431990006258952283114991708139588713819992352155007666724993,3570840730624557363888289300971384212026271292535253654088714304960207074945], [10631832219699477966035893086749763796038339601404385655384965796203332951706,18149516866757139620185569703337513682974386271202034288334366817900829174117]); vk.IC = new Pairing.G1Point[](11); vk.IC[0] = Pairing.G1Point(14177816537775685783067647996272395454522594113428919821714589771180610568314,6823299126837656023989613525270949531672774579800418483384480496108911392326); vk.IC[1] = Pairing.G1Point(11585636782253030502414616875647660216631207697186549464738288453964312644262,16366617865324088972494410389765901462344692803975117494865461021515474079688); @@ -348,7 +348,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([9395119555313831384654254305435309339870216117877276846608719582025986581559,14481299150194752819327210171462563055254604112139318264050449182928580132865], [10171254665189764911222262242249233305905228192904680685905220915458804426318,16142276709992611120029381087609334113224186083881414628879855064462450332473]); + vk.delta2 = Pairing.G2Point([11552821347700917064399599307874475478678259720056533676428779325888673942748,6570564545714964428536154465283703290436803703453895840513854294091223363396], [16910034110512611887376422216737325479893026261270825194368497702089236520835,21804983726595203875690516173899816463134379362971316769599329375851249101270]); vk.IC = new Pairing.G1Point[](8); vk.IC[0] = Pairing.G1Point(10870898939986000468532157640231430092356116495039287249548370970435589722710,9637509233802404751050875244565641105864732921095328155747707264762895963694); vk.IC[1] = Pairing.G1Point(19138797608808993399657283067430257583053688297164578482098293101955262780551,20006287987513927804142618424385437530171110155612987617518879163008364014606); @@ -377,7 +377,7 @@ library Verifier { vk.alfa1 = Pairing.G1Point(19642524115522290447760970021746675789341356000653265441069630957431566301675,15809037446102219312954435152879098683824559980020626143453387822004586242317); vk.beta2 = Pairing.G2Point([6402738102853475583969787773506197858266321704623454181848954418090577674938,3306678135584565297353192801602995509515651571902196852074598261262327790404], [15158588411628049902562758796812667714664232742372443470614751812018801551665,4983765881427969364617654516554524254158908221590807345159959200407712579883]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); - vk.delta2 = Pairing.G2Point([5805631120193347887390089503374629290386996734205828920238471909119996854369,17765028600860864110311499721341709178101182027508450038546280504830400659260], [10509361166074631049839464401038003842870709634837253815868913425907485373089,11819026244651557242231391379854420889202132451603977314768037158779053703596]); + vk.delta2 = Pairing.G2Point([10123887188811757978652006582967309981688296924896692281592716034844402340462,8437434587184002104069613392776479500252004933702450745835914529642928403172], [11161698886763326360580926536864713750517153347852784470696624068459506740867,3417442253331793754026838832056529214092373679258611822438837518808153743676]); vk.IC = new Pairing.G1Point[](10); vk.IC[0] = Pairing.G1Point(11550964137187913352526724844580499338131382138893314699756753981006102732019,19492512945047869932948946467344653872184411292565776553305249475937323729280); vk.IC[1] = Pairing.G1Point(3916477035785360610976006321745916078968774369440543915902405954859488657313,15321034048954067345112787429494548298867833228473430687967681199888641151218); diff --git a/darkforest.toml b/darkforest.toml index 3d64aa9..65b89dc 100644 --- a/darkforest.toml +++ b/darkforest.toml @@ -6,15 +6,15 @@ ADMIN_CAN_ADD_PLANETS = true WORLD_RADIUS_LOCKED = false TOKEN_MINT_END_TIMESTAMP = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) TARGET4_RADIUS = 1600 -INITIAL_WORLD_RADIUS = 8000 +INITIAL_WORLD_RADIUS = 400000 # 400k ################################## # SNARK keys & Perlin parameters # ################################## DISABLE_ZK_CHECKS = false -PLANETHASH_KEY = 6278 -SPACETYPE_KEY = 6279 -BIOMEBASE_KEY = 6270 +PLANETHASH_KEY = 2168 +SPACETYPE_KEY = 2169 +BIOMEBASE_KEY = 2160 PERLIN_MIRROR_X = false PERLIN_MIRROR_Y = false PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 @@ -23,12 +23,12 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 # Game configuration # ###################### SHRINK = 2 # No shrink if 0 -# SHRINK_START = # 2022-01-01T20:00:00.000Z Jan 1, 2022, 12:00:00 PM -# ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) -MIN_RADIUS = 400 # SHOULD be 5% of INITIAL_WORLD_RADIUS. +SHRINK_START = 2022-01-01T20:00:00.000Z # Jan 1, 2022, 12:00:00 PM +ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) +MIN_RADIUS = 80000 # SHOULD be 20% of INITIAL_WORLD_RADIUS - 80k. DESTROY_THRESHOLD = 2 MAX_NATURAL_PLANET_LEVEL = 256 -TIME_FACTOR_HUNDREDTHS = 6000 # speedup/slowdown game +TIME_FACTOR_HUNDREDTHS = 500 # speedup/slowdown game PERLIN_THRESHOLD_1 = 1 PERLIN_THRESHOLD_2 = 2 PERLIN_THRESHOLD_3 = 18 @@ -39,7 +39,7 @@ BIOME_THRESHOLD_1 = 15 BIOME_THRESHOLD_2 = 17 PLANET_RARITY = 16384 PHOTOID_ACTIVATION_DELAY = 14400 # seconds -LOCATION_REVEAL_COOLDOWN = 10800 # seconds -> 3 hours +LOCATION_REVEAL_COOLDOWN = 1800 # seconds -> 30 minutes CLAIM_PLANET_COOLDOWN = 10800 # seconds PLANET_TYPE_WEIGHTS = [ [ @@ -102,4 +102,4 @@ PLANET_TYPE_WEIGHTS = [ level = 9 planetType = 3 requireValidLocationId = false - revealLocation = true \ No newline at end of file + revealLocation = true diff --git a/darkforestprod.toml b/darkforestdev.toml similarity index 82% rename from darkforestprod.toml rename to darkforestdev.toml index 882ec16..3d64aa9 100644 --- a/darkforestprod.toml +++ b/darkforestdev.toml @@ -6,15 +6,15 @@ ADMIN_CAN_ADD_PLANETS = true WORLD_RADIUS_LOCKED = false TOKEN_MINT_END_TIMESTAMP = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) TARGET4_RADIUS = 1600 -INITIAL_WORLD_RADIUS = 300000 # 300000 +INITIAL_WORLD_RADIUS = 8000 ################################## # SNARK keys & Perlin parameters # ################################## DISABLE_ZK_CHECKS = false -PLANETHASH_KEY = 2178 -SPACETYPE_KEY = 2179 -BIOMEBASE_KEY = 2170 +PLANETHASH_KEY = 6278 +SPACETYPE_KEY = 6279 +BIOMEBASE_KEY = 6270 PERLIN_MIRROR_X = false PERLIN_MIRROR_Y = false PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 @@ -23,12 +23,12 @@ PERLIN_LENGTH_SCALE = 16384 # must be a power of two no greater than 16384 # Game configuration # ###################### SHRINK = 2 # No shrink if 0 -SHRINK_START = 2022-01-01T20:00:00.000Z # Jan 1, 2022, 12:00:00 PM -ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) -MIN_RADIUS = 60000 # SHOULD be 20% of INITIAL_WORLD_RADIUS. +# SHRINK_START = # 2022-01-01T20:00:00.000Z Jan 1, 2022, 12:00:00 PM +# ROUND_END = 2022-01-05T07:59:59.000Z # Jan 4, 2022, 11:59:59 PM (PST) +MIN_RADIUS = 400 # SHOULD be 5% of INITIAL_WORLD_RADIUS. DESTROY_THRESHOLD = 2 MAX_NATURAL_PLANET_LEVEL = 256 -TIME_FACTOR_HUNDREDTHS = 500 # speedup/slowdown game +TIME_FACTOR_HUNDREDTHS = 6000 # speedup/slowdown game PERLIN_THRESHOLD_1 = 1 PERLIN_THRESHOLD_2 = 2 PERLIN_THRESHOLD_3 = 18 @@ -39,7 +39,7 @@ BIOME_THRESHOLD_1 = 15 BIOME_THRESHOLD_2 = 17 PLANET_RARITY = 16384 PHOTOID_ACTIVATION_DELAY = 14400 # seconds -LOCATION_REVEAL_COOLDOWN = 1800 # seconds -> 30 minutes +LOCATION_REVEAL_COOLDOWN = 10800 # seconds -> 3 hours CLAIM_PLANET_COOLDOWN = 10800 # seconds PLANET_TYPE_WEIGHTS = [ [ @@ -102,4 +102,4 @@ PLANET_TYPE_WEIGHTS = [ level = 9 planetType = 3 requireValidLocationId = false - revealLocation = true + revealLocation = true \ No newline at end of file From c535501d6dfcafd892e12f3fa448c41f2e8cac1a Mon Sep 17 00:00:00 2001 From: tony-goss Date: Sat, 1 Jan 2022 12:54:11 -0800 Subject: [PATCH 28/35] curr addresses --- curr_addresses.txt | 221 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 curr_addresses.txt diff --git a/curr_addresses.txt b/curr_addresses.txt new file mode 100644 index 0000000..9263138 --- /dev/null +++ b/curr_addresses.txt @@ -0,0 +1,221 @@ +0xae1029FcB41C3595eDC524fE331177C14d5a0B42, +0xE2678451d1F15Fc37cF218b7824E810Cb15f5E01, +0x432A9C14D8103959107d6158D0261481737e9F45, +0x799e8f9E7c36bB5863b81944dAea5cfA5e84BF96, +0xC14d4eb3700C37dFA2992Ebc918f5Fd11A5e531e, +0x62c813d090be686331badd7b7113a8a073bdb00a, +0x4B7b6D3dC60aDBFD35271bcdFaCc5fca5E3a2107,0x488c2c2F8696856C1E0dfA4AD91BE32cC61A1819,0x91928AAfC881Fd95be0A4bD8C09b953d430909bc, +0x7f93B033D18dcA9fD2BA4CbF2bf73A2DF840756c, +0xaB5309888C39646bb222a70E0Bc1C69e3326Ee77, +0xb29f7dd612bfd1430606b07d8742ebfc585d23db,0x277b1801b163981ac0b1c5e25597f60d60d303ec,0x7914312ffee44ca1bf9f3c735713752c612a91d9, +0x5c0bd58a7d5d132d09469f511418d812716a3fc8, +0xF84c4B32222845a8B186471F634bBecFA70a1D6A, +0x8847EBaaf29A18396e49191602f8d8D141b98aa7,0x6737B21FaDF091F8585AA89be0b427764c11787D,0xF6b0530BF76afd8C4739b5377453E996EFed3eec, +0x87Eba0049CA4efe63e801c1F1F5b6EFE7Ca74004,0xE3f6883EEc8318586054bA5179Af8496781E4943, +0x0Dbc1EFa49493e7ce90B8207A3822D1F83Abc4A8,0x1C98d96D2DfA977cA557AcdCDBEA3a124e0565e5,0x8CE4CF6E6f21dfDf4C113CD05F317218C8018e27, +0xea978ecea220b0caa0394341bb71909de3bbf082,0xb70760bF57c3295999f978fE404F4EC906669330, +0x3b1b3edb62b527a134e5a7541f8231a3840486e1, +0xd8839fb0e4dad3b63767310bda086dbea06bf4f6, +0xa6a6299ae4B0C91Ce9b7D24E96CBd48dC29cac7f, +0x2b9d9ddc96bc6e49bc94b6e2273621af7ec5b11e,0xdeada55a685f536c31e20c3ab20f6ae387d85b75,0xdadb0d97eedd69badcc5f626f416a6cb191bc219, +0xcd270Ea8fF7905aeB0B89a840C9e6beb5a034476, +0x2B91caCe45099664f9E354B85732c0507af40066,0x17fe8744b726DB8F6d8E30319fa044f1FB8f1B02, +0xb46FD68BF61bF9c795F90f56F1805283783D24b8,0x61d3F078fCa066eCA55340864cb39e9A66dB9eF1,0xF91D99dE6A9f69089CfC482B4C303275dbF3b967, +0x965c71215E54705739cfD40aDAAD0ee0D0dB6673,0x0563457C83Ca2D0fe1EBE11d578d1eB4B7F1FaEF,0xA438037293a91A2FcF71Fb4A515Ef34DCD75898e, +0xDebfDB2baa4bb879D6Cb983609929d813E9bC39C, +0x1f4EE1b423387c1339148d7c7dc2F69783D27559, +0x243f6512F2752a85E39B5f5B0964f2e27511b366, +0x4047F55ac6C9dA5938E6b662926D04c0dbCC5343, +0x7AB9bd4F456193D5A7efe3754b66469a46eD3950, +0x8E02ecB776B5d3E161801b89F82CAc6abaeD2B47, +0x6b1B673E56f90e5848B022440115BC882cc40e86, +0x63B01E18c2Ed5D4Cb63146070deB3B430C56D58b, +0x41eC43Cbcb39531f2814EA57E89274D00562A5e0, +0x4B80e11D2410F2029aE73628603840dfFbF885Aa, +0x7722b2bC715847A1684AE5fe66fB8F1e52736948,0x19e63Ee48e0df0534818398e68AC4c1Fa68177fB,0xCE3f7c230B0d562C2B7A3Cc683Ff1F26136BffCE, +0x9661491F283093046c1A5c1a2804D3b5D654a5d5,0xca5EE1d5ABb55bFBFdA2fd3Ecd941a949f95057d,0x6772B01B7D1197F0b7f923D7682cFeF2971e839B, +0x0FCdeCc7313E9230a634f19B0874d099e5c5F9A7, +0x188b377db3bC07D626c91d05dE8FFbC687D4a0Ef, +0x62c813d090be686331badd7b7113a8a073bdb00a, +0xd821b38e03f76AfA6c1b0F0E828D0091d4528f4D 0x08c0eF4f787e0E1a37005Db0100748526e35d2ab 0x07a1403089d7998d57E86c864760855035Ff8904, +0x369f218B1112722366A0867563fc254686274f16, +0xcDf585bFeA467CaE0c6Fcad015f65a5B86661b6E, +0x276F129f182C9E0926D7BFaE690373A893019ADf, +0xFaA270aA53bFf002cB9a91CB47b866a475f8Ab85, +0x0502871186dC8b8eFc76cD116841F2B6C26d4339 0x69834ee9D96D1055eE40Fc3DEd19F9Eb0B53Fc4e 0x37e0dB1932C3d071660cbA0919fF4846F43f28f6, +0x9DfdB1ba6ECDD39a5b4d68E969F6144dc55B486E, +0x696F637A5a5F9CC9795D9c597287571F3333e14F, +0x31D3fA5CB29e95Eb50e8ad4031334871523E88f4, +0x3d0ae836FC72A6c026DC823847a0c450D8692a4E, +0xf4ed1EF1f7A52DC7Dd10a9B5d43f23748A1E8992, +0x91b68339914a29c017F9e5c8B2E1739306152fB9, +0x860d7aC75fA001BECD1b4cB6592D35DB28E72f85, +0x54b6032105A6DBdcdb21aD4A2707A8909AF153D7, +0xC416FE7C783846b4D160Fc0b7DB96e9754d15496, +0x54c64A2F14fdDee4b22160281876D948ca569Eae, +0x5f88Eb1e4E43b1e72Bc14Cb32CB2b787625d8aD1, +0x55ddBda09e18D5f2F65a722745248FFEe0E5d021, +0x716dA040f4C30B9d556E25D9Ca6747E1B5c92aaC, +0xc5e0Ba697Ca21C6Da4e3a0e291147504af01bEBf, +0x286A023C325dfaA0ca66fD5c366aaC09440Cd8fb, +0xa90B663a6628970de828C8B8767bcf775Ae20Aa5, +0xF0614bFDa3188d55481Cee03DCFc77Fc042a94E1, +0x2794731a276e4446809E06C45C859797542d7D7f, +0xB6AAa22D04b525b17A6791fdEE490063C2ed1326, +0x6Ee41d7eB1F7fbd8519BBBE010b9e74b3578ccA9, +0xeabCD57CBa653cbEDCA59bE7285b47721Da687DF, +0xdf2077fd792767b5c7aa673bd4199dd726bfb379,0xdf000bc84edfe1f62007f78ecb5eaa0e7279440a,0xBB91F5F1E2014eE5D5b48D8ef682A907220104dD, +0x61813F50535224BA0644CD1d532beB8b0A42046D,0xb1fCB3A762e74549201ed9f607665eE3C7BBD26f, +0x0ae2b017fea73623942698084C6A5339Ed204281,0x55ce39e8834328E3893d24a1652db0Ab17bE4681,0x1b3eFCD48AA4C56A78b082d64E4c1992B56C8146, +0xcf64a77aB821a8fd14c5921D4756B6c953569745 0x5E5d0B33a2c523ae9e3a96F4201c3DE008e9eC10, +0xEE0b6AC559D9F1B9544FD06c3E8A4973fC314448, +0xaebc33133F3260E90BE1Ed6d03dde1000fF0E454,0xf954Dd33a6B4C8F3458F7C7127766067D125a43D,0xC15cB9f02c0EEbbD4b8487620fDd9Df5DCAfd1ca, +0x7029bfa9A85Ebf4653945Be520dC3b7F1181F4aF,0x853589B4e8d44F337369AAd2622A33E43c427f83, +0x5b49B09650B050EC36454e310Bce67073fE8048e, +0x938AAe2aEA56782175E9BEbD54382F443042006C, +0x0D625A4613ee056E14CA2b2711C35D9a409F87e9, +0x169841AA3024cfa570024Eb7Dd6Bf5f774092088, +0xc295c1E703ecEDC97043397D12Ba0D8Cb24Ac4E7, +0x5452A87D78a292988639449D57a4248C1b49df47,0xd1a4fd5eda375117439923e120ece7cbb73253c4,0x8663f17d889fa5aac6f8bff069da2bd3f56adaf6, +0x570693f3a0107aAFC55aD989d951516CBAa6638A,0x0cb78ec8876f0b1a08df1d9e73ac6df93712d524,0x54bd842c168a4d99fb2145b1780a62551cb68480, +0xfBA48a69Ee82c3e1DF80554d04af7a62a6494AaF,0xE2bafdf4B33F5699Ab53C33afD90F62CEe15B6A7,0xE3E0f1370071834F5cC6745d840dBa77D09FABb7, +0x93a8a5C4f66B5D6a6432E05AB4C35a29F42D0b71, +0x51624e7F502c617A49A38ceA1A5d2A6dbc41eE6E,0xbd87014184e19c324d789097826eb88c2aab99c1, +0x54273Ab918bf8fA193cc8d3f3C5995c910B29824,0x5e60e9d1eb2e29525806c87872b4246c35d602ff,0xab9919f8ff015a51e886f872307cb20b57c0425f, +0x3BA26E744791C1c647dadBDb06910ED69AE2C20E,0x9a03120a7c7331d7ab7d2a240366b9d1760ec031,0xc33c1d5ade77cd5431b2cf625d507a24dc1e6fca, +0x06591A212CA774b3F93252CEF20022E56f7Ef736, +0x6A8394D5C60C960a7EF89757f9217487CA9dC48F, +0xb5F3c1084A61BAA976BE895cd6a89503e9678a43,0xF98bD7123f785c17B8Dd966C3E41D9Da79cd5E3f, +0x1966BeEB1C396f3676Dd69E445615b34392F675E,0xd3d67f5834c5cbc16aef7a4cbf5b05629b0351aa, +0x27db43356a337849e10dc9447318A71069e0Ce76, +0xB8Fffc90658b3f12a3C444581204A54EB2120d9f,0x6d1d88fcd906d91d11f7ba6e359b76cb1839d004,0x11cf4b242da0173c71d9815b906caaf831c21e4e, +0x385208De396181b783B5Cee7AfE5E7703d8C275c,0x8f3f1214546fca4ce6b1640f7527f6782c71e318,0x0442f119d1133f26a7ebc48587deac8028ea9fda, +0xE98E1FB9D9243292Fa57b32Cad02CAA3298Cf77b,0x90f4d378bc39539e41f997cb61d22babad258c0e,0xc033ef5c3f2570af3e0257485d712786626e78db, +0x56DebcFe51E8E4a13D81AA674deA7d91552CBa80,0x0747fdd11c366da9407a742cbeea40a63770dd23,0xfe710d5b7f100931488b6e88b8a5b05a93286be2, +0x0cC96208b6e5dB86721E8f378541582f15C238a7, +0xF90668eC684F3fCFD0c322F37A02a336c02dD25d,0x8F455c13b82f25933952BfB814C93ce9324C1D25,0xa59Ac5590c501cF4527aF785aD91013b9b3090f1, +0x2c3030252cB6425863b53B2577b39ef8A124bEF7,0x848128e545f24339890b371a3a9226b3fb9d7523,0x3ed8e0ef71240931ab7d721ab922026df4ee3e9b, +0xb15D493414bb2920be9fb669AdEe2F7698aFc4a4, +0x9d5769d238b590A7a7576114AE64988cb35694F1,0x77eeb782ecee053705e8357ac26d9b0fe0a83ee8, +0x9745959cCD9ef45075fcBD485111b9a5FC46CA55,0xf0c0353489da5b3f53f7c36d869d88c6b83552c9,0x896df02762512cde64ca09453cfb8461506f8b06, +0xd0265Ca293953ea1CfB84F48Ce4EbffD981BBCcA,0x81bd26e6e9686102f0d76184cc44705c4d04ac8f, +0xd7092A881fBeB6e22d4eC113044108F22EaF752E, +0x03e30c15BDe6b4Ca401A76a99B6Eaa34E3a5564d,0xea2ddd301a3b366072035a151f8fef71822e4882,0x25290ddf620f8b9a249944fa3e0854467c2cf36e, +0xbD732423DC61Ab01ec043B314fb7c705faFc61DD, +0x57ceFD4FebFE44E64075df7e4cC656dA235d63aa, +0x6fa3EB8644A6D051a52D24BC9c024bC72746F56B,0x11b285aa27e45b6818122b9ec737a541b7b7dd2b,0xd8701a34cee29ecef20c00898733847b33f48762, +0x3c46ee18e962d6f8cbf9c13e1c9467890484f94c, +0x9CEB592706Faf42dC2299D9089fcA49C8F35DE60, +0x5ac3ac5e072ef4b97c9ef46e78d86701b18c7654, +0x2320Ff4f591eb3F92F59C20C97f6d4977F5fEb9f,0x8b175d30d1091d4ad077af02c8d45dd2391767a2,0xd81a6b9b0d4c912528118630d636ed1e632874fa, +0x66C88De42bEC60b70b7B57CA7821E63045C9d586,0x2616B7237705663ed8a54785B828c339FED8fE96, +0x7bac3F898c94031Bd910cF0eA80512A038753468, +0x0Aa1820ae8C0890dA2cF0ce4d23F666B5f6cFCd3,0x3c5d7bae16eebe2275f84c4130613b266b9a7e23,0x6381d93db41da2bdec5fb4074c9cee28c521d547, +0x2A8feC29Ee38171e98D09A406575D735a526cFB1,0xef6eb0157bc76269d379ee991278df483d601f19,0xd1d6a64f1c69484be61cd2807c0065d98c8c6389, +0xf1D136865a478a96DE6B60940Be899FdC9AAa159,0xe7f827bdd896c8539ed627268501741020b7f598,0x01224cfb0d4783789923a2bf2d34b76e941fe3f3, +0xFc8b92c1d86d90c848d5fF7feC18d1cfebE6426E,0x7f914bf1c5e261478e810466a9aa0a740495b702,0x36032768058cfe1761acabedad92e8b43d258c74, +0x7DCb3D684308bfE73a4b6558eC8d842e6d0956a6, +0xF8375e6F4daF3D6109B2eA8FEc6F90961E97b053, +0x73D930068AF2f88C1293D755efe3fD5529fC133F,0xa9f3c9d2e5b14b72d0bbc5105e8868506b364e35,0x619767574c679f566187eee41ef0ddf6a4173674, +0x2dA87e0B8c9e67f0518A3Ff9d41A391b3B55428A, +0xda824fB9FAE03A7383968d9fEB3717C809689c48, +0x301264F9f05609b7116986b0dcE64129258d3Ce2, +0x36a077E872413eA1E5d11961B44b00c6ce0fEA85, +0x09174CB6652c2260d92F2f4e641C3e1f1829F408, +0x526971e25ca50b79254c082cde9bbb864afcf2cd, +0xfCc152bb169a9595B4af8a7977b94afd85aeb614, +0x56b2826CD764059d537338EE78b6DCfbB457847B, +0x8BCd1086bBC6DAdDf255b4f6902aBaaA31CDc56B, +0x3485495ce944DD8E078f51658f14829B4FC47B5e, +0x810ec028be5f89f0e27Ce5cc27b67f19a8150DAF, +0xe9034BcD20119ee7563d145Dc817820690afD5Fb, +0xa94b52be3270376f5525ee764d2ed340dc8b2b1f, +0x7387577BbFC5A72C5Fd0394c8DF0d521d20fD41A,0x696F637A5a5F9CC9795D9c597287571F3333e14F, +0x2ECECb40ad399C04fa045ae2DF1309284b9fDE8A, +0xb5bec3725aed40b320f8ea0f9165c0cdeead00ce, +0xa994b1a4eefb691850d5a10944bc05a2b4bfbcc5, +0xAf30cb754c150698704efB7a41873A0f79258056, +0x438a3D3e716165537e4C1C76740442a433538EcB, +0x0797846bdb85e3303ad745e9d4e7d563a8ca1702,0xaeb9640e757be9c7e205f616aecd55ebf53e2828, +0xbD7566Ad1107A02A7Bdd2e286Ea3f95482DA836c,0xf696737fa10fac0047195de28e074ef54198bc9e,0xde88debd758059ca456c48769f7777d9561212b9, +0xb11bae2c48fe0e915d436a5fb97fffc15b893600, +0x39C3036F3c61e92780682686B1fcDe249ccbf0Bd,0x166675300f15c390095db96612c863e5e8b3384c,0x649af4bfa01cc9adc35ac5d0babded12c280a66e, +0x9713BA9Bda493e8De285cD62ec4B4630b90D9590,0x1F0a151778e8933704eF4435a3ef4493b35D2F08,0xB3F2d9c43047Fe7a2a0a5429951cB4F44f2D8907, +0x9Cf1a01A0068A1064B787D374A8B60b03C0E8b79,0x834d47be3948de7945b7238c0b067f7575188fdc,0x330db7baded20bf47c671c3f54e842526424e31d, +0xaFc02Fb3b19aEE0693dB770e26dAE1C53c720A24,0xD629582a3933f182409493170C65a389896D028C,0x3B8E3d7a446B2C1B930119471A259F44E6e9Fe9D, +0x86235F3Bb3E95Ea88A92BF88C4Ae551725609436,0x63cb0f5fed6fd78934c7a59faded3b7c97f1a6da,0x3c326e93b62d09e9ed44613e5b5ba016a2dc77ca, +0xD9b1293ceBaCFb60160EE1b5D98Da9AEdEaCef0B,0x8054e2c417399f88f823b59a384f4d00ad7f35db,0xf17fd1ff776a296cb64654ab11d447883d56dd16, +0xB7A8AA73d68aE393dF5C51b8B62f860E6B554c68, +0xe247c507f4E04421742770C8592401bBA4A8D87E,0xee8f63161aa2c8a69bf69c9752ab26dbd880b8d4,0x425a949491d16bb9aa91182795cbe2d4386dcd44, +0x0E84dF630F54acadf6A120C75EB65739B0d18326, +0x353ac34d7d579F8d9949E41E3990f46470291cE0,0x742f257ffc4e922959259e85f0ff0afc0208fbf0,0x8b4d949753d75f3995728dc194f8c57802814673, +0x753cee24147a3926CaF766583beF5013e5430f4d,0xCaC252d5Aa85b36131FdaEF3944Cb3d0f0b26DB4,0x36Ddf2E22ef395b71F4Dc97674a09a485663ED7d, +0xE5f3A73084aEe0BC4A4D1AC847F67A2E94FbEbd3, +0x94D300404139F2577Ca757658F00e0098Ed7F7B0,0x3a3Ac459ed44Bc92d815c618c32194d87A985E3c,0x3364f29b13D0ebfa789efc9C3Aa45e3F46eeEaB1, +0xec0c633A9eb02a9f26Af64d76987478Eb8156b31, +0x9a9bF95c4bbe82705151879FAb44c29a3d126Acf, +0x65E43244d19C3e17058Dfb6F5e5E921402EbD964, +0xa5E2087D9444fBfE4551DA6999C7950C25Ad2A09, +0xAFf039706030fc296caBf0335e072BAf2b85E275, +0x4921619b9481961E1e20f125c2ec49fCbd582234, +0xF051aF743CE7cF61bc1a4292A5C93A1FcF36D72e, +0xbfbce15caf01baad3ffcbf862c1b07bf18f50807, +0xbe4248D659a240D1997845299F10eBA64e40b436, +0xe173765802f7caaecC9ff8ec2A09c4cA8184F3F1, +0x16f902471016ad43fda71ed2101bda5bd4e101c3, +0x6b634885BcB9e07dFB3bCcFC530FBa89CC8760fB, +0x446a2C4de372a585f7AEa47cF6C75e7E1c758De7, +0x1b5C706296888a9C52f0c6dcF0579b638bA7EF2a, +0x2e7B05c3De55Ab1533C7d951727965355a7D0685, +0x2A6a4aAF24D4e44790e0D677aC885731403523d6, +0x67f2576176115F87a90DeEBE208663290AbD0B0c, +0xCC986b978aC8f839BaD796E7303dd2B969AFbf3C, +0xfb4B5c2c9ff294717Ecb80a3fAEd2fb72fd7CD61, +0x0a358b16C80C879f810663Bd5DcE2e9E73183796,0xd4875114a09750de288a7fb14cf395341cda2bcf,0x63cb0f5fed6fd78934c7a59faded3b7c97f1a6da, +0x82D02b1736A64E348e781D3f3F94f842d89c4FBd,0x83e73f263b653335237b44f416f6a7a2a963ba9d,0x18ac5e7f0af44e88704a512c84c8f1f88caefab2, +0xa49Eb9De12f44F37c53CFFAFC22226D1Aa49fFF9, +0x96469f1e59A6FD471361ED2074b2Ab89e1C9a31F, +0x3a5CB4b1AF80e0deE1882a1F5a06267BD56E18aA, +0x8A286b8F584Fd8b893EbE2289D8B803fe81d9a78,0x16d909e37d40f6e5b1e52f4268bc06be5b7a51a7,0x06a1463ef2e6c67d9d1921000b99792cd06471d5, +0x49efcd349627Df5F3c65609BFFd893c0aE34697D,0x377a82318aaa5574658e5b12e5c828aa7e6a7038,0xfc2387ccedb8ad692f90784d71ee888545a0ec7d, +0xd3De8AC3a69b758418130F04EA289Ad20Ba59d48, +0xCeD8E34b95fc429f91906C8577D308710b28fa0B, +0xbF0CA230C5482881e5A3Ac021A363c0a96Dd1110,0xEb732D09107E6Ad3baCadC84E0A6870890543680,0xfa3395983F92fCA99b767eE737bDA484E7F17f75, +0x0b652c646678ca09487435d8f329836fbc2ec6e1,0x3613c9b8dc08a11b09dce6e8c876f76f603a3287, +0x049A8b3F8fA2fcE2Fa9BE507f6948030fED53D42,0x18257133058a38188ef054628924e16a0d81b97f,0x69c448d4bdc8ca09667f30fb851042d01bbee231, +0xEC17972701B011c3983F1EaFdFB4450028284bc7, +0x9aAc3d2d3E9e7cfb93aF71879EFaed8d86aDAc40,0x3814318aa292fa7ee1bcc0ef082cbbbf0bd548f0,0x0063c484c02f92cb2560ea5519143f2cd38511ee, +0xe320f1005B3762411c6E92b46170eFf05177A9b8, +0x06f4951220EE46276Af1D59bdfE1D4cB975a953F,0xF958626C811e8DBcbC2Bf14f225abFc157e8bC2d, +0x1D7678c8262C3054eB75d70A19d09f4a966697ce, +0x4b1c6855475e65446e955612ca6167d9d9e843ab, +0xad50B76A0C5dADdfb0389de4BB6716859BD7E7F0, +0x5A418B39BdE3b3F0404c0305f31Ea0dEe551BC47, +0x937dc26Aa8Cd25B918767296e38e1472667Fd536, +0x629FCBcF826e8EBEFB2714084851b397575bcc93, +0xA0Dd344cdC87c0d014C0080B576c6ce419df4992,0x604921fe98f89c6cb29595767142cf53fdbcf2e1,0xa44be221ff64ed1fe6b76f2d063ef4540eaa7601, +0xA1539D3492367B43f061137794b8d0513f76a561, +0xdF56B490741f2478bE8eb02711FA715bEa83C321, +0x97613ADb7338929A094b0451e88a8d19F034676b, +0x8CA086AEFbB202DEB362F2bFE73CeCCFf2983494, +0x5fD412cceAF648B412C52585a4aD6143a61e283F, +0x7bf369283338e12c90514468aa3868a551ab2929, +0x0B91d6a74c851a1f550ee722bfFeF929b22949eF,0x45103bd143ca25e7f3675aef4cdda677b0dc1290,0x349a21b82963180add5a034b5e0d54b000efe222, +0xab7ba16ed7b499b73014cdc8e45bb0b5bae2de5d, +0x4f51B34D715467F4Cad0b0290E8f65FE98050704, +0xb534Ea2B9ff93Fac0fa2907121F3fE58987a75f7, +0x0f45aBA574AcEbA2E0717Ca86e910211b34f9db9, +0x35dd195ba3d2c89a6f134f1d0bbcfe658228c019, +0xaaBcE7635D15530eB02f4b5700519930248e53a2,0xccb584cfbfe2b5bbf8b5e5f30e94f98ce6366c31,0x9f04b2a3708696ed60838bbcf82ac3e46a6dc431, +0x66D47e7b118DaEC2fc50b41563Adf937E508E0F6,0x4b09ef24a5958c3dee02335096ddc37bd56b0bea,0xc42dac36a0cdcf0045be1d9c91bc1127abae4591, +0xeff21e5df5654857c39d097f00f242e17d69b9f8,0x40cd78f1d9b39c81f6332ee9b65bcebe901e348c, +0xd40516E6ecc57d013465D8e3C98BD6D5AEd6a180,0x0623c8983672b01e8b0379400b5e26Ce4fe821b3, +0x26bef509d92A02Ecb541883C83B3663cBA04E0d1, +0xcE818973b97EE8c96E8eB6AdD43b875682487487, +0x509985400F75Ae13A5179b4396DAbcf15a9937eF, +0xf694e8F43ea477e3e1a018F2baa0867BA2cF8b34,0x1F37196b359b8862367288EE0210b74F027843AC,0x1F37196b359b8862367288EE0210b74F027843AC, +0xd5301efa5561cf031195d662817e86a0fbf8c6d5, +0x1694492e230049A0bA9DFDa008640F8E88973E7C, +0x446e049463632b87b241af7f7d595e5154a85246, +0x6Dbcddb833980f3312dc4fa48aC707e53EBE2578, +0x865D7eb5db37cc02ec209DD778f4e3851a421A20,0x4006dA25df822E602EC927c358e20560c87aF08F, From 8caf297c8b90e0ae0c559055f0cc3af0a5c6e361 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 14:42:43 -0800 Subject: [PATCH 29/35] 1/1/3pm addresses --- curr_addresses.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/curr_addresses.txt b/curr_addresses.txt index 9263138..81552af 100644 --- a/curr_addresses.txt +++ b/curr_addresses.txt @@ -183,7 +183,6 @@ 0xbF0CA230C5482881e5A3Ac021A363c0a96Dd1110,0xEb732D09107E6Ad3baCadC84E0A6870890543680,0xfa3395983F92fCA99b767eE737bDA484E7F17f75, 0x0b652c646678ca09487435d8f329836fbc2ec6e1,0x3613c9b8dc08a11b09dce6e8c876f76f603a3287, 0x049A8b3F8fA2fcE2Fa9BE507f6948030fED53D42,0x18257133058a38188ef054628924e16a0d81b97f,0x69c448d4bdc8ca09667f30fb851042d01bbee231, -0xEC17972701B011c3983F1EaFdFB4450028284bc7, 0x9aAc3d2d3E9e7cfb93aF71879EFaed8d86aDAc40,0x3814318aa292fa7ee1bcc0ef082cbbbf0bd548f0,0x0063c484c02f92cb2560ea5519143f2cd38511ee, 0xe320f1005B3762411c6E92b46170eFf05177A9b8, 0x06f4951220EE46276Af1D59bdfE1D4cB975a953F,0xF958626C811e8DBcbC2Bf14f225abFc157e8bC2d, @@ -203,14 +202,12 @@ 0x0B91d6a74c851a1f550ee722bfFeF929b22949eF,0x45103bd143ca25e7f3675aef4cdda677b0dc1290,0x349a21b82963180add5a034b5e0d54b000efe222, 0xab7ba16ed7b499b73014cdc8e45bb0b5bae2de5d, 0x4f51B34D715467F4Cad0b0290E8f65FE98050704, -0xb534Ea2B9ff93Fac0fa2907121F3fE58987a75f7, 0x0f45aBA574AcEbA2E0717Ca86e910211b34f9db9, 0x35dd195ba3d2c89a6f134f1d0bbcfe658228c019, 0xaaBcE7635D15530eB02f4b5700519930248e53a2,0xccb584cfbfe2b5bbf8b5e5f30e94f98ce6366c31,0x9f04b2a3708696ed60838bbcf82ac3e46a6dc431, 0x66D47e7b118DaEC2fc50b41563Adf937E508E0F6,0x4b09ef24a5958c3dee02335096ddc37bd56b0bea,0xc42dac36a0cdcf0045be1d9c91bc1127abae4591, 0xeff21e5df5654857c39d097f00f242e17d69b9f8,0x40cd78f1d9b39c81f6332ee9b65bcebe901e348c, 0xd40516E6ecc57d013465D8e3C98BD6D5AEd6a180,0x0623c8983672b01e8b0379400b5e26Ce4fe821b3, -0x26bef509d92A02Ecb541883C83B3663cBA04E0d1, 0xcE818973b97EE8c96E8eB6AdD43b875682487487, 0x509985400F75Ae13A5179b4396DAbcf15a9937eF, 0xf694e8F43ea477e3e1a018F2baa0867BA2cF8b34,0x1F37196b359b8862367288EE0210b74F027843AC,0x1F37196b359b8862367288EE0210b74F027843AC, @@ -219,3 +216,20 @@ 0x446e049463632b87b241af7f7d595e5154a85246, 0x6Dbcddb833980f3312dc4fa48aC707e53EBE2578, 0x865D7eb5db37cc02ec209DD778f4e3851a421A20,0x4006dA25df822E602EC927c358e20560c87aF08F, +0xc92e8a9da9d4526adea8b808fccf7f73a8b7da21,0x546649e1982ad701ff22ea5ce3c4e883371f19d8,0x8f6b25946fc62f49bfef1e67401ae0d7c58a3db5, +0x674F357BE1C16b6E7E29e1ecf3565Fe876D7F5eb, +0x8C851c9d36044E5C02c11e42d14A9A058abb5E42,0x70b88971ef701b735177953b328245d6aad27127,0x397057b99b8c1e36041870e4ccc1fa6c3f0d8ec7, +0x57a7ee55f60a721c8aaa0097bdbdf46843e1f7db, +0x7499a5Ad05142e75e6E4C1025cFc7B4daBC7723F,0x73b6e64262f9b57d6c92d439b6d19e17c48031c4,0x38cd718a58fb6f8bde0b1b608f20c48c2a25e24b, +0xcb6289cf48a0fd691d5751f736aee6a92c89a21d, +0xd67af7579d82b2482c5faf228183dc22810afe15, +0x3ab6994380A2f3ec0eD65Bf66caBc204DE88390c, +0x3d408e53FfAc8EE1598435dAB532D1e55C30EF4d, +0xb4F71b03268d649DD3AD41AFA042CD31351Bf193, +0xD790D1711A9dCb3970F47fd775f2f9A2f0bCc348, +0x36C82e6607be72eEa8661268eF3300d6bfABc2B3, +0xDE9c364bf57aEeBC810C48DEBBB307c3A76C1Ef7, +0x77228561575DF26b05001Aa38fA451e5D8fdb81B, +0x8ee96063cd77ceeabae5a7f8ae5b71727cff403e, +0x9DBa4640da89ceFAD5EBb23A414CDbc49D64ca19, +0xDd6A9d86B6785d4E78Ed762CfAfCA9d509fA6A88, From 344dd805f5c917bd48698f4e0f570002906a75c7 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 15:11:05 -0800 Subject: [PATCH 30/35] whitelist task typo --- tasks/whitelist.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/whitelist.ts b/tasks/whitelist.ts index 74834a7..7b2633c 100644 --- a/tasks/whitelist.ts +++ b/tasks/whitelist.ts @@ -141,7 +141,7 @@ async function noKeyWhitelistRegister(args: { path: string, drip?: boolean }, hr await hre.run('utils:assertChainId'); const whitelist: Whitelist = await hre.run('utils:getWhitelist'); - console.log("whitelis address", whitelist.address); + console.log("whitelist address", whitelist.address); const drip = hre.ethers.utils.formatEther(await whitelist.drip()); console.log("drip", drip); @@ -182,12 +182,13 @@ async function noKeyWhitelistRegister(args: { path: string, drip?: boolean }, hr // console.log('validAddresses', validAddresses) console.log("total players to add", validAddresses.length); console.log(`require ${parseFloat(drip) * validAddresses.length} < ${prevBalanceEth} in contract`); - + if(args.drip && (parseFloat(drip) * validAddresses.length) >= prevBalanceEth) { console.log("not enough eth in contract. Add more before whitelisting"); return; } - + return; + if(validAddresses.length === 0) { console.log("no valid addresses to register"); return; From 50451aaf162c7affc6bea2c338b007d7ffc02412 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 15:20:13 -0800 Subject: [PATCH 31/35] 1/1/3:20 whitelist --- curr_addresses.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/curr_addresses.txt b/curr_addresses.txt index 81552af..ec94a49 100644 --- a/curr_addresses.txt +++ b/curr_addresses.txt @@ -72,7 +72,6 @@ 0xaebc33133F3260E90BE1Ed6d03dde1000fF0E454,0xf954Dd33a6B4C8F3458F7C7127766067D125a43D,0xC15cB9f02c0EEbbD4b8487620fDd9Df5DCAfd1ca, 0x7029bfa9A85Ebf4653945Be520dC3b7F1181F4aF,0x853589B4e8d44F337369AAd2622A33E43c427f83, 0x5b49B09650B050EC36454e310Bce67073fE8048e, -0x938AAe2aEA56782175E9BEbD54382F443042006C, 0x0D625A4613ee056E14CA2b2711C35D9a409F87e9, 0x169841AA3024cfa570024Eb7Dd6Bf5f774092088, 0xc295c1E703ecEDC97043397D12Ba0D8Cb24Ac4E7, @@ -209,7 +208,6 @@ 0xeff21e5df5654857c39d097f00f242e17d69b9f8,0x40cd78f1d9b39c81f6332ee9b65bcebe901e348c, 0xd40516E6ecc57d013465D8e3C98BD6D5AEd6a180,0x0623c8983672b01e8b0379400b5e26Ce4fe821b3, 0xcE818973b97EE8c96E8eB6AdD43b875682487487, -0x509985400F75Ae13A5179b4396DAbcf15a9937eF, 0xf694e8F43ea477e3e1a018F2baa0867BA2cF8b34,0x1F37196b359b8862367288EE0210b74F027843AC,0x1F37196b359b8862367288EE0210b74F027843AC, 0xd5301efa5561cf031195d662817e86a0fbf8c6d5, 0x1694492e230049A0bA9DFDa008640F8E88973E7C, @@ -233,3 +231,9 @@ 0x8ee96063cd77ceeabae5a7f8ae5b71727cff403e, 0x9DBa4640da89ceFAD5EBb23A414CDbc49D64ca19, 0xDd6A9d86B6785d4E78Ed762CfAfCA9d509fA6A88, +0x8a307ED3e0D84e8D033598fd700B1e8D016Bb036,0x3237bf1bfebe32fe316bc0e2883c3c730bff0a65,0xf914cf0e56877adbcf2b96b135508ef4e2d642fc, +0x6e7c41f3f1fd608528120169b03b08a0fe95aefe, +0xe23b55f09f0e46575Ff39df10CAB0Bcbc2CAb74B,0xcB843889491dC48FC383150Ee73BaD278539Ce5A,0xe078eac26Efac2eDB9D4E7993Cdc299a3873e40A, +0x04b76c2c460e033c056223e2d237d9ad4e1dab6f, +0x6983176A2a215ECa105ae163F562e71F9413447F, +0x4dbb94164318b65441cef58969f44917f79cfd57, \ No newline at end of file From 4993adb7b7eaae8bde3a991befc6948958075811 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 18:37:58 -0800 Subject: [PATCH 32/35] 1/1/6:37 whitelist --- curr_addresses.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/curr_addresses.txt b/curr_addresses.txt index ec94a49..418cc2b 100644 --- a/curr_addresses.txt +++ b/curr_addresses.txt @@ -199,7 +199,6 @@ 0x5fD412cceAF648B412C52585a4aD6143a61e283F, 0x7bf369283338e12c90514468aa3868a551ab2929, 0x0B91d6a74c851a1f550ee722bfFeF929b22949eF,0x45103bd143ca25e7f3675aef4cdda677b0dc1290,0x349a21b82963180add5a034b5e0d54b000efe222, -0xab7ba16ed7b499b73014cdc8e45bb0b5bae2de5d, 0x4f51B34D715467F4Cad0b0290E8f65FE98050704, 0x0f45aBA574AcEbA2E0717Ca86e910211b34f9db9, 0x35dd195ba3d2c89a6f134f1d0bbcfe658228c019, @@ -236,4 +235,15 @@ 0xe23b55f09f0e46575Ff39df10CAB0Bcbc2CAb74B,0xcB843889491dC48FC383150Ee73BaD278539Ce5A,0xe078eac26Efac2eDB9D4E7993Cdc299a3873e40A, 0x04b76c2c460e033c056223e2d237d9ad4e1dab6f, 0x6983176A2a215ECa105ae163F562e71F9413447F, -0x4dbb94164318b65441cef58969f44917f79cfd57, \ No newline at end of file +0x4dbb94164318b65441cef58969f44917f79cfd57, +0x4a7F84268a2f35D1d7131B38E32f348Dd3b3Ea96,0xaFa5541Da3f115092A2bBc64e04e23a446229a6F,0x84ff8D584eF28819ff28eC22De041c6746fD2cF4, +0x761502Dcfa43D1a990Ca25D9f3014eB801312b95, +0x29e9246deb0Eade11466Fcc14F108Df935C0dE1e, +0x9F80333a5E4e0e0463F8cb765075C4CD58dFf892, +0x46477552018c3373fbB8009177CEED35FCd7c824, +0xc8D317c69473d74D2c1F78fDE5E2d118EC1340Ab, +0xba1e24bb66bcd38663e7dd7931e01381085a4325, +0x2D0790fa9872ebb416F96cE45E727Bc0173e75Ff, +0x4F74C359F6aAcf472Bb685A5aA143b94D546FE2f, +0x1E23F67D6C65db8661840558AE13456c8D969b76, +0x1ccCffF16FD9fd9376340220990B334a8e650C54, From 029ff21ef94649ae0c29aa373566a873663c3936 Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 18:41:37 -0800 Subject: [PATCH 33/35] 1/1/6:41 whitelist for cecsk --- curr_addresses.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/curr_addresses.txt b/curr_addresses.txt index 418cc2b..6f133a3 100644 --- a/curr_addresses.txt +++ b/curr_addresses.txt @@ -247,3 +247,4 @@ 0x4F74C359F6aAcf472Bb685A5aA143b94D546FE2f, 0x1E23F67D6C65db8661840558AE13456c8D969b76, 0x1ccCffF16FD9fd9376340220990B334a8e650C54, +0x9DBa4640da89ceFAD5EBb23A414CDbc49D64ca19,0x3Ac0ae72200611b48065e1A290B88f36d2DFdC07,0x901E2b474377E7Df01d33DC225fCffb5bfbCEC88, From bc4e543f0d2f4ca6e5b57d18be016a2e307f5fbd Mon Sep 17 00:00:00 2001 From: cha0sg0d Date: Sat, 1 Jan 2022 22:49:38 -0800 Subject: [PATCH 34/35] auto-whitelist --- scripts/whitelist.js | 57 ++++++++++++++++++++++++++++++ tasks/whitelist.ts | 83 +++++++++++++++++++++++++++++++------------- 2 files changed, 115 insertions(+), 25 deletions(-) create mode 100644 scripts/whitelist.js diff --git a/scripts/whitelist.js b/scripts/whitelist.js new file mode 100644 index 0000000..ca2fa77 --- /dev/null +++ b/scripts/whitelist.js @@ -0,0 +1,57 @@ +// We require the Hardhat Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node