This commit is contained in:
Sewmina 2024-09-07 18:38:19 +05:30
parent 74ed3d2efb
commit 7c7e65d86a

View File

@ -8,6 +8,8 @@ import "@openzeppelin/contracts/access/Ownable.sol";
contract GameData is ERC1155, Ownable, ERC1155Burnable {
string public name = "Sekret Game Launcher";
string public symbol = "SGL";
//------------------------------ ERC1155 COLLECTION-------------------------------
@ -47,6 +49,10 @@ contract GameData is ERC1155, Ownable, ERC1155Burnable {
return string(abi.encodePacked("http://linode.playpoolstudios.com/begula/nft_data/", Strings.toString(_tokenid), ".json"));
}
function setCollectionName(string memory _name) public{
name= _name;
}
//------------------------------Game Management -------------------------------
@ -86,7 +92,7 @@ contract GameData is ERC1155, Ownable, ERC1155Burnable {
}
function MintUser(uint256 newUserId,address newUserAddress) public{
require(msg.sender == operator, "Only the operator can do this");
require(msg.sender == operator || msg.sender == owner(), "Only the operator can do this");
_mint(newUserAddress, newUserId, 1, "");
nextUserId++;
@ -104,7 +110,7 @@ contract GameData is ERC1155, Ownable, ERC1155Burnable {
}
function startTournament(uint256 tournament_id) public{
require(msg.sender == operator, "Only the operator can do this");
require(msg.sender == operator , "Only the operator can do this");
expiredTournaments.push(tournament_id);
}