Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MihRazvan committed Sep 16, 2024
1 parent 3a55883 commit f509c54
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 89 deletions.
36 changes: 36 additions & 0 deletions packages/foundry/contracts/Lottery.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/** Contract elements should be laid out in the following order:
Pragma statements
Import statements
Events
Errors
Interfaces
Libraries
Contracts
Inside each contract, library or interface, use the following order:
Type declarations
State variables
Events
Errors
Modifiers
Functions */

//SPDX-License-Identifier: MIT

pragma solidity ^0.8;

contract Lottery {
uint256 private constant MIN_AMOUNT = 0.1 ether;

address[] private participants;
mapping(address => uint256) participansToAmountFunded;

error Error_NotEnoughEthFunded();

function fundLottery() public payable {
if (msg.value < MIN_AMOUNT) {
revert Error_NotEnoughEthFunded();
}
participants.push(msg.sender);
}
}
88 changes: 0 additions & 88 deletions packages/foundry/contracts/YourContract.sol

This file was deleted.

148 changes: 147 additions & 1 deletion packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,152 @@
*/
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

const deployedContracts = {} as const;
const deployedContracts = {
31337: {
YourContract: {
address: "0x5fbdb2315678afecb367f032d93f642f64180aa3",
abi: [
{
type: "constructor",
inputs: [
{
name: "_owner",
type: "address",
internalType: "address",
},
],
stateMutability: "nonpayable",
},
{
type: "receive",
stateMutability: "payable",
},
{
type: "function",
name: "greeting",
inputs: [],
outputs: [
{
name: "",
type: "string",
internalType: "string",
},
],
stateMutability: "view",
},
{
type: "function",
name: "owner",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "premium",
inputs: [],
outputs: [
{
name: "",
type: "bool",
internalType: "bool",
},
],
stateMutability: "view",
},
{
type: "function",
name: "setGreeting",
inputs: [
{
name: "_newGreeting",
type: "string",
internalType: "string",
},
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "totalCounter",
inputs: [],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "userGreetingCounter",
inputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
outputs: [
{
name: "",
type: "uint256",
internalType: "uint256",
},
],
stateMutability: "view",
},
{
type: "function",
name: "withdraw",
inputs: [],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "event",
name: "GreetingChange",
inputs: [
{
name: "greetingSetter",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "newGreeting",
type: "string",
indexed: false,
internalType: "string",
},
{
name: "premium",
type: "bool",
indexed: false,
internalType: "bool",
},
{
name: "value",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
],
inheritedFunctions: {},
},
},
} as const;

export default deployedContracts satisfies GenericContractsDeclaration;

0 comments on commit f509c54

Please sign in to comment.