Skip to content
27 changes: 27 additions & 0 deletions packages/nextjs/app/dapp/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use client";

import { useEffect } from "react";
import { useRouter } from "next/navigation";

/**
* Redirect page for /dapp route
* Automatically redirects to /dapp/dashboard
*/
export default function DappRedirectPage() {
const router = useRouter();

useEffect(() => {
// Redirect to dashboard
router.replace("/dapp/dashboard");
}, [router]);

// Show loading state while redirecting
return (
<div className="flex items-center justify-center min-h-screen">
<div className="text-center">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-[#00FFA3] mx-auto mb-4"></div>
<p className="text-white/80">Redirigiendo al dashboard...</p>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion packages/nextjs/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface NavbarProps {
}

const menuItems = [
{ id: "/dapp", labelKey: "navigation.home", icon: HomeIcon },
{ id: "/dapp/dashboard", labelKey: "navigation.home", icon: HomeIcon },
{ id: "/dapp/mint", labelKey: "navigation.mint", icon: Coins },
{ id: "/dapp/claim", labelKey: "navigation.claim", icon: Trophy },
{ id: "/dapp/unmint", labelKey: "navigation.unmint", icon: ArrowUpDown },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Hero({ variant = "casinoGlitz" }: HeroProps) {
const options = particlePresets[variant];

const goToDapp = () => {
navigation.push("/dapp");
navigation.push("/dapp/dashboard");
};

return (
Expand Down
203 changes: 185 additions & 18 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const deployedContracts = {
devnet: {
StarkPlayERC20: {
address:
"0x5ae170a5f7a6865bf12fa8224a32c02acd3dc6e55413ea32b0ae44def275377",
"0x5183c0e5ae2579f5c541c6c5d69d89d7d71b80fe583a90bb1e41c383adadbc1",
abi: [
{
type: "impl",
Expand Down Expand Up @@ -1189,7 +1189,7 @@ const deployedContracts = {
},
StarkPlayVault: {
address:
"0x25ef073cf5fd8d454802699d6712a79a456746ecf66f521e9c02d2c3c0fd063",
"0x621b858ef40bbc6a8716025f6be83e2334647069aaf10d98b567ea26414c691",
abi: [
{
type: "impl",
Expand Down Expand Up @@ -2077,7 +2077,7 @@ const deployedContracts = {
},
Lottery: {
address:
"0x334f06afd7b2dae710821e3d39a9a8d7bf32874ae23cdb6309927ea8eb6d890",
"0x6e9f2cc499c9a1ce19be05a0373e1a4f7f6f44400d37bffb128a37cef58d08f",
abi: [
{
type: "impl",
Expand Down Expand Up @@ -2152,6 +2152,14 @@ const deployedContracts = {
name: "timestamp",
type: "core::integer::u64",
},
{
name: "prize_amount",
type: "core::integer::u256",
},
{
name: "prize_assigned",
type: "core::bool",
},
],
},
{
Expand Down Expand Up @@ -2204,10 +2212,6 @@ const deployedContracts = {
name: "ticketPrice",
type: "core::integer::u256",
},
{
name: "accumulatedPrize",
type: "core::integer::u256",
},
],
outputs: [],
state_mutability: "external",
Expand Down Expand Up @@ -2299,23 +2303,14 @@ const deployedContracts = {
{
type: "function",
name: "CreateNewDraw",
inputs: [
{
name: "accumulatedPrize",
type: "core::integer::u256",
},
],
inputs: [],
outputs: [],
state_mutability: "external",
},
{
type: "function",
name: "CreateNewDrawWithDuration",
inputs: [
{
name: "accumulatedPrize",
type: "core::integer::u256",
},
{
name: "duration_blocks",
type: "core::integer::u64",
Expand Down Expand Up @@ -2386,6 +2381,30 @@ const deployedContracts = {
],
state_mutability: "external",
},
{
type: "function",
name: "DistributePrizes",
inputs: [
{
name: "drawId",
type: "core::integer::u64",
},
],
outputs: [],
state_mutability: "external",
},
{
type: "function",
name: "AddExternalFunds",
inputs: [
{
name: "amount",
type: "core::integer::u256",
},
],
outputs: [],
state_mutability: "external",
},
{
type: "function",
name: "GetTicketPrice",
Expand All @@ -2397,6 +2416,17 @@ const deployedContracts = {
],
state_mutability: "view",
},
{
type: "function",
name: "GetVaultBalance",
inputs: [],
outputs: [
{
type: "core::integer::u256",
},
],
state_mutability: "view",
},
{
type: "function",
name: "GetAccumulatedPrize",
Expand All @@ -2412,6 +2442,10 @@ const deployedContracts = {
type: "function",
name: "GetFixedPrize",
inputs: [
{
name: "drawId",
type: "core::integer::u64",
},
{
name: "matches",
type: "core::integer::u8",
Expand Down Expand Up @@ -3243,6 +3277,119 @@ const deployedContracts = {
},
],
},
{
type: "event",
name: "contracts::Lottery::Lottery::JackpotCalculated",
kind: "struct",
members: [
{
name: "draw_id",
type: "core::integer::u64",
kind: "key",
},
{
name: "vault_balance",
type: "core::integer::u256",
kind: "data",
},
{
name: "prizes_distributed",
type: "core::integer::u256",
kind: "data",
},
{
name: "calculated_jackpot",
type: "core::integer::u256",
kind: "data",
},
{
name: "timestamp",
type: "core::integer::u64",
kind: "data",
},
],
},
{
type: "event",
name: "contracts::Lottery::Lottery::PrizeAssigned",
kind: "struct",
members: [
{
name: "drawId",
type: "core::integer::u64",
kind: "key",
},
{
name: "ticketId",
type: "core::felt252",
kind: "key",
},
{
name: "level",
type: "core::integer::u8",
kind: "data",
},
{
name: "amount",
type: "core::integer::u256",
kind: "data",
},
],
},
{
type: "event",
name: "contracts::Lottery::Lottery::PrizesDistributed",
kind: "struct",
members: [
{
name: "drawId",
type: "core::integer::u64",
kind: "key",
},
{
name: "winners_total",
type: "core::integer::u32",
kind: "data",
},
{
name: "total_distributed",
type: "core::integer::u256",
kind: "data",
},
],
},
{
type: "event",
name: "contracts::Lottery::Lottery::ExternalFundsAdded",
kind: "struct",
members: [
{
name: "contributor",
type: "core::starknet::contract_address::ContractAddress",
kind: "key",
},
{
name: "drawId",
type: "core::integer::u64",
kind: "key",
},
{
name: "amount",
type: "core::integer::u256",
kind: "data",
},
{
name: "new_jackpot",
type: "core::integer::u256",
kind: "data",
},
{
name: "timestamp",
type: "core::integer::u64",
kind: "data",
},
],
},
{
type: "event",
name: "contracts::Lottery::Lottery::Event",
Expand Down Expand Up @@ -3308,11 +3455,31 @@ const deployedContracts = {
type: "contracts::Lottery::Lottery::DrawClosed",
kind: "nested",
},
{
name: "JackpotCalculated",
type: "contracts::Lottery::Lottery::JackpotCalculated",
kind: "nested",
},
{
name: "PrizeAssigned",
type: "contracts::Lottery::Lottery::PrizeAssigned",
kind: "nested",
},
{
name: "PrizesDistributed",
type: "contracts::Lottery::Lottery::PrizesDistributed",
kind: "nested",
},
{
name: "ExternalFundsAdded",
type: "contracts::Lottery::Lottery::ExternalFundsAdded",
kind: "nested",
},
],
},
],
classHash:
"0x5462f3a1c3b87ea9d38b448c523e04dea9119861d38c08b53037f90fdeedc80",
"0x7dbe308ba32779b910b9ab4400caf084dc545c476eb36be6f65f98307a6c088",
},
},
} as const;
Expand Down
Loading
Loading