Skip to content

Commit

Permalink
fix: 🌀type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AazimAnish committed Oct 20, 2024
1 parent d7a9ca1 commit 1f86277
Show file tree
Hide file tree
Showing 9 changed files with 2,075 additions and 256 deletions.
2,066 changes: 1,968 additions & 98 deletions packages/hardhat/deployments/etherlinkTestnet/YourContract.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/nextjs/app/eventDash/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function EventDashboard(): ReactNode {
<div className="container mx-auto py-8">
<h1 className="text-3xl font-bold mb-6">Event Dashboard</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{events && events[0].map((id, index) => (
{events && events[0].map((id: bigint, index: number) => (
<EventCard
key={id.toString()}
eventId={id.toString()}
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/app/eventReg/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default function CreateEventForm() {

useEffect(() => {
if (communitiesData) {
const [ids, names] = communitiesData
const formattedCommunities = ids.map((id, index) => ({
const [ids, names] = communitiesData as [bigint[], string[]]
const formattedCommunities = ids.map((id: bigint, index: number) => ({
id: id.toString(),
name: names[index]
}))
Expand Down
10 changes: 5 additions & 5 deletions packages/nextjs/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Label } from "../../components/ui/label"
import { Table, TableHeader, TableCell, TableRow, TableBody } from "../../components/ui/table"
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth"
import { useAccount } from "wagmi"
import { formatEther } from "viem"
import { formatEther, Address } from "viem"

// Custom List component in shadcn style
const List = ({ children, className, ...props }: React.HTMLAttributes<HTMLUListElement>) => {
Expand All @@ -32,7 +32,7 @@ export default function Profile() {
const { data: userActivity, refetch } = useScaffoldReadContract({
contractName: "YourContract",
functionName: "getUserActivity",
args: [address],
args: [address as Address],
});

useEffect(() => {
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function Profile() {
<TableCell>Amount Funded</TableCell>
</TableHeader>
<TableBody>
{fundedEvents.map((event, index) => (
{fundedEvents.map((_event: bigint, index: number) => (
<TableRow key={index}>
<TableCell>{fundedEventNames[index]}</TableCell>
<TableCell>{formatEther(fundedAmounts[index])} ETH</TableCell>
Expand All @@ -92,7 +92,7 @@ export default function Profile() {
<div className="space-y-2">
<Label htmlFor="joinedCommunity">Joined Community</Label>
<List>
{joinedCommunityNames.map((community, index) => (
{joinedCommunityNames.map((community: string, index: number) => (
<ListItem key={index}>{community}</ListItem>
))}
</List>
Expand All @@ -116,7 +116,7 @@ export default function Profile() {
<div className="space-y-2">
<Label htmlFor="userCreatedEvents">User Created Events</Label>
<List>
{createdEventNames.map((event, index) => (
{createdEventNames.map((event: string, index: number) => (
<ListItem key={index}>{event}</ListItem>
))}
</List>
Expand Down
6 changes: 3 additions & 3 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ export const Header = () => {
</div>
<Link href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
<div className="flex relative w-10 h-10">
<Image alt="SE2 logo" className="cursor-pointer" fill src="/logo.svg" />
<Image alt="SE2 logo" className="cursor-pointer rounded-lg" fill src="/favicon.jpeg" />
</div>
<div className="flex flex-col">
<span className="font-bold leading-tight">Scaffold-ETH</span>
<span className="text-xs">Ethereum dev stack</span>
<span className="font-bold leading-tight">Eventure</span>
<span className="text-xs">Manage your events</span>
</div>
</Link>
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2">
Expand Down
149 changes: 2 additions & 147 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

const deployedContracts = {
31337: {
128123: {
YourContract: {
address: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
address: "0x4142A20B69CBa2c2FB321fF6e5fbf92036901712",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -1366,151 +1366,6 @@ const deployedContracts = {
},
},
},
128123: {
YourContract: {
address: "0xc2591EcC12DB13eef1191459A00e14f6f9850345",
abi: [
{
inputs: [
{
internalType: "address",
name: "_owner",
type: "address",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "greetingSetter",
type: "address",
},
{
indexed: false,
internalType: "string",
name: "newGreeting",
type: "string",
},
{
indexed: false,
internalType: "bool",
name: "premium",
type: "bool",
},
{
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "GreetingChange",
type: "event",
},
{
inputs: [],
name: "greeting",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "premium",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "_newGreeting",
type: "string",
},
],
name: "setGreeting",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [],
name: "totalCounter",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "userGreetingCounter",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
stateMutability: "payable",
type: "receive",
},
],
inheritedFunctions: {},
},
},
} as const;

export default deployedContracts satisfies GenericContractsDeclaration;
Binary file added packages/nextjs/public/favicon.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed packages/nextjs/public/favicon.png
Binary file not shown.

0 comments on commit 1f86277

Please sign in to comment.