Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
adding some more info to the create event function
  • Loading branch information
SIDHARTH20K4 committed Jan 27, 2024
1 parent 4c273dd commit 24be9c4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 34 deletions.
33 changes: 0 additions & 33 deletions web3/contracts/Lock.sol

This file was deleted.

47 changes: 47 additions & 0 deletions web3/contracts/Nft.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Nft {

uint256 currentTime = block.timestamp;
struct Event{
string eventName;
string evntVenue;
uint256 Time;
uint256 Duration;
string createrName;
address creatorAddress;
string imgUrl;
}

struct Person{
string Name;
bytes1 Gender;
uint256 Age;
}

Event public myEvent;
function createEvent(
string calldata _eventName,
string calldata _evntVenue,
uint256 _Time,
uint256 _Duration,
address _creatorAddress,
string memory _imgUrl
)
public returns (uint)
{
myEvent.eventName = _eventName;
myEvent.evntVenue = _evntVenue;
myEvent.Duration = _Duration;
myEvent.creatorAddress = _creatorAddress;
myEvent.imgUrl = _imgUrl;

if (_Time < currentTime){
return 0;
}
else {
myEvent.Time = _Time + currentTime;
}
}
}
2 changes: 1 addition & 1 deletion web3/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const config: HardhatUserConfig = {
solidity: "0.8.19",
solidity: "0.8.20",
};

export default config;

0 comments on commit 24be9c4

Please sign in to comment.