diff --git a/packages/nextjs/app/debug/_components/contract/RandomnessComponent.tsx b/packages/nextjs/app/debug/_components/contract/RandomnessComponent.tsx index 4fe3f64..125209c 100644 --- a/packages/nextjs/app/debug/_components/contract/RandomnessComponent.tsx +++ b/packages/nextjs/app/debug/_components/contract/RandomnessComponent.tsx @@ -19,7 +19,7 @@ const VRF_PROVIDER_ADDRESS = // Dirección esperada del contrato de Randomness desplegado en testnet // Esta dirección se actualiza con cada nuevo deployment para pruebas const EXPECTED_RANDOMNESS_CONTRACT_ADDRESS = - "0x5b3558ec6cbe58d1d1279b428aaace0fd9230b5993e19f482af82306076c54f"; + "0x2e91ef979c67ef901846fed17a9d72c9c745536266d01962339076bd7717714"; interface RandomnessComponentProps { contractName: ContractName; @@ -27,10 +27,6 @@ interface RandomnessComponentProps { onSuccess?: (txHash: string, generationId: string) => void; } -interface VRFCoordinatorConfigProps { - contractAddress: AddressType; -} - export const RandomnessComponent = ({ contractName, contractAddress, @@ -40,8 +36,6 @@ export const RandomnessComponent = ({ const [isLoading, setIsLoading] = useState(false); const [txHash, setTxHash] = useState(""); const [generationId, setGenerationId] = useState(""); - const [useAlternativeMode, setUseAlternativeMode] = useState(false); - const [forceDevMode, setForceDevMode] = useState(false); const { status: walletStatus, isConnected, account, chainId } = useAccount(); const { chain } = useNetwork(); @@ -94,17 +88,6 @@ export const RandomnessComponent = ({ return; } - // 🚨 SPECIFIC VERIFICATION: Detect problematic account - if ( - account?.address === - "0x0297fd6c19289a017d50b1b65a07ea4db27596a8fade85c6b9622a3f9a24d2a9" - ) { - notification.error( - "A problematic account has been detected. Try reconnecting your wallet or use a different account.", - ); - return; - } - if (!seed || isNaN(Number(seed))) { notification.error("Please enter a valid seed (integer number)"); return; @@ -118,6 +101,34 @@ export const RandomnessComponent = ({ // Convertir seed a u64 (número entero sin signo de 64 bits) const seedValue = BigInt(seed); + // TODO: Production mode (request_randomness_prod) is currently disabled due to VRF issues on testnet. + // For now, we're forcing dev mode (devnet_generate) for all environments including testnet. + // Once the production VRF integration is stable, uncomment the conditional logic below + // and remove the forced dev mode implementation. + + // TEMPORARY: Always use devnet_generate regardless of network + const seedHex = num.toHex(seedValue); + + const txHash = await writeTransaction([ + { + contractAddress: contractAddress as string, + entrypoint: "devnet_generate", + calldata: [seedHex], + }, + ]); + + if (txHash) { + setTxHash(txHash); + notification.success( + `5 random numbers generated successfully! Hash: ${txHash}`, + ); + if (onSuccess) { + onSuccess(txHash, generationId); + } + } + + /* COMMENTED OUT - Production mode with VRF (to be re-enabled when VRF is stable) + // Detectar si estamos en devnet o testnet/mainnet const isDevnet = forceDevMode || @@ -230,6 +241,7 @@ export const RandomnessComponent = ({ } } } + */ } catch (error: any) { // Provide more specific error messages let errorMessage = "Unknown error requesting randomness"; @@ -286,107 +298,38 @@ export const RandomnessComponent = ({

- 🏆 Multicall VRF - Request Randomness with Cartridge + 🎲 Generate Random Numbers (Development Mode)

- {isDevnet ? ( - <> - This function generates 5 unique random numbers in the range - [1,40] using local generation for development. - - ) : ( - <> - This function executes a multicall that first requests randomness - from the Cartridge VRF provider, then consumes that randomness to - generate 5 unique numbers in the range [1,40]. - - )} + Genera 5 números aleatorios únicos en el rango [1,40] usando la + función de desarrollo{" "} + devnet_generate + .

+
+

+ ℹ️ Nota: El modo de producción con VRF está + temporalmente deshabilitado. Por ahora, se usa generación local para + pruebas. +

+
+ {/* Contract information */}
-

Consumer Contract:

+

Contrato Randomness:

-
-

- Expected address:{" "} - {EXPECTED_RANDOMNESS_CONTRACT_ADDRESS} -

+

- Current address: {contractAddress} + Red: {targetNetwork.name}

- Network: {chain?.name || "Unknown"} →{" "} - {targetNetwork.name} + Función:{" "} + + devnet_generate(seed) +

-

- Mode:{" "} - {isDevnet - ? "Development (devnet)" - : "Production (testnet/sepolia)"} -

-
-
- - {/* Technical information */} -
-

- 📋 Mode:{" "} - {isDevnet - ? forceDevMode - ? "Forced Development (devnet_generate)" - : "Development (Local)" - : useAlternativeMode - ? "Production (Safe Multicall)" - : "Production (Standard Multicall)"} -

-
- {isDevnet ? ( - <> -

- Method: devnet_generate (local generation) -

-

- Contract: {contractAddress} -

-

- Status:{" "} - {forceDevMode ? "Forced for testing" : "Automatic"} -

- - ) : ( - <> -

- Method: Multicall VRF ( - {useAlternativeMode ? "Safe Mode" : "Standard"}) -

-

- Transaction 1: request_random → VRF Provider -

-

- Transaction 2: request_randomness_prod → - Contract -

-

- VRF Provider: {VRF_PROVIDER_ADDRESS} -

-

- Callback Fee Limit:{" "} - {useAlternativeMode ? "50,000" : callbackFeeLimit} wei -

-

- Publish Delay: {publishDelay} (no delay) -

-

- Source (Seed): Used as source for VRF -

- - )}
@@ -457,188 +400,6 @@ export const RandomnessComponent = ({
)} - {/* Specific account/wallet problem diagnosis */} - {account?.address && - account.address.startsWith( - "0x0297fd6c19289a017d50b1b65a07ea4db27596a8fade85c6b9622a3f9a24d2a9", - ) && ( -
-

- 🚨 Problematic Account Detected -

-
-

- - An account that causes transaction errors has been - detected. - -

-
-

- Problematic address: -

-

{account.address}

-
- -
-

🔧 Options to fix:

- -
- - - - - - - -
- -
- - More advanced options - -
-

• Use a different account in your wallet

-

• Verify that you have enough ETH for fees

-

• Make sure the account is active

-

• Contact support if the problem persists

-
-
-
-
-
- )} - - {/* Information about Safe Mode when active */} - {useAlternativeMode && ( -
-

- ✅ Safe Mode Active -

-
-

• Using more conservative parameters (fee limit: 50,000)

-

• Higher probability of success with problematic accounts

-

• You can generate numbers using the main button

- -
-
- )} - - {/* Information about Forced Development Mode when active */} - {forceDevMode && ( -
-

- ⚠️ Forced Development Mode -

-
-

- • Using development function (devnet_generate) even on testnet -

-

• Local generation without depending on external oracles

-

• Useful for testing when there are VRF problems

- -
-
- )} - - {/* Account status (advanced debugging) */} - {isConnected && !writeDisabled && !account?.address && ( -
-

- 🔍 Account status (debugging): -

-
-

- Wallet connected:{" "} - {isConnected ? "Yes" : "No"} -

-

- Account address:{" "} - {account?.address || "Not available"} -

-

- Wallet status: {walletStatus} -

-

- Current network: {chain?.name || "Unknown"} -

-

- Target network: {targetNetwork.name} -

-
-

- 💡 If you see this, try reconnecting your wallet or refreshing - the page. -

-
- )} - {/* Transaction result */} {txHash && (
@@ -661,210 +422,39 @@ export const RandomnessComponent = ({ {isLoading && ( )} - {isDevnet - ? "🎲 Generate 5 Numbers (Development)" - : useAlternativeMode - ? "🔒 Multicall VRF (Safe Mode)" - : "🔮 Multicall VRF (Standard)"} + 🎲 Generar 5 Números Aleatorios
- {/* VRF Coordinator Configuration (production only) */} - {!isDevnet && ( - - )} - {/* Additional information */}
-

💡 How it works:

- {isDevnet ? ( -
    -
  1. - 1. Directly calls devnet_generate(seed) -
  2. -
  3. - 2. The contract generates 5 unique numbers using a local LCG - algorithm -
  4. -
  5. - 3. Numbers are generated immediately without depending on - external oracles -
  6. -
  7. - 4. Numbers are stored and can be queried with{" "} - get_generation_numbers(id) -
  8. -
- ) : ( -
    -
  1. - 1. Step 1: Executes multicall with 2 - transactions -
  2. -
  3. - 2. Transaction 1:{" "} - request_random(caller, source) → VRF Provider -
  4. -
  5. - 3. Transaction 2:{" "} - request_randomness_prod(seed, fee, delay) → - Contract -
  6. -
  7. - 4. The contract requests and consumes randomness using Cartridge - VRF protocol -
  8. -
  9. - 5. Numbers are generated using verifiable decentralized - randomness -
  10. -
  11. - 6. Numbers are stored and can be queried with{" "} - get_generation_numbers(id) -
  12. -
- )} +

+ 💡 Cómo funciona: +

+
    +
  1. + 1. Llama directamente a{" "} + + devnet_generate(seed) + +
  2. +
  3. + 2. El contrato genera 5 números únicos usando un algoritmo LCG + local +
  4. +
  5. + 3. Los números se generan inmediatamente sin depender de oráculos + externos +
  6. +
  7. + 4. Los números se almacenan y pueden consultarse con{" "} + + get_generation_numbers(id) + +
  8. +
); }; - -// Component to configure VRF Coordinator -const VRFCoordinatorConfig = ({ - contractAddress, -}: VRFCoordinatorConfigProps) => { - const [newCoordinatorAddress, setNewCoordinatorAddress] = - useState(VRF_PROVIDER_ADDRESS); - const [isLoading, setIsLoading] = useState(false); - const [isExpanded, setIsExpanded] = useState(false); - - const { writeTransaction } = useTransactor(); - - const handleUpdateCoordinator = async () => { - if ( - !newCoordinatorAddress || - !newCoordinatorAddress.startsWith("0x") || - newCoordinatorAddress.length !== 66 - ) { - notification.error("Invalid VRF coordinator address"); - return; - } - - setIsLoading(true); - - try { - const txHash = await writeTransaction([ - { - contractAddress: contractAddress as string, - entrypoint: "set_vrf_coordinator", - calldata: [newCoordinatorAddress], - }, - ]); - - if (txHash) { - notification.success( - `VRF coordinator updated successfully! Hash: ${txHash}`, - ); - setIsExpanded(false); - } - } catch (error: any) { - notification.error( - "Error updating VRF coordinator: " + (error.message || "Unknown error"), - ); - } finally { - setIsLoading(false); - } - }; - - return ( -
-
-

⚙️ VRF Configuration

- -
- - {isExpanded && ( -
-

- The contract must be configured with the correct VRF coordinator - address from Cartridge. -

- -
-
- - setNewCoordinatorAddress(e.target.value)} - placeholder="0x..." - className="input input-bordered w-full bg-base-100 text-white text-sm" - disabled={isLoading} - /> -
- -
-

- Current configured address:{" "} - {VRF_PROVIDER_ADDRESS} -

-

- Address in form: {newCoordinatorAddress} -

-

- - Note: Only the contract owner can change this configuration. - -

-
- - -
- -
- - Technical information - -
-

- • This function calls set_vrf_coordinator() on the - contract -

-

• Only the contract owner can execute this function

-

- • The contract will use this address to validate VRF callbacks -

-

- • Make sure to use the correct VRF provider address from - Cartridge -

-
-
-
- )} -
- ); -}; diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index dd0ef1f..f5e87cd 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -4,487 +4,10 @@ */ const deployedContracts = { - devnet: { - Randomness: { - address: - "0x5b3558ec6cbe58d1d1279b428aaace0fd9230b5993e19f482af82306076c54f", - abi: [ - { - type: "impl", - name: "RandomnessImpl", - interface_name: - "starklotto_adapter_vrf::Randomness::IRandomnessLottery", - }, - { - type: "interface", - name: "starklotto_adapter_vrf::Randomness::IRandomnessLottery", - items: [ - { - type: "function", - name: "request_randomness_prod", - inputs: [ - { - name: "seed", - type: "core::integer::u64", - }, - { - name: "callback_fee_limit", - type: "core::integer::u128", - }, - { - name: "publish_delay", - type: "core::integer::u64", - }, - ], - outputs: [ - { - type: "core::integer::u64", - }, - ], - state_mutability: "external", - }, - { - type: "function", - name: "devnet_generate", - inputs: [ - { - name: "seed", - type: "core::integer::u64", - }, - ], - outputs: [ - { - type: "core::integer::u64", - }, - ], - state_mutability: "external", - }, - { - type: "function", - name: "get_generation_numbers", - inputs: [ - { - name: "id", - type: "core::integer::u64", - }, - ], - outputs: [ - { - type: "core::array::Array::", - }, - ], - state_mutability: "view", - }, - { - type: "function", - name: "get_generation_status", - inputs: [ - { - name: "id", - type: "core::integer::u64", - }, - ], - outputs: [ - { - type: "core::integer::u8", - }, - ], - state_mutability: "view", - }, - { - type: "function", - name: "get_generation_timestamps", - inputs: [ - { - name: "id", - type: "core::integer::u64", - }, - ], - outputs: [ - { - type: "(core::integer::u64, core::integer::u64)", - }, - ], - state_mutability: "view", - }, - { - type: "function", - name: "get_latest_id", - inputs: [], - outputs: [ - { - type: "core::integer::u64", - }, - ], - state_mutability: "view", - }, - ], - }, - { - type: "impl", - name: "OwnableImpl", - interface_name: "openzeppelin_access::ownable::interface::IOwnable", - }, - { - type: "interface", - name: "openzeppelin_access::ownable::interface::IOwnable", - items: [ - { - type: "function", - name: "owner", - inputs: [], - outputs: [ - { - type: "core::starknet::contract_address::ContractAddress", - }, - ], - state_mutability: "view", - }, - { - type: "function", - name: "transfer_ownership", - inputs: [ - { - name: "new_owner", - type: "core::starknet::contract_address::ContractAddress", - }, - ], - outputs: [], - state_mutability: "external", - }, - { - type: "function", - name: "renounce_ownership", - inputs: [], - outputs: [], - state_mutability: "external", - }, - ], - }, - { - type: "enum", - name: "core::bool", - variants: [ - { - name: "False", - type: "()", - }, - { - name: "True", - type: "()", - }, - ], - }, - { - type: "constructor", - name: "constructor", - inputs: [ - { - name: "owner", - type: "core::starknet::contract_address::ContractAddress", - }, - { - name: "vrf_coordinator", - type: "core::starknet::contract_address::ContractAddress", - }, - { - name: "dev_mode", - type: "core::bool", - }, - ], - }, - { - type: "struct", - name: "core::array::Span::", - members: [ - { - name: "snapshot", - type: "@core::array::Array::", - }, - ], - }, - { - type: "function", - name: "receive_random_words", - inputs: [ - { - name: "requester_address", - type: "core::starknet::contract_address::ContractAddress", - }, - { - name: "request_id", - type: "core::integer::u64", - }, - { - name: "random_words", - type: "core::array::Span::", - }, - { - name: "_calldata", - type: "core::array::Array::", - }, - ], - outputs: [], - state_mutability: "external", - }, - { - type: "function", - name: "mark_generation_failed", - inputs: [ - { - name: "id", - type: "core::integer::u64", - }, - { - name: "code", - type: "core::felt252", - }, - ], - outputs: [], - state_mutability: "external", - }, - { - type: "function", - name: "set_vrf_coordinator", - inputs: [ - { - name: "addr", - type: "core::starknet::contract_address::ContractAddress", - }, - ], - outputs: [], - state_mutability: "external", - }, - { - type: "event", - name: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred", - kind: "struct", - members: [ - { - name: "previous_owner", - type: "core::starknet::contract_address::ContractAddress", - kind: "key", - }, - { - name: "new_owner", - type: "core::starknet::contract_address::ContractAddress", - kind: "key", - }, - ], - }, - { - type: "event", - name: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", - kind: "struct", - members: [ - { - name: "previous_owner", - type: "core::starknet::contract_address::ContractAddress", - kind: "key", - }, - { - name: "new_owner", - type: "core::starknet::contract_address::ContractAddress", - kind: "key", - }, - ], - }, - { - type: "event", - name: "openzeppelin_access::ownable::ownable::OwnableComponent::Event", - kind: "enum", - variants: [ - { - name: "OwnershipTransferred", - type: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred", - kind: "nested", - }, - { - name: "OwnershipTransferStarted", - type: "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", - kind: "nested", - }, - ], - }, - { - type: "event", - name: "starklotto_adapter_vrf::Randomness::Randomness::GenerationRequested", - kind: "struct", - members: [ - { - name: "id", - type: "core::integer::u64", - kind: "key", - }, - { - name: "requester", - type: "core::starknet::contract_address::ContractAddress", - kind: "data", - }, - { - name: "timestamp", - type: "core::integer::u64", - kind: "data", - }, - { - name: "is_test", - type: "core::bool", - kind: "data", - }, - ], - }, - { - type: "event", - name: "starklotto_adapter_vrf::Randomness::Randomness::GenerationCompleted", - kind: "struct", - members: [ - { - name: "id", - type: "core::integer::u64", - kind: "key", - }, - { - name: "n1", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n2", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n3", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n4", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n5", - type: "core::integer::u8", - kind: "data", - }, - { - name: "timestamp", - type: "core::integer::u64", - kind: "data", - }, - { - name: "is_test", - type: "core::bool", - kind: "data", - }, - ], - }, - { - type: "event", - name: "starklotto_adapter_vrf::Randomness::Randomness::GenerationFailed", - kind: "struct", - members: [ - { - name: "id", - type: "core::integer::u64", - kind: "key", - }, - { - name: "code", - type: "core::felt252", - kind: "data", - }, - { - name: "timestamp", - type: "core::integer::u64", - kind: "data", - }, - ], - }, - { - type: "event", - name: "starklotto_adapter_vrf::Randomness::Randomness::TestGeneration", - kind: "struct", - members: [ - { - name: "id", - type: "core::integer::u64", - kind: "key", - }, - { - name: "n1", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n2", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n3", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n4", - type: "core::integer::u8", - kind: "data", - }, - { - name: "n5", - type: "core::integer::u8", - kind: "data", - }, - { - name: "timestamp", - type: "core::integer::u64", - kind: "data", - }, - ], - }, - { - type: "event", - name: "starklotto_adapter_vrf::Randomness::Randomness::Event", - kind: "enum", - variants: [ - { - name: "OwnableEvent", - type: "openzeppelin_access::ownable::ownable::OwnableComponent::Event", - kind: "flat", - }, - { - name: "GenerationRequested", - type: "starklotto_adapter_vrf::Randomness::Randomness::GenerationRequested", - kind: "nested", - }, - { - name: "GenerationCompleted", - type: "starklotto_adapter_vrf::Randomness::Randomness::GenerationCompleted", - kind: "nested", - }, - { - name: "GenerationFailed", - type: "starklotto_adapter_vrf::Randomness::Randomness::GenerationFailed", - kind: "nested", - }, - { - name: "TestGeneration", - type: "starklotto_adapter_vrf::Randomness::Randomness::TestGeneration", - kind: "nested", - }, - ], - }, - ], - classHash: - "0x1a5be748810b5e77913c3ec2d68967a24cb0390bc0bdb4fda03742ab7cf8b77", - }, - }, sepolia: { Randomness: { address: - "0x31cdafdd0fc1a80d57f3290afff3ba0a62e9d2c628e35c81eb55e05879f0f4f", + "0x2e91ef979c67ef901846fed17a9d72c9c745536266d01962339076bd7717714", abi: [ { type: "impl", @@ -955,7 +478,7 @@ const deployedContracts = { }, ], classHash: - "0x342eab9caa3364fe668dfeaddf7c5ff2516f791c35e39dc7065c00e1b9fc017", + "0x48bff87a49d373cb93e9559587cf10619c270fa4dcd0bedde61609cd7a81d3f", }, }, } as const; diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 27dad03..ee945b7 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -68,6 +68,7 @@ "eslint": "^8", "eslint-config-next": "15.2.3", "jsdom": "^26.0.0", + "minimatch": "^9.0.3", "postcss": "^8", "shx": "^0.4.0", "tailwindcss": "^3.3.0", diff --git a/packages/nextjs/public/sw.js b/packages/nextjs/public/sw.js index 924c508..919d2d7 100644 --- a/packages/nextjs/public/sw.js +++ b/packages/nextjs/public/sw.js @@ -1,30 +1,30 @@ if (!self.define) { let e, - s = {}; - const n = (n, i) => ( - (n = new URL(n + ".js", i).href), - s[n] || - new Promise((s) => { + n = {}; + const s = (s, a) => ( + (s = new URL(s + ".js", a).href), + n[s] || + new Promise((n) => { if ("document" in self) { const e = document.createElement("script"); - (e.src = n), (e.onload = s), document.head.appendChild(e); - } else (e = n), importScripts(n), s(); + (e.src = s), (e.onload = n), document.head.appendChild(e); + } else (e = s), importScripts(s), n(); }).then(() => { - let e = s[n]; - if (!e) throw new Error(`Module ${n} didn’t register its module`); + let e = n[s]; + if (!e) throw new Error(`Module ${s} didn’t register its module`); return e; }) ); - self.define = (i, c) => { - const a = + self.define = (a, i) => { + const t = e || ("document" in self ? document.currentScript.src : "") || location.href; - if (s[a]) return; - let t = {}; - const r = (e) => n(e, a), - o = { module: { uri: a }, exports: t, require: r }; - s[a] = Promise.all(i.map((e) => o[e] || r(e))).then((e) => (c(...e), t)); + if (n[t]) return; + let c = {}; + const r = (e) => s(e, t), + o = { module: { uri: t }, exports: c, require: r }; + n[t] = Promise.all(a.map((e) => o[e] || r(e))).then((e) => (i(...e), c)); }; } define(["./workbox-4754cb34"], function (e) { @@ -36,143 +36,139 @@ define(["./workbox-4754cb34"], function (e) { [ { url: "/_next/app-build-manifest.json", - revision: "b275a34557ea1a9cb4b65203cdd486b3", + revision: "7045f79c0757532d4b5f7cd4855d5649", }, { - url: "/_next/static/FQQienyxJ-IKX7XJN9c-U/_buildManifest.js", + url: "/_next/static/a7-nNL44ILHpMXjO8yznh/_buildManifest.js", revision: "51da8d50ab8ae1c1afafe38c7e424e4e", }, { - url: "/_next/static/FQQienyxJ-IKX7XJN9c-U/_ssgManifest.js", + url: "/_next/static/a7-nNL44ILHpMXjO8yznh/_ssgManifest.js", revision: "b6652df95db52feb4daf4eca35380933", }, { url: "/_next/static/chunks/141-d196c46095c0e291.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/145-87bbd58530c47b49.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/145-06c74ecb1424b1e8.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/2f0b94e8-734829800d3eb38b.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/473f56c0-0933f1e2ac7ad0b5.js", - revision: "FQQienyxJ-IKX7XJN9c-U", - }, - { - url: "/_next/static/chunks/486-3b991d95cef62049.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/4bd1b696-48a906261550a4c5.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/658-e54429557207cf0c.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/668-1fc7cc2fee87ff24.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/668-61b1540c76186c47.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/684-3cf479aafee24c45.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/70646a03-d8bbffbaf77fafd0.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/850-4a1aa8fcc9cc8597.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/850-9f08a3c50b278e3d.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/929-7d9534372e77efc8.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/94-3076be7aeedb9512.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/972.6d641f23fb3b1bd5.js", - revision: "6d641f23fb3b1bd5", + url: "/_next/static/chunks/972.0f900fee228de7ed.js", + revision: "0f900fee228de7ed", }, { url: "/_next/static/chunks/app/_not-found/page-04d3b5ab1d5bc6de.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/app/api/price/route-6c0ab67fce666a7b.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/app/configure/page-2501fcf559af4c9f.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/app/debug/page-00e35916938cbdb1.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/app/debug/page-6bf2130703b290b9.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/app/debug/randomness/page-01ec39be690d1ca3.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/app/debug/randomness/page-b7fd465125e2745d.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/app/layout-2dc3d265bddc1be4.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/app/layout-3f1d79a9df2a4a83.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/chunks/app/page-f53cfa65768f16c0.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/app/page-9f25e9a14f8c04f9.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/e6909d18-d7c7e73117910c02.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/framework-859199dea06580b0.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/main-a106802aa546c841.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/main-app-58ca74d35777be74.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/pages/_app-da15c11dea942c36.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/pages/_error-cc3f077a18ea1793.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + revision: "a7-nNL44ILHpMXjO8yznh", }, { url: "/_next/static/chunks/polyfills-42372ed130431b0a.js", revision: "846118c33b2c0e922d7b3a7676f81f6f", }, { - url: "/_next/static/chunks/webpack-8cb4a62bb51bf237.js", - revision: "FQQienyxJ-IKX7XJN9c-U", + url: "/_next/static/chunks/webpack-8a51ae7d91979afc.js", + revision: "a7-nNL44ILHpMXjO8yznh", }, { - url: "/_next/static/css/a3de78c781ee431c.css", - revision: "a3de78c781ee431c", + url: "/_next/static/css/9edad75ea06915e9.css", + revision: "9edad75ea06915e9", }, { url: "/blast-icon-color.svg", - revision: "f455c22475a343be9fcd764de7e7147e", + revision: "d949ffbc94b7c50e2e4fcf2b1daf1607", }, { url: "/debug-icon.svg", - revision: "25aadc709736507034d14ca7aabcd29d", + revision: "62ce54a2ddb8d11cb25c891c9adbdbea", }, { url: "/debug-image.png", @@ -180,15 +176,15 @@ define(["./workbox-4754cb34"], function (e) { }, { url: "/explorer-icon.svg", - revision: "84507da0e8989bb5b7616a3f66d31f48", + revision: "f6413b9b86d870f77edeb18891f6b3d5", }, { url: "/gradient-s.svg", - revision: "c003f595a6d30b1b476115f64476e2cf", + revision: "1966c9867618efad27716a8591d9ade0", }, { url: "/logo.ico", revision: "0359e607e29a3d3b08095d84a9d25c39" }, - { url: "/logo.svg", revision: "962a8546ade641ef7ad4e1b669f0548c" }, - { url: "/manifest.json", revision: "781788f3e2bc4b2b176b5d8c425d7475" }, + { url: "/logo.svg", revision: "a497d49f3c5cf63fe06eda59345d5ec1" }, + { url: "/manifest.json", revision: "004abf8d9f1b515402e5ee94bf8f3567" }, { url: "/rpc-version.png", revision: "cf97fd668cfa1221bec0210824978027", @@ -203,7 +199,7 @@ define(["./workbox-4754cb34"], function (e) { }, { url: "/starkcompass-icon.svg", - revision: "eccc2ece017ee9e73e512996b74e49ac", + revision: "f8853deea695e7491b012b31a0e6ed82", }, { url: "/voyager-icon.svg", @@ -221,17 +217,17 @@ define(["./workbox-4754cb34"], function (e) { { cacheWillUpdate: async ({ request: e, - response: s, - event: n, - state: i, + response: n, + event: s, + state: a, }) => - s && "opaqueredirect" === s.type - ? new Response(s.body, { + n && "opaqueredirect" === n.type + ? new Response(n.body, { status: 200, statusText: "OK", - headers: s.headers, + headers: n.headers, }) - : s, + : n, }, ], }), @@ -352,8 +348,8 @@ define(["./workbox-4754cb34"], function (e) { e.registerRoute( ({ url: e }) => { if (!(self.origin === e.origin)) return !1; - const s = e.pathname; - return !s.startsWith("/api/auth/") && !!s.startsWith("/api/"); + const n = e.pathname; + return !n.startsWith("/api/auth/") && !!n.startsWith("/api/"); }, new e.NetworkFirst({ cacheName: "apis", diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index 993d640..230cf80 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -13,7 +13,7 @@ export type ScaffoldConfig = { }; const scaffoldConfig = { - targetNetworks: [chains.devnet], + targetNetworks: [chains.sepolia], // Only show the Burner Wallet when running on devnet onlyLocalBurnerWallet: false, rpcProviderUrl: { diff --git a/packages/snfoundry/contracts/src/Randomness.cairo b/packages/snfoundry/contracts/src/Randomness.cairo index b85bea7..db1a73c 100644 --- a/packages/snfoundry/contracts/src/Randomness.cairo +++ b/packages/snfoundry/contracts/src/Randomness.cairo @@ -201,6 +201,8 @@ pub mod Randomness { } fn devnet_generate(ref self: ContractState, seed: u64) -> u64 { + // Only the contract owner can call this function + self.ownable.assert_only_owner(); assert(self.dev_mode.read(), 'DEV_DISABLED'); let next_id = self.generation_counter.read() + 1_u64; diff --git a/yarn.lock b/yarn.lock index 1e183d7..782ceb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3862,6 +3862,7 @@ __metadata: ethers: ^6.12.0 get-starknet-core: ^4.0.0 jsdom: ^26.0.0 + minimatch: ^9.0.3 next: 15.2.4 next-pwa: ^5.6.0 next-themes: ^0.2.1 @@ -9981,7 +9982,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.3, minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: