Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- GameNftCollection
- Optimization enabled
- true
- Compiler version
- v0.8.9+commit.e5eed63a
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-03-18T04:32:12.420188Z
Constructor Arguments
0x000000000000000000000000a0782ea41afe61e9aac45a408e51d9ed1b3eda07
Arg [0] (address) : 0xa0782ea41afe61e9aac45a408e51d9ed1b3eda07
contracts/gesoten-nft-game-collection.sol
// SPDX-License-Identifier: MITpragma solidity ^0.8.9;import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";import "@openzeppelin/contracts/access/Ownable.sol";contract GameNftCollection is Ownable {IERC1155 public gesotenErc1155Contract;address public gesotenErc1155ContractAddr;event PackOpened(address indexed user,uint256[] tokenIds,uint256[] amounts);event Compound(address indexed user,uint256[] tokenIds,uint256[] amounts,uint256 newTokenId,uint256 mintAmount);constructor(address _erc1155ContractAddress) {gesotenErc1155ContractAddr = _erc1155ContractAddress;gesotenErc1155Contract = IERC1155(_erc1155ContractAddress);}function setERC1155Contract(address _erc1155ContractAddress) external onlyOwner {require(_erc1155ContractAddress != address(0), "Invalid address");gesotenErc1155ContractAddr = _erc1155ContractAddress;gesotenErc1155Contract = IERC1155(_erc1155ContractAddress);}function openPack(address to,uint256[] memory tokenIds,uint256[] memory amounts,
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)pragma solidity ^0.8.0;import "../utils/Context.sol";/*** @dev Contract module which provides a basic access control mechanism, where* there is an account (an owner) that can be granted exclusive access to* specific functions.** By default, the owner account will be the one that deploys the contract. This* can later be changed with {transferOwnership}.** This module is used through inheritance. It will make available the modifier* `onlyOwner`, which can be applied to your functions to restrict their use to* the owner.*/abstract contract Ownable is Context {address private _owner;event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);/*** @dev Initializes the contract setting the deployer as the initial owner.*/constructor() {_transferOwnership(_msgSender());}/*** @dev Throws if called by any account other than the owner.*/modifier onlyOwner() {_checkOwner();_;}/*** @dev Returns the address of the current owner.
@openzeppelin/contracts/token/ERC1155/IERC1155.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)pragma solidity ^0.8.0;import "../../utils/introspection/IERC165.sol";/*** @dev Required interface of an ERC1155 compliant contract, as defined in the* https://eips.ethereum.org/EIPS/eip-1155[EIP].** _Available since v3.1._*/interface IERC1155 is IERC165 {/*** @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.*/event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);/*** @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all* transfers.*/event TransferBatch(address indexed operator,address indexed from,address indexed to,uint256[] ids,uint256[] values);/*** @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to* `approved`.*/event ApprovalForAll(address indexed account, address indexed operator, bool approved);/*** @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.** If an {URI} event was emitted for `id`, the standard
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)pragma solidity ^0.8.0;/*** @dev Provides information about the current execution context, including the* sender of the transaction and its data. While these are generally available* via msg.sender and msg.data, they should not be accessed in such a direct* manner, since when dealing with meta-transactions the account sending and* paying for execution may not be the actual sender (as far as an application* is concerned).** This contract is only required for intermediate, library-like contracts.*/abstract contract Context {function _msgSender() internal view virtual returns (address) {return msg.sender;}function _msgData() internal view virtual returns (bytes calldata) {return msg.data;}}
@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)pragma solidity ^0.8.0;/*** @dev Interface of the ERC165 standard, as defined in the* https://eips.ethereum.org/EIPS/eip-165[EIP].** Implementers can declare support of contract interfaces, which can then be* queried by others ({ERC165Checker}).** For an implementation, see {ERC165}.*/interface IERC165 {/*** @dev Returns true if this contract implements the interface defined by* `interfaceId`. See the corresponding* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]* to learn more about how these ids are created.** This function call must use less than 30 000 gas.*/function supportsInterface(bytes4 interfaceId) external view returns (bool);}
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_erc1155ContractAddress","internalType":"address"}]},{"type":"event","name":"Compound","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]","indexed":false},{"type":"uint256[]","name":"amounts","internalType":"uint256[]","indexed":false},{"type":"uint256","name":"newTokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"mintAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PackOpened","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]","indexed":false},{"type":"uint256[]","name":"amounts","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"compound","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"uint256","name":"newTokenId","internalType":"uint256"},{"type":"uint256","name":"mintAmount","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC1155"}],"name":"gesotenErc1155Contract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gesotenErc1155ContractAddr","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"openPack","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setERC1155Contract","inputs":[{"type":"address","name":"_erc1155ContractAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50604051610d82380380610d8283398101604081905261002f916100b7565b61003833610067565b600280546001600160a01b039092166001600160a01b03199283168117909155600180549092161790556100e7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100c957600080fd5b81516001600160a01b03811681146100e057600080fd5b9392505050565b610c8c806100f66000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a6146100f75780638da5cb5b146100ff578063dcde62f714610110578063f2fde38b1461012357600080fd5b80633df5b2161461008d5780634a76506a146100a25780635c584d4a146100b5578063706029d2146100e4575b600080fd5b6100a061009b366004610912565b610136565b005b6100a06100b03660046109ca565b6103f7565b6002546100c8906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a06100f23660046109ec565b610473565b6100a06106a4565b6000546001600160a01b03166100c8565b6001546100c8906001600160a01b031681565b6100a06101313660046109ca565b6106b8565b61013e610731565b835185511461018d5760405162461bcd60e51b8152602060048201526016602482015275082e4e4c2f2e640d8cadccee8d040dad2e6dac2e8c6d60531b60448201526064015b60405180910390fd5b6002546001600160a01b03166101e55760405162461bcd60e51b815260206004820181905260248201527f4552433131353520636f6e74726163742061646472657373206e6f74207365746044820152606401610184565b6002546040516000916001600160a01b03169061020a90339089908990602401610ac0565b60408051601f198184030181529181526020820180516001600160e01b0316631ac8311560e21b1790525161023f9190610b30565b6000604051808303816000865af19150503d806000811461027c576040519150601f19603f3d011682016040523d82523d6000602084013e610281565b606091505b50509050806102ca5760405162461bcd60e51b8152602060048201526015602482015274189d5c9b90985d18da0818d85b1b0819985a5b1959605a1b6044820152606401610184565b6002546040516000916001600160a01b0316906102f1903390889088908890602401610b78565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516103269190610b30565b6000604051808303816000865af19150503d8060008114610363576040519150601f19603f3d011682016040523d82523d6000602084013e610368565b606091505b50509050806103a75760405162461bcd60e51b815260206004820152600b60248201526a135a5b9d0819985a5b195960aa1b6044820152606401610184565b336001600160a01b03167fbc4147e7d95265d2b50e41f2c17127902f399866c206768b2020372b7aba99ef888888886040516103e69493929190610ba5565b60405180910390a250505050505050565b6103ff610731565b6001600160a01b0381166104475760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610184565b600280546001600160a01b039092166001600160a01b0319928316811790915560018054909216179055565b61047b610731565b6001600160a01b0384166104d15760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207265636569766572206164647265737300000000000000006044820152606401610184565b6002546001600160a01b03166105295760405162461bcd60e51b815260206004820181905260248201527f4552433131353520636f6e74726163742061646472657373206e6f74207365746044820152606401610184565b81518351146105735760405162461bcd60e51b8152602060048201526016602482015275082e4e4c2f2e640d8cadccee8d040dad2e6dac2e8c6d60531b6044820152606401610184565b6002546040516000916001600160a01b03169061059a908790879087908790602401610bde565b60408051601f198184030181529181526020820180516001600160e01b0316630fbfeffd60e11b179052516105cf9190610b30565b6000604051808303816000865af19150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b505090508061065a5760405162461bcd60e51b8152602060048201526015602482015274135a5b9d10985d18da0818d85b1b0819985a5b1959605a1b6044820152606401610184565b846001600160a01b03167ff7abfe87506a99dfe239c7c8cdb614b8c0bd515135b3897f983d0dd4c657aeaf8585604051610695929190610c28565b60405180910390a25050505050565b6106ac610731565b6106b6600061078b565b565b6106c0610731565b6001600160a01b0381166107255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610184565b61072e8161078b565b50565b6000546001600160a01b031633146106b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610184565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561081a5761081a6107db565b604052919050565b600082601f83011261083357600080fd5b8135602067ffffffffffffffff82111561084f5761084f6107db565b8160051b61085e8282016107f1565b928352848101820192828101908785111561087857600080fd5b83870192505b848310156108975782358252918301919083019061087e565b979650505050505050565b600082601f8301126108b357600080fd5b813567ffffffffffffffff8111156108cd576108cd6107db565b6108e0601f8201601f19166020016107f1565b8181528460208386010111156108f557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561092a57600080fd5b853567ffffffffffffffff8082111561094257600080fd5b61094e89838a01610822565b9650602088013591508082111561096457600080fd5b61097089838a01610822565b95506040880135945060608801359350608088013591508082111561099457600080fd5b506109a1888289016108a2565b9150509295509295909350565b80356001600160a01b03811681146109c557600080fd5b919050565b6000602082840312156109dc57600080fd5b6109e5826109ae565b9392505050565b60008060008060808587031215610a0257600080fd5b610a0b856109ae565b9350602085013567ffffffffffffffff80821115610a2857600080fd5b610a3488838901610822565b94506040870135915080821115610a4a57600080fd5b610a5688838901610822565b93506060870135915080821115610a6c57600080fd5b50610a79878288016108a2565b91505092959194509250565b600081518084526020808501945080840160005b83811015610ab557815187529582019590820190600101610a99565b509495945050505050565b6001600160a01b0384168152606060208201819052600090610ae490830185610a85565b8281036040840152610af68185610a85565b9695505050505050565b60005b83811015610b1b578181015183820152602001610b03565b83811115610b2a576000848401525b50505050565b60008251610b42818460208701610b00565b9190910192915050565b60008151808452610b64816020860160208601610b00565b601f01601f19169290920160200192915050565b60018060a01b0385168152836020820152826040820152608060608201526000610af66080830184610b4c565b608081526000610bb86080830187610a85565b8281036020840152610bca8187610a85565b604084019590955250506060015292915050565b6001600160a01b0385168152608060208201819052600090610c0290830186610a85565b8281036040840152610c148186610a85565b905082810360608401526108978185610b4c565b604081526000610c3b6040830185610a85565b8281036020840152610c4d8185610a85565b9594505050505056fea2646970667358221220f8b3347b98e292af7d01ab244e9989301aef2eb5a9a937cf85ae353ef1410f8d64736f6c63430008090033000000000000000000000000a0782ea41afe61e9aac45a408e51d9ed1b3eda07
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a6146100f75780638da5cb5b146100ff578063dcde62f714610110578063f2fde38b1461012357600080fd5b80633df5b2161461008d5780634a76506a146100a25780635c584d4a146100b5578063706029d2146100e4575b600080fd5b6100a061009b366004610912565b610136565b005b6100a06100b03660046109ca565b6103f7565b6002546100c8906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a06100f23660046109ec565b610473565b6100a06106a4565b6000546001600160a01b03166100c8565b6001546100c8906001600160a01b031681565b6100a06101313660046109ca565b6106b8565b61013e610731565b835185511461018d5760405162461bcd60e51b8152602060048201526016602482015275082e4e4c2f2e640d8cadccee8d040dad2e6dac2e8c6d60531b60448201526064015b60405180910390fd5b6002546001600160a01b03166101e55760405162461bcd60e51b815260206004820181905260248201527f4552433131353520636f6e74726163742061646472657373206e6f74207365746044820152606401610184565b6002546040516000916001600160a01b03169061020a90339089908990602401610ac0565b60408051601f198184030181529181526020820180516001600160e01b0316631ac8311560e21b1790525161023f9190610b30565b6000604051808303816000865af19150503d806000811461027c576040519150601f19603f3d011682016040523d82523d6000602084013e610281565b606091505b50509050806102ca5760405162461bcd60e51b8152602060048201526015602482015274189d5c9b90985d18da0818d85b1b0819985a5b1959605a1b6044820152606401610184565b6002546040516000916001600160a01b0316906102f1903390889088908890602401610b78565b60408051601f198184030181529181526020820180516001600160e01b031663731133e960e01b179052516103269190610b30565b6000604051808303816000865af19150503d8060008114610363576040519150601f19603f3d011682016040523d82523d6000602084013e610368565b606091505b50509050806103a75760405162461bcd60e51b815260206004820152600b60248201526a135a5b9d0819985a5b195960aa1b6044820152606401610184565b336001600160a01b03167fbc4147e7d95265d2b50e41f2c17127902f399866c206768b2020372b7aba99ef888888886040516103e69493929190610ba5565b60405180910390a250505050505050565b6103ff610731565b6001600160a01b0381166104475760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610184565b600280546001600160a01b039092166001600160a01b0319928316811790915560018054909216179055565b61047b610731565b6001600160a01b0384166104d15760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207265636569766572206164647265737300000000000000006044820152606401610184565b6002546001600160a01b03166105295760405162461bcd60e51b815260206004820181905260248201527f4552433131353520636f6e74726163742061646472657373206e6f74207365746044820152606401610184565b81518351146105735760405162461bcd60e51b8152602060048201526016602482015275082e4e4c2f2e640d8cadccee8d040dad2e6dac2e8c6d60531b6044820152606401610184565b6002546040516000916001600160a01b03169061059a908790879087908790602401610bde565b60408051601f198184030181529181526020820180516001600160e01b0316630fbfeffd60e11b179052516105cf9190610b30565b6000604051808303816000865af19150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b505090508061065a5760405162461bcd60e51b8152602060048201526015602482015274135a5b9d10985d18da0818d85b1b0819985a5b1959605a1b6044820152606401610184565b846001600160a01b03167ff7abfe87506a99dfe239c7c8cdb614b8c0bd515135b3897f983d0dd4c657aeaf8585604051610695929190610c28565b60405180910390a25050505050565b6106ac610731565b6106b6600061078b565b565b6106c0610731565b6001600160a01b0381166107255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610184565b61072e8161078b565b50565b6000546001600160a01b031633146106b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610184565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561081a5761081a6107db565b604052919050565b600082601f83011261083357600080fd5b8135602067ffffffffffffffff82111561084f5761084f6107db565b8160051b61085e8282016107f1565b928352848101820192828101908785111561087857600080fd5b83870192505b848310156108975782358252918301919083019061087e565b979650505050505050565b600082601f8301126108b357600080fd5b813567ffffffffffffffff8111156108cd576108cd6107db565b6108e0601f8201601f19166020016107f1565b8181528460208386010111156108f557600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561092a57600080fd5b853567ffffffffffffffff8082111561094257600080fd5b61094e89838a01610822565b9650602088013591508082111561096457600080fd5b61097089838a01610822565b95506040880135945060608801359350608088013591508082111561099457600080fd5b506109a1888289016108a2565b9150509295509295909350565b80356001600160a01b03811681146109c557600080fd5b919050565b6000602082840312156109dc57600080fd5b6109e5826109ae565b9392505050565b60008060008060808587031215610a0257600080fd5b610a0b856109ae565b9350602085013567ffffffffffffffff80821115610a2857600080fd5b610a3488838901610822565b94506040870135915080821115610a4a57600080fd5b610a5688838901610822565b93506060870135915080821115610a6c57600080fd5b50610a79878288016108a2565b91505092959194509250565b600081518084526020808501945080840160005b83811015610ab557815187529582019590820190600101610a99565b509495945050505050565b6001600160a01b0384168152606060208201819052600090610ae490830185610a85565b8281036040840152610af68185610a85565b9695505050505050565b60005b83811015610b1b578181015183820152602001610b03565b83811115610b2a576000848401525b50505050565b60008251610b42818460208701610b00565b9190910192915050565b60008151808452610b64816020860160208601610b00565b601f01601f19169290920160200192915050565b60018060a01b0385168152836020820152826040820152608060608201526000610af66080830184610b4c565b608081526000610bb86080830187610a85565b8281036020840152610bca8187610a85565b604084019590955250506060015292915050565b6001600160a01b0385168152608060208201819052600090610c0290830186610a85565b8281036040840152610c148186610a85565b905082810360608401526108978185610b4c565b604081526000610c3b6040830185610a85565b8281036020840152610c4d8185610a85565b9594505050505056fea2646970667358221220f8b3347b98e292af7d01ab244e9989301aef2eb5a9a937cf85ae353ef1410f8d64736f6c63430008090033