Skip to content

Commit

Permalink
deleted sensible defaul info
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanguneri committed Sep 2, 2024
1 parent 4bd70b6 commit 3d619aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 235 deletions.
15 changes: 7 additions & 8 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import "@nomicfoundation/hardhat-verify";
import "hardhat-deploy";
import "hardhat-deploy-ethers";

// If not set, it uses ours Alchemy's default API key.
// You can get your own at https://dashboard.alchemyapi.io
const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF";
// If not set, it uses the hardhat account 0 private key.
const providerApiKey = process.env.ALCHEMY_API_KEY;
const deployerPrivateKey =
process.env.DEPLOYER_PRIVATE_KEY ?? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
// If not set, it uses ours Etherscan default API key.
const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW";
process.env.DEPLOYER_PRIVATE_KEY;
if (!deployerPrivateKey) {
throw new Error("DEPLOYER_PRIVATE_KEY environment variable is not set");
}
const etherscanApiKey = process.env.ETHERSCAN_API_KEY;

const config: HardhatUserConfig = {
solidity: {
Expand All @@ -30,7 +29,7 @@ const config: HardhatUserConfig = {
},
},
},
defaultNetwork: "sepolia",
defaultNetwork: "hardhat",
namedAccounts: {
deployer: {
// By default, it will take the first Hardhat account as the deployer
Expand Down
224 changes: 0 additions & 224 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,230 +5,6 @@
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

const deployedContracts = {
31337: {
DiceGame: {
address: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3",
abi: [
{
inputs: [],
stateMutability: "payable",
type: "constructor",
},
{
inputs: [],
name: "NotEnoughEther",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "player",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "roll",
type: "uint256",
},
],
name: "Roll",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "winner",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "Winner",
type: "event",
},
{
inputs: [],
name: "nonce",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "prize",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "rollTheDice",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
],
inheritedFunctions: {},
},
RiggedRoll: {
address: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
abi: [
{
inputs: [
{
internalType: "address payable",
name: "diceGameAddress",
type: "address",
},
],
stateMutability: "payable",
type: "constructor",
},
{
inputs: [],
name: "NotEnoughEther",
type: "error",
},
{
inputs: [],
name: "RollBiggerThanFive",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
inputs: [],
name: "diceGame",
outputs: [
{
internalType: "contract DiceGame",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "riggedRoll",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_addr",
type: "address",
},
{
internalType: "uint256",
name: "_amount",
type: "uint256",
},
],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
],
inheritedFunctions: {
owner: "@openzeppelin/contracts/access/Ownable.sol",
renounceOwnership: "@openzeppelin/contracts/access/Ownable.sol",
transferOwnership: "@openzeppelin/contracts/access/Ownable.sol",
},
},
},
11155111: {
DiceGame: {
address: "0x7285bf14271775b777Bc619bD4af9F6E5edcDeA1",
Expand Down
6 changes: 3 additions & 3 deletions packages/nextjs/scaffold.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type ScaffoldConfig = {

const scaffoldConfig = {
// The networks on which your DApp is live
targetNetworks: [chains.sepolia],
targetNetworks: [chains.hardhat],

// The interval at which your front-end polls the RPC servers for new data
// it has no effect if you only target the local network (default is 4000)
Expand All @@ -20,13 +20,13 @@ const scaffoldConfig = {
// You can get your own at https://dashboard.alchemyapi.io
// It's recommended to store it in an env variable:
// .env.local for local testing, and in the Vercel/system env config for live apps.
alchemyApiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF",
alchemyApiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY ?? (() => { throw new Error("Alchemy API Key is required") })(),

// This is ours WalletConnect's default project ID.
// You can get your own at https://cloud.walletconnect.com
// It's recommended to store it in an env variable:
// .env.local for local testing, and in the Vercel/system env config for live apps.
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || "3a8170812b534d0ff9d794f19a901d64",
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? (() => { throw new Error("WalletConnect Project ID is required") })(),

// Only show the Burner Wallet when running on hardhat network
onlyLocalBurnerWallet: true,
Expand Down

0 comments on commit 3d619aa

Please sign in to comment.