ERC-1155
Source Code
Overview
Max Total Supply
0
Holders
4
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
Web3bune
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 800 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Web3bune is ERC1155, Ownable {
// Errors
error NonexistentPost();
error InvalidFee();
error InsufficientFunds();
error NotOwner();
// Structs and data
struct Post {
string tokenURI;
address payable author;
uint256 price;
uint256 feeBasisPoints;
uint256 aggFeeBasisPoints;
}
// Events
event PostCreated(
address indexed from,
uint256 index,
string tokenURI,
uint256 price,
uint256 feeBasisPoints,
uint256 aggFeeBasisPoints
);
event PostUpdated(
address indexed from,
uint256 index,
string tokenURI,
uint256 price,
uint256 feeBasisPoints,
uint256 aggFeeBasisPoints
);
uint256 constant PAGE_SIZE = 100;
Post[] internal _posts;
mapping(address => uint256[]) internal _addressToPostIds;
address payable internal _protocolFeeReceiver;
modifier postExists(uint256 index) {
if (index >= _posts.length) {
revert NonexistentPost();
}
_;
}
constructor(
address initialOwner,
address payable protocolFeeReceiver
) ERC1155("") Ownable(initialOwner) {
_protocolFeeReceiver = protocolFeeReceiver;
}
function createPost(
string calldata tokenURI,
uint256 price,
uint256 feeBasisPoints,
uint256 aggFeeBasisPoints
) public {
if (feeBasisPoints + aggFeeBasisPoints > 10000) {
revert InvalidFee();
}
_posts.push(
Post(
tokenURI,
payable(msg.sender),
price,
feeBasisPoints,
aggFeeBasisPoints
)
);
_addressToPostIds[msg.sender].push(_posts.length - 1);
emit PostCreated(
msg.sender,
_posts.length - 1,
tokenURI,
price,
feeBasisPoints,
aggFeeBasisPoints
);
}
function updatePost(
uint256 index,
string calldata tokenURI,
uint256 price,
uint256 feeBasisPoints,
uint256 aggFeeBasisPoints
) public postExists(index) {
Post storage post = _posts[index];
if (msg.sender != post.author) {
revert NotOwner();
}
if (feeBasisPoints + aggFeeBasisPoints > 10000) {
revert InvalidFee();
}
post.tokenURI = tokenURI;
post.price = price;
post.feeBasisPoints = feeBasisPoints;
post.aggFeeBasisPoints = aggFeeBasisPoints;
emit PostUpdated(
msg.sender,
index,
tokenURI,
price,
feeBasisPoints,
aggFeeBasisPoints
);
}
function mint(
address payable aggregator,
address account,
uint256 index
) public payable {
mintBatch(aggregator, account, index, 1);
}
function mintBatch(
address payable aggregator,
address account,
uint256 index,
uint256 amount
) public payable postExists(index) {
Post memory post = _posts[index];
uint256 total = post.price * amount;
if (msg.value < total) {
revert InsufficientFunds();
}
uint256 protocolFee = (msg.value * post.feeBasisPoints) / 10_000;
uint256 aggregatorFee = aggregator == address(0)
? 0
: (msg.value * post.aggFeeBasisPoints) / 10_000;
post.author.transfer(msg.value - protocolFee - aggregatorFee);
aggregator.transfer(aggregatorFee);
_protocolFeeReceiver.transfer(protocolFee);
_mint(account, index, amount, "");
}
function uri(
uint256 id
) public view virtual override postExists(id) returns (string memory) {
Post memory post = _posts[id];
return post.tokenURI;
}
function getPost(
uint256 id
) public view virtual postExists(id) returns (Post memory) {
return _posts[id];
}
function listPostsByAccount(
address account,
uint256 page
) public view returns (Post[PAGE_SIZE] memory) {
Post[PAGE_SIZE] memory posts;
uint256 offset = page * PAGE_SIZE;
uint256[] memory postIds = _addressToPostIds[account];
for (uint256 i = 0; i < PAGE_SIZE && i + offset < postIds.length; i++) {
posts[i] = _posts[postIds[i + offset]];
}
return posts;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "./IERC1155.sol";
import {IERC1155Receiver} from "./IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol";
import {Context} from "../../utils/Context.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {Arrays} from "../../utils/Arrays.sol";
import {IERC1155Errors} from "../../interfaces/draft-IERC6093.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
*/
abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors {
using Arrays for uint256[];
using Arrays for address[];
mapping(uint256 id => mapping(address account => uint256)) private _balances;
mapping(address account => mapping(address operator => 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 /* id */) public view virtual returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*/
function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
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 returns (uint256[] memory) {
if (accounts.length != ids.length) {
revert ERC1155InvalidArrayLength(ids.length, accounts.length);
}
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeTransferFrom(from, to, id, value, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeBatchTransferFrom(from, to, ids, values, data);
}
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
* (or `to`) is the zero address.
*
* Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
* or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
* - `ids` and `values` must have the same length.
*
* NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
*/
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
if (ids.length != values.length) {
revert ERC1155InvalidArrayLength(ids.length, values.length);
}
address operator = _msgSender();
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids.unsafeMemoryAccess(i);
uint256 value = values.unsafeMemoryAccess(i);
if (from != address(0)) {
uint256 fromBalance = _balances[id][from];
if (fromBalance < value) {
revert ERC1155InsufficientBalance(from, fromBalance, value, id);
}
unchecked {
// Overflow not possible: value <= fromBalance
_balances[id][from] = fromBalance - value;
}
}
if (to != address(0)) {
_balances[id][to] += value;
}
}
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
emit TransferSingle(operator, from, to, id, value);
} else {
emit TransferBatch(operator, from, to, ids, values);
}
}
/**
* @dev Version of {_update} that performs the token acceptance check by calling
* {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
* contains code (eg. is a smart contract at the moment of execution).
*
* IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
* update to the contract state after this function would break the check-effect-interaction pattern. Consider
* overriding {_update} instead.
*/
function _updateWithAcceptanceCheck(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal virtual {
_update(from, to, ids, values);
if (to != address(0)) {
address operator = _msgSender();
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
_doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
} else {
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
}
}
}
/**
* @dev Transfers a `value` 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 `value` 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 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, to, ids, values, 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.
* - `ids` and `values` must have the same length.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, to, ids, values, 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 values 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 a `value` amount of tokens of 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 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - `to` cannot be the zero address.
* - 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 values, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev Destroys a `value` amount of tokens of type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
*/
function _burn(address from, uint256 id, uint256 value) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
* - `ids` and `values` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the zero address.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
if (operator == address(0)) {
revert ERC1155InvalidOperator(address(0));
}
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 value,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Creates an array in memory with only one value for each of the elements provided.
*/
function _asSingletonArrays(
uint256 element1,
uint256 element2
) private pure returns (uint256[] memory array1, uint256[] memory array2) {
/// @solidity memory-safe-assembly
assembly {
// Load the free memory pointer
array1 := mload(0x40)
// Set array length to 1
mstore(array1, 1)
// Store the single element at the next word after the length (where content starts)
mstore(add(array1, 0x20), element1)
// Repeat for next array locating it right after the first array
array2 := add(array1, 0x40)
mstore(array2, 1)
mstore(add(array2, 0x20), element2)
// Update the free memory pointer by pointing after the second array
mstore(0x40, add(array2, 0x40))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*/
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 v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* 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 `value` 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 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` 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 values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
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 v5.0.0) (utils/Arrays.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";
/**
* @dev Collection of functions related to array types.
*/
library Arrays {
using StorageSlot for bytes32;
/**
* @dev Searches a sorted `array` and returns the first index that contains
* a value greater or equal to `element`. If no such index exists (i.e. all
* values in the array are strictly less than `element`), the array length is
* returned. Time complexity O(log n).
*
* `array` is expected to be sorted in ascending order, and to contain no
* repeated elements.
*/
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
uint256 low = 0;
uint256 high = array.length;
if (high == 0) {
return 0;
}
while (low < high) {
uint256 mid = Math.average(low, high);
// Note that mid will always be strictly less than high (i.e. it will be a valid array index)
// because Math.average rounds towards zero (it does integer division with truncation).
if (unsafeAccess(array, mid).value > element) {
high = mid;
} else {
low = mid + 1;
}
}
// At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
if (low > 0 && unsafeAccess(array, low - 1).value == element) {
return low - 1;
} else {
return low;
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getAddressSlot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getBytes32Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getUint256Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./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);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}{
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 800
},
"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":"initialOwner","type":"address"},{"internalType":"address payable","name":"protocolFeeReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidFee","type":"error"},{"inputs":[],"name":"NonexistentPost","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","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":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":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"name":"PostCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"name":"PostUpdated","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":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"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":"string","name":"tokenURI","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"name":"createPost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPost","outputs":[{"components":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"address payable","name":"author","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"internalType":"struct Web3bune.Post","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"page","type":"uint256"}],"name":"listPostsByAccount","outputs":[{"components":[{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"address payable","name":"author","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"internalType":"struct Web3bune.Post[100]","name":"","type":"tuple[100]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"aggregator","type":"address"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"aggregator","type":"address"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[],"stateMutability":"payable","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":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","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":"value","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"feeBasisPoints","type":"uint256"},{"internalType":"uint256","name":"aggFeeBasisPoints","type":"uint256"}],"name":"updatePost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200254038038062002540833981016040819052620000349162000130565b60408051602081019091526000815282906200005081620000b3565b506001600160a01b0381166200008057604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200008b81620000c5565b50600680546001600160a01b0319166001600160a01b039290921691909117905550620002e2565b6002620000c1828262000216565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146200012d57600080fd5b50565b600080604083850312156200014457600080fd5b8251620001518162000117565b6020840151909250620001648162000117565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200019a57607f821691505b602082108103620001bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000211576000816000526020600020601f850160051c81016020861015620001ec5750805b601f850160051c820191505b818110156200020d57828155600101620001f8565b5050505b505050565b81516001600160401b038111156200023257620002326200016f565b6200024a8162000243845462000185565b84620001c1565b602080601f831160018114620002825760008415620002695750858301515b600019600386901b1c1916600185901b1785556200020d565b600085815260208120601f198616915b82811015620002b35788860151825594840194600190910190840162000292565b5085821015620002d25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61224e80620002f26000396000f3fe60806040526004361061010d5760003560e01c80637f7b0fae116100a5578063c6c3bbe611610074578063e985e9c511610059578063e985e9c51461030e578063f242432a14610357578063f2fde38b1461037757600080fd5b8063c6c3bbe6146102e8578063d3cc479e146102fb57600080fd5b80637f7b0fae146102605780638da5cb5b146102805780639e44cc57146102a8578063a22cb465146102c857600080fd5b80632eb2c2d6116100e15780632eb2c2d6146101cf57806340731c24146101f15780634e1273f41461021e578063715018a61461024b57600080fd5b8062fdd58e1461011257806301ffc9a7146101455780630e89341c1461017557806320b0215c146101a2575b600080fd5b34801561011e57600080fd5b5061013261012d366004611751565b610397565b6040519081526020015b60405180910390f35b34801561015157600080fd5b50610165610160366004611793565b6103bf565b604051901515815260200161013c565b34801561018157600080fd5b506101956101903660046117b7565b61040f565b60405161013c9190611816565b3480156101ae57600080fd5b506101c26101bd366004611751565b610533565b60405161013c919061187b565b3480156101db57600080fd5b506101ef6101ea366004611a13565b610721565b005b3480156101fd57600080fd5b5061021161020c3660046117b7565b6107ac565b60405161013c9190611ac1565b34801561022a57600080fd5b5061023e610239366004611ad4565b610902565b60405161013c9190611bd2565b34801561025757600080fd5b506101ef6109cf565b34801561026c57600080fd5b506101ef61027b366004611c2e565b6109e3565b34801561028c57600080fd5b506003546040516001600160a01b03909116815260200161013c565b3480156102b457600080fd5b506101ef6102c3366004611c88565b610b6f565b3480156102d457600080fd5b506101ef6102e3366004611cee565b610c84565b6101ef6102f6366004611d2c565b610c93565b6101ef610309366004611d6d565b610ca5565b34801561031a57600080fd5b50610165610329366004611db3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561036357600080fd5b506101ef610372366004611de1565b610f37565b34801561038357600080fd5b506101ef610392366004611e4a565b610fb5565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806103f057506001600160e01b031982166303a24d0760e21b145b806103b957506301ffc9a760e01b6001600160e01b03198316146103b9565b6004546060908290811061043657604051630439dedf60e21b815260040160405180910390fd5b60006004848154811061044b5761044b611e67565b90600052602060002090600502016040518060a001604052908160008201805461047490611e7d565b80601f01602080910402602001604051908101604052809291908181526020018280546104a090611e7d565b80156104ed5780601f106104c2576101008083540402835291602001916104ed565b820191906000526020600020905b8154815290600101906020018083116104d057829003601f168201915b505050918352505060018201546001600160a01b031660208201526002820154604082015260038201546060820152600490910154608090910152519250505b50919050565b61053b6116db565b6105436116db565b6000610550606485611ec7565b6001600160a01b0386166000908152600560209081526040808320805482518185028101850190935280835294955092939092918301828280156105b357602002820191906000526020600020905b81548152602001906001019080831161059f575b5050505050905060005b6064811080156105d6575081516105d48483611ede565b105b15610716576004826105e88584611ede565b815181106105f8576105f8611e67565b60200260200101518154811061061057610610611e67565b90600052602060002090600502016040518060a001604052908160008201805461063990611e7d565b80601f016020809104026020016040519081016040528092919081815260200182805461066590611e7d565b80156106b25780601f10610687576101008083540402835291602001916106b2565b820191906000526020600020905b81548152906001019060200180831161069557829003601f168201915b505050918352505060018201546001600160a01b0316602082015260028201546040820152600382015460608201526004909101546080909101528482606481106106ff576106ff611e67565b60200201528061070e81611ef1565b9150506105bd565b509195945050505050565b336001600160a01b038616811480159061076157506001600160a01b0380871660009081526001602090815260408083209385168352929052205460ff16155b156107975760405163711bec9160e11b81526001600160a01b038083166004830152871660248201526044015b60405180910390fd5b6107a48686868686610ff3565b505050505050565b6107e76040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b6004548290811061080b57604051630439dedf60e21b815260040160405180910390fd5b6004838154811061081e5761081e611e67565b90600052602060002090600502016040518060a001604052908160008201805461084790611e7d565b80601f016020809104026020016040519081016040528092919081815260200182805461087390611e7d565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b505050918352505060018201546001600160a01b0316602082015260028201546040820152600382015460608201526004909101546080909101529392505050565b606081518351146109335781518351604051635b05999160e01b81526004810192909252602482015260440161078e565b6000835167ffffffffffffffff81111561094f5761094f6118c9565b604051908082528060200260200182016040528015610978578160200160208202803683370190505b50905060005b84518110156109c7576020808202860101516109a290602080840287010151610397565b8282815181106109b4576109b4611e67565b602090810291909101015260010161097e565b509392505050565b6109d761105a565b6109e16000611087565b565b6127106109f08284611ede565b1115610a0f576040516358d620b360e01b815260040160405180910390fd5b6040805160c06020601f8801819004028201810190925260a081018681526004928291908990899081908501838280828437600092018290525093855250503360208085019190915260408401899052606084018890526080909301869052508354600181018555938152208151919260050201908190610a909082611f52565b506020828101516001838101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390931692909217909155604080850151600285015560608501516003850155608090940151600493840155336000908152600590925292902090549091610b0391612012565b81546001818101845560009384526020909320015560045433917f27affce3f8e6fbf8947873b6ae2b024803f4e059d43d42d583451ebd0059ac9691610b499190612012565b8787878787604051610b6096959493929190612025565b60405180910390a25050505050565b60045486908110610b9357604051630439dedf60e21b815260040160405180910390fd5b600060048881548110610ba857610ba8611e67565b6000918252602090912060059091020160018101549091506001600160a01b03163314610be8576040516330cd747160e01b815260040160405180910390fd5b612710610bf58486611ede565b1115610c14576040516358d620b360e01b815260040160405180910390fd5b80610c20878983612073565b5060028101859055600381018490556004810183905560405133907f43a7c48e67bbd701a6d381f503ac713f7885ebe534422d29ba45e632fbf33dea90610c72908b908b908b908b908b908b90612025565b60405180910390a25050505050505050565b610c8f3383836110e6565b5050565b610ca08383836001610ca5565b505050565b60045482908110610cc957604051630439dedf60e21b815260040160405180910390fd5b600060048481548110610cde57610cde611e67565b90600052602060002090600502016040518060a0016040529081600082018054610d0790611e7d565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3390611e7d565b8015610d805780601f10610d5557610100808354040283529160200191610d80565b820191906000526020600020905b815481529060010190602001808311610d6357829003601f168201915b505050918352505060018201546001600160a01b03166020820152600282015460408083019190915260038301546060830152600490920154608090910152810151909150600090610dd3908590611ec7565b905080341015610df65760405163356680b760e01b815260040160405180910390fd5b6000612710836060015134610e0b9190611ec7565b610e159190612133565b905060006001600160a01b03891615610e4a57612710846080015134610e3b9190611ec7565b610e459190612133565b610e4d565b60005b60208501519091506001600160a01b03166108fc82610e6c8534612012565b610e769190612012565b6040518115909202916000818181858888f19350505050158015610e9e573d6000803e3d6000fd5b506040516001600160a01b038a169082156108fc029083906000818181858888f19350505050158015610ed5573d6000803e3d6000fd5b506006546040516001600160a01b039091169083156108fc029084906000818181858888f19350505050158015610f10573d6000803e3d6000fd5b50610f2c8888886040518060200160405280600081525061117c565b505050505050505050565b336001600160a01b0386168114801590610f7757506001600160a01b0380871660009081526001602090815260408083209385168352929052205460ff16155b15610fa85760405163711bec9160e11b81526001600160a01b0380831660048301528716602482015260440161078e565b6107a486868686866111d9565b610fbd61105a565b6001600160a01b038116610fe757604051631e4fbdf760e01b81526000600482015260240161078e565b610ff081611087565b50565b6001600160a01b03841661101d57604051632bfa23e760e11b81526000600482015260240161078e565b6001600160a01b03851661104657604051626a0d4560e21b81526000600482015260240161078e565b6110538585858585611267565b5050505050565b6003546001600160a01b031633146109e15760405163118cdaa760e01b815233600482015260240161078e565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661110f5760405162ced3e160e81b81526000600482015260240161078e565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166111a657604051632bfa23e760e11b81526000600482015260240161078e565b604080516001808252602082018690528183019081526060820185905260808201909252906107a4600087848487611267565b6001600160a01b03841661120357604051632bfa23e760e11b81526000600482015260240161078e565b6001600160a01b03851661122c57604051626a0d4560e21b81526000600482015260240161078e565b6040805160018082526020820186905281830190815260608201859052608082019092529061125e8787848487611267565b50505050505050565b611273858585856112ba565b6001600160a01b0384161561105357825133906001036112ac57602084810151908401516112a58389898585896114ce565b50506107a4565b6107a48187878787876115f2565b80518251146112e95781518151604051635b05999160e01b81526004810192909252602482015260440161078e565b3360005b83518110156113ef576020818102858101820151908501909101516001600160a01b038816156113a0576000828152602081815260408083206001600160a01b038c16845290915290205481811015611379576040516303dee4c560e01b81526001600160a01b038a16600482015260248101829052604481018390526064810184905260840161078e565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b038716156113e5576000828152602081815260408083206001600160a01b038b168452909152812080548392906113df908490611ede565b90915550505b50506001016112ed565b5082516001036114705760208301516000906020840151909150856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611461929190918252602082015260400190565b60405180910390a45050611053565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516114bf929190612155565b60405180910390a45050505050565b6001600160a01b0384163b156107a45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906115129089908990889088908890600401612183565b6020604051808303816000875af192505050801561154d575060408051601f3d908101601f1916820190925261154a918101906121c6565b60015b6115b6573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b606091505b5080516000036115ae57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b1461125e57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b6001600160a01b0384163b156107a45760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061163690899089908890889088906004016121e3565b6020604051808303816000875af1925050508015611671575060408051601f3d908101601f1916820190925261166e918101906121c6565b60015b61169f573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b6001600160e01b0319811663bc197c8160e01b1461125e57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b60405180610c8001604052806064905b6117266040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b8152602001906001900390816116eb5790505090565b6001600160a01b0381168114610ff057600080fd5b6000806040838503121561176457600080fd5b823561176f8161173c565b946020939093013593505050565b6001600160e01b031981168114610ff057600080fd5b6000602082840312156117a557600080fd5b81356117b08161177d565b9392505050565b6000602082840312156117c957600080fd5b5035919050565b6000815180845260005b818110156117f6576020818501810151868301820152016117da565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006117b060208301846117d0565b6000815160a0845261183e60a08501826117d0565b90506001600160a01b0360208401511660208501526040830151604085015260608301516060850152608083015160808501528091505092915050565b6020808252600090610ca0830183820185845b60648110156118bd57601f198785030183526118ab848351611829565b9350918401919084019060010161188e565b50919695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611908576119086118c9565b604052919050565b600067ffffffffffffffff82111561192a5761192a6118c9565b5060051b60200190565b600082601f83011261194557600080fd5b8135602061195a61195583611910565b6118df565b8083825260208201915060208460051b87010193508684111561197c57600080fd5b602086015b848110156119985780358352918301918301611981565b509695505050505050565b600082601f8301126119b457600080fd5b813567ffffffffffffffff8111156119ce576119ce6118c9565b6119e1601f8201601f19166020016118df565b8181528460208386010111156119f657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611a2b57600080fd5b8535611a368161173c565b94506020860135611a468161173c565b9350604086013567ffffffffffffffff80821115611a6357600080fd5b611a6f89838a01611934565b94506060880135915080821115611a8557600080fd5b611a9189838a01611934565b93506080880135915080821115611aa757600080fd5b50611ab4888289016119a3565b9150509295509295909350565b6020815260006117b06020830184611829565b60008060408385031215611ae757600080fd5b823567ffffffffffffffff80821115611aff57600080fd5b818501915085601f830112611b1357600080fd5b81356020611b2361195583611910565b82815260059290921b84018101918181019089841115611b4257600080fd5b948201945b83861015611b69578535611b5a8161173c565b82529482019490820190611b47565b96505086013592505080821115611b7f57600080fd5b50611b8c85828601611934565b9150509250929050565b60008151808452602080850194506020840160005b83811015611bc757815187529582019590820190600101611bab565b509495945050505050565b6020815260006117b06020830184611b96565b60008083601f840112611bf757600080fd5b50813567ffffffffffffffff811115611c0f57600080fd5b602083019150836020828501011115611c2757600080fd5b9250929050565b600080600080600060808688031215611c4657600080fd5b853567ffffffffffffffff811115611c5d57600080fd5b611c6988828901611be5565b9099909850602088013597604081013597506060013595509350505050565b60008060008060008060a08789031215611ca157600080fd5b86359550602087013567ffffffffffffffff811115611cbf57600080fd5b611ccb89828a01611be5565b979a90995096976040810135976060820135975060809091013595509350505050565b60008060408385031215611d0157600080fd5b8235611d0c8161173c565b915060208301358015158114611d2157600080fd5b809150509250929050565b600080600060608486031215611d4157600080fd5b8335611d4c8161173c565b92506020840135611d5c8161173c565b929592945050506040919091013590565b60008060008060808587031215611d8357600080fd5b8435611d8e8161173c565b93506020850135611d9e8161173c565b93969395505050506040820135916060013590565b60008060408385031215611dc657600080fd5b8235611dd18161173c565b91506020830135611d218161173c565b600080600080600060a08688031215611df957600080fd5b8535611e048161173c565b94506020860135611e148161173c565b93506040860135925060608601359150608086013567ffffffffffffffff811115611e3e57600080fd5b611ab4888289016119a3565b600060208284031215611e5c57600080fd5b81356117b08161173c565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680611e9157607f821691505b60208210810361052d57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176103b9576103b9611eb1565b808201808211156103b9576103b9611eb1565b600060018201611f0357611f03611eb1565b5060010190565b601f821115610ca0576000816000526020600020601f850160051c81016020861015611f335750805b601f850160051c820191505b818110156107a457828155600101611f3f565b815167ffffffffffffffff811115611f6c57611f6c6118c9565b611f8081611f7a8454611e7d565b84611f0a565b602080601f831160018114611fb55760008415611f9d5750858301515b600019600386901b1c1916600185901b1785556107a4565b600085815260208120601f198616915b82811015611fe457888601518255948401946001909101908401611fc5565b50858210156120025787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b818103818111156103b9576103b9611eb1565b86815260a060208201528460a0820152848660c0830137600060c08683010152600060c0601f19601f8801168301019050846040830152836060830152826080830152979650505050505050565b67ffffffffffffffff83111561208b5761208b6118c9565b61209f836120998354611e7d565b83611f0a565b6000601f8411600181146120d357600085156120bb5750838201355b600019600387901b1c1916600186901b178355611053565b600083815260209020601f19861690835b8281101561210457868501358255602094850194600190920191016120e4565b50868210156121215760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008261215057634e487b7160e01b600052601260045260246000fd5b500490565b6040815260006121686040830185611b96565b828103602084015261217a8185611b96565b95945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526121bb60a08301846117d0565b979650505050505050565b6000602082840312156121d857600080fd5b81516117b08161177d565b60006001600160a01b03808816835280871660208401525060a0604083015261220f60a0830186611b96565b82810360608401526122218186611b96565b9050828103608084015261223581856117d0565b9897505050505050505056fea164736f6c6343000817000a00000000000000000000000062817523f3b94182b9df911a8071764f998f11a4000000000000000000000000a61a4dad4d3471bfcc91469342589c83ba5727cb
Deployed Bytecode
0x60806040526004361061010d5760003560e01c80637f7b0fae116100a5578063c6c3bbe611610074578063e985e9c511610059578063e985e9c51461030e578063f242432a14610357578063f2fde38b1461037757600080fd5b8063c6c3bbe6146102e8578063d3cc479e146102fb57600080fd5b80637f7b0fae146102605780638da5cb5b146102805780639e44cc57146102a8578063a22cb465146102c857600080fd5b80632eb2c2d6116100e15780632eb2c2d6146101cf57806340731c24146101f15780634e1273f41461021e578063715018a61461024b57600080fd5b8062fdd58e1461011257806301ffc9a7146101455780630e89341c1461017557806320b0215c146101a2575b600080fd5b34801561011e57600080fd5b5061013261012d366004611751565b610397565b6040519081526020015b60405180910390f35b34801561015157600080fd5b50610165610160366004611793565b6103bf565b604051901515815260200161013c565b34801561018157600080fd5b506101956101903660046117b7565b61040f565b60405161013c9190611816565b3480156101ae57600080fd5b506101c26101bd366004611751565b610533565b60405161013c919061187b565b3480156101db57600080fd5b506101ef6101ea366004611a13565b610721565b005b3480156101fd57600080fd5b5061021161020c3660046117b7565b6107ac565b60405161013c9190611ac1565b34801561022a57600080fd5b5061023e610239366004611ad4565b610902565b60405161013c9190611bd2565b34801561025757600080fd5b506101ef6109cf565b34801561026c57600080fd5b506101ef61027b366004611c2e565b6109e3565b34801561028c57600080fd5b506003546040516001600160a01b03909116815260200161013c565b3480156102b457600080fd5b506101ef6102c3366004611c88565b610b6f565b3480156102d457600080fd5b506101ef6102e3366004611cee565b610c84565b6101ef6102f6366004611d2c565b610c93565b6101ef610309366004611d6d565b610ca5565b34801561031a57600080fd5b50610165610329366004611db3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561036357600080fd5b506101ef610372366004611de1565b610f37565b34801561038357600080fd5b506101ef610392366004611e4a565b610fb5565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806103f057506001600160e01b031982166303a24d0760e21b145b806103b957506301ffc9a760e01b6001600160e01b03198316146103b9565b6004546060908290811061043657604051630439dedf60e21b815260040160405180910390fd5b60006004848154811061044b5761044b611e67565b90600052602060002090600502016040518060a001604052908160008201805461047490611e7d565b80601f01602080910402602001604051908101604052809291908181526020018280546104a090611e7d565b80156104ed5780601f106104c2576101008083540402835291602001916104ed565b820191906000526020600020905b8154815290600101906020018083116104d057829003601f168201915b505050918352505060018201546001600160a01b031660208201526002820154604082015260038201546060820152600490910154608090910152519250505b50919050565b61053b6116db565b6105436116db565b6000610550606485611ec7565b6001600160a01b0386166000908152600560209081526040808320805482518185028101850190935280835294955092939092918301828280156105b357602002820191906000526020600020905b81548152602001906001019080831161059f575b5050505050905060005b6064811080156105d6575081516105d48483611ede565b105b15610716576004826105e88584611ede565b815181106105f8576105f8611e67565b60200260200101518154811061061057610610611e67565b90600052602060002090600502016040518060a001604052908160008201805461063990611e7d565b80601f016020809104026020016040519081016040528092919081815260200182805461066590611e7d565b80156106b25780601f10610687576101008083540402835291602001916106b2565b820191906000526020600020905b81548152906001019060200180831161069557829003601f168201915b505050918352505060018201546001600160a01b0316602082015260028201546040820152600382015460608201526004909101546080909101528482606481106106ff576106ff611e67565b60200201528061070e81611ef1565b9150506105bd565b509195945050505050565b336001600160a01b038616811480159061076157506001600160a01b0380871660009081526001602090815260408083209385168352929052205460ff16155b156107975760405163711bec9160e11b81526001600160a01b038083166004830152871660248201526044015b60405180910390fd5b6107a48686868686610ff3565b505050505050565b6107e76040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b6004548290811061080b57604051630439dedf60e21b815260040160405180910390fd5b6004838154811061081e5761081e611e67565b90600052602060002090600502016040518060a001604052908160008201805461084790611e7d565b80601f016020809104026020016040519081016040528092919081815260200182805461087390611e7d565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b505050918352505060018201546001600160a01b0316602082015260028201546040820152600382015460608201526004909101546080909101529392505050565b606081518351146109335781518351604051635b05999160e01b81526004810192909252602482015260440161078e565b6000835167ffffffffffffffff81111561094f5761094f6118c9565b604051908082528060200260200182016040528015610978578160200160208202803683370190505b50905060005b84518110156109c7576020808202860101516109a290602080840287010151610397565b8282815181106109b4576109b4611e67565b602090810291909101015260010161097e565b509392505050565b6109d761105a565b6109e16000611087565b565b6127106109f08284611ede565b1115610a0f576040516358d620b360e01b815260040160405180910390fd5b6040805160c06020601f8801819004028201810190925260a081018681526004928291908990899081908501838280828437600092018290525093855250503360208085019190915260408401899052606084018890526080909301869052508354600181018555938152208151919260050201908190610a909082611f52565b506020828101516001838101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390931692909217909155604080850151600285015560608501516003850155608090940151600493840155336000908152600590925292902090549091610b0391612012565b81546001818101845560009384526020909320015560045433917f27affce3f8e6fbf8947873b6ae2b024803f4e059d43d42d583451ebd0059ac9691610b499190612012565b8787878787604051610b6096959493929190612025565b60405180910390a25050505050565b60045486908110610b9357604051630439dedf60e21b815260040160405180910390fd5b600060048881548110610ba857610ba8611e67565b6000918252602090912060059091020160018101549091506001600160a01b03163314610be8576040516330cd747160e01b815260040160405180910390fd5b612710610bf58486611ede565b1115610c14576040516358d620b360e01b815260040160405180910390fd5b80610c20878983612073565b5060028101859055600381018490556004810183905560405133907f43a7c48e67bbd701a6d381f503ac713f7885ebe534422d29ba45e632fbf33dea90610c72908b908b908b908b908b908b90612025565b60405180910390a25050505050505050565b610c8f3383836110e6565b5050565b610ca08383836001610ca5565b505050565b60045482908110610cc957604051630439dedf60e21b815260040160405180910390fd5b600060048481548110610cde57610cde611e67565b90600052602060002090600502016040518060a0016040529081600082018054610d0790611e7d565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3390611e7d565b8015610d805780601f10610d5557610100808354040283529160200191610d80565b820191906000526020600020905b815481529060010190602001808311610d6357829003601f168201915b505050918352505060018201546001600160a01b03166020820152600282015460408083019190915260038301546060830152600490920154608090910152810151909150600090610dd3908590611ec7565b905080341015610df65760405163356680b760e01b815260040160405180910390fd5b6000612710836060015134610e0b9190611ec7565b610e159190612133565b905060006001600160a01b03891615610e4a57612710846080015134610e3b9190611ec7565b610e459190612133565b610e4d565b60005b60208501519091506001600160a01b03166108fc82610e6c8534612012565b610e769190612012565b6040518115909202916000818181858888f19350505050158015610e9e573d6000803e3d6000fd5b506040516001600160a01b038a169082156108fc029083906000818181858888f19350505050158015610ed5573d6000803e3d6000fd5b506006546040516001600160a01b039091169083156108fc029084906000818181858888f19350505050158015610f10573d6000803e3d6000fd5b50610f2c8888886040518060200160405280600081525061117c565b505050505050505050565b336001600160a01b0386168114801590610f7757506001600160a01b0380871660009081526001602090815260408083209385168352929052205460ff16155b15610fa85760405163711bec9160e11b81526001600160a01b0380831660048301528716602482015260440161078e565b6107a486868686866111d9565b610fbd61105a565b6001600160a01b038116610fe757604051631e4fbdf760e01b81526000600482015260240161078e565b610ff081611087565b50565b6001600160a01b03841661101d57604051632bfa23e760e11b81526000600482015260240161078e565b6001600160a01b03851661104657604051626a0d4560e21b81526000600482015260240161078e565b6110538585858585611267565b5050505050565b6003546001600160a01b031633146109e15760405163118cdaa760e01b815233600482015260240161078e565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661110f5760405162ced3e160e81b81526000600482015260240161078e565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166111a657604051632bfa23e760e11b81526000600482015260240161078e565b604080516001808252602082018690528183019081526060820185905260808201909252906107a4600087848487611267565b6001600160a01b03841661120357604051632bfa23e760e11b81526000600482015260240161078e565b6001600160a01b03851661122c57604051626a0d4560e21b81526000600482015260240161078e565b6040805160018082526020820186905281830190815260608201859052608082019092529061125e8787848487611267565b50505050505050565b611273858585856112ba565b6001600160a01b0384161561105357825133906001036112ac57602084810151908401516112a58389898585896114ce565b50506107a4565b6107a48187878787876115f2565b80518251146112e95781518151604051635b05999160e01b81526004810192909252602482015260440161078e565b3360005b83518110156113ef576020818102858101820151908501909101516001600160a01b038816156113a0576000828152602081815260408083206001600160a01b038c16845290915290205481811015611379576040516303dee4c560e01b81526001600160a01b038a16600482015260248101829052604481018390526064810184905260840161078e565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b038716156113e5576000828152602081815260408083206001600160a01b038b168452909152812080548392906113df908490611ede565b90915550505b50506001016112ed565b5082516001036114705760208301516000906020840151909150856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611461929190918252602082015260400190565b60405180910390a45050611053565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516114bf929190612155565b60405180910390a45050505050565b6001600160a01b0384163b156107a45760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906115129089908990889088908890600401612183565b6020604051808303816000875af192505050801561154d575060408051601f3d908101601f1916820190925261154a918101906121c6565b60015b6115b6573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b606091505b5080516000036115ae57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b1461125e57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b6001600160a01b0384163b156107a45760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061163690899089908890889088906004016121e3565b6020604051808303816000875af1925050508015611671575060408051601f3d908101601f1916820190925261166e918101906121c6565b60015b61169f573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b6001600160e01b0319811663bc197c8160e01b1461125e57604051632bfa23e760e11b81526001600160a01b038616600482015260240161078e565b60405180610c8001604052806064905b6117266040518060a001604052806060815260200160006001600160a01b031681526020016000815260200160008152602001600081525090565b8152602001906001900390816116eb5790505090565b6001600160a01b0381168114610ff057600080fd5b6000806040838503121561176457600080fd5b823561176f8161173c565b946020939093013593505050565b6001600160e01b031981168114610ff057600080fd5b6000602082840312156117a557600080fd5b81356117b08161177d565b9392505050565b6000602082840312156117c957600080fd5b5035919050565b6000815180845260005b818110156117f6576020818501810151868301820152016117da565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006117b060208301846117d0565b6000815160a0845261183e60a08501826117d0565b90506001600160a01b0360208401511660208501526040830151604085015260608301516060850152608083015160808501528091505092915050565b6020808252600090610ca0830183820185845b60648110156118bd57601f198785030183526118ab848351611829565b9350918401919084019060010161188e565b50919695505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611908576119086118c9565b604052919050565b600067ffffffffffffffff82111561192a5761192a6118c9565b5060051b60200190565b600082601f83011261194557600080fd5b8135602061195a61195583611910565b6118df565b8083825260208201915060208460051b87010193508684111561197c57600080fd5b602086015b848110156119985780358352918301918301611981565b509695505050505050565b600082601f8301126119b457600080fd5b813567ffffffffffffffff8111156119ce576119ce6118c9565b6119e1601f8201601f19166020016118df565b8181528460208386010111156119f657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611a2b57600080fd5b8535611a368161173c565b94506020860135611a468161173c565b9350604086013567ffffffffffffffff80821115611a6357600080fd5b611a6f89838a01611934565b94506060880135915080821115611a8557600080fd5b611a9189838a01611934565b93506080880135915080821115611aa757600080fd5b50611ab4888289016119a3565b9150509295509295909350565b6020815260006117b06020830184611829565b60008060408385031215611ae757600080fd5b823567ffffffffffffffff80821115611aff57600080fd5b818501915085601f830112611b1357600080fd5b81356020611b2361195583611910565b82815260059290921b84018101918181019089841115611b4257600080fd5b948201945b83861015611b69578535611b5a8161173c565b82529482019490820190611b47565b96505086013592505080821115611b7f57600080fd5b50611b8c85828601611934565b9150509250929050565b60008151808452602080850194506020840160005b83811015611bc757815187529582019590820190600101611bab565b509495945050505050565b6020815260006117b06020830184611b96565b60008083601f840112611bf757600080fd5b50813567ffffffffffffffff811115611c0f57600080fd5b602083019150836020828501011115611c2757600080fd5b9250929050565b600080600080600060808688031215611c4657600080fd5b853567ffffffffffffffff811115611c5d57600080fd5b611c6988828901611be5565b9099909850602088013597604081013597506060013595509350505050565b60008060008060008060a08789031215611ca157600080fd5b86359550602087013567ffffffffffffffff811115611cbf57600080fd5b611ccb89828a01611be5565b979a90995096976040810135976060820135975060809091013595509350505050565b60008060408385031215611d0157600080fd5b8235611d0c8161173c565b915060208301358015158114611d2157600080fd5b809150509250929050565b600080600060608486031215611d4157600080fd5b8335611d4c8161173c565b92506020840135611d5c8161173c565b929592945050506040919091013590565b60008060008060808587031215611d8357600080fd5b8435611d8e8161173c565b93506020850135611d9e8161173c565b93969395505050506040820135916060013590565b60008060408385031215611dc657600080fd5b8235611dd18161173c565b91506020830135611d218161173c565b600080600080600060a08688031215611df957600080fd5b8535611e048161173c565b94506020860135611e148161173c565b93506040860135925060608601359150608086013567ffffffffffffffff811115611e3e57600080fd5b611ab4888289016119a3565b600060208284031215611e5c57600080fd5b81356117b08161173c565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680611e9157607f821691505b60208210810361052d57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176103b9576103b9611eb1565b808201808211156103b9576103b9611eb1565b600060018201611f0357611f03611eb1565b5060010190565b601f821115610ca0576000816000526020600020601f850160051c81016020861015611f335750805b601f850160051c820191505b818110156107a457828155600101611f3f565b815167ffffffffffffffff811115611f6c57611f6c6118c9565b611f8081611f7a8454611e7d565b84611f0a565b602080601f831160018114611fb55760008415611f9d5750858301515b600019600386901b1c1916600185901b1785556107a4565b600085815260208120601f198616915b82811015611fe457888601518255948401946001909101908401611fc5565b50858210156120025787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b818103818111156103b9576103b9611eb1565b86815260a060208201528460a0820152848660c0830137600060c08683010152600060c0601f19601f8801168301019050846040830152836060830152826080830152979650505050505050565b67ffffffffffffffff83111561208b5761208b6118c9565b61209f836120998354611e7d565b83611f0a565b6000601f8411600181146120d357600085156120bb5750838201355b600019600387901b1c1916600186901b178355611053565b600083815260209020601f19861690835b8281101561210457868501358255602094850194600190920191016120e4565b50868210156121215760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008261215057634e487b7160e01b600052601260045260246000fd5b500490565b6040815260006121686040830185611b96565b828103602084015261217a8185611b96565b95945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526121bb60a08301846117d0565b979650505050505050565b6000602082840312156121d857600080fd5b81516117b08161177d565b60006001600160a01b03808816835280871660208401525060a0604083015261220f60a0830186611b96565b82810360608401526122218186611b96565b9050828103608084015261223581856117d0565b9897505050505050505056fea164736f6c6343000817000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000062817523f3b94182b9df911a8071764f998f11a4000000000000000000000000a61a4dad4d3471bfcc91469342589c83ba5727cb
-----Decoded View---------------
Arg [0] : initialOwner (address): 0x62817523F3B94182B9DF911a8071764F998f11a4
Arg [1] : protocolFeeReceiver (address): 0xa61a4DaD4D3471BfCC91469342589c83Ba5727CB
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000062817523f3b94182b9df911a8071764f998f11a4
Arg [1] : 000000000000000000000000a61a4dad4d3471bfcc91469342589c83ba5727cb
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.