forked from codesters-r2w3/Project-proposal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding some more info to the create event function
- Loading branch information
1 parent
4c273dd
commit 24be9c4
Showing
3 changed files
with
48 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters