commit fd6ec22187a34f6ab85ba6a6d3180957d8378630 Author: mad.nikolett Date: Sun Feb 13 17:35:07 2022 +0100 házi feltöltése diff --git a/Niki_homework_1.txt b/Niki_homework_1.txt new file mode 100644 index 0000000..651bde4 --- /dev/null +++ b/Niki_homework_1.txt @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.11; + +contract Cakery { + + uint256 public cakeportfolio; + address public admin; + uint256 public fixedcosts; + uint256 public variablecosts; + uint256 public soldqty; + uint256 public price; + uint256 private income; + string private correct_password; + mapping (uint256 => string) internal idToHash; + mapping (uint256 => address) internal idToOwner; + + + constructor() { + cakeportfolio = 10; + fixedcosts = 50; + variablecosts = 30 * 20; + soldqty = 30; + price = 100; + income = soldqty * price; + admin = msg.sender; + } + + function showincome () public view returns (uint256) { + return income; + } + + function showvariablecost () public view returns (uint256) { + return variablecosts; + } + + function showprice () public view returns (uint256) { + return price; + } + + function transfer(uint256 _tokenId, address _toAddress) external { + require(msg.sender == idToOwner[_tokenId]); + idToOwner[_tokenId] = _toAddress; + + } } \ No newline at end of file