házijavítás
parent
88022dd30e
commit
69e6e70fba
|
@ -5,14 +5,16 @@ contract Cakery {
|
||||||
|
|
||||||
uint256 public cakeportfolio;
|
uint256 public cakeportfolio;
|
||||||
address public admin;
|
address public admin;
|
||||||
uint256 public fixedcosts;
|
uint256 private fixedcosts;
|
||||||
uint256 public variablecosts;
|
uint256 private variablecosts;
|
||||||
uint256 public soldqty;
|
uint256 public soldqty;
|
||||||
uint256 public price;
|
uint256 public price;
|
||||||
uint256 private income;
|
uint256 private income;
|
||||||
string private correct_password;
|
string private correct_password;
|
||||||
mapping (uint256 => string) internal idToHash;
|
mapping (uint256 => string) internal mintmessage;
|
||||||
mapping (uint256 => address) internal idToOwner;
|
mapping (uint256 => address) internal mintaddress;
|
||||||
|
uint256 public mintcount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -23,22 +25,47 @@ contract Cakery {
|
||||||
price = 100;
|
price = 100;
|
||||||
income = soldqty * price;
|
income = soldqty * price;
|
||||||
admin = msg.sender;
|
admin = msg.sender;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showincome () public view returns (uint256) {
|
function showincome () public view returns (uint256) {
|
||||||
return income;
|
return income;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add(uint256 sold, uint cost) public pure returns(uint) {
|
||||||
|
return sold + cost;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function showvariablecost () public view returns (uint256) {
|
function showvariablecost () public view returns (uint256) {
|
||||||
return variablecosts;
|
return variablecosts;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showprice () public view returns (uint256) {
|
function showprice () public view returns (uint256) {
|
||||||
return price;
|
return price;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function transfer(uint256 _tokenId, address _toAddress) external {
|
function set_password(string memory _password) external {
|
||||||
require(msg.sender == idToOwner[_tokenId]);
|
require(msg.sender == admin);
|
||||||
idToOwner[_tokenId] = _toAddress;
|
correct_password = _password;
|
||||||
|
|
||||||
} }
|
}
|
||||||
|
|
||||||
|
function mint(string memory _message) external payable {
|
||||||
|
require(msg.value >= price);
|
||||||
|
require(msg.sender == admin);
|
||||||
|
mintcount = mintcount + 1;
|
||||||
|
mintmessage[mintcount] = _message;
|
||||||
|
mintaddress[mintcount] = msg.sender;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function WhatIsTheHash(uint256 _mintnumber) public view returns (string memory message_, address sender_){
|
||||||
|
return(mintmessage[_mintnumber], mintaddress[_mintnumber]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue