Skip to content

Instantly share code, notes, and snippets.

@wass08
Created June 16, 2022 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wass08/64d7b85e611323255acbe3574daa2b2d to your computer and use it in GitHub Desktop.
Save wass08/64d7b85e611323255acbe3574daa2b2d to your computer and use it in GitHub Desktop.
Infinity Tower Tutorial Simple Contract
// 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