mirror of
https://github.com/0xShay/ticketchain.git
synced 2026-01-12 05:33:23 +00:00
added new components for sc
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import EventCounter from '@/components/sc/eventCounter';
|
import EventCounter from '@/components/sc/eventCounter';
|
||||||
import CreateEvent from '@/components/sc/createEvent';
|
import CreateEvent from '@/components/sc/createEvent';
|
||||||
import GetEventPrice from '@/components/sc/getEventPrice';
|
import GetEventPrice from '@/components/sc/getEventPriceFlare';
|
||||||
import FlareFeed from '@/components/sc/getFlareFeed';
|
import FlareFeed from '@/components/sc/getFlareFeed';
|
||||||
import GetEventImages from '@/components/sc/getEventImages';
|
import GetEventImages from '@/components/sc/getEventImages';
|
||||||
import GetEventTickets from '@/components/sc/getEventTickets';
|
import GetEventTickets from '@/components/sc/getEventTickets';
|
||||||
|
import BuyTicket from '@/components/sc/buyTicket';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
@@ -41,6 +42,8 @@ export default function Home() {
|
|||||||
|
|
||||||
<GetEventTickets />
|
<GetEventTickets />
|
||||||
|
|
||||||
|
<BuyTicket />
|
||||||
|
|
||||||
<div className="flex gap-4 items-center flex-col sm:flex-row">
|
<div className="flex gap-4 items-center flex-col sm:flex-row">
|
||||||
<a
|
<a
|
||||||
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
|
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { ethers } from 'ethers';
|
||||||
|
import { getContract } from '@/lib/ethers';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
ethereum: ethers.providers.ExternalProvider;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const BuyTicket = () => {
|
||||||
|
const [eventId, setEventId] = useState<number | null>(null);
|
||||||
|
const [transactionHash, setTransactionHash] = useState<string | null>(null);
|
||||||
|
const [isWalletConnected, setIsWalletConnected] = useState<boolean>(false);
|
||||||
|
const [walletAddress, setWalletAddress] = useState<string | null>(null);
|
||||||
|
|
||||||
|
// Connect Wallet
|
||||||
|
const handleConnectWallet = async () => {
|
||||||
|
try {
|
||||||
|
if (typeof window.ethereum !== 'undefined' && window.ethereum.request) {
|
||||||
|
const accounts = await window.ethereum.request({
|
||||||
|
method: 'eth_requestAccounts',
|
||||||
|
});
|
||||||
|
if (accounts.length > 0) {
|
||||||
|
setIsWalletConnected(true);
|
||||||
|
setWalletAddress(accounts[0]);
|
||||||
|
console.log('Wallet connected:', accounts[0]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert('Please install MetaMask or another Ethereum wallet');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error connecting to wallet:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Handle buying a ticket for the event
|
||||||
|
const handleBuyTicket = async () => {
|
||||||
|
if (!eventId) {
|
||||||
|
alert('Please enter a valid Event ID.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Get the provider and signer
|
||||||
|
const provider = new ethers.providers.Web3Provider(window.ethereum);
|
||||||
|
const signer = provider.getSigner();
|
||||||
|
const contract = getContract().connect(signer);
|
||||||
|
|
||||||
|
// Call `getEventPriceFlare` to get the ticket cost in FLR
|
||||||
|
const ticketCost = await contract.getEventPriceFlare(eventId);
|
||||||
|
console.log('Ticket cost in FLR:', ethers.utils.formatEther(ticketCost));
|
||||||
|
|
||||||
|
// Check wallet balance
|
||||||
|
const balance = await provider.getBalance(await signer.getAddress());
|
||||||
|
console.log('Wallet balance in Wei:', balance.toString());
|
||||||
|
console.log('Wallet balance in FLR:', ethers.utils.formatEther(balance)); // Converts to FLR for readability
|
||||||
|
|
||||||
|
if (balance.lt(ticketCost)) {
|
||||||
|
alert('Insufficient balance to cover ticket cost and gas fees.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Proceed with buying the ticket
|
||||||
|
const tx = await contract.buyTicket(eventId, { value: ticketCost });
|
||||||
|
const receipt = await tx.wait();
|
||||||
|
|
||||||
|
setTransactionHash(receipt.transactionHash);
|
||||||
|
console.log(
|
||||||
|
'Ticket bought successfully, transaction hash:',
|
||||||
|
receipt.transactionHash
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error buying ticket:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="p-4">
|
||||||
|
<h2>Buy Ticket</h2>
|
||||||
|
{!isWalletConnected ? (
|
||||||
|
<button
|
||||||
|
onClick={handleConnectWallet}
|
||||||
|
className="bg-blue-500 text-white px-4 py-2 rounded mb-4"
|
||||||
|
>
|
||||||
|
Connect Wallet
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<div>
|
||||||
|
<p>Connected Wallet: {walletAddress}</p>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
placeholder="Enter Event ID"
|
||||||
|
value={eventId !== null ? eventId : ''}
|
||||||
|
onChange={(e) => setEventId(Number(e.target.value))}
|
||||||
|
className="border p-2 mb-2"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={handleBuyTicket}
|
||||||
|
className="bg-purple-500 text-white px-4 py-2 rounded"
|
||||||
|
>
|
||||||
|
Buy Ticket
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{transactionHash && (
|
||||||
|
<p className="mt-4">
|
||||||
|
Transaction successful! Hash: <strong>{transactionHash}</strong>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BuyTicket;
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ const CreateEvent = () => {
|
|||||||
const [name, setName] = useState('');
|
const [name, setName] = useState('');
|
||||||
const [description, setDescription] = useState('');
|
const [description, setDescription] = useState('');
|
||||||
const [capacity, setCapacity] = useState(0);
|
const [capacity, setCapacity] = useState(0);
|
||||||
const [ticketPrice, setTicketPrice] = useState(0); // Price in FLR
|
const [ticketPrice, setTicketPrice] = useState(0);
|
||||||
const [eventDate, setEventDate] = useState('');
|
const [eventDate, setEventDate] = useState('');
|
||||||
const [images, setImages] = useState<string[]>([]);
|
const [images, setImages] = useState<string[]>([]);
|
||||||
const [transactionHash, setTransactionHash] = useState('');
|
const [transactionHash, setTransactionHash] = useState('');
|
||||||
const [isWalletConnected, setIsWalletConnected] = useState(false);
|
const [isWalletConnected, setIsWalletConnected] = useState(false);
|
||||||
|
const [walletAddress, setWalletAddress] = useState<string | null>(null); // Store the connected wallet address
|
||||||
|
const [eventId, setEventId] = useState<number | null>(null); // Store the created event ID
|
||||||
|
|
||||||
// Check if the wallet is connected on component mount
|
// Check if the wallet is connected on component mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -29,6 +31,7 @@ const CreateEvent = () => {
|
|||||||
});
|
});
|
||||||
if (accounts && accounts.length > 0) {
|
if (accounts && accounts.length > 0) {
|
||||||
setIsWalletConnected(true); // Wallet is connected
|
setIsWalletConnected(true); // Wallet is connected
|
||||||
|
setWalletAddress(accounts[0]); // Store the connected wallet address
|
||||||
} else {
|
} else {
|
||||||
setIsWalletConnected(false); // Wallet is not connected
|
setIsWalletConnected(false); // Wallet is not connected
|
||||||
}
|
}
|
||||||
@@ -48,6 +51,7 @@ const CreateEvent = () => {
|
|||||||
});
|
});
|
||||||
if (accounts.length > 0) {
|
if (accounts.length > 0) {
|
||||||
setIsWalletConnected(true);
|
setIsWalletConnected(true);
|
||||||
|
setWalletAddress(accounts[0]); // Store the connected wallet address
|
||||||
console.log('Wallet connected:', accounts[0]);
|
console.log('Wallet connected:', accounts[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,19 +79,37 @@ const CreateEvent = () => {
|
|||||||
const contract = getContract().connect(signer);
|
const contract = getContract().connect(signer);
|
||||||
|
|
||||||
const unixEventDate = Math.floor(new Date(eventDate).getTime() / 1000); // Convert to Unix timestamp
|
const unixEventDate = Math.floor(new Date(eventDate).getTime() / 1000); // Convert to Unix timestamp
|
||||||
const weiTicketPrice = ethers.utils.parseEther(ticketPrice.toString()); // Convert FLR to Wei
|
|
||||||
|
|
||||||
|
// Convert ticket price from dollars to cents
|
||||||
|
const centsTicketPrice = Math.round(ticketPrice * 100); // Assuming ticketPrice is entered in USD cents
|
||||||
|
|
||||||
|
// Call the `createEvent` function, which submits the transaction
|
||||||
const tx = await contract.createEvent(
|
const tx = await contract.createEvent(
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
capacity,
|
capacity,
|
||||||
weiTicketPrice,
|
centsTicketPrice, // Now this is in cents, e.g storing as 500 cents == 5.00 usd
|
||||||
unixEventDate,
|
unixEventDate,
|
||||||
images
|
images
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log('Transaction Submitted:', tx);
|
||||||
|
|
||||||
|
// Wait for the transaction to be mined
|
||||||
const receipt = await tx.wait();
|
const receipt = await tx.wait();
|
||||||
setTransactionHash(receipt.transactionHash);
|
setTransactionHash(receipt.transactionHash);
|
||||||
console.log('Event created successfully!');
|
|
||||||
|
// Extract the `eventId` from the event logs in the receipt
|
||||||
|
const eventId = receipt.events?.find(
|
||||||
|
(event: ethers.Event) => event.event === 'EventCreated'
|
||||||
|
)?.args?.[0];
|
||||||
|
|
||||||
|
if (eventId) {
|
||||||
|
setEventId(eventId.toNumber()); // Store the event ID if found
|
||||||
|
console.log('Event created successfully with ID:', eventId.toNumber());
|
||||||
|
} else {
|
||||||
|
console.log('Event ID not found in the logs.');
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error creating event:', error);
|
console.error('Error creating event:', error);
|
||||||
}
|
}
|
||||||
@@ -100,6 +122,8 @@ const CreateEvent = () => {
|
|||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<h2>Create Event</h2>
|
<h2>Create Event</h2>
|
||||||
|
<p>Connected Wallet: {walletAddress}</p>{' '}
|
||||||
|
{/* Display connected wallet address */}
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Event Name"
|
placeholder="Event Name"
|
||||||
@@ -137,10 +161,10 @@ const CreateEvent = () => {
|
|||||||
onChange={(e) => setImages(e.target.value.split(','))}
|
onChange={(e) => setImages(e.target.value.split(','))}
|
||||||
/>
|
/>
|
||||||
<button onClick={handleCreateEvent}>Create Event</button>
|
<button onClick={handleCreateEvent}>Create Event</button>
|
||||||
|
|
||||||
{transactionHash && (
|
{transactionHash && (
|
||||||
<p>Transaction successful! Hash: {transactionHash}</p>
|
<p>Transaction successful! Hash: {transactionHash}</p>
|
||||||
)}
|
)}
|
||||||
|
{eventId !== null && <p>Event ID: {eventId}</p>}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const GetEventPrice = () => {
|
|||||||
if (eventId === null) return;
|
if (eventId === null) return;
|
||||||
|
|
||||||
const contract = getContract();
|
const contract = getContract();
|
||||||
const flrPrice = await contract.getEventPriceFlare(eventId);
|
const flrPrice = await contract.getEventPriceFlare(eventId); // flr price in usd cents e.g. return 36856 meaning 500 usd cents
|
||||||
setPriceInFlr(ethers.utils.formatEther(flrPrice.toString()));
|
setPriceInFlr(ethers.utils.formatEther(flrPrice.toString()));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching event price:', error);
|
console.error('Error fetching event price:', error);
|
||||||
@@ -1,22 +1,39 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import { ethers } from 'ethers';
|
||||||
import { getContract } from '@/lib/ethers'; // Adjust the path to your ethers helper
|
import { getContract } from '@/lib/ethers'; // Adjust the path to your ethers helper
|
||||||
|
|
||||||
const GetEventTickets = () => {
|
const GetEventTickets = () => {
|
||||||
const [eventId, setEventId] = useState<number | null>(null);
|
const [eventId, setEventId] = useState<number | null>(null);
|
||||||
const [tickets, setTickets] = useState<number[] | null>(null);
|
const [tickets, setTickets] = useState<number[] | null>(null);
|
||||||
|
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||||
|
|
||||||
const handleGetTickets = async () => {
|
const handleGetTickets = async () => {
|
||||||
|
setErrorMessage(null);
|
||||||
|
setTickets(null);
|
||||||
|
|
||||||
|
if (eventId === null) {
|
||||||
|
setErrorMessage('Please enter a valid Event ID.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Get the contract instance
|
||||||
const contract = getContract();
|
const contract = getContract();
|
||||||
|
|
||||||
if (eventId === null) return;
|
// Fetch tickets for the given event ID
|
||||||
|
|
||||||
const eventTickets = await contract.getEventTickets(eventId);
|
const eventTickets = await contract.getEventTickets(eventId);
|
||||||
setTickets(eventTickets);
|
|
||||||
|
// Convert BigNumbers to plain numbers for display
|
||||||
|
setTickets(
|
||||||
|
eventTickets.map((ticket: ethers.BigNumber) => ticket.toNumber())
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching event tickets:', error);
|
console.error('Error fetching event tickets:', error);
|
||||||
|
setErrorMessage(
|
||||||
|
'Failed to fetch tickets. Please check the Event ID and try again.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,6 +54,8 @@ const GetEventTickets = () => {
|
|||||||
Get Tickets
|
Get Tickets
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{errorMessage && <p className="text-red-500">{errorMessage}</p>}
|
||||||
|
|
||||||
{tickets && (
|
{tickets && (
|
||||||
<div className="mt-4">
|
<div className="mt-4">
|
||||||
<h3>Tickets for Event {eventId}:</h3>
|
<h3>Tickets for Event {eventId}:</h3>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ contract EventManager {
|
|||||||
uint256 eventDate;
|
uint256 eventDate;
|
||||||
string[] images; // array of image URLs
|
string[] images; // array of image URLs
|
||||||
uint256[] tickets;
|
uint256[] tickets;
|
||||||
address eventHost;
|
address payable eventHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Ticket {
|
struct Ticket {
|
||||||
@@ -71,7 +71,7 @@ contract EventManager {
|
|||||||
return _cents * power(10, decimals) * 1 ether / 100 / feedValue;
|
return _cents * power(10, decimals) * 1 ether / 100 / feedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
function power(uint base, int8 exponent) public pure returns (uint) {
|
function power(uint base, int8 exponent) private pure returns (uint) {
|
||||||
require(exponent >= 0, "Exponent must be non-negative");
|
require(exponent >= 0, "Exponent must be non-negative");
|
||||||
uint result = 1;
|
uint result = 1;
|
||||||
for (int8 i = 0; i < exponent; i++) {
|
for (int8 i = 0; i < exponent; i++) {
|
||||||
@@ -85,9 +85,10 @@ contract EventManager {
|
|||||||
return centsToFlare(events[_eventId].ticketPrice);
|
return centsToFlare(events[_eventId].ticketPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createEvent(string memory _name, string memory _description, uint256 _capacity, uint256 _ticketPrice, uint256 _eventDate, string[] memory _images) public {
|
function createEvent(string memory _name, string memory _description, uint256 _capacity, uint256 _ticketPrice, uint256 _eventDate, string[] memory _images) public returns (uint256 _eventId) {
|
||||||
events[eventCounter] = Event(_name, _description, _capacity, 0, _ticketPrice, _eventDate, _images, new uint256[](0), msg.sender);
|
events[eventCounter] = Event(_name, _description, _capacity, 0, _ticketPrice, _eventDate, _images, new uint256[](0), payable(msg.sender));
|
||||||
eventCounter++;
|
eventCounter++;
|
||||||
|
return eventCounter - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEventImages(uint256 _eventId) public view returns (string[] memory) {
|
function getEventImages(uint256 _eventId) public view returns (string[] memory) {
|
||||||
@@ -100,12 +101,18 @@ contract EventManager {
|
|||||||
return events[_eventId].tickets;
|
return events[_eventId].tickets;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: ADD CURRENCY CONVERSION + CHECK
|
function buyTicket(uint256 _eventId) public payable returns (uint256 _ticketId) {
|
||||||
function buyTicket(uint256 _eventId) public payable {
|
|
||||||
require(_eventId < eventCounter, "Invalid event ID");
|
require(_eventId < eventCounter, "Invalid event ID");
|
||||||
require(events[_eventId].eventDate > block.timestamp, "Event has already passed");
|
require(events[_eventId].eventDate > block.timestamp, "Event has already passed");
|
||||||
require(events[_eventId].tickets.length < events[_eventId].capacity, "Event is full");
|
require(events[_eventId].tickets.length < events[_eventId].capacity, "Event is full");
|
||||||
require(msg.value == events[_eventId].ticketPrice, "Invalid ticket price");
|
|
||||||
|
uint256 ticketCost = getEventPriceFlare(_eventId); // Get ticket price in FLR
|
||||||
|
require(msg.value >= ticketCost, "Insufficient value provided"); // Ensure user has paid >= ticket price
|
||||||
|
if (msg.value > ticketCost) {
|
||||||
|
// Pay any excess the user paid
|
||||||
|
(bool sentExcess, ) = msg.sender.call{value: msg.value - ticketCost}("");
|
||||||
|
require(sentExcess, "Failed to send FLR excess back to buyer");
|
||||||
|
}
|
||||||
|
|
||||||
// Create new ticket
|
// Create new ticket
|
||||||
tickets[ticketCounter] = Ticket(msg.sender, block.timestamp, _eventId);
|
tickets[ticketCounter] = Ticket(msg.sender, block.timestamp, _eventId);
|
||||||
@@ -119,8 +126,10 @@ contract EventManager {
|
|||||||
events[_eventId].ticketsSold++;
|
events[_eventId].ticketsSold++;
|
||||||
|
|
||||||
// Transfer FLR to event host
|
// Transfer FLR to event host
|
||||||
(bool sent, ) = events[_eventId].eventHost.call{value: msg.value}("");
|
(bool sentToHost, ) = events[_eventId].eventHost.call{value: ticketCost}("");
|
||||||
require(sent, "Failed to send FLR to event host");
|
require(sentToHost, "Failed to send FLR to event host");
|
||||||
|
|
||||||
|
return ticketCounter - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function transferTicketForce(uint256 _ticketId, address _to) private {
|
function transferTicketForce(uint256 _ticketId, address _to) private {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ethers } from 'ethers';
|
|||||||
|
|
||||||
const FLARE_TESTNET_RPC_URL = 'https://coston2.enosys.global/ext/C/rpc';
|
const FLARE_TESTNET_RPC_URL = 'https://coston2.enosys.global/ext/C/rpc';
|
||||||
|
|
||||||
const CONTRACT_ADDRESS = '0x0B236423274D36C32fb2362cc177756a21A025A3';
|
const CONTRACT_ADDRESS = '0xa67f64937a0a4daf3b5f5Eea7903d1E81d375b7b';
|
||||||
|
|
||||||
export function getFlareProvider() {
|
export function getFlareProvider() {
|
||||||
const flareRpcUrl = FLARE_TESTNET_RPC_URL;
|
const flareRpcUrl = FLARE_TESTNET_RPC_URL;
|
||||||
@@ -46,7 +46,13 @@ export function getContract() {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'buyTicket',
|
name: 'buyTicket',
|
||||||
outputs: [],
|
outputs: [
|
||||||
|
{
|
||||||
|
internalType: 'uint256',
|
||||||
|
name: '_ticketId',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
stateMutability: 'payable',
|
stateMutability: 'payable',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
@@ -84,7 +90,13 @@ export function getContract() {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
name: 'createEvent',
|
name: 'createEvent',
|
||||||
outputs: [],
|
outputs: [
|
||||||
|
{
|
||||||
|
internalType: 'uint256',
|
||||||
|
name: '_eventId',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
stateMutability: 'nonpayable',
|
stateMutability: 'nonpayable',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
@@ -184,7 +196,7 @@ export function getContract() {
|
|||||||
type: 'uint256',
|
type: 'uint256',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
internalType: 'address',
|
internalType: 'address payable',
|
||||||
name: 'eventHost',
|
name: 'eventHost',
|
||||||
type: 'address',
|
type: 'address',
|
||||||
},
|
},
|
||||||
@@ -314,30 +326,6 @@ export function getContract() {
|
|||||||
stateMutability: 'view',
|
stateMutability: 'view',
|
||||||
type: 'function',
|
type: 'function',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
internalType: 'uint256',
|
|
||||||
name: 'base',
|
|
||||||
type: 'uint256',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
internalType: 'int8',
|
|
||||||
name: 'exponent',
|
|
||||||
type: 'int8',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: 'power',
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
internalType: 'uint256',
|
|
||||||
name: '',
|
|
||||||
type: 'uint256',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
stateMutability: 'pure',
|
|
||||||
type: 'function',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
inputs: [],
|
inputs: [],
|
||||||
name: 'ticketCounter',
|
name: 'ticketCounter',
|
||||||
|
|||||||
Reference in New Issue
Block a user