diff --git a/packages/nextjs/app/debug/_components/contract/ContractUI.tsx b/packages/nextjs/app/debug/_components/contract/ContractUI.tsx index 691a86d3..1b94446e 100644 --- a/packages/nextjs/app/debug/_components/contract/ContractUI.tsx +++ b/packages/nextjs/app/debug/_components/contract/ContractUI.tsx @@ -5,10 +5,7 @@ import { useReducer, useState } from "react"; import dynamic from "next/dynamic"; import { ContractReadMethods } from "./ContractReadMethods"; import { Address, Balance } from "~~/components/scaffold-stark"; -import { - useDeployedContractInfo, - useNetworkColor, -} from "~~/hooks/scaffold-stark"; +import { useDeployedContractInfo } from "~~/hooks/scaffold-stark"; import { useTargetNetwork } from "~~/hooks/scaffold-stark/useTargetNetwork"; import { ContractName } from "~~/utils/scaffold-stark/contract"; import { ContractVariables } from "./ContractVariables"; diff --git a/packages/nextjs/utils/scaffold-stark/contract.ts b/packages/nextjs/utils/scaffold-stark/contract.ts index 6a8fb479..eb64030b 100644 --- a/packages/nextjs/utils/scaffold-stark/contract.ts +++ b/packages/nextjs/utils/scaffold-stark/contract.ts @@ -239,16 +239,22 @@ export type ExtractAbiFunctionNamesScaffold< TAbiStateMutability extends AbiStateMutability = AbiStateMutability, > = ExtractAbiFunctionsScaffold["name"]; +// helper function will only take from interfaces : //TODO: see if we can make it more generic // helper function will only take from interfaces : //TODO: see if we can make it more generic export type ExtractAbiFunctionsScaffold< TAbi extends Abi, TAbiStateMutability extends AbiStateMutability = AbiStateMutability, > = Extract< ExtractAbiInterfaces["items"][number], - { - type: "function"; - state_mutability: TAbiStateMutability; - } + | { + state_mutability: TAbiStateMutability; + } + | Extract< + TAbi[number], + { + type: "function"; + } + > >; // helper function will only take from interfaces : //TODO: see if we can make it more generic @@ -328,31 +334,6 @@ export type AbiFunctionOutputs< TFunctionName extends string, > = ExtractAbiFunctionScaffold["outputs"]; -/*export type AbiEventInputs> = ExtractAbiEvent< - TAbi, - TEventName ->["inputs"]; - -type IndexedEventInputs< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, -> = Extract, TEventName>[number], { indexed: true }>; - -export type EventFilters< - TContractName extends ContractName, - TEventName extends ExtractAbiEventNames>, -> = IsContractDeclarationMissing< - any, - IndexedEventInputs extends never - ? never - : { - [Key in IsContractDeclarationMissing< - any, - IndexedEventInputs["name"] - >]?: AbiParameterToPrimitiveType, { name: Key }>>; - } ->;*/ - export type UseScaffoldEventHistoryConfig< TContractName extends ContractName, TEventName extends ExtractAbiEventNames>, diff --git a/packages/snfoundry/scripts_js/deploy.js b/packages/snfoundry/scripts_js/deploy.js new file mode 100644 index 00000000..91b23f4b --- /dev/null +++ b/packages/snfoundry/scripts_js/deploy.js @@ -0,0 +1,18 @@ +const { deployer, deployContract } = require("./deploy_contract"); +const deployScript = async () => { + const { address: diceGameAddr } = await deployContract(null, "DiceGame"); + + await deployContract( + { + dice_game_address: diceGameAddr, + owner: deployer.address, + }, + "RiggedRoll" + ); +}; + +deployScript() + .then(() => { + console.log("All Setup Done"); + }) + .catch(console.error);