mirror of
https://github.com/0xShay/ticketchain.git
synced 2026-01-11 13:13:25 +00:00
Merge pull request #45 from Ayush272002/uint256-64
Make capcaity, ticketPrice and ticketsSold uint64
This commit is contained in:
@@ -24,9 +24,9 @@ contract EventManager {
|
||||
string name;
|
||||
string description;
|
||||
string location;
|
||||
uint256 capacity;
|
||||
uint256 ticketsSold;
|
||||
uint256 ticketPrice; // in USD cents
|
||||
uint64 capacity;
|
||||
uint64 ticketsSold;
|
||||
uint64 ticketPrice; // in USD cents
|
||||
uint256 eventStartDate;
|
||||
uint256 eventEndDate;
|
||||
string[] images; // array of image URLs
|
||||
@@ -92,7 +92,7 @@ contract EventManager {
|
||||
return centsToFlare(events[_eventId].ticketPrice);
|
||||
}
|
||||
|
||||
function createEvent(string memory _name, string memory _description, string memory _location, uint256 _capacity, uint256 _ticketPrice, uint256 _eventStartDate, uint256 _eventEndDate, string[] memory _images) public returns (uint256 _eventId) {
|
||||
function createEvent(string memory _name, string memory _description, string memory _location, uint64 _capacity, uint64 _ticketPrice, uint256 _eventStartDate, uint256 _eventEndDate, string[] memory _images) public returns (uint256 _eventId) {
|
||||
events[eventCounter] = Event(_name, _description, _location, _capacity, 0, _ticketPrice, _eventStartDate, _eventEndDate, _images, new uint256[](0), payable(msg.sender));
|
||||
eventCounter++;
|
||||
emit EventCreated(eventCounter - 1, _name, _eventStartDate);
|
||||
|
||||
@@ -1,100 +1,4 @@
|
||||
[
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "_allowed",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "approveTicket",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "buyTicket",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_location",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_capacity",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketPrice",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventStartDate",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventEndDate",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "string[]",
|
||||
"name": "_images",
|
||||
"type": "string[]"
|
||||
}
|
||||
],
|
||||
"name": "createEvent",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
@@ -217,9 +121,14 @@
|
||||
"internalType": "address",
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "_allowed",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"name": "transferTicket",
|
||||
"name": "approveTicket",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
@@ -228,18 +137,19 @@
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"name": "_eventId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferTicketFrom",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"name": "buyTicket",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "payable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
@@ -261,6 +171,60 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "_location",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "uint64",
|
||||
"name": "_capacity",
|
||||
"type": "uint64"
|
||||
},
|
||||
{
|
||||
"internalType": "uint64",
|
||||
"name": "_ticketPrice",
|
||||
"type": "uint64"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventStartDate",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventEndDate",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "string[]",
|
||||
"name": "_images",
|
||||
"type": "string[]"
|
||||
}
|
||||
],
|
||||
"name": "createEvent",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_eventId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "eventCounter",
|
||||
@@ -300,9 +264,9 @@
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"internalType": "uint64",
|
||||
"name": "capacity",
|
||||
"type": "uint256"
|
||||
"type": "uint64"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
@@ -310,9 +274,9 @@
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"internalType": "uint64",
|
||||
"name": "ticketPrice",
|
||||
"type": "uint256"
|
||||
"type": "uint64"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
@@ -497,6 +461,42 @@
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferTicket",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_ticketId",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferTicketFrom",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user