Skip to content

Commit

Permalink
Merge pull request #2429 from BibliothecaDAO/next
Browse files Browse the repository at this point in the history
revert hardcoded timer
  • Loading branch information
RedBeardEth authored Dec 11, 2024
2 parents 2dc0824 + 0832cdd commit aab7250
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 84 deletions.
4 changes: 2 additions & 2 deletions client/src/hooks/useSeasonStart.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//import { configManager } from "@/dojo/setup";
import { configManager } from "@/dojo/setup";
import { useMemo, useState } from "react";

export const useSeasonStart = () => {
const seasonStart = BigInt(new Date("2024-12-11T15:35:00Z").getTime() / 1000);/*useMemo(() => BigInt(configManager.getSeasonConfig().startAt || 0), []);*/
const seasonStart = useMemo(() => BigInt(configManager.getSeasonConfig().startAt || 0), []);
const nextBlockTimestamp = useMemo(() => BigInt(Math.floor(Date.now() / 1000)), []);

const [countdown, setCountdown] = useState<bigint>(0n);
Expand Down
74 changes: 6 additions & 68 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import type { Config } from "@bibliothecadao/eternum";
import devManifest from "../contracts/manifest_dev.json";
import productionManifest from "../contracts/manifest_prod.json";
import productionManifest from "../contracts/manifest_mainnet.json";

import {
CapacityConfigCategory,
EternumConfig,
EternumGlobalConfig,
EternumProvider,
getContractByName,
NAMESPACE,
NAMESPACE
} from "@bibliothecadao/eternum";
import { Account } from "starknet";
import { MAX_QUEST_RESOURCES } from "./speed";

if (
!process.env.VITE_PUBLIC_MASTER_ADDRESS ||
Expand Down Expand Up @@ -51,68 +49,7 @@ const provider = new EternumProvider(manifest, nodeUrl, VITE_VRF_PROVIDER_ADDRES
console.log("Account set up");
const account = new Account(provider.provider, VITE_PUBLIC_MASTER_ADDRESS, VITE_PUBLIC_MASTER_PRIVATE_KEY);

const setupConfig: Config =
VITE_PUBLIC_DEV === "true" || VITE_PUBLIC_CHAIN === "sepolia"
? {
...EternumGlobalConfig,
questResources: MAX_QUEST_RESOURCES as typeof EternumGlobalConfig.questResources,
stamina: {
...EternumGlobalConfig.stamina,
travelCost: 0,
exploreCost: 0,
},
carryCapacityGram: {
...EternumGlobalConfig.carryCapacityGram,
[CapacityConfigCategory.Storehouse]: 300_000_000_000,
},
battle: {
graceTickCount: 0,
graceTickCountHyp: 0,
delaySeconds: 0,
},

// increase the probability of failure for shards mines
exploration: {
...EternumGlobalConfig.exploration,
shardsMinesFailProbability: 10000,
},

// bridge fees to multi in dev mode
bridge: {
...EternumGlobalConfig.bridge,
velords_fee_recipient: BigInt(VITE_PUBLIC_MASTER_ADDRESS),
season_pool_fee_recipient: BigInt(getContractByName(manifest, `${NAMESPACE}-season_systems`)), // Season System holds the Lords...
},

// make it easier to build hyperstructures in dev mode
hyperstructures: {
...EternumGlobalConfig.hyperstructures,
hyperstructurePointsForWin: 100_000,
// hyperstructureTotalCosts: [
// ...EternumGlobalConfig.hyperstructures.hyperstructureTotalCosts.map((cost) => ({
// resource_tier: cost.resource_tier,
// min_amount: Math.floor(Math.random() * 4) + 1,
// max_amount: Math.floor(Math.random() * 10) + 5,
// })),
// {
// resource_tier: ResourceTier.Lords,
// min_amount: 3,
// max_amount: 3,
// },
// {
// resource_tier: ResourceTier.Food,
// min_amount: 0,
// max_amount: 0,
// },
// {
// resource_tier: ResourceTier.Military,
// min_amount: 0,
// max_amount: 0,
// },
// ],
},
}
: EternumGlobalConfig;
const setupConfig: Config = EternumGlobalConfig;

// const setupConfig: Config = EternumGlobalConfig;

Expand All @@ -124,11 +61,12 @@ setupConfig.vrf.vrfProviderAddress = VITE_VRF_PROVIDER_ADDRESS!;
velords_fee_recipient: BigInt("0x045c587318c9ebcf2fbe21febf288ee2e3597a21cd48676005a5770a50d433c5"), // burner
season_pool_fee_recipient: BigInt(getContractByName(manifest, `${NAMESPACE}-season_systems`)),
}),

// Season Pass
(setupConfig.season = {
...EternumGlobalConfig.season,
startAfterSeconds: 60 * 10, // 10 minutes
bridgeCloseAfterEndSeconds: 60 * 60 * 1, // 2 hours
startAfterSeconds: 60 * 60, // 60 minutes
// bridgeCloseAfterEndSeconds: 60 * 60 * 1, // 2 hours
seasonPassAddress: process.env.VITE_SEASON_PASS_ADDRESS!,
realmsAddress: process.env.VITE_REALMS_ADDRESS!,
lordsAddress: process.env.VITE_LORDS_ADDRESS!,
Expand Down
6 changes: 3 additions & 3 deletions contracts/manifest_mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@
},
{
"address": "0x4ed3a7c5f53c6e96186eaf1b670bd2e2a3699c08e070aedf4e5fc6ac246ddc1",
"class_hash": "0x201104f5060cf70aada2986e9569d578251884db4208862b88aa48bf491eed1",
"class_hash": "0x1d705daa1501a2647e6e051aceaff470486f0d803d528461d8a23c27265072",
"abi": [
{
"type": "impl",
Expand Down Expand Up @@ -1686,7 +1686,7 @@
},
{
"address": "0x2620f65aa2fd72d705306ada1ee7410023a3df03da9291f1ccb744fabfebc0",
"class_hash": "0x40e7660b0e34f56e08bbdf7573bc55eb94f9d88e580f76890c136f418aa60bd",
"class_hash": "0x6212c2b9ed24053620aa93e85707a364870d5ab5696a164233d5f46efd412b6",
"abi": [
{
"type": "impl",
Expand Down Expand Up @@ -2775,7 +2775,7 @@
},
{
"address": "0x421446d51cac1e926cb1a2b00ae318b52df71beb737159d5c1d7061030758cf",
"class_hash": "0x2a1623aa93f362b754f5c9dc9c592ef42bf820498ba120b256002463aa89292",
"class_hash": "0x682236180454ea85548145c9c75a1db98361212b8320a4dad0757066ee4ead6",
"abi": [
{
"type": "impl",
Expand Down
2 changes: 1 addition & 1 deletion landing/src/components/modules/season-start-timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SeasonStartTimer = () => {

return (
<div className="text-3xl text-primary font-semibold">
{"<"} {String(hours).padStart(2, "0")}:{String(minutes).padStart(2, "0")}:{String(seconds).padStart(2, "0")}
{String(hours).padStart(2, "0")}:{String(minutes).padStart(2, "0")}:{String(seconds).padStart(2, "0")}
</div>
);
};
1 change: 0 additions & 1 deletion landing/src/components/ui/elements/CountdownTimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function CountdownTimer() {

<TypeH1 className="tracking-wider">Eternum is Launching in</TypeH1>
<div className="flex gap-4 text-center mt-4 mx-auto">
<span className="text-4xl font-bold">{"<"}</span>
<TimeUnit value={days} label="Days" />
<TimeUnit value={hours} label="Hours" />
<TimeUnit value={minutes} label="Minutes" />
Expand Down
5 changes: 2 additions & 3 deletions landing/src/hooks/use-season-start.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { configManager } from "@/dojo/setup";
import { useEffect, useState } from "react";

export const useSeasonStart = () => {
const seasonStart = BigInt(new Date("2024-12-11T15:35:00Z").getTime() / 1000);

/*BigInt(configManager.getSeasonConfig().startAt || 0);*/
const seasonStart = BigInt(configManager.getSeasonConfig().startAt || 0);
const nextBlockTimestamp = BigInt(Math.floor(Date.now() / 1000));

const [countdown, setCountdown] = useState<bigint>(0n);
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/eternum/src/constants/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const EternumGlobalConfig: Config = {
carryCapacityGram: {
[CapacityConfigCategory.None]: 0,
[CapacityConfigCategory.Structure]: BigInt(2) ** BigInt(128) - BigInt(1),
[CapacityConfigCategory.Donkey]: 4_000_000,
[CapacityConfigCategory.Donkey]: 500_000,
[CapacityConfigCategory.Army]: 10_000,
[CapacityConfigCategory.Storehouse]: 300_000_000,
},
Expand Down
8 changes: 4 additions & 4 deletions sdk/packages/eternum/src/constants/quests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const QUEST_RESOURCES: { [key in QuestType]: ResourceCost[] } = {
{ resource: ResourcesIds.Mithral, amount: 5 },
{ resource: ResourcesIds.Dragonhide, amount: 5 },
],
[QuestType.BuildResource]: [{ resource: ResourcesIds.Donkey, amount: 0.025 }],
[QuestType.BuildResource]: [{ resource: ResourcesIds.Donkey, amount: 0.2 }],
[QuestType.PauseProduction]: [
{ resource: ResourcesIds.Knight, amount: 0.5 },
{ resource: ResourcesIds.Crossbowman, amount: 0.5 },
Expand All @@ -53,10 +53,10 @@ export const QUEST_RESOURCES: { [key in QuestType]: ResourceCost[] } = {
{ resource: ResourcesIds.Paladin, amount: 0.5 },
{ resource: ResourcesIds.Crossbowman, amount: 0.5 },
],
[QuestType.CreateDefenseArmy]: [{ resource: ResourcesIds.Donkey, amount: 0.125 }],
[QuestType.Travel]: [{ resource: ResourcesIds.Donkey, amount: 0.025 }],
[QuestType.CreateDefenseArmy]: [{ resource: ResourcesIds.Donkey, amount: 1 }],
[QuestType.Travel]: [{ resource: ResourcesIds.Donkey, amount: 0.2 }],
[QuestType.CreateTrade]: [
{ resource: ResourcesIds.Donkey, amount: 0.025 },
{ resource: ResourcesIds.Donkey, amount: 0.2 },
{ resource: ResourcesIds.Paladin, amount: 1 },
{ resource: ResourcesIds.Knight, amount: 1 },
{ resource: ResourcesIds.Crossbowman, amount: 1 },
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/eternum/src/constants/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export const RESOURCE_OUTPUTS: ResourceOutputs = {
[ResourcesIds.Adamantine]: 30,
[ResourcesIds.Mithral]: 30,
[ResourcesIds.Dragonhide]: 30,
[ResourcesIds.Donkey]: 0.01,
[ResourcesIds.Donkey]: 0.5,
[ResourcesIds.Knight]: 0.04,
[ResourcesIds.Crossbowman]: 0.04,
[ResourcesIds.Paladin]: 0.04,
Expand Down

0 comments on commit aab7250

Please sign in to comment.