Overview
APE Balance
APE Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Multichain Info
Latest 25 from a total of 161 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Safe Transfer Fr... | 32656344 | 4 days ago | IN | 0 APE | 0.00453677 | ||||
| Set Approval For... | 32490219 | 8 days ago | IN | 0 APE | 0.0047013 | ||||
| Set Approval For... | 32158704 | 17 days ago | IN | 0 APE | 0.0047013 | ||||
| Safe Transfer Fr... | 32115340 | 18 days ago | IN | 0 APE | 0.00627555 | ||||
| Safe Transfer Fr... | 31982140 | 22 days ago | IN | 0 APE | 0.00676363 | ||||
| Safe Transfer Fr... | 31982139 | 22 days ago | IN | 0 APE | 0.00453677 | ||||
| Safe Transfer Fr... | 31821955 | 25 days ago | IN | 0 APE | 0.00453677 | ||||
| Safe Transfer Fr... | 31821159 | 25 days ago | IN | 0 APE | 0.00676363 | ||||
| Set Approval For... | 31714632 | 28 days ago | IN | 0 APE | 0.0047013 | ||||
| Set Approval For... | 31114230 | 39 days ago | IN | 0 APE | 0.0047013 | ||||
| Set Approval For... | 31111121 | 39 days ago | IN | 0 APE | 0.0047013 | ||||
| Set Approval For... | 28713333 | 65 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 28138227 | 70 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 27643318 | 73 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 26044165 | 83 days ago | IN | 0 APE | 0.00061868 | ||||
| Set Approval For... | 25552938 | 91 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 25226275 | 97 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 24999644 | 103 days ago | IN | 0 APE | 0.00061868 | ||||
| Set Approval For... | 24771282 | 109 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 24696339 | 111 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 24509759 | 115 days ago | IN | 0 APE | 0.00117357 | ||||
| Set Approval For... | 24503004 | 115 days ago | IN | 0 APE | 0.00061868 | ||||
| Set Approval For... | 24492260 | 115 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 24387391 | 118 days ago | IN | 0 APE | 0.0011757 | ||||
| Set Approval For... | 23784822 | 127 days ago | IN | 0 APE | 0.00061868 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "@limitbreak/creator-token-standards/src/access/OwnableBasic.sol";
import "@limitbreak/creator-token-standards/src/erc1155c/ERC1155C.sol";
import "@limitbreak/creator-token-standards/src/programmable-royalties/BasicRoyalties.sol";
/**
* @title MintotaurColiseumRewards
* @notice ERC1155 contract for Mintotaur battle trophies and achievements
*/
contract MintotaurColiseumRewards is
ERC1155C,
OwnableBasic,
BasicRoyalties
{
// Authorized minters (e.g., Coliseum contract)
mapping(address => bool) public authorizedMinters;
string public name;
string public symbol;
struct TrophyMetadata {
string name;
string description;
string svg;
}
// Trophy ID => Metadata
mapping(uint256 => TrophyMetadata) public trophyMetadata;
// Contract address => Trophy ID for win-based trophies
mapping(address => uint256) public addressIndex;
constructor(
address coliseumAddress,
address royaltyReceiver,
uint96 royaltyFeeNumerator
)
ERC1155OpenZeppelin("")
BasicRoyalties(royaltyReceiver, royaltyFeeNumerator)
{
authorizedMinters[coliseumAddress] = true;
// Initialize OwnableBasic owner
_transferOwnership(msg.sender);
name = "Mintos Coliseum Rewards";
symbol = "MCR";
}
/**
* @dev See {IERC165-supportsInterface}
* @param interfaceId The interface identifier to check
* @return bool True if the contract supports the interface
*/
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC1155C, ERC2981) returns (bool) {
return
ERC1155C.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId);
}
/**
* @notice Set metadata for a trophy
* @param trophyId The ID of the trophy
* @param trophyName Trophy name
* @param description Trophy description
* @param svg Trophy SVG artwork
*/
function setTrophyMetadata(
uint256 trophyId,
string memory trophyName,
string memory description,
string memory svg
) external onlyOwner {
require(trophyId > 0, "Invalid trophy ID");
trophyMetadata[trophyId] = TrophyMetadata({
name: trophyName,
description: description,
svg: svg
});
}
/**
* @notice Set contract address to trophy ID mapping
* @param contractAddress The NFT contract address
* @param trophyId Trophy ID to associate with the contract
*/
function setContractTrophy(address contractAddress, uint256 trophyId) external onlyOwner {
require(trophyId > 0, "Invalid trophy ID");
addressIndex[contractAddress] = trophyId;
}
/**
* @notice Get the URI for a token type
* @param tokenId The token ID to get the URI for
*/
function uri(uint256 tokenId) public view virtual override returns (string memory) {
TrophyMetadata memory metadata = trophyMetadata[tokenId];
require(bytes(metadata.name).length > 0, "Trophy does not exist");
bytes memory json = abi.encodePacked(
'{"name": "',
metadata.name,
'", "description": "',
metadata.description,
'", "image": "data:image/svg+xml;base64,',
Base64.encode(bytes(metadata.svg)),
'", "attributes": []}'
);
return string(
abi.encodePacked(
"data:application/json;base64,",
Base64.encode(json)
)
);
}
function setAuthorizedMinter(address minter, bool authorized) external onlyOwner {
authorizedMinters[minter] = authorized;
}
function isAuthorizedMinter(address minter) public view returns (bool) {
return authorizedMinters[minter];
}
/**
* @notice Mints a trophy to a winner for defeating a specific contract.
* @param winner The address of the player who won and will receive the trophy.
* @param defeatedContractAddress The address of the contract whose NFT was defeated.
*/
function mintForDefeatingContract(address winner, address defeatedContractAddress) external {
require(authorizedMinters[msg.sender], "Not authorized to mint");
uint256 trophyId = addressIndex[defeatedContractAddress];
require(trophyId > 0, "No trophy associated with this defeated contract");
require(bytes(trophyMetadata[trophyId].name).length > 0, "Trophy does not exist"); // Ensure metadata is set
_mint(winner, trophyId, 1, "");
}
// --- Burn Functionality ---
/**
* @notice Burns `value` tokens of token type `id` from `account`.
* @dev Caller must be `account` or be approved to operate on behalf of `account`.
* @param account The address whose tokens are to be burned.
* @param id The ID of the token type to burn.
* @param value The amount of tokens to burn.
*/
function burn(address account, uint256 id, uint256 value) public virtual {
require(
msg.sender == account || isApprovedForAll(account, msg.sender),
"ERC1155: caller is not token owner nor approved"
);
_burn(account, id, value);
}
/**
* @notice Burns `values` tokens of token types `ids` from `account`.
* @dev Caller must be `account` or be approved to operate on behalf of `account`.
* @param account The address whose tokens are to be burned.
* @param ids The IDs of the token types to burn.
* @param values The amounts of tokens to burn for each type.
*/
function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {
require(
msg.sender == account || isApprovedForAll(account, msg.sender),
"ERC1155: caller is not token owner nor approved"
);
_burnBatch(account, ids, values);
}
// --- End Burn Functionality ---
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "./OwnablePermissions.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract OwnableBasic is OwnablePermissions, Ownable {
function _requireCallerIsContractOwner() internal view virtual override {
_checkOwner();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Context.sol";
abstract contract OwnablePermissions is Context {
function _requireCallerIsContractOwner() internal view virtual;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../utils/AutomaticValidatorTransferApproval.sol";
import "../utils/CreatorTokenBase.sol";
import "../token/erc1155/ERC1155OpenZeppelin.sol";
import {TOKEN_TYPE_ERC1155} from "@limitbreak/permit-c/src/Constants.sol";
/**
* @title ERC1155C
* @author Limit Break, Inc.
* @notice Extends OpenZeppelin's ERC1155 implementation with Creator Token functionality, which
* allows the contract owner to update the transfer validation logic by managing a security policy in
* an external transfer validation security policy registry. See {CreatorTokenTransferValidator}.
*/
abstract contract ERC1155C is ERC1155OpenZeppelin, CreatorTokenBase, AutomaticValidatorTransferApproval {
/**
* @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved
* for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) {
isApproved = super.isApprovedForAll(owner, operator);
if (!isApproved) {
if (autoApproveTransfersFromValidator) {
isApproved = operator == address(getTransferValidator());
}
}
}
/**
* @notice Indicates whether the contract implements the specified interface.
* @dev Overrides supportsInterface in ERC165.
* @param interfaceId The interface id
* @return true if the contract implements the specified interface, false otherwise
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == type(ICreatorToken).interfaceId ||
interfaceId == type(ICreatorTokenLegacy).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @notice Returns the function selector for the transfer validator's validation function to be called
* @notice for transaction simulation.
*/
function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) {
functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256,uint256)"));
isViewFunction = false;
}
/// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
function _beforeTokenTransfer(
address /*operator*/,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory /*data*/
) internal virtual override {
uint256 idsArrayLength = ids.length;
for (uint256 i = 0; i < idsArrayLength;) {
_validateBeforeTransfer(from, to, ids[i], amounts[i]);
unchecked {
++i;
}
}
}
/// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
function _afterTokenTransfer(
address /*operator*/,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory /*data*/
) internal virtual override {
uint256 idsArrayLength = ids.length;
for (uint256 i = 0; i < idsArrayLength;) {
_validateAfterTransfer(from, to, ids[i], amounts[i]);
unchecked {
++i;
}
}
}
function _tokenType() internal pure override returns(uint16) {
return uint16(TOKEN_TYPE_ERC1155);
}
}
/**
* @title ERC1155CInitializable
* @author Limit Break, Inc.
* @notice Initializable implementation of ERC1155C to allow for EIP-1167 proxy clones.
*/
abstract contract ERC1155CInitializable is ERC1155OpenZeppelinInitializable, CreatorTokenBase, AutomaticValidatorTransferApproval {
function initializeERC1155(string memory uri_) public override {
super.initializeERC1155(uri_);
_emitDefaultTransferValidator();
_registerTokenType(getTransferValidator());
}
/**
* @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved
* for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) {
isApproved = super.isApprovedForAll(owner, operator);
if (!isApproved) {
if (autoApproveTransfersFromValidator) {
isApproved = operator == address(getTransferValidator());
}
}
}
/**
* @notice Indicates whether the contract implements the specified interface.
* @dev Overrides supportsInterface in ERC165.
* @param interfaceId The interface id
* @return true if the contract implements the specified interface, false otherwise
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == type(ICreatorToken).interfaceId ||
interfaceId == type(ICreatorTokenLegacy).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @notice Returns the function selector for the transfer validator's validation function to be called
* @notice for transaction simulation.
*/
function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) {
functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256,uint256)"));
isViewFunction = false;
}
/// @dev Ties the open-zeppelin _beforeTokenTransfer hook to more granular transfer validation logic
function _beforeTokenTransfer(
address /*operator*/,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory /*data*/
) internal virtual override {
uint256 idsArrayLength = ids.length;
for (uint256 i = 0; i < idsArrayLength;) {
_validateBeforeTransfer(from, to, ids[i], amounts[i]);
unchecked {
++i;
}
}
}
/// @dev Ties the open-zeppelin _afterTokenTransfer hook to more granular transfer validation logic
function _afterTokenTransfer(
address /*operator*/,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory /*data*/
) internal virtual override {
uint256 idsArrayLength = ids.length;
for (uint256 i = 0; i < idsArrayLength;) {
_validateAfterTransfer(from, to, ids[i], amounts[i]);
unchecked {
++i;
}
}
}
function _tokenType() internal pure override returns(uint16) {
return uint16(TOKEN_TYPE_ERC1155);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorTokenLegacy {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidator {
function applyCollectionTransferPolicy(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;
function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
function afterAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransfer(address operator, address token) external;
function afterAuthorizedTransfer(address token) external;
function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidatorSetTokenType {
function setTokenTypeOfCollection(address collection, uint16 tokenType) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/common/ERC2981.sol";
/**
* @title BasicRoyaltiesBase
* @author Limit Break, Inc.
* @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties.
*/
abstract contract BasicRoyaltiesBase is ERC2981 {
event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator);
event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator);
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override {
super._setDefaultRoyalty(receiver, feeNumerator);
emit DefaultRoyaltySet(receiver, feeNumerator);
}
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override {
super._setTokenRoyalty(tokenId, receiver, feeNumerator);
emit TokenRoyaltySet(tokenId, receiver, feeNumerator);
}
}
/**
* @title BasicRoyalties
* @author Limit Break, Inc.
* @notice Constructable BasicRoyalties Contract implementation.
*/
abstract contract BasicRoyalties is BasicRoyaltiesBase {
constructor(address receiver, uint96 feeNumerator) {
_setDefaultRoyalty(receiver, feeNumerator);
}
}
/**
* @title BasicRoyaltiesInitializable
* @author Limit Break, Inc.
* @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones.
*/
abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../../access/OwnablePermissions.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
abstract contract ERC1155OpenZeppelinBase is ERC1155 {
}
abstract contract ERC1155OpenZeppelin is ERC1155OpenZeppelinBase {
constructor(string memory uri_) ERC1155(uri_) {}
}
abstract contract ERC1155OpenZeppelinInitializable is OwnablePermissions, ERC1155OpenZeppelinBase {
error ERC1155OpenZeppelinInitializable__AlreadyInitializedERC1155();
bool private _erc1155Initialized;
function initializeERC1155(string memory uri_) public virtual {
_requireCallerIsContractOwner();
if(_erc1155Initialized) {
revert ERC1155OpenZeppelinInitializable__AlreadyInitializedERC1155();
}
_erc1155Initialized = true;
_setURI(uri_);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../access/OwnablePermissions.sol";
/**
* @title AutomaticValidatorTransferApproval
* @author Limit Break, Inc.
* @notice Base contract mix-in that provides boilerplate code giving the contract owner the
* option to automatically approve a 721-C transfer validator implementation for transfers.
*/
abstract contract AutomaticValidatorTransferApproval is OwnablePermissions {
/// @dev Emitted when the automatic approval flag is modified by the creator.
event AutomaticApprovalOfTransferValidatorSet(bool autoApproved);
/// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens.
bool public autoApproveTransfersFromValidator;
/**
* @notice Sets if the transfer validator is automatically approved as an operator for all token owners.
*
* @dev Throws when the caller is not the contract owner.
*
* @param autoApprove If true, the collection's transfer validator will be automatically approved to
* transfer holder's tokens.
*/
function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external {
_requireCallerIsContractOwner();
autoApproveTransfersFromValidator = autoApprove;
emit AutomaticApprovalOfTransferValidatorSet(autoApprove);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenLegacy.sol";
import "../interfaces/ITransferValidator.sol";
import "./TransferValidation.sol";
import "../interfaces/ITransferValidatorSetTokenType.sol";
/**
* @title CreatorTokenBase
* @author Limit Break, Inc.
* @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token
* transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3.
* This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer
* restrictions and security policies.
*
* <h4>Features:</h4>
* <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
* <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
*
* <h4>Benefits:</h4>
* <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
* <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul>
* <ul>Can be easily integrated into other token contracts as a base contract.</ul>
*
* <h4>Intended Usage:</h4>
* <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and
* security policies.</ul>
* <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the
* creator token.</ul>
*
* <h4>Compatibility:</h4>
* <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul>
*/
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {
/// @dev Thrown when setting a transfer validator address that has no deployed code.
error CreatorTokenBase__InvalidTransferValidatorContract();
/// @dev The default transfer validator that will be used if no transfer validator has been set by the creator.
address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C002B0059009a671D00aD1700c9748146cd1B);
/// @dev Used to determine if the default transfer validator is applied.
/// @dev Set to true when the creator sets a transfer validator address.
bool private isValidatorInitialized;
/// @dev Address of the transfer validator to apply to transactions.
address private transferValidator;
constructor() {
_emitDefaultTransferValidator();
_registerTokenType(DEFAULT_TRANSFER_VALIDATOR);
}
/**
* @notice Sets the transfer validator for the token contract.
*
* @dev Throws when provided validator contract is not the zero address and does not have code.
* @dev Throws when the caller is not the contract owner.
*
* @dev <h4>Postconditions:</h4>
* 1. The transferValidator address is updated.
* 2. The `TransferValidatorUpdated` event is emitted.
*
* @param transferValidator_ The address of the transfer validator contract.
*/
function setTransferValidator(address transferValidator_) public {
_requireCallerIsContractOwner();
bool isValidTransferValidator = transferValidator_.code.length > 0;
if(transferValidator_ != address(0) && !isValidTransferValidator) {
revert CreatorTokenBase__InvalidTransferValidatorContract();
}
emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_);
isValidatorInitialized = true;
transferValidator = transferValidator_;
_registerTokenType(transferValidator_);
}
/**
* @notice Returns the transfer validator contract address for this token contract.
*/
function getTransferValidator() public view override returns (address validator) {
validator = transferValidator;
if (validator == address(0)) {
if (!isValidatorInitialized) {
validator = DEFAULT_TRANSFER_VALIDATOR;
}
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 /*value*/) internal virtual override {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(caller, from, to, tokenId);
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator.
* @dev The `tokenId` for ERC20 tokens should be set to `0`.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
* @param amount The amount of token being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 amount,
uint256 /*value*/) internal virtual override {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount);
}
}
function _tokenType() internal virtual pure returns(uint16);
function _registerTokenType(address validator) internal {
if (validator != address(0)) {
uint256 validatorCodeSize;
assembly {
validatorCodeSize := extcodesize(validator)
}
if(validatorCodeSize > 0) {
try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) {
} catch { }
}
}
}
/**
* @dev Used during contract deployment for constructable and cloneable creator tokens
* @dev to emit the `TransferValidatorUpdated` event signaling the validator for the contract
* @dev is the default transfer validator.
*/
function _emitDefaultTransferValidator() internal {
emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Context.sol";
/**
* @title TransferValidation
* @author Limit Break, Inc.
* @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks.
* Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows
* developers to validate or customize transfers within the context of a mint, a burn, or a transfer.
*/
abstract contract TransferValidation is Context {
/// @dev Thrown when the from and to address are both the zero address.
error ShouldNotMintToBurnAddress();
/*************************************************************************/
/* Transfers Without Amounts */
/*************************************************************************/
/// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_preValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_preValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_preValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_postValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_postValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_postValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Optional validation hook that fires before a mint
function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a mint
function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a burn
function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a burn
function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a transfer
function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a transfer
function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
/*************************************************************************/
/* Transfers With Amounts */
/*************************************************************************/
/// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
function _validateBeforeTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_preValidateMint(_msgSender(), to, tokenId, amount, msg.value);
} else if(toZeroAddress) {
_preValidateBurn(_msgSender(), from, tokenId, amount, msg.value);
} else {
_preValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value);
}
}
/// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
function _validateAfterTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_postValidateMint(_msgSender(), to, tokenId, amount, msg.value);
} else if(toZeroAddress) {
_postValidateBurn(_msgSender(), from, tokenId, amount, msg.value);
} else {
_postValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value);
}
}
/// @dev Optional validation hook that fires before a mint
function _preValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a mint
function _postValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a burn
function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a burn
function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a transfer
function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a transfer
function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @dev Constant bytes32 value of 0x000...000
bytes32 constant ZERO_BYTES32 = bytes32(0);
/// @dev Constant value of 0
uint256 constant ZERO = 0;
/// @dev Constant value of 1
uint256 constant ONE = 1;
/// @dev Constant value representing an open order in storage
uint8 constant ORDER_STATE_OPEN = 0;
/// @dev Constant value representing a filled order in storage
uint8 constant ORDER_STATE_FILLED = 1;
/// @dev Constant value representing a cancelled order in storage
uint8 constant ORDER_STATE_CANCELLED = 2;
/// @dev Constant value representing the ERC721 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC721 = 721;
/// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC1155 = 1155;
/// @dev Constant value representing the ERC20 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC20 = 20;
/// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s`
bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
/// @dev EIP-712 typehash used for validating signature based stored approvals
bytes32 constant UPDATE_APPROVAL_TYPEHASH =
keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)");
/// @dev EIP-712 typehash used for validating a single use permit without additional data
bytes32 constant SINGLE_USE_PERMIT_TYPEHASH =
keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)");
/// @dev EIP-712 typehash used for validating a single use permit with additional data
string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB =
"PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,";
/// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills
string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB =
"PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,";
/// @dev Pausable flag for stored approval transfers of ERC721 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0;
/// @dev Pausable flag for stored approval transfers of ERC1155 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1;
/// @dev Pausable flag for stored approval transfers of ERC20 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2;
/// @dev Pausable flag for single use permit transfers of ERC721 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3;
/// @dev Pausable flag for single use permit transfers of ERC1155 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4;
/// @dev Pausable flag for single use permit transfers of ERC20 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5;
/// @dev Pausable flag for order fill transfers of ERC1155 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6;
/// @dev Pausable flag for order fill transfers of ERC20 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides a set of functions to operate with Base64 strings.
*
* _Available since v4.5._
*/
library Base64 {
/**
* @dev Base64 Encoding/Decoding Table
*/
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/**
* @dev Converts a `bytes` to its Bytes64 `string` representation.
*/
function encode(bytes memory data) internal pure returns (string memory) {
/**
* Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
* https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
*/
if (data.length == 0) return "";
// Loads the table into memory
string memory table = _TABLE;
// Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
// and split into 4 numbers of 6 bits.
// The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
// - `data.length + 2` -> Round up
// - `/ 3` -> Number of 3-bytes chunks
// - `4 *` -> 4 characters for each chunk
string memory result = new string(4 * ((data.length + 2) / 3));
/// @solidity memory-safe-assembly
assembly {
// Prepare the lookup table (skip the first "length" byte)
let tablePtr := add(table, 1)
// Prepare result pointer, jump over length
let resultPtr := add(result, 32)
// Run over the input, 3 bytes at a time
for {
let dataPtr := data
let endPtr := add(data, mload(data))
} lt(dataPtr, endPtr) {
} {
// Advance 3 bytes
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
// To write each character, shift the 3 bytes (18 bits) chunk
// 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
// and apply logical AND with 0x3F which is the number of
// the previous character in the ASCII table prior to the Base64 Table
// The result is then added to the table to get the character to write,
// and finally write it in the result pointer but with a left shift
// of 256 (1 byte) - 8 (1 ASCII char) = 248 bits
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1) // Advance
}
// When data `bytes` is not exactly 3 bytes long
// it is padded with `=` characters at the end
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}// 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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": false,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"coliseumAddress","type":"address"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedMinters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"isAuthorizedMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"winner","type":"address"},{"internalType":"address","name":"defeatedContractAddress","type":"address"}],"name":"mintForDefeatingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"authorized","type":"bool"}],"name":"setAuthorizedMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"trophyId","type":"uint256"}],"name":"setContractTrophy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"trophyId","type":"uint256"},{"internalType":"string","name":"trophyName","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"svg","type":"string"}],"name":"setTrophyMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"trophyMetadata","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"svg","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5060405161350338038061350383398101604081905261002f916103d1565b818160405180602001604052806000815250806100518161012c60201b60201c565b5061005c905061013c565b61007973721c002b0059009a671d00ad1700c9748146cd1b61018b565b6100823361020c565b61008c828261025e565b50506001600160a01b0383166000908152600760205260409020805460ff191660011790556100ba3361020c565b60408051808201909152601781527f4d696e746f7320436f6c697365756d205265776172647300000000000000000060208201526008906100fb90826104c4565b5060408051808201909152600381526226a1a960e91b602082015260099061012390826104c4565b50505050610582565b600261013882826104c4565b5050565b604080516000815273721c002b0059009a671d00ad1700c9748146cd1b60208201527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a1565b6001600160a01b0381161561020957803b8015610138576040805163fb2de5d760e01b8152306004820152610483602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b1580156101f157600080fd5b505af1925050508015610202575060015b1561013857505b50565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61026882826102b3565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b6127106001600160601b03821611156103265760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b03821661037c5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161031d565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600555565b80516001600160a01b03811681146103cc57600080fd5b919050565b6000806000606084860312156103e657600080fd5b6103ef846103b5565b92506103fd602085016103b5565b60408501519092506001600160601b038116811461041a57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061044f57607f821691505b60208210810361046f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156104bf57806000526020600020601f840160051c8101602085101561049c5750805b601f840160051c820191505b818110156104bc57600081556001016104a8565b50505b505050565b81516001600160401b038111156104dd576104dd610425565b6104f1816104eb845461043b565b84610475565b6020601f821160018114610525576000831561050d5750848201515b600019600385901b1c1916600184901b1784556104bc565b600084815260208120601f198516915b828110156105555787850151825560209485019460019092019101610535565b50848210156105735786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b612f72806105916000396000f3fe608060405234801561001057600080fd5b50600436106101d95760003560e01c8063842392c211610104578063a22cb465116100a2578063ed58bad811610071578063ed58bad81461046a578063f242432a1461047d578063f2fde38b14610490578063f5298aca146104a357600080fd5b8063a22cb4651461040e578063a9fc664e14610421578063aa2fe91b14610434578063e985e9c51461045757600080fd5b8063935c1fb1116100de578063935c1fb1146103c057806395d89b41146103e0578063974aea12146103e85780639e05d240146103fb57600080fd5b8063842392c2146103705780638c06197d1461039c5780638da5cb5b146103af57600080fd5b8063161dc1f41161017c5780635b89b7d11161014b5780635b89b7d11461031f5780636221d13c146103415780636b20c45414610355578063715018a61461036857600080fd5b8063161dc1f4146102a55780632a55205a146102ba5780632eb2c2d6146102ec5780634e1273f4146102ff57600080fd5b806306fdde03116101b857806306fdde031461025a578063098144d41461026f5780630d705df6146102775780630e89341c1461029257600080fd5b8062fdd58e146101de578063014635461461020457806301ffc9a714610237575b600080fd5b6101f16101ec3660046121af565b6104b6565b6040519081526020015b60405180910390f35b61021f73721c002b0059009a671d00ad1700c9748146cd1b81565b6040516001600160a01b0390911681526020016101fb565b61024a6102453660046121ef565b61054f565b60405190151581526020016101fb565b610262610569565b6040516101fb9190612263565b61021f6105f7565b60408051631854b24160e01b815260006020820152016101fb565b6102626102a0366004612276565b610631565b6102b86102b33660046121af565b6108c5565b005b6102cd6102c836600461228f565b61092d565b604080516001600160a01b0390931683526020830191909152016101fb565b6102b86102fa366004612408565b6109d9565b61031261030d3660046124bb565b610a25565b6040516101fb91906125ca565b61033261032d366004612276565b610b46565b6040516101fb939291906125dd565b60035461024a90600160a81b900460ff1681565b6102b8610363366004612620565b610d00565b6102b8610d48565b61024a61037e366004612697565b6001600160a01b031660009081526007602052604090205460ff1690565b6102b86103aa3660046126b2565b610d5c565b6004546001600160a01b031661021f565b6101f16103ce366004612697565b600b6020526000908152604090205481565b610262610e12565b6102b86103f636600461274d565b610e1f565b6102b8610409366004612790565b610f72565b6102b861041c3660046127ab565b610fd2565b6102b861042f366004612697565b610fe1565b61024a610442366004612697565b60076020526000908152604090205460ff1681565b61024a61046536600461274d565b61109a565b6102b86104783660046127ab565b6110fe565b6102b861048b3660046127d5565b611131565b6102b861049e366004612697565b611176565b6102b86104b136600461282d565b6111ef565b60006001600160a01b0383166105265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061055a82611232565b80610549575061054982611272565b6008805461057690612860565b80601f01602080910402602001604051908101604052809291908181526020018280546105a290612860565b80156105ef5780601f106105c4576101008083540402835291602001916105ef565b820191906000526020600020905b8154815290600101906020018083116105d257829003601f168201915b505050505081565b60035461010090046001600160a01b03168061062e5760035460ff1661062e575073721c002b0059009a671d00ad1700c9748146cd1b5b90565b60606000600a600084815260200190815260200160002060405180606001604052908160008201805461066390612860565b80601f016020809104026020016040519081016040528092919081815260200182805461068f90612860565b80156106dc5780601f106106b1576101008083540402835291602001916106dc565b820191906000526020600020905b8154815290600101906020018083116106bf57829003601f168201915b505050505081526020016001820180546106f590612860565b80601f016020809104026020016040519081016040528092919081815260200182805461072190612860565b801561076e5780601f106107435761010080835404028352916020019161076e565b820191906000526020600020905b81548152906001019060200180831161075157829003601f168201915b5050505050815260200160028201805461078790612860565b80601f01602080910402602001604051908101604052809291908181526020018280546107b390612860565b80156108005780601f106107d557610100808354040283529160200191610800565b820191906000526020600020905b8154815290600101906020018083116107e357829003601f168201915b50505050508152505090506000816000015151116108585760405162461bcd60e51b8152602060048201526015602482015274151c9bdc1a1e48191bd95cc81b9bdd08195e1a5cdd605a1b604482015260640161051d565b6000816000015182602001516108718460400151611297565b6040516020016108839392919061289a565b604051602081830303815290604052905061089d81611297565b6040516020016108ad9190612973565b60405160208183030381529060405292505050919050565b6108cd6113e9565b600081116109115760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1c9bdc1a1e481251607a1b604482015260640161051d565b6001600160a01b039091166000908152600b6020526040902055565b60008281526006602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109a25750604080518082019091526005546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109c1906001600160601b0316876129ce565b6109cb91906129e5565b915196919550909350505050565b6001600160a01b0385163314806109f557506109f5853361109a565b610a115760405162461bcd60e51b815260040161051d90612a07565b610a1e8585858585611443565b5050505050565b60608151835114610a8a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161051d565b600083516001600160401b03811115610aa557610aa56122b1565b604051908082528060200260200182016040528015610ace578160200160208202803683370190505b50905060005b8451811015610b3e57610b19858281518110610af257610af2612a55565b6020026020010151858381518110610b0c57610b0c612a55565b60200260200101516104b6565b828281518110610b2b57610b2b612a55565b6020908102919091010152600101610ad4565b509392505050565b600a60205260009081526040902080548190610b6190612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8d90612860565b8015610bda5780601f10610baf57610100808354040283529160200191610bda565b820191906000526020600020905b815481529060010190602001808311610bbd57829003601f168201915b505050505090806001018054610bef90612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610c1b90612860565b8015610c685780601f10610c3d57610100808354040283529160200191610c68565b820191906000526020600020905b815481529060010190602001808311610c4b57829003601f168201915b505050505090806002018054610c7d90612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca990612860565b8015610cf65780601f10610ccb57610100808354040283529160200191610cf6565b820191906000526020600020905b815481529060010190602001808311610cd957829003601f168201915b5050505050905083565b336001600160a01b0384161480610d1c5750610d1c833361109a565b610d385760405162461bcd60e51b815260040161051d90612a6b565b610d438383836115f4565b505050565b610d506113e9565b610d5a6000611796565b565b610d646113e9565b60008411610da85760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1c9bdc1a1e481251607a1b604482015260640161051d565b6040805160608101825284815260208082018590528183018490526000878152600a9091529190912081518190610ddf9082612b01565b5060208201516001820190610df49082612b01565b5060408201516002820190610e099082612b01565b50505050505050565b6009805461057690612860565b3360009081526007602052604090205460ff16610e775760405162461bcd60e51b8152602060048201526016602482015275139bdd08185d5d1a1bdc9a5e9959081d1bc81b5a5b9d60521b604482015260640161051d565b6001600160a01b0381166000908152600b602052604090205480610ef65760405162461bcd60e51b815260206004820152603060248201527f4e6f2074726f706879206173736f63696174656420776974682074686973206460448201526f195999585d19590818dbdb9d1c9858dd60821b606482015260840161051d565b6000818152600a602052604081208054610f0f90612860565b905011610f565760405162461bcd60e51b8152602060048201526015602482015274151c9bdc1a1e48191bd95cc81b9bdd08195e1a5cdd605a1b604482015260640161051d565b610d4383826001604051806020016040528060008152506117e8565b610f7a611911565b60038054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc90610fc790831515815260200190565b60405180910390a150565b610fdd338383611919565b5050565b610fe9611911565b6001600160a01b038116803b15159015801590611004575080155b15611022576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61104b6105f7565b604080516001600160a01b03928316815291851660208301520160405180910390a1600380546001600160a01b038416610100026001600160a81b0319909116176001179055610fdd826119f9565b6001600160a01b0382811660009081526001602090815260408083209385168352929052205460ff168061054957600354600160a81b900460ff1615610549576110e26105f7565b6001600160a01b0316826001600160a01b031614905092915050565b6111066113e9565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b6001600160a01b03851633148061114d575061114d853361109a565b6111695760405162461bcd60e51b815260040161051d90612a07565b610a1e8585858585611a79565b61117e6113e9565b6001600160a01b0381166111e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161051d565b6111ec81611796565b50565b336001600160a01b038416148061120b575061120b833361109a565b6112275760405162461bcd60e51b815260040161051d90612a6b565b610d43838383611bbf565b60006001600160e01b03198216632b435fdb60e21b148061126357506001600160e01b0319821663503e914d60e11b145b80610549575061054982611ce1565b60006001600160e01b0319821663152a902d60e11b1480610549575061054982611232565b606081516000036112b657505060408051602081019091526000815290565b6000604051806060016040528060408152602001612efd60409139905060006003845160026112e59190612bbf565b6112ef91906129e5565b6112fa9060046129ce565b6001600160401b03811115611311576113116122b1565b6040519080825280601f01601f19166020018201604052801561133b576020820181803683370190505b509050600182016020820185865187015b808210156113a7576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f811685015184535060018301925061134c565b50506003865106600181146113c357600281146113d6576113de565b603d6001830353603d60028303536113de565b603d60018303535b509195945050505050565b6004546001600160a01b03163314610d5a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161051d565b81518351146114645760405162461bcd60e51b815260040161051d90612bd2565b6001600160a01b03841661148a5760405162461bcd60e51b815260040161051d90612c1a565b33611499818787878787611d31565b60005b84518110156115785760008582815181106114b9576114b9612a55565b6020026020010151905060008583815181106114d7576114d7612a55565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115275760405162461bcd60e51b815260040161051d90612c5f565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611564908490612bbf565b90915550506001909301925061149c915050565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115c8929190612ca9565b60405180910390a46115de818787878787611d8e565b6115ec818787878787611de1565b505050505050565b6001600160a01b03831661161a5760405162461bcd60e51b815260040161051d90612cd7565b805182511461163b5760405162461bcd60e51b815260040161051d90612bd2565b600033905061165e81856000868660405180602001604052806000815250611d31565b60005b835181101561171957600084828151811061167e5761167e612a55565b60200260200101519050600084838151811061169c5761169c612a55565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156116ec5760405162461bcd60e51b815260040161051d90612d1a565b6000928352602083815260408085206001600160a01b038b16865290915290922091039055600101611661565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161176a929190612ca9565b60405180910390a461179081856000868660405180602001604052806000815250611d8e565b50505050565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166118485760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161051d565b33600061185485611f3c565b9050600061186185611f3c565b905061187283600089858589611d31565b6000868152602081815260408083206001600160a01b038b168452909152812080548792906118a2908490612bbf565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461190283600089858589611d8e565b610e0983600089898989611f87565b610d5a6113e9565b816001600160a01b0316836001600160a01b03160361198c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161051d565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038116156111ec57803b8015610fdd576040805163fb2de5d760e01b8152306004820152610483602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b158015611a5f57600080fd5b505af1925050508015611a70575060015b15610fdd575050565b6001600160a01b038416611a9f5760405162461bcd60e51b815260040161051d90612c1a565b336000611aab85611f3c565b90506000611ab885611f3c565b9050611ac8838989858589611d31565b6000868152602081815260408083206001600160a01b038c16845290915290205485811015611b095760405162461bcd60e51b815260040161051d90612c5f565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611b46908490612bbf565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ba6848a8a86868a611d8e565b611bb4848a8a8a8a8a611f87565b505050505050505050565b6001600160a01b038316611be55760405162461bcd60e51b815260040161051d90612cd7565b336000611bf184611f3c565b90506000611bfe84611f3c565b9050611c1e83876000858560405180602001604052806000815250611d31565b6000858152602081815260408083206001600160a01b038a16845290915290205484811015611c5f5760405162461bcd60e51b815260040161051d90612d1a565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e0984886000868660405180602001604052806000815250611d8e565b60006001600160e01b03198216636cdb3d1360e11b1480611d1257506001600160e01b031982166303a24d0760e21b145b8061054957506301ffc9a760e01b6001600160e01b0319831614610549565b825160005b81811015611d8457611d7c8787878481518110611d5557611d55612a55565b6020026020010151878581518110611d6f57611d6f612a55565b6020026020010151612042565b600101611d36565b5050505050505050565b825160005b81811015611d8457611dd98787878481518110611db257611db2612a55565b6020026020010151878581518110611dcc57611dcc612a55565b6020026020010151612099565b600101611d93565b6001600160a01b0384163b156115ec5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611e259089908990889088908890600401612d5e565b6020604051808303816000875af1925050508015611e60575060408051601f3d908101601f19168201909252611e5d91810190612dbc565b60015b611f0c57611e6c612dd9565b806308c379a003611ea55750611e80612df4565b80611e8b5750611ea7565b8060405162461bcd60e51b815260040161051d9190612263565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161051d565b6001600160e01b0319811663bc197c8160e01b14610e095760405162461bcd60e51b815260040161051d90612e6f565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611f7657611f76612a55565b602090810291909101015292915050565b6001600160a01b0384163b156115ec5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611fcb9089908990889088908890600401612eb7565b6020604051808303816000875af1925050508015612006575060408051601f3d908101601f1916820190925261200391810190612dbc565b60015b61201257611e6c612dd9565b6001600160e01b0319811663f23a6e6160e01b14610e095760405162461bcd60e51b815260040161051d90612e6f565b6001600160a01b03848116159084161581801561205c5750805b1561207a57604051635cbd944160e01b815260040160405180910390fd5b8115612086575b6115ec565b80612081576115ec3387878787346120e0565b6001600160a01b0384811615908416158180156120b35750805b156120d157604051635cbd944160e01b815260040160405180910390fd5b816120815780612081576115ec565b60006120ea6105f7565b90506001600160a01b03811615610e09576001600160a01b038116330361211157506115ec565b604051631854b24160e01b81526001600160a01b038881166004830152878116602483015286811660448301526064820186905260848201859052821690631854b2419060a401600060405180830381600087803b15801561217257600080fd5b505af1158015612186573d6000803e3d6000fd5b5050505050505050505050565b80356001600160a01b03811681146121aa57600080fd5b919050565b600080604083850312156121c257600080fd5b6121cb83612193565b946020939093013593505050565b6001600160e01b0319811681146111ec57600080fd5b60006020828403121561220157600080fd5b813561220c816121d9565b9392505050565b60005b8381101561222e578181015183820152602001612216565b50506000910152565b6000815180845261224f816020860160208601612213565b601f01601f19169290920160200192915050565b60208152600061220c6020830184612237565b60006020828403121561228857600080fd5b5035919050565b600080604083850312156122a257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156122ec576122ec6122b1565b6040525050565b60006001600160401b0382111561230c5761230c6122b1565b5060051b60200190565b600082601f83011261232757600080fd5b8135612332816122f3565b60405161233f82826122c7565b80915082815260208101915060208360051b86010192508583111561236357600080fd5b602085015b83811015612380578035835260209283019201612368565b5095945050505050565b600082601f83011261239b57600080fd5b8135602083016000806001600160401b038411156123bb576123bb6122b1565b50604051601f8401601f1916602001906123d582826122c7565b8092508481528785850111156123ea57600080fd5b84846020830137600060208683010152809550505050505092915050565b600080600080600060a0868803121561242057600080fd5b61242986612193565b945061243760208701612193565b935060408601356001600160401b0381111561245257600080fd5b61245e88828901612316565b93505060608601356001600160401b0381111561247a57600080fd5b61248688828901612316565b92505060808601356001600160401b038111156124a257600080fd5b6124ae8882890161238a565b9150509295509295909350565b600080604083850312156124ce57600080fd5b82356001600160401b038111156124e457600080fd5b8301601f810185136124f557600080fd5b8035612500816122f3565b60405161250d82826122c7565b80915082815260208101915060208360051b85010192508783111561253157600080fd5b6020840193505b8284101561255a5761254984612193565b825260209384019390910190612538565b945050505060208301356001600160401b0381111561257857600080fd5b61258485828601612316565b9150509250929050565b600081518084526020840193506020830160005b828110156125c05781518652602095860195909101906001016125a2565b5093949350505050565b60208152600061220c602083018461258e565b6060815260006125f06060830186612237565b82810360208401526126028186612237565b905082810360408401526126168185612237565b9695505050505050565b60008060006060848603121561263557600080fd5b61263e84612193565b925060208401356001600160401b0381111561265957600080fd5b61266586828701612316565b92505060408401356001600160401b0381111561268157600080fd5b61268d86828701612316565b9150509250925092565b6000602082840312156126a957600080fd5b61220c82612193565b600080600080608085870312156126c857600080fd5b8435935060208501356001600160401b038111156126e557600080fd5b6126f18782880161238a565b93505060408501356001600160401b0381111561270d57600080fd5b6127198782880161238a565b92505060608501356001600160401b0381111561273557600080fd5b6127418782880161238a565b91505092959194509250565b6000806040838503121561276057600080fd5b61276983612193565b915061277760208401612193565b90509250929050565b803580151581146121aa57600080fd5b6000602082840312156127a257600080fd5b61220c82612780565b600080604083850312156127be57600080fd5b6127c783612193565b915061277760208401612780565b600080600080600060a086880312156127ed57600080fd5b6127f686612193565b945061280460208701612193565b9350604086013592506060860135915060808601356001600160401b038111156124a257600080fd5b60008060006060848603121561284257600080fd5b61284b84612193565b95602085013595506040909401359392505050565b600181811c9082168061287457607f821691505b60208210810361289457634e487b7160e01b600052602260045260246000fd5b50919050565b693d913730b6b2911d101160b11b815283516000906128c081600a850160208901612213565b72111610113232b9b1b934b83a34b7b7111d101160691b600a9184019182015284516128f381601d840160208901612213565b600a818301019150507f222c2022696d616765223a2022646174613a696d6167652f7376672b786d6c3b60138201526618985cd94d8d0b60ca1b6033820152835161294581603a840160208801612213565b73222c202261747472696275746573223a205b5d7d60601b603a9290910191820152604e0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516129ab81601d850160208701612213565b91909101601d0192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610549576105496129b8565b600082612a0257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b601f821115610d4357806000526020600020601f840160051c81016020851015612ae15750805b601f840160051c820191505b81811015610a1e5760008155600101612aed565b81516001600160401b03811115612b1a57612b1a6122b1565b612b2e81612b288454612860565b84612aba565b6020601f821160018114612b625760008315612b4a5750848201515b600019600385901b1c1916600184901b178455610a1e565b600084815260208120601f198516915b82811015612b925787850151825560209485019460019092019101612b72565b5084821015612bb05786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b80820180821115610549576105496129b8565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000612cbc604083018561258e565b8281036020840152612cce818561258e565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090612d8a9083018661258e565b8281036060840152612d9c818661258e565b90508281036080840152612db08185612237565b98975050505050505050565b600060208284031215612dce57600080fd5b815161220c816121d9565b600060033d111561062e5760046000803e5060005160e01c90565b600060443d1015612e025790565b6040513d600319016004823e80513d60248201116001600160401b0382111715612e2b57505090565b80820180516001600160401b03811115612e46575050505090565b3d8401600319018282016020011115612e60575050505090565b610b3e602082850101856122c7565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612ef190830184612237565b97965050505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212201bd74a72b0fc7abc028bab56d53346d7acb9594d35f01dc292cce44f807d1ea164736f6c634300081a0033000000000000000000000000b2f455957e3fdc86f4a492f9cd576f41023e02ce000000000000000000000000155096fdd85c6ba1f43133359bb22023e2b3127200000000000000000000000000000000000000000000000000000000000001a4
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101d95760003560e01c8063842392c211610104578063a22cb465116100a2578063ed58bad811610071578063ed58bad81461046a578063f242432a1461047d578063f2fde38b14610490578063f5298aca146104a357600080fd5b8063a22cb4651461040e578063a9fc664e14610421578063aa2fe91b14610434578063e985e9c51461045757600080fd5b8063935c1fb1116100de578063935c1fb1146103c057806395d89b41146103e0578063974aea12146103e85780639e05d240146103fb57600080fd5b8063842392c2146103705780638c06197d1461039c5780638da5cb5b146103af57600080fd5b8063161dc1f41161017c5780635b89b7d11161014b5780635b89b7d11461031f5780636221d13c146103415780636b20c45414610355578063715018a61461036857600080fd5b8063161dc1f4146102a55780632a55205a146102ba5780632eb2c2d6146102ec5780634e1273f4146102ff57600080fd5b806306fdde03116101b857806306fdde031461025a578063098144d41461026f5780630d705df6146102775780630e89341c1461029257600080fd5b8062fdd58e146101de578063014635461461020457806301ffc9a714610237575b600080fd5b6101f16101ec3660046121af565b6104b6565b6040519081526020015b60405180910390f35b61021f73721c002b0059009a671d00ad1700c9748146cd1b81565b6040516001600160a01b0390911681526020016101fb565b61024a6102453660046121ef565b61054f565b60405190151581526020016101fb565b610262610569565b6040516101fb9190612263565b61021f6105f7565b60408051631854b24160e01b815260006020820152016101fb565b6102626102a0366004612276565b610631565b6102b86102b33660046121af565b6108c5565b005b6102cd6102c836600461228f565b61092d565b604080516001600160a01b0390931683526020830191909152016101fb565b6102b86102fa366004612408565b6109d9565b61031261030d3660046124bb565b610a25565b6040516101fb91906125ca565b61033261032d366004612276565b610b46565b6040516101fb939291906125dd565b60035461024a90600160a81b900460ff1681565b6102b8610363366004612620565b610d00565b6102b8610d48565b61024a61037e366004612697565b6001600160a01b031660009081526007602052604090205460ff1690565b6102b86103aa3660046126b2565b610d5c565b6004546001600160a01b031661021f565b6101f16103ce366004612697565b600b6020526000908152604090205481565b610262610e12565b6102b86103f636600461274d565b610e1f565b6102b8610409366004612790565b610f72565b6102b861041c3660046127ab565b610fd2565b6102b861042f366004612697565b610fe1565b61024a610442366004612697565b60076020526000908152604090205460ff1681565b61024a61046536600461274d565b61109a565b6102b86104783660046127ab565b6110fe565b6102b861048b3660046127d5565b611131565b6102b861049e366004612697565b611176565b6102b86104b136600461282d565b6111ef565b60006001600160a01b0383166105265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061055a82611232565b80610549575061054982611272565b6008805461057690612860565b80601f01602080910402602001604051908101604052809291908181526020018280546105a290612860565b80156105ef5780601f106105c4576101008083540402835291602001916105ef565b820191906000526020600020905b8154815290600101906020018083116105d257829003601f168201915b505050505081565b60035461010090046001600160a01b03168061062e5760035460ff1661062e575073721c002b0059009a671d00ad1700c9748146cd1b5b90565b60606000600a600084815260200190815260200160002060405180606001604052908160008201805461066390612860565b80601f016020809104026020016040519081016040528092919081815260200182805461068f90612860565b80156106dc5780601f106106b1576101008083540402835291602001916106dc565b820191906000526020600020905b8154815290600101906020018083116106bf57829003601f168201915b505050505081526020016001820180546106f590612860565b80601f016020809104026020016040519081016040528092919081815260200182805461072190612860565b801561076e5780601f106107435761010080835404028352916020019161076e565b820191906000526020600020905b81548152906001019060200180831161075157829003601f168201915b5050505050815260200160028201805461078790612860565b80601f01602080910402602001604051908101604052809291908181526020018280546107b390612860565b80156108005780601f106107d557610100808354040283529160200191610800565b820191906000526020600020905b8154815290600101906020018083116107e357829003601f168201915b50505050508152505090506000816000015151116108585760405162461bcd60e51b8152602060048201526015602482015274151c9bdc1a1e48191bd95cc81b9bdd08195e1a5cdd605a1b604482015260640161051d565b6000816000015182602001516108718460400151611297565b6040516020016108839392919061289a565b604051602081830303815290604052905061089d81611297565b6040516020016108ad9190612973565b60405160208183030381529060405292505050919050565b6108cd6113e9565b600081116109115760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1c9bdc1a1e481251607a1b604482015260640161051d565b6001600160a01b039091166000908152600b6020526040902055565b60008281526006602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109a25750604080518082019091526005546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109c1906001600160601b0316876129ce565b6109cb91906129e5565b915196919550909350505050565b6001600160a01b0385163314806109f557506109f5853361109a565b610a115760405162461bcd60e51b815260040161051d90612a07565b610a1e8585858585611443565b5050505050565b60608151835114610a8a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161051d565b600083516001600160401b03811115610aa557610aa56122b1565b604051908082528060200260200182016040528015610ace578160200160208202803683370190505b50905060005b8451811015610b3e57610b19858281518110610af257610af2612a55565b6020026020010151858381518110610b0c57610b0c612a55565b60200260200101516104b6565b828281518110610b2b57610b2b612a55565b6020908102919091010152600101610ad4565b509392505050565b600a60205260009081526040902080548190610b6190612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8d90612860565b8015610bda5780601f10610baf57610100808354040283529160200191610bda565b820191906000526020600020905b815481529060010190602001808311610bbd57829003601f168201915b505050505090806001018054610bef90612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610c1b90612860565b8015610c685780601f10610c3d57610100808354040283529160200191610c68565b820191906000526020600020905b815481529060010190602001808311610c4b57829003601f168201915b505050505090806002018054610c7d90612860565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca990612860565b8015610cf65780601f10610ccb57610100808354040283529160200191610cf6565b820191906000526020600020905b815481529060010190602001808311610cd957829003601f168201915b5050505050905083565b336001600160a01b0384161480610d1c5750610d1c833361109a565b610d385760405162461bcd60e51b815260040161051d90612a6b565b610d438383836115f4565b505050565b610d506113e9565b610d5a6000611796565b565b610d646113e9565b60008411610da85760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1c9bdc1a1e481251607a1b604482015260640161051d565b6040805160608101825284815260208082018590528183018490526000878152600a9091529190912081518190610ddf9082612b01565b5060208201516001820190610df49082612b01565b5060408201516002820190610e099082612b01565b50505050505050565b6009805461057690612860565b3360009081526007602052604090205460ff16610e775760405162461bcd60e51b8152602060048201526016602482015275139bdd08185d5d1a1bdc9a5e9959081d1bc81b5a5b9d60521b604482015260640161051d565b6001600160a01b0381166000908152600b602052604090205480610ef65760405162461bcd60e51b815260206004820152603060248201527f4e6f2074726f706879206173736f63696174656420776974682074686973206460448201526f195999585d19590818dbdb9d1c9858dd60821b606482015260840161051d565b6000818152600a602052604081208054610f0f90612860565b905011610f565760405162461bcd60e51b8152602060048201526015602482015274151c9bdc1a1e48191bd95cc81b9bdd08195e1a5cdd605a1b604482015260640161051d565b610d4383826001604051806020016040528060008152506117e8565b610f7a611911565b60038054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc90610fc790831515815260200190565b60405180910390a150565b610fdd338383611919565b5050565b610fe9611911565b6001600160a01b038116803b15159015801590611004575080155b15611022576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61104b6105f7565b604080516001600160a01b03928316815291851660208301520160405180910390a1600380546001600160a01b038416610100026001600160a81b0319909116176001179055610fdd826119f9565b6001600160a01b0382811660009081526001602090815260408083209385168352929052205460ff168061054957600354600160a81b900460ff1615610549576110e26105f7565b6001600160a01b0316826001600160a01b031614905092915050565b6111066113e9565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b6001600160a01b03851633148061114d575061114d853361109a565b6111695760405162461bcd60e51b815260040161051d90612a07565b610a1e8585858585611a79565b61117e6113e9565b6001600160a01b0381166111e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161051d565b6111ec81611796565b50565b336001600160a01b038416148061120b575061120b833361109a565b6112275760405162461bcd60e51b815260040161051d90612a6b565b610d43838383611bbf565b60006001600160e01b03198216632b435fdb60e21b148061126357506001600160e01b0319821663503e914d60e11b145b80610549575061054982611ce1565b60006001600160e01b0319821663152a902d60e11b1480610549575061054982611232565b606081516000036112b657505060408051602081019091526000815290565b6000604051806060016040528060408152602001612efd60409139905060006003845160026112e59190612bbf565b6112ef91906129e5565b6112fa9060046129ce565b6001600160401b03811115611311576113116122b1565b6040519080825280601f01601f19166020018201604052801561133b576020820181803683370190505b509050600182016020820185865187015b808210156113a7576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f811685015184535060018301925061134c565b50506003865106600181146113c357600281146113d6576113de565b603d6001830353603d60028303536113de565b603d60018303535b509195945050505050565b6004546001600160a01b03163314610d5a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161051d565b81518351146114645760405162461bcd60e51b815260040161051d90612bd2565b6001600160a01b03841661148a5760405162461bcd60e51b815260040161051d90612c1a565b33611499818787878787611d31565b60005b84518110156115785760008582815181106114b9576114b9612a55565b6020026020010151905060008583815181106114d7576114d7612a55565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156115275760405162461bcd60e51b815260040161051d90612c5f565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611564908490612bbf565b90915550506001909301925061149c915050565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115c8929190612ca9565b60405180910390a46115de818787878787611d8e565b6115ec818787878787611de1565b505050505050565b6001600160a01b03831661161a5760405162461bcd60e51b815260040161051d90612cd7565b805182511461163b5760405162461bcd60e51b815260040161051d90612bd2565b600033905061165e81856000868660405180602001604052806000815250611d31565b60005b835181101561171957600084828151811061167e5761167e612a55565b60200260200101519050600084838151811061169c5761169c612a55565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156116ec5760405162461bcd60e51b815260040161051d90612d1a565b6000928352602083815260408085206001600160a01b038b16865290915290922091039055600101611661565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161176a929190612ca9565b60405180910390a461179081856000868660405180602001604052806000815250611d8e565b50505050565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166118485760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161051d565b33600061185485611f3c565b9050600061186185611f3c565b905061187283600089858589611d31565b6000868152602081815260408083206001600160a01b038b168452909152812080548792906118a2908490612bbf565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461190283600089858589611d8e565b610e0983600089898989611f87565b610d5a6113e9565b816001600160a01b0316836001600160a01b03160361198c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161051d565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038116156111ec57803b8015610fdd576040805163fb2de5d760e01b8152306004820152610483602482015290516001600160a01b0384169163fb2de5d791604480830192600092919082900301818387803b158015611a5f57600080fd5b505af1925050508015611a70575060015b15610fdd575050565b6001600160a01b038416611a9f5760405162461bcd60e51b815260040161051d90612c1a565b336000611aab85611f3c565b90506000611ab885611f3c565b9050611ac8838989858589611d31565b6000868152602081815260408083206001600160a01b038c16845290915290205485811015611b095760405162461bcd60e51b815260040161051d90612c5f565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611b46908490612bbf565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ba6848a8a86868a611d8e565b611bb4848a8a8a8a8a611f87565b505050505050505050565b6001600160a01b038316611be55760405162461bcd60e51b815260040161051d90612cd7565b336000611bf184611f3c565b90506000611bfe84611f3c565b9050611c1e83876000858560405180602001604052806000815250611d31565b6000858152602081815260408083206001600160a01b038a16845290915290205484811015611c5f5760405162461bcd60e51b815260040161051d90612d1a565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610e0984886000868660405180602001604052806000815250611d8e565b60006001600160e01b03198216636cdb3d1360e11b1480611d1257506001600160e01b031982166303a24d0760e21b145b8061054957506301ffc9a760e01b6001600160e01b0319831614610549565b825160005b81811015611d8457611d7c8787878481518110611d5557611d55612a55565b6020026020010151878581518110611d6f57611d6f612a55565b6020026020010151612042565b600101611d36565b5050505050505050565b825160005b81811015611d8457611dd98787878481518110611db257611db2612a55565b6020026020010151878581518110611dcc57611dcc612a55565b6020026020010151612099565b600101611d93565b6001600160a01b0384163b156115ec5760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611e259089908990889088908890600401612d5e565b6020604051808303816000875af1925050508015611e60575060408051601f3d908101601f19168201909252611e5d91810190612dbc565b60015b611f0c57611e6c612dd9565b806308c379a003611ea55750611e80612df4565b80611e8b5750611ea7565b8060405162461bcd60e51b815260040161051d9190612263565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161051d565b6001600160e01b0319811663bc197c8160e01b14610e095760405162461bcd60e51b815260040161051d90612e6f565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611f7657611f76612a55565b602090810291909101015292915050565b6001600160a01b0384163b156115ec5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611fcb9089908990889088908890600401612eb7565b6020604051808303816000875af1925050508015612006575060408051601f3d908101601f1916820190925261200391810190612dbc565b60015b61201257611e6c612dd9565b6001600160e01b0319811663f23a6e6160e01b14610e095760405162461bcd60e51b815260040161051d90612e6f565b6001600160a01b03848116159084161581801561205c5750805b1561207a57604051635cbd944160e01b815260040160405180910390fd5b8115612086575b6115ec565b80612081576115ec3387878787346120e0565b6001600160a01b0384811615908416158180156120b35750805b156120d157604051635cbd944160e01b815260040160405180910390fd5b816120815780612081576115ec565b60006120ea6105f7565b90506001600160a01b03811615610e09576001600160a01b038116330361211157506115ec565b604051631854b24160e01b81526001600160a01b038881166004830152878116602483015286811660448301526064820186905260848201859052821690631854b2419060a401600060405180830381600087803b15801561217257600080fd5b505af1158015612186573d6000803e3d6000fd5b5050505050505050505050565b80356001600160a01b03811681146121aa57600080fd5b919050565b600080604083850312156121c257600080fd5b6121cb83612193565b946020939093013593505050565b6001600160e01b0319811681146111ec57600080fd5b60006020828403121561220157600080fd5b813561220c816121d9565b9392505050565b60005b8381101561222e578181015183820152602001612216565b50506000910152565b6000815180845261224f816020860160208601612213565b601f01601f19169290920160200192915050565b60208152600061220c6020830184612237565b60006020828403121561228857600080fd5b5035919050565b600080604083850312156122a257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156122ec576122ec6122b1565b6040525050565b60006001600160401b0382111561230c5761230c6122b1565b5060051b60200190565b600082601f83011261232757600080fd5b8135612332816122f3565b60405161233f82826122c7565b80915082815260208101915060208360051b86010192508583111561236357600080fd5b602085015b83811015612380578035835260209283019201612368565b5095945050505050565b600082601f83011261239b57600080fd5b8135602083016000806001600160401b038411156123bb576123bb6122b1565b50604051601f8401601f1916602001906123d582826122c7565b8092508481528785850111156123ea57600080fd5b84846020830137600060208683010152809550505050505092915050565b600080600080600060a0868803121561242057600080fd5b61242986612193565b945061243760208701612193565b935060408601356001600160401b0381111561245257600080fd5b61245e88828901612316565b93505060608601356001600160401b0381111561247a57600080fd5b61248688828901612316565b92505060808601356001600160401b038111156124a257600080fd5b6124ae8882890161238a565b9150509295509295909350565b600080604083850312156124ce57600080fd5b82356001600160401b038111156124e457600080fd5b8301601f810185136124f557600080fd5b8035612500816122f3565b60405161250d82826122c7565b80915082815260208101915060208360051b85010192508783111561253157600080fd5b6020840193505b8284101561255a5761254984612193565b825260209384019390910190612538565b945050505060208301356001600160401b0381111561257857600080fd5b61258485828601612316565b9150509250929050565b600081518084526020840193506020830160005b828110156125c05781518652602095860195909101906001016125a2565b5093949350505050565b60208152600061220c602083018461258e565b6060815260006125f06060830186612237565b82810360208401526126028186612237565b905082810360408401526126168185612237565b9695505050505050565b60008060006060848603121561263557600080fd5b61263e84612193565b925060208401356001600160401b0381111561265957600080fd5b61266586828701612316565b92505060408401356001600160401b0381111561268157600080fd5b61268d86828701612316565b9150509250925092565b6000602082840312156126a957600080fd5b61220c82612193565b600080600080608085870312156126c857600080fd5b8435935060208501356001600160401b038111156126e557600080fd5b6126f18782880161238a565b93505060408501356001600160401b0381111561270d57600080fd5b6127198782880161238a565b92505060608501356001600160401b0381111561273557600080fd5b6127418782880161238a565b91505092959194509250565b6000806040838503121561276057600080fd5b61276983612193565b915061277760208401612193565b90509250929050565b803580151581146121aa57600080fd5b6000602082840312156127a257600080fd5b61220c82612780565b600080604083850312156127be57600080fd5b6127c783612193565b915061277760208401612780565b600080600080600060a086880312156127ed57600080fd5b6127f686612193565b945061280460208701612193565b9350604086013592506060860135915060808601356001600160401b038111156124a257600080fd5b60008060006060848603121561284257600080fd5b61284b84612193565b95602085013595506040909401359392505050565b600181811c9082168061287457607f821691505b60208210810361289457634e487b7160e01b600052602260045260246000fd5b50919050565b693d913730b6b2911d101160b11b815283516000906128c081600a850160208901612213565b72111610113232b9b1b934b83a34b7b7111d101160691b600a9184019182015284516128f381601d840160208901612213565b600a818301019150507f222c2022696d616765223a2022646174613a696d6167652f7376672b786d6c3b60138201526618985cd94d8d0b60ca1b6033820152835161294581603a840160208801612213565b73222c202261747472696275746573223a205b5d7d60601b603a9290910191820152604e0195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516129ab81601d850160208701612213565b91909101601d0192915050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610549576105496129b8565b600082612a0257634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b601f821115610d4357806000526020600020601f840160051c81016020851015612ae15750805b601f840160051c820191505b81811015610a1e5760008155600101612aed565b81516001600160401b03811115612b1a57612b1a6122b1565b612b2e81612b288454612860565b84612aba565b6020601f821160018114612b625760008315612b4a5750848201515b600019600385901b1c1916600184901b178455610a1e565b600084815260208120601f198516915b82811015612b925787850151825560209485019460019092019101612b72565b5084821015612bb05786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b80820180821115610549576105496129b8565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000612cbc604083018561258e565b8281036020840152612cce818561258e565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090612d8a9083018661258e565b8281036060840152612d9c818661258e565b90508281036080840152612db08185612237565b98975050505050505050565b600060208284031215612dce57600080fd5b815161220c816121d9565b600060033d111561062e5760046000803e5060005160e01c90565b600060443d1015612e025790565b6040513d600319016004823e80513d60248201116001600160401b0382111715612e2b57505090565b80820180516001600160401b03811115612e46575050505090565b3d8401600319018282016020011115612e60575050505090565b610b3e602082850101856122c7565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612ef190830184612237565b97965050505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212201bd74a72b0fc7abc028bab56d53346d7acb9594d35f01dc292cce44f807d1ea164736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b2f455957e3fdc86f4a492f9cd576f41023e02ce000000000000000000000000155096fdd85c6ba1f43133359bb22023e2b3127200000000000000000000000000000000000000000000000000000000000001a4
-----Decoded View---------------
Arg [0] : coliseumAddress (address): 0xB2F455957e3fDc86F4A492f9Cd576f41023E02CE
Arg [1] : royaltyReceiver (address): 0x155096FdD85c6Ba1f43133359Bb22023e2B31272
Arg [2] : royaltyFeeNumerator (uint96): 420
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000b2f455957e3fdc86f4a492f9cd576f41023e02ce
Arg [1] : 000000000000000000000000155096fdd85c6ba1f43133359bb22023e2b31272
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a4
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.