Created
June 16, 2022 14:28
-
-
Save wass08/64d7b85e611323255acbe3574daa2b2d to your computer and use it in GitHub Desktop.
Infinity Tower Tutorial Simple Contract
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title InfinityTower | |
* @dev Implements floors creation | |
*/ | |
contract InfinityTower { | |
struct Floor { | |
string ownerName; | |
string message; | |
string link; | |
uint color; | |
uint windowsTint; | |
} | |
event NewFloor(uint floor, string ownerName, string message, string link, uint color, uint windowsTint); | |
Floor[] public floors; | |
uint public nbFloors; | |
function createFloor(string memory _ownerName, string memory _message, string memory _link, uint _color, uint _windowTint) public { | |
floors.push(Floor(_ownerName, _message, _link, _color, _windowTint)); | |
emit NewFloor(nbFloors, _ownerName, _message, _link, _color, _windowTint); | |
nbFloors++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment