Skip to content

Commit 5657a0c

Browse files
authored
Add Opus Seasons (#293)
* - add content relevant to opus seasons - switch environment from dark shuffle tournament to season - improve styles * fix build * approval fix
1 parent 4ffefcf commit 5657a0c

File tree

6 files changed

+70
-73
lines changed

6 files changed

+70
-73
lines changed

ui/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NEXT_PUBLIC_NETWORK="mainnet"
22
NEXT_PUBLIC_TOURNAMENT_ENDED="true"
3-
NEXT_PUBLIC_SEASON_ACTIVE="false"
4-
NEXT_PUBLIC_DS_TOURNAMENT_ACTIVE="true"
3+
NEXT_PUBLIC_SEASON_ACTIVE="true"
4+
NEXT_PUBLIC_DS_TOURNAMENT_ACTIVE="false"
55
NEXT_PUBLIC_DS_TOURNAMENT_ID=1
66
NEXT_PUBLIC_DS_TOURNAMENT_START_TIME=1737727200

ui/src/app/components/start/CreateAdventurer.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,23 @@ export const CreateAdventurer = ({
144144
return (
145145
<>
146146
{step == 1 && (
147-
<div className="flex flex-col w-full justify-between items-center gap-2 sm:gap-0 py-2 sm:py-10">
147+
<div className="flex flex-col w-full justify-between items-center gap-5 sm:gap-0 py-2 sm:pt-10">
148148
{seasonActive ? (
149149
<div className="flex flex-col items-center w-full gap-2 sm:gap-5">
150150
<h3 className="uppercase text-center 2xl:text-5xl m-0">
151-
Enter Season 0
151+
Opus Season 1
152152
</h3>
153153
<p className="w-5/6 sm:text-xl text-center">
154-
Introducing onchain seasons for Loot Survivor. This is the first
155-
weekly season with a prize pool of:
154+
We&apos;ve teamed up with Opus to sponsor on-chain tournaments
155+
with $CASH prizes.{" "}
156+
<a
157+
className="underline uppercase"
158+
href="https://www.opus.money/"
159+
>
160+
Visit Opus
161+
</a>
156162
</p>
163+
<p className="sm:text-xl text-center">Ends 17/02 14:00 UTC</p>
157164
<div className="w-full sm:w-3/4">
158165
{tournamentPrizes && (
159166
<Prizes

ui/src/app/components/start/Prizes.tsx

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { TournamentTrophyIcon } from "@/app/components/icons/Icons";
22
import { getOrdinalSuffix } from "@/app/lib/utils";
3-
import Lords from "public/icons/lords.svg";
4-
import { useEffect, useState } from "react";
53

64
interface Prizes {
75
prizes: any;
@@ -10,16 +8,16 @@ interface Prizes {
108

119
const Prizes = ({ prizes, lordsDollarValue }: Prizes) => {
1210
const formattedPrizes = prizes.lsTournamentsV0TournamentPrizeModels.edges;
13-
const [lordsDollar, setLordsDollar] = useState<bigint>(0n);
11+
// const [lordsDollar, setLordsDollar] = useState<bigint>(0n);
1412

15-
const handleLordsDollarValue = async () => {
16-
const value = await lordsDollarValue();
17-
setLordsDollar(value);
18-
};
13+
// const handleLordsDollarValue = async () => {
14+
// const value = await lordsDollarValue();
15+
// setLordsDollar(value);
16+
// };
1917

20-
useEffect(() => {
21-
handleLordsDollarValue();
22-
}, []);
18+
// useEffect(() => {
19+
// handleLordsDollarValue();
20+
// }, []);
2321

2422
return (
2523
<>
@@ -41,7 +39,7 @@ const Prizes = ({ prizes, lordsDollarValue }: Prizes) => {
4139
return (
4240
<div
4341
key={index}
44-
className="flex flex-row gap-5 overflow-scroll default-scroll"
42+
className="flex flex-row gap-5 overflow-scroll item-scrol h-10"
4543
>
4644
{prizes.map((prize: any, index: any) => {
4745
const isERC20 = variant === "erc20";
@@ -52,39 +50,42 @@ const Prizes = ({ prizes, lordsDollarValue }: Prizes) => {
5250
);
5351

5452
return (
55-
<span key={index} className="flex flex-row items-center gap-2">
56-
<div className="flex flex-row gap-2 items-center">
57-
{prize.payout_position <= 3 && (
58-
<span
59-
className={`w-4 h-4 sm:w-8 sm:h-8 ${
60-
prize.payout_position === 1
61-
? "text-terminal-gold"
62-
: prize.payout_position === 2
63-
? "text-terminal-silver"
64-
: "text-terminal-bronze"
65-
}`}
66-
>
67-
<TournamentTrophyIcon />
68-
</span>
69-
)}
70-
<p className="flex text-2xl">
71-
{prize.payout_position}
72-
<sup className="text-sm">
73-
{getOrdinalSuffix(prize.payout_position).slice(1)}
74-
</sup>
75-
</p>
76-
</div>
77-
<span className="hidden sm:flex text-2xl">-</span>
78-
<Lords className="self-center w-4 h-4 sm:w-5 sm:h-5 fill-current" />
79-
<span className="text-terminal-green text-2xl">
80-
$
81-
{(
82-
(tokenValue * Number(lordsDollar)) /
83-
10 ** 8 /
84-
10 ** 18
85-
).toFixed(2)}
53+
<>
54+
{index > 0 && (
55+
<div className="h-1/2 min-w-[2px] bg-terminal-green self-center opacity-50" />
56+
)}
57+
<span
58+
key={index}
59+
className="flex flex-row items-center gap-2"
60+
>
61+
<div className="flex flex-row gap-2 items-center">
62+
{prize.payout_position <= 3 && (
63+
<span
64+
className={`w-4 h-4 sm:w-8 sm:h-8 ${
65+
prize.payout_position === 1
66+
? "text-terminal-gold"
67+
: prize.payout_position === 2
68+
? "text-terminal-silver"
69+
: "text-terminal-bronze"
70+
}`}
71+
>
72+
<TournamentTrophyIcon />
73+
</span>
74+
)}
75+
<p className="flex text-2xl">
76+
{prize.payout_position}
77+
<sup className="text-sm">
78+
{getOrdinalSuffix(prize.payout_position).slice(1)}
79+
</sup>
80+
</p>
81+
</div>
82+
<span className="hidden sm:flex text-2xl">-</span>
83+
{/* <Lords className="self-center w-4 h-4 sm:w-5 sm:h-5 fill-current" /> */}
84+
<span className="text-terminal-green text-2xl">
85+
${tokenValue / 10 ** 18}
86+
</span>
8687
</span>
87-
</span>
88+
</>
8889
);
8990
})}
9091
</div>

ui/src/app/components/start/SeasonDetails.tsx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const SeasonTable = ({ prizes, lordsValue }: SeasonDetailsProps) => {
1919
<div className="flex flex-col items-center border border-terminal-green b-5 bg-terminal-black text-terminal-green uppercase w-3/4">
2020
<div className="bg-terminal-green/75 w-full">
2121
<h1 className="m-0 p-2 text-lg sm:text-2xl text-terminal-black">
22-
Season 0 Pool
22+
Opus Season 1
2323
</h1>
2424
</div>
2525
<div className="flex flex-row w-full justify-between p-2 border-t border-terminal-green">
@@ -34,12 +34,8 @@ const SeasonTable = ({ prizes, lordsValue }: SeasonDetailsProps) => {
3434
<Lords className="self-center w-5 h-5 fill-current" />
3535
<p className="text-2xl">
3636
$
37-
{(
38-
(formattedPrizes[0].node.token_data_type.erc20?.token_amount *
39-
Number(lordsValue)) /
40-
10 ** 8 /
41-
10 ** 18
42-
).toFixed(2)}
37+
{formattedPrizes[0].node.token_data_type.erc20?.token_amount /
38+
10 ** 18}
4339
</p>
4440
</div>
4541
</div>
@@ -56,12 +52,8 @@ const SeasonTable = ({ prizes, lordsValue }: SeasonDetailsProps) => {
5652
<Lords className="self-center w-5 h-5 fill-current" />
5753
<p className="text-2xl">
5854
$
59-
{(
60-
(formattedPrizes[1].node.token_data_type.erc20?.token_amount *
61-
Number(lordsValue)) /
62-
10 ** 8 /
63-
10 ** 18
64-
).toFixed(2)}
55+
{formattedPrizes[1].node.token_data_type.erc20?.token_amount /
56+
10 ** 18}
6557
</p>
6658
</div>
6759
</div>
@@ -78,17 +70,14 @@ const SeasonTable = ({ prizes, lordsValue }: SeasonDetailsProps) => {
7870
<Lords className="self-center w-5 h-5 fill-current" />
7971
<p className="text-2xl">
8072
$
81-
{(
82-
(formattedPrizes[2].node.token_data_type.erc20?.token_amount *
83-
Number(lordsValue)) /
84-
10 ** 8 /
85-
10 ** 18
86-
).toFixed(2)}
73+
{formattedPrizes[2].node.token_data_type.erc20?.token_amount /
74+
10 ** 18}
8775
</p>
8876
</div>
8977
</div>
9078
</div>
9179
</div>
80+
<span className="uppercase text-lg">... more!</span>
9281
</div>
9382
);
9483
};

ui/src/app/lib/networkConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const networkConfig = {
6767
rendererAddress: "0x0",
6868
tournamentAddress:
6969
"0x3347382d530ff6acb9283ac1d78471187aae8a4690e9316bb4e3c3365ff7a86",
70-
tournamentId: "0x1",
70+
tournamentId: "0x4",
7171
appUrl: "https://lootsurvivor.io/",
7272
tournamentAppUrl: "https://tournaments.lootsurvivor.io/",
7373
beastsViewer:

ui/src/app/lib/utils/syscalls.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,17 +1658,17 @@ export function createSyscalls({
16581658
const randomInt = getRandomInt(0, revenueAddresses.length - 1);
16591659
const selectedRevenueAddress = revenueAddresses[randomInt];
16601660

1661+
const tournamentId = networkConfig[network!].tournamentId;
1662+
16611663
const enterTournamentTx = {
16621664
contractAddress: tournamentContractAddress,
16631665
entrypoint: "enter_tournament",
16641666
calldata: CallData.compile([
1665-
networkConfig[network!].tournamentId,
1667+
tournamentId,
16661668
new CairoOption(CairoOptionVariant.None),
16671669
]),
16681670
};
16691671

1670-
const tournamentId = networkConfig[network!].tournamentId;
1671-
16721672
const startTournamentTx = {
16731673
contractAddress: tournamentContractAddress,
16741674
entrypoint: "start_tournament",
@@ -1709,7 +1709,7 @@ export function createSyscalls({
17091709
freeVRF,
17101710
(costToPlay ?? 0) + (seasonCost ?? 0),
17111711
goldenTokenId,
1712-
blobertTokenId
1712+
goldenTokenId !== "0" ? "0" : blobertTokenId
17131713
);
17141714
}
17151715

0 commit comments

Comments
 (0)