Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save M4cs/b990c51d18f7ae1c397a663aa5f740bc to your computer and use it in GitHub Desktop.
Save M4cs/b990c51d18f7ae1c397a663aa5f740bc to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
/**
* @dev ERC721 token with storage based token URI management.
*/
abstract contract ERC721URIStorage is ERC721 {
using Strings for uint256;
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = _baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(base, _tokenURI));
}
return super.tokenURI(tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual override {
super._burn(tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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 substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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 addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract.
For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required).
Scripts have full access to the web3.js and ethers.js libraries.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
// this line is added to create a gist. Empty file is not allowed.
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "_baseURI",
"type": "string"
},
{
"internalType": "uint256",
"name": "_costToName",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_maxTokens",
"type": "uint256"
},
{
"internalType": "address",
"name": "_masterAdmin",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "_tokenIds",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "costToName",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "masterAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxTokens",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxTokensPerMint",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string[]",
"name": "names",
"type": "string[]"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mintShart",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "price",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "removeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"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": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenOfOwnerByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "tokenURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "tokensOwned",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokensOwned",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_maxTokens",
"type": "uint256"
}
],
"name": "updateMaxTokens",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "newURI",
"type": "string"
}
],
"name": "updateURI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"approve(address,uint256)": {
"details": "See {IERC721-approve}."
},
"balanceOf(address)": {
"details": "See {IERC721-balanceOf}."
},
"getApproved(uint256)": {
"details": "See {IERC721-getApproved}."
},
"isApprovedForAll(address,address)": {
"details": "See {IERC721-isApprovedForAll}."
},
"name()": {
"details": "See {IERC721Metadata-name}."
},
"ownerOf(uint256)": {
"details": "See {IERC721-ownerOf}."
},
"safeTransferFrom(address,address,uint256)": {
"details": "See {IERC721-safeTransferFrom}."
},
"safeTransferFrom(address,address,uint256,bytes)": {
"details": "See {IERC721-safeTransferFrom}."
},
"setApprovalForAll(address,bool)": {
"details": "See {IERC721-setApprovalForAll}."
},
"symbol()": {
"details": "See {IERC721Metadata-symbol}."
},
"tokenByIndex(uint256)": {
"details": "See {IERC721Enumerable-tokenByIndex}."
},
"tokenOfOwnerByIndex(address,uint256)": {
"details": "See {IERC721Enumerable-tokenOfOwnerByIndex}."
},
"totalSupply()": {
"details": "See {IERC721Enumerable-totalSupply}."
},
"transferFrom(address,address,uint256)": {
"details": "See {IERC721-transferFrom}."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/LittleShartCollectible.sol": "LittleShartCollectible"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"@openzeppelin/contracts/token/ERC20/ERC20.sol": {
"keccak256": "0xb03df8481a954604ad0c9125680893b2e3f7ff770fe470e38b89ac61b84e8072",
"license": "MIT",
"urls": [
"bzz-raw://b34655953d18ba3a45b762fb6bdbb6549af69a27435e10ece178742bf70baf45",
"dweb:/ipfs/QmcqjUoFLLMyx7dbwSHUnDBH6aphkVHXWQvQRRev5EAWEh"
]
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a",
"license": "MIT",
"urls": [
"bzz-raw://087318b21c528119f649899f5b5580566dd8d7b0303d4904bd0e8580c3545f14",
"dweb:/ipfs/Qmbn5Mj7aUn8hJuQ8VrQjjEXRsXyJKykgnjR9p4C3nfLtL"
]
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"keccak256": "0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2",
"license": "MIT",
"urls": [
"bzz-raw://d4c3df1a7ca104b633a7d81c6c6f5192367d150cd5a32cba81f7f27012729013",
"dweb:/ipfs/QmSim72e3ZVsfgZt8UceCvbiSuMRHR6WDsiamqNzZahGSY"
]
},
"@openzeppelin/contracts/token/ERC721/ERC721.sol": {
"keccak256": "0x7d2b8ba4b256bfcac347991b75242f9bc37f499c5236af50cf09d0b35943dc0c",
"license": "MIT",
"urls": [
"bzz-raw://d8eeaf6afe00229af4c232ca058bb08b7a24cc3886f0b387159ac49ffd8b5312",
"dweb:/ipfs/QmdnVKmDDWDvdRr6vtrxy3G6WafqA2TAhUZv1UFMsm4B4r"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"keccak256": "0xf101e8720213560fab41104d53b3cc7ba0456ef3a98455aa7f022391783144a0",
"license": "MIT",
"urls": [
"bzz-raw://3e7820bcf567e6892d937c3cb10db263a4042e446799bca602535868d822384e",
"dweb:/ipfs/QmPG2oeDjKncqsEeyYGjAN7CwAJmMgHterXGGnpzhha4z7"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"keccak256": "0xd9517254724276e2e8de3769183c1f738f445f0095c26fd9b86d3c6687e887b9",
"license": "MIT",
"urls": [
"bzz-raw://0e604bcdcd5e5b2fb299ad09769cde6db19d5aa1929d1b5e939234a0f10d7eb8",
"dweb:/ipfs/Qmd8hXE3GZfBHuWx3RNiYgFW2ci7KvHtib8DiwzJ2dgo9V"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": {
"keccak256": "0x41dc7bf7f69c668eb98aa078c5140a4d3c3b097124ee4b6058a649ca99688300",
"license": "MIT",
"urls": [
"bzz-raw://621b0e2f8b95aa04707f3106f48a8c7cfab2d6fbe2dd8253e70b0b024daee683",
"dweb:/ipfs/QmTptvu7MJ6QcogPJUxkDEkdKm97KGTC28bhsZKu4sex4M"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": {
"keccak256": "0x188d038a65a945481cc13fe30db334472dfbed61f7959d4478d05feb6303b1ea",
"license": "MIT",
"urls": [
"bzz-raw://7aec4efa22389811ffa393463569410bbca1ecaa551bc94d69020bc9567e9277",
"dweb:/ipfs/QmPwk5uVSHPQkepebrZSQ9xqgXdPABKqHwJZ2HkzNByLRE"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": {
"keccak256": "0xa69205e5009601cf13be78b1e2f500e1e3b1d8012f22d966e63975273f602038",
"license": "MIT",
"urls": [
"bzz-raw://d919a0061e43f9878f6171b7f853cb92093805cd1160858c1884195a639b40a0",
"dweb:/ipfs/QmRZsS3EYuLp75nBym1QQ4y6aQXGew75wSbv1uwqkvouUK"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
"keccak256": "0xd32fb7f530a914b1083d10a6bed3a586f2451952fec04fe542bcc670a82f7ba5",
"license": "MIT",
"urls": [
"bzz-raw://af63ab940a34687c45f0ad84960b048fc5f49330c92ccb422db7822a444733b9",
"dweb:/ipfs/QmUShaQEu8HS1GjDnsMJQ8jkZEBrecn6NuDZ3pfjY1gVck"
]
},
"@openzeppelin/contracts/utils/Address.sol": {
"keccak256": "0x3336baae5cf23e94274d75336e2d412193be508504aee185e61dc7d58cd05c8a",
"license": "MIT",
"urls": [
"bzz-raw://39a05eec7083dfa0cc7e0cbfe6cd1bd085a340af1ede93fdff3ad047c5fb3d8e",
"dweb:/ipfs/QmVApz5fCUq2QC8gKTsNNdCmcedJ3ETHp68zR5N3WUKS4r"
]
},
"@openzeppelin/contracts/utils/Context.sol": {
"keccak256": "0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f",
"license": "MIT",
"urls": [
"bzz-raw://26e8b38a7ac8e7b4463af00cf7fff1bf48ae9875765bf4f7751e100124d0bc8c",
"dweb:/ipfs/QmWcsmkVr24xmmjfnBQZoemFniXjj3vwT78Cz6uqZW1Hux"
]
},
"@openzeppelin/contracts/utils/Strings.sol": {
"keccak256": "0x391d3ba97ab6856a16b225d6ee29617ad15ff00db70f3b4df1ab5ea33aa47c9d",
"license": "MIT",
"urls": [
"bzz-raw://d636ba90bbbeed04a1ea7fe9ec2466757e30fd38ba2ca173636dbf69a518735e",
"dweb:/ipfs/QmQwCB2BHnEuYR22PYt9HkpbgeFDhq4rHmaYqAZbX3WRC7"
]
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"keccak256": "0x5718c5df9bd67ac68a796961df938821bb5dc0cd4c6118d77e9145afb187409b",
"license": "MIT",
"urls": [
"bzz-raw://d10e1d9b26042424789246603906ad06143bf9a928f4e99de8b5e3bdc662f549",
"dweb:/ipfs/Qmejonoaj5MLekPus229rJQHcC6E9dz2xorjHJR84fMfmn"
]
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"keccak256": "0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4",
"license": "MIT",
"urls": [
"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6",
"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx"
]
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"keccak256": "0x8666f020bd8fc9dc14f07e2ebc52b5f236ab4cdde7c77679b08cb2f94730043b",
"license": "MIT",
"urls": [
"bzz-raw://163776cbf565c722232393aa2d62cbe8a2ffb5805986abf4906c00e1e07450a6",
"dweb:/ipfs/QmPZoN9T3cb6o8bGhjBPZcz7im8T8DWhpr3tjLwhJJHx9N"
]
},
"contracts/LittleShartCollectible.sol": {
"keccak256": "0x8cb1c8b8a201e7513c88e981b853430348fec3538cd02762f9441667264776f7",
"license": "UNLICENSED",
"urls": [
"bzz-raw://cc87ccb6a49a4b008733962543dcefafe414ee772e42c06bbd0e57426abb8d4b",
"dweb:/ipfs/QmbPSt91vacfqvsR2M1M91aajgcnkXeZB17X2ZaR2nbrfc"
]
},
"contracts/LittleShartsAdmins.sol": {
"keccak256": "0xd9f2693d2bf92e7bb97f91bdece099821415988db8647fcc10547c62c06195ef",
"license": "UNLICENSED",
"urls": [
"bzz-raw://34f208bf65c79df87590a468d983b845d7c6f12a746c8bbd6e4e77c9def5eb3e",
"dweb:/ipfs/QmYfKqFeFr92n7aJTGnKJH7NE4ZLA3bh9zNL6CCK5FEkqz"
]
}
},
"version": 1
}
// this line is added to create a gist. Empty file is not allowed.
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_nftAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_tokenAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "_listingFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "_tokensForSale",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "cancelListing",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "createBid",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "createListing",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "getFeeTreasuryAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTreasuryAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "masterAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "removeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/LittleShartMarketplace.sol": "LittleShartMarketplace"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"@openzeppelin/contracts/token/ERC20/ERC20.sol": {
"keccak256": "0xb03df8481a954604ad0c9125680893b2e3f7ff770fe470e38b89ac61b84e8072",
"license": "MIT",
"urls": [
"bzz-raw://b34655953d18ba3a45b762fb6bdbb6549af69a27435e10ece178742bf70baf45",
"dweb:/ipfs/QmcqjUoFLLMyx7dbwSHUnDBH6aphkVHXWQvQRRev5EAWEh"
]
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a",
"license": "MIT",
"urls": [
"bzz-raw://087318b21c528119f649899f5b5580566dd8d7b0303d4904bd0e8580c3545f14",
"dweb:/ipfs/Qmbn5Mj7aUn8hJuQ8VrQjjEXRsXyJKykgnjR9p4C3nfLtL"
]
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"keccak256": "0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2",
"license": "MIT",
"urls": [
"bzz-raw://d4c3df1a7ca104b633a7d81c6c6f5192367d150cd5a32cba81f7f27012729013",
"dweb:/ipfs/QmSim72e3ZVsfgZt8UceCvbiSuMRHR6WDsiamqNzZahGSY"
]
},
"@openzeppelin/contracts/token/ERC721/ERC721.sol": {
"keccak256": "0x7d2b8ba4b256bfcac347991b75242f9bc37f499c5236af50cf09d0b35943dc0c",
"license": "MIT",
"urls": [
"bzz-raw://d8eeaf6afe00229af4c232ca058bb08b7a24cc3886f0b387159ac49ffd8b5312",
"dweb:/ipfs/QmdnVKmDDWDvdRr6vtrxy3G6WafqA2TAhUZv1UFMsm4B4r"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"keccak256": "0xf101e8720213560fab41104d53b3cc7ba0456ef3a98455aa7f022391783144a0",
"license": "MIT",
"urls": [
"bzz-raw://3e7820bcf567e6892d937c3cb10db263a4042e446799bca602535868d822384e",
"dweb:/ipfs/QmPG2oeDjKncqsEeyYGjAN7CwAJmMgHterXGGnpzhha4z7"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"keccak256": "0xd9517254724276e2e8de3769183c1f738f445f0095c26fd9b86d3c6687e887b9",
"license": "MIT",
"urls": [
"bzz-raw://0e604bcdcd5e5b2fb299ad09769cde6db19d5aa1929d1b5e939234a0f10d7eb8",
"dweb:/ipfs/Qmd8hXE3GZfBHuWx3RNiYgFW2ci7KvHtib8DiwzJ2dgo9V"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
"keccak256": "0xd32fb7f530a914b1083d10a6bed3a586f2451952fec04fe542bcc670a82f7ba5",
"license": "MIT",
"urls": [
"bzz-raw://af63ab940a34687c45f0ad84960b048fc5f49330c92ccb422db7822a444733b9",
"dweb:/ipfs/QmUShaQEu8HS1GjDnsMJQ8jkZEBrecn6NuDZ3pfjY1gVck"
]
},
"@openzeppelin/contracts/utils/Address.sol": {
"keccak256": "0x3336baae5cf23e94274d75336e2d412193be508504aee185e61dc7d58cd05c8a",
"license": "MIT",
"urls": [
"bzz-raw://39a05eec7083dfa0cc7e0cbfe6cd1bd085a340af1ede93fdff3ad047c5fb3d8e",
"dweb:/ipfs/QmVApz5fCUq2QC8gKTsNNdCmcedJ3ETHp68zR5N3WUKS4r"
]
},
"@openzeppelin/contracts/utils/Context.sol": {
"keccak256": "0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f",
"license": "MIT",
"urls": [
"bzz-raw://26e8b38a7ac8e7b4463af00cf7fff1bf48ae9875765bf4f7751e100124d0bc8c",
"dweb:/ipfs/QmWcsmkVr24xmmjfnBQZoemFniXjj3vwT78Cz6uqZW1Hux"
]
},
"@openzeppelin/contracts/utils/Strings.sol": {
"keccak256": "0x391d3ba97ab6856a16b225d6ee29617ad15ff00db70f3b4df1ab5ea33aa47c9d",
"license": "MIT",
"urls": [
"bzz-raw://d636ba90bbbeed04a1ea7fe9ec2466757e30fd38ba2ca173636dbf69a518735e",
"dweb:/ipfs/QmQwCB2BHnEuYR22PYt9HkpbgeFDhq4rHmaYqAZbX3WRC7"
]
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"keccak256": "0x5718c5df9bd67ac68a796961df938821bb5dc0cd4c6118d77e9145afb187409b",
"license": "MIT",
"urls": [
"bzz-raw://d10e1d9b26042424789246603906ad06143bf9a928f4e99de8b5e3bdc662f549",
"dweb:/ipfs/Qmejonoaj5MLekPus229rJQHcC6E9dz2xorjHJR84fMfmn"
]
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"keccak256": "0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4",
"license": "MIT",
"urls": [
"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6",
"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx"
]
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"keccak256": "0x8666f020bd8fc9dc14f07e2ebc52b5f236ab4cdde7c77679b08cb2f94730043b",
"license": "MIT",
"urls": [
"bzz-raw://163776cbf565c722232393aa2d62cbe8a2ffb5805986abf4906c00e1e07450a6",
"dweb:/ipfs/QmPZoN9T3cb6o8bGhjBPZcz7im8T8DWhpr3tjLwhJJHx9N"
]
},
"contracts/LittleShartMarketplace.sol": {
"keccak256": "0x5c7391610ef5fd02373ae13dba879cfe4e804d9b5fe79ad4c277cc4abd7a03d6",
"license": "UNLICENSED",
"urls": [
"bzz-raw://250b5a877872d69666138baa4c10ef3725d349f90ab262eba8a7b44a7f799152",
"dweb:/ipfs/QmQ7MmQPDea1yuLBaBjCtzo7oV4SQfg2JGFWqHabZXeen3"
]
},
"contracts/LittleShartsAdmins.sol": {
"keccak256": "0xd9f2693d2bf92e7bb97f91bdece099821415988db8647fcc10547c62c06195ef",
"license": "UNLICENSED",
"urls": [
"bzz-raw://34f208bf65c79df87590a468d983b845d7c6f12a746c8bbd6e4e77c9def5eb3e",
"dweb:/ipfs/QmYfKqFeFr92n7aJTGnKJH7NE4ZLA3bh9zNL6CCK5FEkqz"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6080604052604051806020016040528060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250600190600161006f929190610082565b5034801561007c57600080fd5b50610129565b8280548282559060005260206000209081019282156100fb579160200282015b828111156100fa5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906100a2565b5b509050610108919061010c565b5090565b5b8082111561012557600081600090555060010161010d565b5090565b6109d6806101386000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632a68f64e146100465780637048027514610064578063ad7bbc2914610080575b600080fd5b61004e61009c565b60405161005b919061068e565b60405180910390f35b61007e60048036038101906100799190610576565b6100c0565b005b61009a600480360381019061009591906105a3565b6101b7565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6100c93361049d565b610108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ff90610709565b60405180910390fd5b6101118161049d565b15610151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014890610729565b60405180910390fd5b6001819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6101c03361049d565b6101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f690610709565b60405180910390fd5b60018080549050610210919061075a565b811115610252576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610249906106e9565b60405180910390fd5b6002600180549050101561029b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610292906106c9565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600182815481106102e6576102e5610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f906106a9565b60405180910390fd5b6001818154811061037c5761037b610871565b5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018080805490506103bb919061075a565b815481106103cc576103cb610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001828154811061040b5761040a610871565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600180548061046557610464610842565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905550565b600080600090505b600180549050811015610541578273ffffffffffffffffffffffffffffffffffffffff16600182815481106104dd576104dc610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561052e576001915050610547565b8080610539906107ca565b9150506104a5565b50600090505b919050565b60008135905061055b81610972565b92915050565b60008135905061057081610989565b92915050565b60006020828403121561058c5761058b6108a0565b5b600061059a8482850161054c565b91505092915050565b6000602082840312156105b9576105b86108a0565b5b60006105c784828501610561565b91505092915050565b6105d98161078e565b82525050565b60006105ec601b83610749565b91506105f7826108a5565b602082019050919050565b600061060f601983610749565b915061061a826108ce565b602082019050919050565b6000610632601783610749565b915061063d826108f7565b602082019050919050565b6000610655601783610749565b915061066082610920565b602082019050919050565b6000610678601c83610749565b915061068382610949565b602082019050919050565b60006020820190506106a360008301846105d0565b92915050565b600060208201905081810360008301526106c2816105df565b9050919050565b600060208201905081810360008301526106e281610602565b9050919050565b6000602082019050818103600083015261070281610625565b9050919050565b6000602082019050818103600083015261072281610648565b9050919050565b600060208201905081810360008301526107428161066b565b9050919050565b600082825260208201905092915050565b6000610765826107c0565b9150610770836107c0565b92508282101561078357610782610813565b5b828203905092915050565b6000610799826107a0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006107d5826107c0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561080857610807610813565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b7f43616e6e6f742072656d6f7665206d61737465722061646d696e210000000000600082015250565b7f43616e6e6f742072656d6f766520616c6c2061646d696e732100000000000000600082015250565b7f496e76616c696420496e646578206f662041646d696e73000000000000000000600082015250565b7f53656e646572206973206e6f7420616e2061646d696e21000000000000000000600082015250565b7f4164647265737320697320616c726561647920616e2061646d696e2100000000600082015250565b61097b8161078e565b811461098657600080fd5b50565b610992816107c0565b811461099d57600080fd5b5056fea2646970667358221220e91b74c186ef0a5b2d8033cf3fd915fc90781109482078da4548ab005870e23d64736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x40 MLOAD DUP1 PUSH1 0x20 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE POP PUSH1 0x1 SWAP1 PUSH1 0x1 PUSH2 0x6F SWAP3 SWAP2 SWAP1 PUSH2 0x82 JUMP JUMPDEST POP CALLVALUE DUP1 ISZERO PUSH2 0x7C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x129 JUMP JUMPDEST DUP3 DUP1 SLOAD DUP3 DUP3 SSTORE SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 DUP2 ADD SWAP3 DUP3 ISZERO PUSH2 0xFB JUMPI SWAP2 PUSH1 0x20 MUL DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0xFA JUMPI DUP3 MLOAD DUP3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0xA2 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x108 SWAP2 SWAP1 PUSH2 0x10C JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x125 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x10D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x9D6 DUP1 PUSH2 0x138 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2A68F64E EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x70480275 EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0xAD7BBC29 EQ PUSH2 0x80 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x68E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x7E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x576 JUMP JUMPDEST PUSH2 0xC0 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x95 SWAP2 SWAP1 PUSH2 0x5A3 JUMP JUMPDEST PUSH2 0x1B7 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0xC9 CALLER PUSH2 0x49D JUMP JUMPDEST PUSH2 0x108 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFF SWAP1 PUSH2 0x709 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x111 DUP2 PUSH2 0x49D JUMP JUMPDEST ISZERO PUSH2 0x151 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x148 SWAP1 PUSH2 0x729 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH2 0x1C0 CALLER PUSH2 0x49D JUMP JUMPDEST PUSH2 0x1FF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1F6 SWAP1 PUSH2 0x709 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP1 DUP1 SLOAD SWAP1 POP PUSH2 0x210 SWAP2 SWAP1 PUSH2 0x75A JUMP JUMPDEST DUP2 GT ISZERO PUSH2 0x252 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x249 SWAP1 PUSH2 0x6E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x1 DUP1 SLOAD SWAP1 POP LT ISZERO PUSH2 0x29B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x292 SWAP1 PUSH2 0x6C9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x2E6 JUMPI PUSH2 0x2E5 PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x368 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x35F SWAP1 PUSH2 0x6A9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP2 DUP2 SLOAD DUP2 LT PUSH2 0x37C JUMPI PUSH2 0x37B PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 DUP1 DUP1 DUP1 SLOAD SWAP1 POP PUSH2 0x3BB SWAP2 SWAP1 PUSH2 0x75A JUMP JUMPDEST DUP2 SLOAD DUP2 LT PUSH2 0x3CC JUMPI PUSH2 0x3CB PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x40B JUMPI PUSH2 0x40A PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 DUP1 SLOAD DUP1 PUSH2 0x465 JUMPI PUSH2 0x464 PUSH2 0x842 JUMP JUMPDEST JUMPDEST PUSH1 0x1 SWAP1 SUB DUP2 DUP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x1 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x541 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x4DD JUMPI PUSH2 0x4DC PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x52E JUMPI PUSH1 0x1 SWAP2 POP POP PUSH2 0x547 JUMP JUMPDEST DUP1 DUP1 PUSH2 0x539 SWAP1 PUSH2 0x7CA JUMP JUMPDEST SWAP2 POP POP PUSH2 0x4A5 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 POP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x55B DUP2 PUSH2 0x972 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x570 DUP2 PUSH2 0x989 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x58C JUMPI PUSH2 0x58B PUSH2 0x8A0 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x59A DUP5 DUP3 DUP6 ADD PUSH2 0x54C JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5B9 JUMPI PUSH2 0x5B8 PUSH2 0x8A0 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x5C7 DUP5 DUP3 DUP6 ADD PUSH2 0x561 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x5D9 DUP2 PUSH2 0x78E JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x5EC PUSH1 0x1B DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x5F7 DUP3 PUSH2 0x8A5 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x60F PUSH1 0x19 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x61A DUP3 PUSH2 0x8CE JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x632 PUSH1 0x17 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x63D DUP3 PUSH2 0x8F7 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x655 PUSH1 0x17 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x660 DUP3 PUSH2 0x920 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x678 PUSH1 0x1C DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x683 DUP3 PUSH2 0x949 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x6A3 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x5D0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x6C2 DUP2 PUSH2 0x5DF JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x6E2 DUP2 PUSH2 0x602 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x702 DUP2 PUSH2 0x625 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x722 DUP2 PUSH2 0x648 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x742 DUP2 PUSH2 0x66B JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x765 DUP3 PUSH2 0x7C0 JUMP JUMPDEST SWAP2 POP PUSH2 0x770 DUP4 PUSH2 0x7C0 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 LT ISZERO PUSH2 0x783 JUMPI PUSH2 0x782 PUSH2 0x813 JUMP JUMPDEST JUMPDEST DUP3 DUP3 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x799 DUP3 PUSH2 0x7A0 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7D5 DUP3 PUSH2 0x7C0 JUMP JUMPDEST SWAP2 POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 EQ ISZERO PUSH2 0x808 JUMPI PUSH2 0x807 PUSH2 0x813 JUMP JUMPDEST JUMPDEST PUSH1 0x1 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x31 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH32 0x43616E6E6F742072656D6F7665206D61737465722061646D696E210000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x43616E6E6F742072656D6F766520616C6C2061646D696E732100000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x496E76616C696420496E646578206F662041646D696E73000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x53656E646572206973206E6F7420616E2061646D696E21000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x4164647265737320697320616C726561647920616E2061646D696E2100000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH2 0x97B DUP2 PUSH2 0x78E JUMP JUMPDEST DUP2 EQ PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x992 DUP2 PUSH2 0x7C0 JUMP JUMPDEST DUP2 EQ PUSH2 0x99D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE9 SHL PUSH21 0xC186EF0A5B2D8033CF3FD915FC90781109482078DA GASLIMIT BASEFEE 0xAB STOP PC PUSH17 0xE23D64736F6C6343000807003300000000 ",
"sourceMap": "64:993:0:-:0;;;130:32;;;;;;;;150:11;;;;;;;;;;130:32;;;;;;;;;;;;;;;:::i;:::-;;64:993;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@_isAdmin_130": {
"entryPoint": 1181,
"id": 130,
"parameterSlots": 1,
"returnSlots": 1
},
"@addAdmin_42": {
"entryPoint": 192,
"id": 42,
"parameterSlots": 1,
"returnSlots": 0
},
"@masterAdmin_3": {
"entryPoint": 156,
"id": 3,
"parameterSlots": 0,
"returnSlots": 0
},
"@removeAdmin_98": {
"entryPoint": 439,
"id": 98,
"parameterSlots": 1,
"returnSlots": 0
},
"abi_decode_t_address": {
"entryPoint": 1356,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_t_uint256": {
"entryPoint": 1377,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_address": {
"entryPoint": 1398,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_uint256": {
"entryPoint": 1443,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_address_to_t_address_fromStack": {
"entryPoint": 1488,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9_to_t_string_memory_ptr_fromStack": {
"entryPoint": 1503,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b_to_t_string_memory_ptr_fromStack": {
"entryPoint": 1538,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782_to_t_string_memory_ptr_fromStack": {
"entryPoint": 1573,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae_to_t_string_memory_ptr_fromStack": {
"entryPoint": 1608,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d_to_t_string_memory_ptr_fromStack": {
"entryPoint": 1643,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_address__to_t_address__fromStack_reversed": {
"entryPoint": 1678,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": 1705,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": 1737,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": 1769,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": 1801,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"abi_encode_tuple_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d__to_t_string_memory_ptr__fromStack_reversed": {
"entryPoint": 1833,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"array_storeLengthForEncoding_t_string_memory_ptr_fromStack": {
"entryPoint": 1865,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"checked_sub_t_uint256": {
"entryPoint": 1882,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"cleanup_t_address": {
"entryPoint": 1934,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_uint160": {
"entryPoint": 1952,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 1984,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"increment_t_uint256": {
"entryPoint": 1994,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x11": {
"entryPoint": 2067,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"panic_error_0x31": {
"entryPoint": 2114,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"panic_error_0x32": {
"entryPoint": 2161,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 2208,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"store_literal_in_memory_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9": {
"entryPoint": 2213,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"store_literal_in_memory_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b": {
"entryPoint": 2254,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"store_literal_in_memory_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782": {
"entryPoint": 2295,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"store_literal_in_memory_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae": {
"entryPoint": 2336,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"store_literal_in_memory_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d": {
"entryPoint": 2377,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"validator_revert_t_address": {
"entryPoint": 2418,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"validator_revert_t_uint256": {
"entryPoint": 2441,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:8276:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "59:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "69:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "91:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "78:12:1"
},
"nodeType": "YulFunctionCall",
"src": "78:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "69:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "134:5:1"
}
],
"functionName": {
"name": "validator_revert_t_address",
"nodeType": "YulIdentifier",
"src": "107:26:1"
},
"nodeType": "YulFunctionCall",
"src": "107:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "107:33:1"
}
]
},
"name": "abi_decode_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "37:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "45:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:1",
"type": ""
}
],
"src": "7:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "204:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "214:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "236:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "223:12:1"
},
"nodeType": "YulFunctionCall",
"src": "223:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "214:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "279:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "252:26:1"
},
"nodeType": "YulFunctionCall",
"src": "252:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "252:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "182:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "190:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "198:5:1",
"type": ""
}
],
"src": "152:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "363:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "409:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "411:77:1"
},
"nodeType": "YulFunctionCall",
"src": "411:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "411:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "384:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "393:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "380:3:1"
},
"nodeType": "YulFunctionCall",
"src": "380:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "405:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "376:3:1"
},
"nodeType": "YulFunctionCall",
"src": "376:32:1"
},
"nodeType": "YulIf",
"src": "373:119:1"
},
{
"nodeType": "YulBlock",
"src": "502:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "517:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "531:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "521:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "546:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "581:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "592:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "577:3:1"
},
"nodeType": "YulFunctionCall",
"src": "577:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "601:7:1"
}
],
"functionName": {
"name": "abi_decode_t_address",
"nodeType": "YulIdentifier",
"src": "556:20:1"
},
"nodeType": "YulFunctionCall",
"src": "556:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "546:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "333:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "344:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "356:6:1",
"type": ""
}
],
"src": "297:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "698:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "744:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "746:77:1"
},
"nodeType": "YulFunctionCall",
"src": "746:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "746:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "719:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "728:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "715:3:1"
},
"nodeType": "YulFunctionCall",
"src": "715:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "740:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "711:3:1"
},
"nodeType": "YulFunctionCall",
"src": "711:32:1"
},
"nodeType": "YulIf",
"src": "708:119:1"
},
{
"nodeType": "YulBlock",
"src": "837:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "852:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "866:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "856:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "881:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "916:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "927:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "912:3:1"
},
"nodeType": "YulFunctionCall",
"src": "912:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "936:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "891:20:1"
},
"nodeType": "YulFunctionCall",
"src": "891:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "881:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "668:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "679:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "691:6:1",
"type": ""
}
],
"src": "632:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1032:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1049:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1072:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "1054:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1054:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1042:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1042:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "1042:37:1"
}
]
},
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1020:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1027:3:1",
"type": ""
}
],
"src": "967:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1237:220:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1247:74:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1313:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1318:2:1",
"type": "",
"value": "27"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "1254:58:1"
},
"nodeType": "YulFunctionCall",
"src": "1254:67:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1247:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1419:3:1"
}
],
"functionName": {
"name": "store_literal_in_memory_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9",
"nodeType": "YulIdentifier",
"src": "1330:88:1"
},
"nodeType": "YulFunctionCall",
"src": "1330:93:1"
},
"nodeType": "YulExpressionStatement",
"src": "1330:93:1"
},
{
"nodeType": "YulAssignment",
"src": "1432:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1443:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1448:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1439:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1439:12:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "1432:3:1"
}
]
}
]
},
"name": "abi_encode_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1225:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "1233:3:1",
"type": ""
}
],
"src": "1091:366:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1609:220:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1619:74:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1685:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1690:2:1",
"type": "",
"value": "25"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "1626:58:1"
},
"nodeType": "YulFunctionCall",
"src": "1626:67:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1619:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1791:3:1"
}
],
"functionName": {
"name": "store_literal_in_memory_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b",
"nodeType": "YulIdentifier",
"src": "1702:88:1"
},
"nodeType": "YulFunctionCall",
"src": "1702:93:1"
},
"nodeType": "YulExpressionStatement",
"src": "1702:93:1"
},
{
"nodeType": "YulAssignment",
"src": "1804:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1815:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1820:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1811:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1811:12:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "1804:3:1"
}
]
}
]
},
"name": "abi_encode_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1597:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "1605:3:1",
"type": ""
}
],
"src": "1463:366:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1981:220:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1991:74:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2057:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2062:2:1",
"type": "",
"value": "23"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "1998:58:1"
},
"nodeType": "YulFunctionCall",
"src": "1998:67:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1991:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2163:3:1"
}
],
"functionName": {
"name": "store_literal_in_memory_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782",
"nodeType": "YulIdentifier",
"src": "2074:88:1"
},
"nodeType": "YulFunctionCall",
"src": "2074:93:1"
},
"nodeType": "YulExpressionStatement",
"src": "2074:93:1"
},
{
"nodeType": "YulAssignment",
"src": "2176:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2187:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2192:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2183:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2183:12:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "2176:3:1"
}
]
}
]
},
"name": "abi_encode_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1969:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "1977:3:1",
"type": ""
}
],
"src": "1835:366:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2353:220:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2363:74:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2429:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2434:2:1",
"type": "",
"value": "23"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "2370:58:1"
},
"nodeType": "YulFunctionCall",
"src": "2370:67:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2363:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2535:3:1"
}
],
"functionName": {
"name": "store_literal_in_memory_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae",
"nodeType": "YulIdentifier",
"src": "2446:88:1"
},
"nodeType": "YulFunctionCall",
"src": "2446:93:1"
},
"nodeType": "YulExpressionStatement",
"src": "2446:93:1"
},
{
"nodeType": "YulAssignment",
"src": "2548:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2559:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2564:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2555:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2555:12:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "2548:3:1"
}
]
}
]
},
"name": "abi_encode_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "2341:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "2349:3:1",
"type": ""
}
],
"src": "2207:366:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2725:220:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2735:74:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2801:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2806:2:1",
"type": "",
"value": "28"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "2742:58:1"
},
"nodeType": "YulFunctionCall",
"src": "2742:67:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2735:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2907:3:1"
}
],
"functionName": {
"name": "store_literal_in_memory_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d",
"nodeType": "YulIdentifier",
"src": "2818:88:1"
},
"nodeType": "YulFunctionCall",
"src": "2818:93:1"
},
"nodeType": "YulExpressionStatement",
"src": "2818:93:1"
},
{
"nodeType": "YulAssignment",
"src": "2920:19:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "2931:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2936:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2927:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2927:12:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "2920:3:1"
}
]
}
]
},
"name": "abi_encode_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "2713:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "2721:3:1",
"type": ""
}
],
"src": "2579:366:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3049:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3059:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3071:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3082:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3067:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3067:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3059:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "3139:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3152:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3163:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3148:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3148:17:1"
}
],
"functionName": {
"name": "abi_encode_t_address_to_t_address_fromStack",
"nodeType": "YulIdentifier",
"src": "3095:43:1"
},
"nodeType": "YulFunctionCall",
"src": "3095:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "3095:71:1"
}
]
},
"name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "3021:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "3033:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "3044:4:1",
"type": ""
}
],
"src": "2951:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3350:248:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3360:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3372:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3383:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3368:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3368:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3360:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3407:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3418:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3403:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3403:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3426:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3432:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "3422:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3422:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3396:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3396:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "3396:47:1"
},
{
"nodeType": "YulAssignment",
"src": "3452:139:1",
"value": {
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3586:4:1"
}
],
"functionName": {
"name": "abi_encode_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "3460:124:1"
},
"nodeType": "YulFunctionCall",
"src": "3460:131:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3452:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "3330:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "3345:4:1",
"type": ""
}
],
"src": "3179:419:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3775:248:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "3785:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3797:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3808:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3793:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3793:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3785:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3832:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3843:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "3828:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3828:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3851:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "3857:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "3847:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3847:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "3821:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3821:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "3821:47:1"
},
{
"nodeType": "YulAssignment",
"src": "3877:139:1",
"value": {
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4011:4:1"
}
],
"functionName": {
"name": "abi_encode_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "3885:124:1"
},
"nodeType": "YulFunctionCall",
"src": "3885:131:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "3877:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "3755:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "3770:4:1",
"type": ""
}
],
"src": "3604:419:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4200:248:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "4210:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4222:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4233:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4218:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4218:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4210:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4257:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4268:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4253:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4253:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4276:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4282:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "4272:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4272:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4246:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4246:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "4246:47:1"
},
{
"nodeType": "YulAssignment",
"src": "4302:139:1",
"value": {
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4436:4:1"
}
],
"functionName": {
"name": "abi_encode_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "4310:124:1"
},
"nodeType": "YulFunctionCall",
"src": "4310:131:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4302:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "4180:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "4195:4:1",
"type": ""
}
],
"src": "4029:419:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "4625:248:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "4635:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4647:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4658:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4643:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4643:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4635:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4682:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "4693:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "4678:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4678:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4701:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "4707:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "4697:3:1"
},
"nodeType": "YulFunctionCall",
"src": "4697:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "4671:6:1"
},
"nodeType": "YulFunctionCall",
"src": "4671:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "4671:47:1"
},
{
"nodeType": "YulAssignment",
"src": "4727:139:1",
"value": {
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4861:4:1"
}
],
"functionName": {
"name": "abi_encode_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "4735:124:1"
},
"nodeType": "YulFunctionCall",
"src": "4735:131:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "4727:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "4605:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "4620:4:1",
"type": ""
}
],
"src": "4454:419:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5050:248:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "5060:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "5072:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5083:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "5068:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5068:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "5060:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "5107:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5118:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "5103:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5103:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "5126:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "5132:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "5122:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5122:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "5096:6:1"
},
"nodeType": "YulFunctionCall",
"src": "5096:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "5096:47:1"
},
{
"nodeType": "YulAssignment",
"src": "5152:139:1",
"value": {
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "5286:4:1"
}
],
"functionName": {
"name": "abi_encode_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "5160:124:1"
},
"nodeType": "YulFunctionCall",
"src": "5160:131:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "5152:4:1"
}
]
}
]
},
"name": "abi_encode_tuple_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d__to_t_string_memory_ptr__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "5030:9:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "5045:4:1",
"type": ""
}
],
"src": "4879:419:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5344:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "5354:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5370:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "5364:5:1"
},
"nodeType": "YulFunctionCall",
"src": "5364:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "5354:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "5337:6:1",
"type": ""
}
],
"src": "5304:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5481:73:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "5498:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "5503:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "5491:6:1"
},
"nodeType": "YulFunctionCall",
"src": "5491:19:1"
},
"nodeType": "YulExpressionStatement",
"src": "5491:19:1"
},
{
"nodeType": "YulAssignment",
"src": "5519:29:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "5538:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5543:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "5534:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5534:14:1"
},
"variableNames": [
{
"name": "updated_pos",
"nodeType": "YulIdentifier",
"src": "5519:11:1"
}
]
}
]
},
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "5453:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "5458:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "updated_pos",
"nodeType": "YulTypedName",
"src": "5469:11:1",
"type": ""
}
],
"src": "5385:169:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5605:146:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "5615:25:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "5638:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "5620:17:1"
},
"nodeType": "YulFunctionCall",
"src": "5620:20:1"
},
"variableNames": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "5615:1:1"
}
]
},
{
"nodeType": "YulAssignment",
"src": "5649:25:1",
"value": {
"arguments": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "5672:1:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "5654:17:1"
},
"nodeType": "YulFunctionCall",
"src": "5654:20:1"
},
"variableNames": [
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "5649:1:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "5696:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "5698:16:1"
},
"nodeType": "YulFunctionCall",
"src": "5698:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "5698:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "5690:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "5693:1:1"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "5687:2:1"
},
"nodeType": "YulFunctionCall",
"src": "5687:8:1"
},
"nodeType": "YulIf",
"src": "5684:34:1"
},
{
"nodeType": "YulAssignment",
"src": "5728:17:1",
"value": {
"arguments": [
{
"name": "x",
"nodeType": "YulIdentifier",
"src": "5740:1:1"
},
{
"name": "y",
"nodeType": "YulIdentifier",
"src": "5743:1:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "5736:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5736:9:1"
},
"variableNames": [
{
"name": "diff",
"nodeType": "YulIdentifier",
"src": "5728:4:1"
}
]
}
]
},
"name": "checked_sub_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "x",
"nodeType": "YulTypedName",
"src": "5591:1:1",
"type": ""
},
{
"name": "y",
"nodeType": "YulTypedName",
"src": "5594:1:1",
"type": ""
}
],
"returnVariables": [
{
"name": "diff",
"nodeType": "YulTypedName",
"src": "5600:4:1",
"type": ""
}
],
"src": "5560:191:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5802:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "5812:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "5841:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "5823:17:1"
},
"nodeType": "YulFunctionCall",
"src": "5823:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "5812:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "5784:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "5794:7:1",
"type": ""
}
],
"src": "5757:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "5904:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "5914:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "5929:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "5936:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "5925:3:1"
},
"nodeType": "YulFunctionCall",
"src": "5925:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "5914:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "5886:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "5896:7:1",
"type": ""
}
],
"src": "5859:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6036:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "6046:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "6057:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "6046:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "6018:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "6028:7:1",
"type": ""
}
],
"src": "5991:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6117:190:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "6127:33:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "6154:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "6136:17:1"
},
"nodeType": "YulFunctionCall",
"src": "6136:24:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "6127:5:1"
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "6250:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x11",
"nodeType": "YulIdentifier",
"src": "6252:16:1"
},
"nodeType": "YulFunctionCall",
"src": "6252:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "6252:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "6175:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6182:66:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "6172:2:1"
},
"nodeType": "YulFunctionCall",
"src": "6172:77:1"
},
"nodeType": "YulIf",
"src": "6169:103:1"
},
{
"nodeType": "YulAssignment",
"src": "6281:20:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "6292:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6299:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "6288:3:1"
},
"nodeType": "YulFunctionCall",
"src": "6288:13:1"
},
"variableNames": [
{
"name": "ret",
"nodeType": "YulIdentifier",
"src": "6281:3:1"
}
]
}
]
},
"name": "increment_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "6103:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "ret",
"nodeType": "YulTypedName",
"src": "6113:3:1",
"type": ""
}
],
"src": "6074:233:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6341:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6358:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6361:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6351:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6351:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "6351:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6455:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6458:4:1",
"type": "",
"value": "0x11"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6448:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6448:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6448:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6479:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6482:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "6472:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6472:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6472:15:1"
}
]
},
"name": "panic_error_0x11",
"nodeType": "YulFunctionDefinition",
"src": "6313:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6527:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6544:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6547:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6537:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6537:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "6537:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6641:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6644:4:1",
"type": "",
"value": "0x31"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6634:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6634:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6634:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6665:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6668:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "6658:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6658:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6658:15:1"
}
]
},
"name": "panic_error_0x31",
"nodeType": "YulFunctionDefinition",
"src": "6499:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6713:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6730:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6733:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6723:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6723:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "6723:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6827:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6830:4:1",
"type": "",
"value": "0x32"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "6820:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6820:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6820:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6851:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6854:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "6844:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6844:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "6844:15:1"
}
]
},
"name": "panic_error_0x32",
"nodeType": "YulFunctionDefinition",
"src": "6685:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "6960:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6977:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "6980:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "6970:6:1"
},
"nodeType": "YulFunctionCall",
"src": "6970:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "6970:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "6871:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7083:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7100:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7103:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "7093:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7093:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "7093:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "6994:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7223:71:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "7245:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7253:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "7241:3:1"
},
"nodeType": "YulFunctionCall",
"src": "7241:14:1"
},
{
"hexValue": "43616e6e6f742072656d6f7665206d61737465722061646d696e21",
"kind": "string",
"nodeType": "YulLiteral",
"src": "7257:29:1",
"type": "",
"value": "Cannot remove master admin!"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "7234:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7234:53:1"
},
"nodeType": "YulExpressionStatement",
"src": "7234:53:1"
}
]
},
"name": "store_literal_in_memory_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "7215:6:1",
"type": ""
}
],
"src": "7117:177:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7406:69:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "7428:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7436:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "7424:3:1"
},
"nodeType": "YulFunctionCall",
"src": "7424:14:1"
},
{
"hexValue": "43616e6e6f742072656d6f766520616c6c2061646d696e7321",
"kind": "string",
"nodeType": "YulLiteral",
"src": "7440:27:1",
"type": "",
"value": "Cannot remove all admins!"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "7417:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7417:51:1"
},
"nodeType": "YulExpressionStatement",
"src": "7417:51:1"
}
]
},
"name": "store_literal_in_memory_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "7398:6:1",
"type": ""
}
],
"src": "7300:175:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7587:67:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "7609:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7617:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "7605:3:1"
},
"nodeType": "YulFunctionCall",
"src": "7605:14:1"
},
{
"hexValue": "496e76616c696420496e646578206f662041646d696e73",
"kind": "string",
"nodeType": "YulLiteral",
"src": "7621:25:1",
"type": "",
"value": "Invalid Index of Admins"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "7598:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7598:49:1"
},
"nodeType": "YulExpressionStatement",
"src": "7598:49:1"
}
]
},
"name": "store_literal_in_memory_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "7579:6:1",
"type": ""
}
],
"src": "7481:173:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7766:67:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "7788:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7796:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "7784:3:1"
},
"nodeType": "YulFunctionCall",
"src": "7784:14:1"
},
{
"hexValue": "53656e646572206973206e6f7420616e2061646d696e21",
"kind": "string",
"nodeType": "YulLiteral",
"src": "7800:25:1",
"type": "",
"value": "Sender is not an admin!"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "7777:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7777:49:1"
},
"nodeType": "YulExpressionStatement",
"src": "7777:49:1"
}
]
},
"name": "store_literal_in_memory_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "7758:6:1",
"type": ""
}
],
"src": "7660:173:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "7945:72:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "7967:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "7975:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "7963:3:1"
},
"nodeType": "YulFunctionCall",
"src": "7963:14:1"
},
{
"hexValue": "4164647265737320697320616c726561647920616e2061646d696e21",
"kind": "string",
"nodeType": "YulLiteral",
"src": "7979:30:1",
"type": "",
"value": "Address is already an admin!"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "7956:6:1"
},
"nodeType": "YulFunctionCall",
"src": "7956:54:1"
},
"nodeType": "YulExpressionStatement",
"src": "7956:54:1"
}
]
},
"name": "store_literal_in_memory_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "7937:6:1",
"type": ""
}
],
"src": "7839:178:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "8066:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "8123:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "8132:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "8135:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "8125:6:1"
},
"nodeType": "YulFunctionCall",
"src": "8125:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "8125:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "8089:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "8114:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "8096:17:1"
},
"nodeType": "YulFunctionCall",
"src": "8096:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "8086:2:1"
},
"nodeType": "YulFunctionCall",
"src": "8086:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "8079:6:1"
},
"nodeType": "YulFunctionCall",
"src": "8079:43:1"
},
"nodeType": "YulIf",
"src": "8076:63:1"
}
]
},
"name": "validator_revert_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "8059:5:1",
"type": ""
}
],
"src": "8023:122:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "8194:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "8251:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "8260:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "8263:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "8253:6:1"
},
"nodeType": "YulFunctionCall",
"src": "8253:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "8253:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "8217:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "8242:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "8224:17:1"
},
"nodeType": "YulFunctionCall",
"src": "8224:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "8214:2:1"
},
"nodeType": "YulFunctionCall",
"src": "8214:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "8207:6:1"
},
"nodeType": "YulFunctionCall",
"src": "8207:43:1"
},
"nodeType": "YulIf",
"src": "8204:63:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "8187:5:1",
"type": ""
}
],
"src": "8151:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 27)\n store_literal_in_memory_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 25)\n store_literal_in_memory_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 23)\n store_literal_in_memory_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 23)\n store_literal_in_memory_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d_to_t_string_memory_ptr_fromStack(pos) -> end {\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, 28)\n store_literal_in_memory_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d(pos)\n end := add(pos, 32)\n }\n\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_encode_tuple_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function abi_encode_tuple_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d__to_t_string_memory_ptr__fromStack_reversed(headStart ) -> tail {\n tail := add(headStart, 32)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_stringliteral_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d_to_t_string_memory_ptr_fromStack( tail)\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function checked_sub_t_uint256(x, y) -> diff {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n if lt(x, y) { panic_error_0x11() }\n\n diff := sub(x, y)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function increment_t_uint256(value) -> ret {\n value := cleanup_t_uint256(value)\n if eq(value, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) { panic_error_0x11() }\n ret := add(value, 1)\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function panic_error_0x31() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x31)\n revert(0, 0x24)\n }\n\n function panic_error_0x32() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x32)\n revert(0, 0x24)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function store_literal_in_memory_4f3fde84b593cf4d2e7c1ff6682aad2d7901997ff5718cad99c53c0dc6e38cf9(memPtr) {\n\n mstore(add(memPtr, 0), \"Cannot remove master admin!\")\n\n }\n\n function store_literal_in_memory_5a48d49e45832919ed018400b907ba8bab6940d01bde2f41a67d221897289c8b(memPtr) {\n\n mstore(add(memPtr, 0), \"Cannot remove all admins!\")\n\n }\n\n function store_literal_in_memory_9934508bf0398d273e6d32eb5246a0f39229c43b5f3ec798b8222200e7fa5782(memPtr) {\n\n mstore(add(memPtr, 0), \"Invalid Index of Admins\")\n\n }\n\n function store_literal_in_memory_9ef1655a1def19f38e4f9856d99edc0768cb748dffbcd53ceca38137c058e4ae(memPtr) {\n\n mstore(add(memPtr, 0), \"Sender is not an admin!\")\n\n }\n\n function store_literal_in_memory_ab797ef5c4de572cc05802336c806dc6ef50eb59192c1b56fd62cc8601cc0e9d(memPtr) {\n\n mstore(add(memPtr, 0), \"Address is already an admin!\")\n\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100415760003560e01c80632a68f64e146100465780637048027514610064578063ad7bbc2914610080575b600080fd5b61004e61009c565b60405161005b919061068e565b60405180910390f35b61007e60048036038101906100799190610576565b6100c0565b005b61009a600480360381019061009591906105a3565b6101b7565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6100c93361049d565b610108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100ff90610709565b60405180910390fd5b6101118161049d565b15610151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014890610729565b60405180910390fd5b6001819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6101c03361049d565b6101ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f690610709565b60405180910390fd5b60018080549050610210919061075a565b811115610252576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610249906106e9565b60405180910390fd5b6002600180549050101561029b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610292906106c9565b60405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600182815481106102e6576102e5610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f906106a9565b60405180910390fd5b6001818154811061037c5761037b610871565b5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018080805490506103bb919061075a565b815481106103cc576103cb610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001828154811061040b5761040a610871565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600180548061046557610464610842565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905550565b600080600090505b600180549050811015610541578273ffffffffffffffffffffffffffffffffffffffff16600182815481106104dd576104dc610871565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561052e576001915050610547565b8080610539906107ca565b9150506104a5565b50600090505b919050565b60008135905061055b81610972565b92915050565b60008135905061057081610989565b92915050565b60006020828403121561058c5761058b6108a0565b5b600061059a8482850161054c565b91505092915050565b6000602082840312156105b9576105b86108a0565b5b60006105c784828501610561565b91505092915050565b6105d98161078e565b82525050565b60006105ec601b83610749565b91506105f7826108a5565b602082019050919050565b600061060f601983610749565b915061061a826108ce565b602082019050919050565b6000610632601783610749565b915061063d826108f7565b602082019050919050565b6000610655601783610749565b915061066082610920565b602082019050919050565b6000610678601c83610749565b915061068382610949565b602082019050919050565b60006020820190506106a360008301846105d0565b92915050565b600060208201905081810360008301526106c2816105df565b9050919050565b600060208201905081810360008301526106e281610602565b9050919050565b6000602082019050818103600083015261070281610625565b9050919050565b6000602082019050818103600083015261072281610648565b9050919050565b600060208201905081810360008301526107428161066b565b9050919050565b600082825260208201905092915050565b6000610765826107c0565b9150610770836107c0565b92508282101561078357610782610813565b5b828203905092915050565b6000610799826107a0565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006107d5826107c0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561080857610807610813565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b7f43616e6e6f742072656d6f7665206d61737465722061646d696e210000000000600082015250565b7f43616e6e6f742072656d6f766520616c6c2061646d696e732100000000000000600082015250565b7f496e76616c696420496e646578206f662041646d696e73000000000000000000600082015250565b7f53656e646572206973206e6f7420616e2061646d696e21000000000000000000600082015250565b7f4164647265737320697320616c726561647920616e2061646d696e2100000000600082015250565b61097b8161078e565b811461098657600080fd5b50565b610992816107c0565b811461099d57600080fd5b5056fea2646970667358221220e91b74c186ef0a5b2d8033cf3fd915fc90781109482078da4548ab005870e23d64736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x41 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2A68F64E EQ PUSH2 0x46 JUMPI DUP1 PUSH4 0x70480275 EQ PUSH2 0x64 JUMPI DUP1 PUSH4 0xAD7BBC29 EQ PUSH2 0x80 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x5B SWAP2 SWAP1 PUSH2 0x68E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x7E PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x79 SWAP2 SWAP1 PUSH2 0x576 JUMP JUMPDEST PUSH2 0xC0 JUMP JUMPDEST STOP JUMPDEST PUSH2 0x9A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x95 SWAP2 SWAP1 PUSH2 0x5A3 JUMP JUMPDEST PUSH2 0x1B7 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH2 0xC9 CALLER PUSH2 0x49D JUMP JUMPDEST PUSH2 0x108 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0xFF SWAP1 PUSH2 0x709 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x111 DUP2 PUSH2 0x49D JUMP JUMPDEST ISZERO PUSH2 0x151 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x148 SWAP1 PUSH2 0x729 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP2 SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP POP JUMP JUMPDEST PUSH2 0x1C0 CALLER PUSH2 0x49D JUMP JUMPDEST PUSH2 0x1FF JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x1F6 SWAP1 PUSH2 0x709 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP1 DUP1 SLOAD SWAP1 POP PUSH2 0x210 SWAP2 SWAP1 PUSH2 0x75A JUMP JUMPDEST DUP2 GT ISZERO PUSH2 0x252 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x249 SWAP1 PUSH2 0x6E9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x2 PUSH1 0x1 DUP1 SLOAD SWAP1 POP LT ISZERO PUSH2 0x29B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x292 SWAP1 PUSH2 0x6C9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x2E6 JUMPI PUSH2 0x2E5 PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x368 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD PUSH2 0x35F SWAP1 PUSH2 0x6A9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 DUP2 DUP2 SLOAD DUP2 LT PUSH2 0x37C JUMPI PUSH2 0x37B PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE PUSH1 0x1 DUP1 DUP1 DUP1 SLOAD SWAP1 POP PUSH2 0x3BB SWAP2 SWAP1 PUSH2 0x75A JUMP JUMPDEST DUP2 SLOAD DUP2 LT PUSH2 0x3CC JUMPI PUSH2 0x3CB PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x40B JUMPI PUSH2 0x40A PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 DUP1 SLOAD DUP1 PUSH2 0x465 JUMPI PUSH2 0x464 PUSH2 0x842 JUMP JUMPDEST JUMPDEST PUSH1 0x1 SWAP1 SUB DUP2 DUP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD SWAP1 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 SSTORE SWAP1 SSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 POP JUMPDEST PUSH1 0x1 DUP1 SLOAD SWAP1 POP DUP2 LT ISZERO PUSH2 0x541 JUMPI DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 DUP3 DUP2 SLOAD DUP2 LT PUSH2 0x4DD JUMPI PUSH2 0x4DC PUSH2 0x871 JUMP JUMPDEST JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 ADD PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x52E JUMPI PUSH1 0x1 SWAP2 POP POP PUSH2 0x547 JUMP JUMPDEST DUP1 DUP1 PUSH2 0x539 SWAP1 PUSH2 0x7CA JUMP JUMPDEST SWAP2 POP POP PUSH2 0x4A5 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 POP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x55B DUP2 PUSH2 0x972 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x570 DUP2 PUSH2 0x989 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x58C JUMPI PUSH2 0x58B PUSH2 0x8A0 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x59A DUP5 DUP3 DUP6 ADD PUSH2 0x54C JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x5B9 JUMPI PUSH2 0x5B8 PUSH2 0x8A0 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x5C7 DUP5 DUP3 DUP6 ADD PUSH2 0x561 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x5D9 DUP2 PUSH2 0x78E JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x5EC PUSH1 0x1B DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x5F7 DUP3 PUSH2 0x8A5 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x60F PUSH1 0x19 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x61A DUP3 PUSH2 0x8CE JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x632 PUSH1 0x17 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x63D DUP3 PUSH2 0x8F7 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x655 PUSH1 0x17 DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x660 DUP3 PUSH2 0x920 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x678 PUSH1 0x1C DUP4 PUSH2 0x749 JUMP JUMPDEST SWAP2 POP PUSH2 0x683 DUP3 PUSH2 0x949 JUMP JUMPDEST PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x6A3 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x5D0 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x6C2 DUP2 PUSH2 0x5DF JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x6E2 DUP2 PUSH2 0x602 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x702 DUP2 PUSH2 0x625 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x722 DUP2 PUSH2 0x648 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x742 DUP2 PUSH2 0x66B JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x765 DUP3 PUSH2 0x7C0 JUMP JUMPDEST SWAP2 POP PUSH2 0x770 DUP4 PUSH2 0x7C0 JUMP JUMPDEST SWAP3 POP DUP3 DUP3 LT ISZERO PUSH2 0x783 JUMPI PUSH2 0x782 PUSH2 0x813 JUMP JUMPDEST JUMPDEST DUP3 DUP3 SUB SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x799 DUP3 PUSH2 0x7A0 JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x7D5 DUP3 PUSH2 0x7C0 JUMP JUMPDEST SWAP2 POP PUSH32 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 EQ ISZERO PUSH2 0x808 JUMPI PUSH2 0x807 PUSH2 0x813 JUMP JUMPDEST JUMPDEST PUSH1 0x1 DUP3 ADD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x31 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x32 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH32 0x43616E6E6F742072656D6F7665206D61737465722061646D696E210000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x43616E6E6F742072656D6F766520616C6C2061646D696E732100000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x496E76616C696420496E646578206F662041646D696E73000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x53656E646572206973206E6F7420616E2061646D696E21000000000000000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH32 0x4164647265737320697320616C726561647920616E2061646D696E2100000000 PUSH1 0x0 DUP3 ADD MSTORE POP JUMP JUMPDEST PUSH2 0x97B DUP2 PUSH2 0x78E JUMP JUMPDEST DUP2 EQ PUSH2 0x986 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP JUMPDEST PUSH2 0x992 DUP2 PUSH2 0x7C0 JUMP JUMPDEST DUP2 EQ PUSH2 0x99D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE9 SHL PUSH21 0xC186EF0A5B2D8033CF3FD915FC90781109482078DA GASLIMIT BASEFEE 0xAB STOP PC PUSH17 0xE23D64736F6C6343000807003300000000 ",
"sourceMap": "64:993:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;98:26;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;286:161;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;457:383;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;98:26;;;;;;;;;;;;:::o;286:161::-;210:20;219:10;210:8;:20::i;:::-;202:56;;;;;;;;;;;;:::i;:::-;;;;;;;;;358:18:::1;367:8;358;:18::i;:::-;357:19;349:60;;;;;;;;;;;;:::i;:::-;;;;;;;;;419:6;431:8;419:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;286:161:::0;:::o;457:383::-;210:20;219:10;210:8;:20::i;:::-;202:56;;;;;;;;;;;;:::i;:::-;;;;;;;;;550:1:::1;534:6:::0;:13:::1;;;;:17;;;;:::i;:::-;525:5;:26;;517:62;;;;;;;;;;;;:::i;:::-;;;;;;;;;614:1;597:6;:13;;;;:18;;589:56;;;;;;;;;;;;:::i;:::-;;;;;;;;;680:11;::::0;::::1;;;;;;;;663:28;;:6;670:5;663:13;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:28;;;;655:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;740:6;747:5;740:13;;;;;;;;:::i;:::-;;;;;;;;;;733:20;;;;;;;;;;;788:6;809:1:::0;795:6;:13:::1;;;;:15;;;;:::i;:::-;788:23;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;772:6;779:5;772:13;;;;;;;;:::i;:::-;;;;;;;;;;:39;;;;;;;;;;;;;;;;;;821:6;:12;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;457:383:::0;:::o;850:205::-;909:4;930:6;937:1;930:8;;925:102;941:6;:13;;;;939:1;:15;925:102;;;991:8;978:21;;:6;985:1;978:9;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;:21;;;974:43;;;1010:4;1003:11;;;;;974:43;955:3;;;;;:::i;:::-;;;;925:102;;;;1043:5;1036:12;;850:205;;;;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;7:139;;;;:::o;152:::-;198:5;236:6;223:20;214:29;;252:33;279:5;252:33;:::i;:::-;152:139;;;;:::o;297:329::-;356:6;405:2;393:9;384:7;380:23;376:32;373:119;;;411:79;;:::i;:::-;373:119;531:1;556:53;601:7;592:6;581:9;577:22;556:53;:::i;:::-;546:63;;502:117;297:329;;;;:::o;632:::-;691:6;740:2;728:9;719:7;715:23;711:32;708:119;;;746:79;;:::i;:::-;708:119;866:1;891:53;936:7;927:6;916:9;912:22;891:53;:::i;:::-;881:63;;837:117;632:329;;;;:::o;967:118::-;1054:24;1072:5;1054:24;:::i;:::-;1049:3;1042:37;967:118;;:::o;1091:366::-;1233:3;1254:67;1318:2;1313:3;1254:67;:::i;:::-;1247:74;;1330:93;1419:3;1330:93;:::i;:::-;1448:2;1443:3;1439:12;1432:19;;1091:366;;;:::o;1463:::-;1605:3;1626:67;1690:2;1685:3;1626:67;:::i;:::-;1619:74;;1702:93;1791:3;1702:93;:::i;:::-;1820:2;1815:3;1811:12;1804:19;;1463:366;;;:::o;1835:::-;1977:3;1998:67;2062:2;2057:3;1998:67;:::i;:::-;1991:74;;2074:93;2163:3;2074:93;:::i;:::-;2192:2;2187:3;2183:12;2176:19;;1835:366;;;:::o;2207:::-;2349:3;2370:67;2434:2;2429:3;2370:67;:::i;:::-;2363:74;;2446:93;2535:3;2446:93;:::i;:::-;2564:2;2559:3;2555:12;2548:19;;2207:366;;;:::o;2579:::-;2721:3;2742:67;2806:2;2801:3;2742:67;:::i;:::-;2735:74;;2818:93;2907:3;2818:93;:::i;:::-;2936:2;2931:3;2927:12;2920:19;;2579:366;;;:::o;2951:222::-;3044:4;3082:2;3071:9;3067:18;3059:26;;3095:71;3163:1;3152:9;3148:17;3139:6;3095:71;:::i;:::-;2951:222;;;;:::o;3179:419::-;3345:4;3383:2;3372:9;3368:18;3360:26;;3432:9;3426:4;3422:20;3418:1;3407:9;3403:17;3396:47;3460:131;3586:4;3460:131;:::i;:::-;3452:139;;3179:419;;;:::o;3604:::-;3770:4;3808:2;3797:9;3793:18;3785:26;;3857:9;3851:4;3847:20;3843:1;3832:9;3828:17;3821:47;3885:131;4011:4;3885:131;:::i;:::-;3877:139;;3604:419;;;:::o;4029:::-;4195:4;4233:2;4222:9;4218:18;4210:26;;4282:9;4276:4;4272:20;4268:1;4257:9;4253:17;4246:47;4310:131;4436:4;4310:131;:::i;:::-;4302:139;;4029:419;;;:::o;4454:::-;4620:4;4658:2;4647:9;4643:18;4635:26;;4707:9;4701:4;4697:20;4693:1;4682:9;4678:17;4671:47;4735:131;4861:4;4735:131;:::i;:::-;4727:139;;4454:419;;;:::o;4879:::-;5045:4;5083:2;5072:9;5068:18;5060:26;;5132:9;5126:4;5122:20;5118:1;5107:9;5103:17;5096:47;5160:131;5286:4;5160:131;:::i;:::-;5152:139;;4879:419;;;:::o;5385:169::-;5469:11;5503:6;5498:3;5491:19;5543:4;5538:3;5534:14;5519:29;;5385:169;;;;:::o;5560:191::-;5600:4;5620:20;5638:1;5620:20;:::i;:::-;5615:25;;5654:20;5672:1;5654:20;:::i;:::-;5649:25;;5693:1;5690;5687:8;5684:34;;;5698:18;;:::i;:::-;5684:34;5743:1;5740;5736:9;5728:17;;5560:191;;;;:::o;5757:96::-;5794:7;5823:24;5841:5;5823:24;:::i;:::-;5812:35;;5757:96;;;:::o;5859:126::-;5896:7;5936:42;5929:5;5925:54;5914:65;;5859:126;;;:::o;5991:77::-;6028:7;6057:5;6046:16;;5991:77;;;:::o;6074:233::-;6113:3;6136:24;6154:5;6136:24;:::i;:::-;6127:33;;6182:66;6175:5;6172:77;6169:103;;;6252:18;;:::i;:::-;6169:103;6299:1;6292:5;6288:13;6281:20;;6074:233;;;:::o;6313:180::-;6361:77;6358:1;6351:88;6458:4;6455:1;6448:15;6482:4;6479:1;6472:15;6499:180;6547:77;6544:1;6537:88;6644:4;6641:1;6634:15;6668:4;6665:1;6658:15;6685:180;6733:77;6730:1;6723:88;6830:4;6827:1;6820:15;6854:4;6851:1;6844:15;6994:117;7103:1;7100;7093:12;7117:177;7257:29;7253:1;7245:6;7241:14;7234:53;7117:177;:::o;7300:175::-;7440:27;7436:1;7428:6;7424:14;7417:51;7300:175;:::o;7481:173::-;7621:25;7617:1;7609:6;7605:14;7598:49;7481:173;:::o;7660:::-;7800:25;7796:1;7788:6;7784:14;7777:49;7660:173;:::o;7839:178::-;7979:30;7975:1;7967:6;7963:14;7956:54;7839:178;:::o;8023:122::-;8096:24;8114:5;8096:24;:::i;:::-;8089:5;8086:35;8076:63;;8135:1;8132;8125:12;8076:63;8023:122;:::o;8151:::-;8224:24;8242:5;8224:24;:::i;:::-;8217:5;8214:35;8204:63;;8263:1;8260;8253:12;8204:63;8151:122;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "503600",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"addAdmin(address)": "infinite",
"masterAdmin()": "2489",
"removeAdmin(uint256)": "infinite"
},
"internal": {
"_isAdmin(address)": "infinite"
}
},
"methodIdentifiers": {
"addAdmin(address)": "70480275",
"masterAdmin()": "2a68f64e",
"removeAdmin(uint256)": "ad7bbc29"
}
},
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "masterAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "removeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "masterAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "removeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/LittleShartsAdmins.sol": "LittleShartsAdmins"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/LittleShartsAdmins.sol": {
"keccak256": "0xd9f2693d2bf92e7bb97f91bdece099821415988db8647fcc10547c62c06195ef",
"license": "UNLICENSED",
"urls": [
"bzz-raw://34f208bf65c79df87590a468d983b845d7c6f12a746c8bbd6e4e77c9def5eb3e",
"dweb:/ipfs/QmYfKqFeFr92n7aJTGnKJH7NE4ZLA3bh9zNL6CCK5FEkqz"
]
}
},
"version": 1
}
// this line is added to create a gist. Empty file is not allowed.
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "_baseURI",
"type": "string"
},
{
"internalType": "uint256",
"name": "_costToName",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_maxTokens",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "_tokenIds",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "costToName",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "masterAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxTokens",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxTokensPerMint",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string[]",
"name": "names",
"type": "string[]"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mintShart",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "price",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "removeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"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": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenOfOwnerByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_id",
"type": "uint256"
}
],
"name": "tokenURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "tokensOwned",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokensOwned",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_maxTokens",
"type": "uint256"
}
],
"name": "updateMaxTokens",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "newURI",
"type": "string"
}
],
"name": "updateURI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"approve(address,uint256)": {
"details": "See {IERC721-approve}."
},
"balanceOf(address)": {
"details": "See {IERC721-balanceOf}."
},
"getApproved(uint256)": {
"details": "See {IERC721-getApproved}."
},
"isApprovedForAll(address,address)": {
"details": "See {IERC721-isApprovedForAll}."
},
"name()": {
"details": "See {IERC721Metadata-name}."
},
"ownerOf(uint256)": {
"details": "See {IERC721-ownerOf}."
},
"safeTransferFrom(address,address,uint256)": {
"details": "See {IERC721-safeTransferFrom}."
},
"safeTransferFrom(address,address,uint256,bytes)": {
"details": "See {IERC721-safeTransferFrom}."
},
"setApprovalForAll(address,bool)": {
"details": "See {IERC721-setApprovalForAll}."
},
"symbol()": {
"details": "See {IERC721Metadata-symbol}."
},
"tokenByIndex(uint256)": {
"details": "See {IERC721Enumerable-tokenByIndex}."
},
"tokenOfOwnerByIndex(address,uint256)": {
"details": "See {IERC721Enumerable-tokenOfOwnerByIndex}."
},
"totalSupply()": {
"details": "See {IERC721Enumerable-totalSupply}."
},
"transferFrom(address,address,uint256)": {
"details": "See {IERC721-transferFrom}."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/LSHRTCollectible.sol": "LSHRTCollectible"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"@openzeppelin/contracts/token/ERC20/ERC20.sol": {
"keccak256": "0xb03df8481a954604ad0c9125680893b2e3f7ff770fe470e38b89ac61b84e8072",
"license": "MIT",
"urls": [
"bzz-raw://b34655953d18ba3a45b762fb6bdbb6549af69a27435e10ece178742bf70baf45",
"dweb:/ipfs/QmcqjUoFLLMyx7dbwSHUnDBH6aphkVHXWQvQRRev5EAWEh"
]
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a",
"license": "MIT",
"urls": [
"bzz-raw://087318b21c528119f649899f5b5580566dd8d7b0303d4904bd0e8580c3545f14",
"dweb:/ipfs/Qmbn5Mj7aUn8hJuQ8VrQjjEXRsXyJKykgnjR9p4C3nfLtL"
]
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"keccak256": "0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2",
"license": "MIT",
"urls": [
"bzz-raw://d4c3df1a7ca104b633a7d81c6c6f5192367d150cd5a32cba81f7f27012729013",
"dweb:/ipfs/QmSim72e3ZVsfgZt8UceCvbiSuMRHR6WDsiamqNzZahGSY"
]
},
"@openzeppelin/contracts/token/ERC721/ERC721.sol": {
"keccak256": "0x7d2b8ba4b256bfcac347991b75242f9bc37f499c5236af50cf09d0b35943dc0c",
"license": "MIT",
"urls": [
"bzz-raw://d8eeaf6afe00229af4c232ca058bb08b7a24cc3886f0b387159ac49ffd8b5312",
"dweb:/ipfs/QmdnVKmDDWDvdRr6vtrxy3G6WafqA2TAhUZv1UFMsm4B4r"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"keccak256": "0xf101e8720213560fab41104d53b3cc7ba0456ef3a98455aa7f022391783144a0",
"license": "MIT",
"urls": [
"bzz-raw://3e7820bcf567e6892d937c3cb10db263a4042e446799bca602535868d822384e",
"dweb:/ipfs/QmPG2oeDjKncqsEeyYGjAN7CwAJmMgHterXGGnpzhha4z7"
]
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"keccak256": "0xd9517254724276e2e8de3769183c1f738f445f0095c26fd9b86d3c6687e887b9",
"license": "MIT",
"urls": [
"bzz-raw://0e604bcdcd5e5b2fb299ad09769cde6db19d5aa1929d1b5e939234a0f10d7eb8",
"dweb:/ipfs/Qmd8hXE3GZfBHuWx3RNiYgFW2ci7KvHtib8DiwzJ2dgo9V"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": {
"keccak256": "0x41dc7bf7f69c668eb98aa078c5140a4d3c3b097124ee4b6058a649ca99688300",
"license": "MIT",
"urls": [
"bzz-raw://621b0e2f8b95aa04707f3106f48a8c7cfab2d6fbe2dd8253e70b0b024daee683",
"dweb:/ipfs/QmTptvu7MJ6QcogPJUxkDEkdKm97KGTC28bhsZKu4sex4M"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": {
"keccak256": "0x188d038a65a945481cc13fe30db334472dfbed61f7959d4478d05feb6303b1ea",
"license": "MIT",
"urls": [
"bzz-raw://7aec4efa22389811ffa393463569410bbca1ecaa551bc94d69020bc9567e9277",
"dweb:/ipfs/QmPwk5uVSHPQkepebrZSQ9xqgXdPABKqHwJZ2HkzNByLRE"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": {
"keccak256": "0xa69205e5009601cf13be78b1e2f500e1e3b1d8012f22d966e63975273f602038",
"license": "MIT",
"urls": [
"bzz-raw://d919a0061e43f9878f6171b7f853cb92093805cd1160858c1884195a639b40a0",
"dweb:/ipfs/QmRZsS3EYuLp75nBym1QQ4y6aQXGew75wSbv1uwqkvouUK"
]
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
"keccak256": "0xd32fb7f530a914b1083d10a6bed3a586f2451952fec04fe542bcc670a82f7ba5",
"license": "MIT",
"urls": [
"bzz-raw://af63ab940a34687c45f0ad84960b048fc5f49330c92ccb422db7822a444733b9",
"dweb:/ipfs/QmUShaQEu8HS1GjDnsMJQ8jkZEBrecn6NuDZ3pfjY1gVck"
]
},
"@openzeppelin/contracts/utils/Address.sol": {
"keccak256": "0x3336baae5cf23e94274d75336e2d412193be508504aee185e61dc7d58cd05c8a",
"license": "MIT",
"urls": [
"bzz-raw://39a05eec7083dfa0cc7e0cbfe6cd1bd085a340af1ede93fdff3ad047c5fb3d8e",
"dweb:/ipfs/QmVApz5fCUq2QC8gKTsNNdCmcedJ3ETHp68zR5N3WUKS4r"
]
},
"@openzeppelin/contracts/utils/Context.sol": {
"keccak256": "0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f",
"license": "MIT",
"urls": [
"bzz-raw://26e8b38a7ac8e7b4463af00cf7fff1bf48ae9875765bf4f7751e100124d0bc8c",
"dweb:/ipfs/QmWcsmkVr24xmmjfnBQZoemFniXjj3vwT78Cz6uqZW1Hux"
]
},
"@openzeppelin/contracts/utils/Strings.sol": {
"keccak256": "0x391d3ba97ab6856a16b225d6ee29617ad15ff00db70f3b4df1ab5ea33aa47c9d",
"license": "MIT",
"urls": [
"bzz-raw://d636ba90bbbeed04a1ea7fe9ec2466757e30fd38ba2ca173636dbf69a518735e",
"dweb:/ipfs/QmQwCB2BHnEuYR22PYt9HkpbgeFDhq4rHmaYqAZbX3WRC7"
]
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"keccak256": "0x5718c5df9bd67ac68a796961df938821bb5dc0cd4c6118d77e9145afb187409b",
"license": "MIT",
"urls": [
"bzz-raw://d10e1d9b26042424789246603906ad06143bf9a928f4e99de8b5e3bdc662f549",
"dweb:/ipfs/Qmejonoaj5MLekPus229rJQHcC6E9dz2xorjHJR84fMfmn"
]
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"keccak256": "0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4",
"license": "MIT",
"urls": [
"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6",
"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx"
]
},
"@openzeppelin/contracts/utils/math/SafeMath.sol": {
"keccak256": "0x8666f020bd8fc9dc14f07e2ebc52b5f236ab4cdde7c77679b08cb2f94730043b",
"license": "MIT",
"urls": [
"bzz-raw://163776cbf565c722232393aa2d62cbe8a2ffb5805986abf4906c00e1e07450a6",
"dweb:/ipfs/QmPZoN9T3cb6o8bGhjBPZcz7im8T8DWhpr3tjLwhJJHx9N"
]
},
"contracts/LSHRTCollectible.sol": {
"keccak256": "0x66868667490b37345d06f8bd401878a9133db81874fb4db5f797cd15fa24d7df",
"license": "UNLICENSED",
"urls": [
"bzz-raw://6aaa36cca8fc001472d8006dbe54367144585ce5b1829f60158c146a553b9c48",
"dweb:/ipfs/QmeR6wKfUJV9vqRDsSxejAcbAF7KpS9uD24swZwg7yfdt6"
]
}
},
"version": 1
}
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import './LittleShartsAdmins.sol';
contract LittleShartCollectible is ERC721, ERC721URIStorage, ERC721Enumerable, LittleShartsAdmins {
using SafeMath for uint256;
string public baseURI;
uint256 public costToName;
uint256 public price = 1 ether;
uint256 public maxTokens;
uint256 public maxTokensPerMint = 10;
uint256 public _tokenIds=0;
mapping (uint256 => string) _names;
mapping (uint256 => uint256) _nameChangeCount;
mapping (string => uint256) _uniqueNames;
constructor(
string memory _baseURI,
uint256 _costToName,
uint256 _maxTokens,
address _masterAdmin
) ERC721("Little Sharts", "LSHRT") {
baseURI = _baseURI;
costToName = _costToName;
maxTokens = _maxTokens;
masterAdmin = _masterAdmin;
}
function mintShart(
string[] memory names,
uint256 amount
) payable public returns (uint256[] memory) {
require(msg.value >= (amount * price), "Not enough funds sent to cover transaction!");
uint256[] memory newItems = new uint256[](amount);
require(names.length == amount, "Provided too many or too little names in relation to the amount!");
require((_tokenIds+amount) <= maxTokens, "Not enough remaining tokens to mint that many!");
require(amount <= maxTokensPerMint, "Requested to mint too many tokens!");
for (uint i=0;i<amount;i++) {
uint256 newItemId = _tokenIds+1;
require(_uniqueNames[names[i]] == 0, "One of your names is already taken!");
_names[newItemId] = names[i];
_uniqueNames[names[i]] = newItemId;
_safeMint(msg.sender, newItemId);
_setTokenURI(newItemId, uint2str(newItemId));
newItems[i] = newItemId;
_tokenIds++;
}
payable(address(masterAdmin)).transfer(msg.value);
return newItems;
}
function updateURI(string memory newURI) public onlyAdmin {
baseURI = newURI;
}
function updateMaxTokens(uint256 _maxTokens) public onlyAdmin {
require(_maxTokens > maxTokens, "New count must be higher than old count!");
maxTokens = _maxTokens;
}
function tokensOwned() public view returns (uint256[] memory) {
uint balance = balanceOf(msg.sender);
uint256[] memory tOwned = new uint256[](balance);
for (uint i=0;i<balance;i++) {
tOwned[i] = tokenOfOwnerByIndex(msg.sender, i);
}
return tOwned;
}
function tokensOwned(address _owner) public view returns (uint256[] memory) {
uint balance = balanceOf(_owner);
uint256[] memory tOwned = new uint256[](balance);
for (uint i=0;i<balance;i++) {
tOwned[i] = tokenOfOwnerByIndex(_owner, i);
}
return tOwned;
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
if (_i == 0) {
return "0";
}
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len;
while (_i != 0) {
k = k-1;
uint8 temp = (48 + uint8(_i - _i / 10 * 10));
bytes1 b1 = bytes1(temp);
bstr[k] = b1;
_i /= 10;
}
return string(bstr);
}
function tokenURI(uint256 _id) public view override(ERC721, ERC721URIStorage) returns (string memory) {
return string(abi.encodePacked(baseURI, uint2str(_id), ".json"));
}
function _burn(uint256 tokenId) internal virtual override(ERC721, ERC721URIStorage) {
super._burn(tokenId);
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
super._beforeTokenTransfer(from, to, tokenId);
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}
}
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./LittleShartsAdmins.sol";
contract LittleShartMarketplace is LittleShartsAdmins {
using SafeMath for uint256;
uint256 public _listingFee = 1;
address _nft;
address _token;
struct Listing {
address seller;
bool isActive;
uint price;
}
struct Bid {
address bidder;
bool isActive;
uint value;
}
// Treasury for sellers/bidders
mapping (address => uint256) _treasury;
mapping (uint256 => Listing) _listings;
mapping (uint256 => Bid) _bids;
// Locks up until listing is bought or refunds lister if cancelled
uint256 _pendingFeeTreasury;
// Tracks tokenIds for sale for easy call access
uint256[] public _tokensForSale;
constructor (
address _nftAddress,
address _tokenAddress
) {
_nft = _nftAddress;
_token = _tokenAddress;
}
function createBid(uint256 tokenId) public payable {
require(msg.value > 0, "Bid Price Cannot Be Negative!");
Listing memory listing = _listings[tokenId];
require(listing.isActive, "Listing Must Be Active To Bid!");
require(listing.seller != msg.sender, "Cannot bid on your own listing!");
Bid memory currentBid = _bids[tokenId];
// Check if there is already a Bid
if (currentBid.isActive) {
// Make sure new bid is greater than old bid
require(msg.value > currentBid.value, "Too low to outbid current bid!");
// Refund old bidder
payable(currentBid.bidder).transfer(currentBid.value);
}
_bids[tokenId] = Bid(msg.sender, true, msg.value);
}
function createListing(uint256 tokenId, uint256 value) public payable {
require(value > 0, "Listing price cannot be negative!"); // Listing Cannot be Negatively Priced
require(ERC721(_nft).ownerOf(tokenId)==msg.sender, "Must be owner of token!"); // Must own the token trying to be listed
require(!_listings[tokenId].isActive, "Listing is already active!"); // Listing must be inactive to start. Cancel or Update Otherwise
uint256[2] memory amounts = _getFeeAmounts(_listingFee, value);
require(ERC20(_token).balanceOf(msg.sender) == amounts[1], "Not enough SHART to cover listing fee!");
_pendingFeeTreasury += amounts[1];
// Contract Should Be Approved, Transfer to Contract
ERC721(_nft).transferFrom(msg.sender, address(this), tokenId);
require(ERC721(_nft).ownerOf(tokenId)==address(this), "Token Transfer Failed!");
_listings[tokenId] = Listing(msg.sender, true, value);
_tokensForSale.push(tokenId);
}
function cancelListing(uint256 tokenId) public {
Listing memory listing = _listings[tokenId];
require(listing.seller == msg.sender, "Must be owner of listing!");
require(listing.isActive, "Listing must be active!");
// At this point we know the sender is the seller.
// Lets refund and remove their Listing
uint256[2] memory amounts = _getFeeAmounts(_listingFee, listing.price);
_pendingFeeTreasury -= amounts[1];
payable(listing.seller).transfer(amounts[1]);
_removeFromSale(tokenId);
}
function _removeFromSale(uint256 tokenId) internal {
uint256 tokenIndex;
for (uint i=0;i<_tokensForSale.length;i++) {
if (_tokensForSale[i] == tokenId) {
tokenIndex = i;
}
}
_tokensForSale[tokenIndex] = _tokensForSale[_tokensForSale.length-1];
_tokensForSale.pop();
_listings[tokenId] = Listing(msg.sender, false, 0);
}
function getTreasuryAmount() public view returns (uint256) {
return _treasury[msg.sender];
}
function getFeeTreasuryAmount() public view onlyAdmin returns (uint256) {
return _pendingFeeTreasury;
}
function _getFeeAmounts(uint256 fee, uint256 amount) internal pure returns (uint256[2] memory outAmounts) {
uint256 feeAmount = (amount / 100) * fee;
uint256 tOut = amount - feeAmount;
outAmounts[0] = tOut;
outAmounts[1] = feeAmount;
return outAmounts;
}
}
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract LittleShartsAdmins {
address public masterAdmin;
address[] admins = [masterAdmin];
modifier onlyAdmin {
require(_isAdmin(msg.sender), "Sender is not an admin!");
_;
}
function addAdmin(address _address) public onlyAdmin {
require(!_isAdmin(_address), "Address is already an admin!");
admins.push(_address);
}
function removeAdmin(uint index) public onlyAdmin {
require(index <= admins.length - 1, "Invalid Index of Admins");
require(admins.length >= 2, "Cannot remove all admins!");
require(admins[index] != masterAdmin, "Cannot remove master admin!");
delete admins[index];
admins[index] = admins[admins.length-1];
admins.pop();
}
function _isAdmin(address _address) internal view returns (bool) {
for (uint i=0;i<admins.length;i++) {
if (admins[i] == _address) { return true; }
}
return false;
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract BEP777 {
address public admin;
string public name;
string public symbol;
string public metadata;
uint public lastTokenIdMinted = 1;
uint public maxTokens;
uint public maxMint;
uint public saleStart;
uint public price;
struct TokenOwner {
uint[] tokens;
}
struct Listing {
address owner;
bool isForSale;
uint minValue;
}
struct Bid {
bool isActive;
address bidder;
uint value;
}
mapping (uint => Listing) public tokenListings;
mapping (uint => Bid) public bids;
mapping (address => TokenOwner) tokenOwners;
uint[] public tokensListed;
modifier onlyAdmin {
require(admin == msg.sender, "Only Admin allowed");
_;
}
modifier onlyAfterSale {
require(block.timestamp >= saleStart, "Sale has not started!");
_;
}
constructor(
string memory _name,
string memory _symbol,
string memory _metadata,
uint _price,
uint _maxTokens,
uint _maxMint,
uint _saleStart
) {
admin = msg.sender;
name = _name;
symbol = _symbol;
metadata = _metadata;
price = _price;
maxTokens = _maxTokens;
maxMint = _maxMint;
saleStart = _saleStart;
}
function buyNow(uint _tokenId) public payable {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
TokenOwner storage buyerData = tokenOwners[msg.sender];
require(!uintArrContains(buyerData.tokens, _tokenId), "Cannot buy your own token!");
Listing storage listing = tokenListings[_tokenId];
require(listing.isForSale, "Token is not for sale!");
require(msg.value >= listing.minValue, "Buy now price is too low!");
Bid memory currentBid = bids[_tokenId];
if (currentBid.isActive) {
address bidder = currentBid.bidder;
uint value = currentBid.value;
payable(bidder).transfer(value);
}
bids[_tokenId] = Bid(false, 0x0000000000000000000000000000000000000000, 0);
address owner = listing.owner;
_transferToken(_tokenId, owner, msg.sender, msg.value);
payable(owner).transfer(msg.value);
}
function acceptBid(uint _tokenId) public {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
TokenOwner storage senderData = tokenOwners[msg.sender];
require(uintArrContains(senderData.tokens, _tokenId), "Not owner of listing!");
Listing storage listing = tokenListings[_tokenId];
address owner = listing.owner;
require(owner == msg.sender, "Not owner of listing!");
Bid storage bid = bids[_tokenId];
require(bid.isActive, "Invalid or Inactive Bid!");
require(bid.value >= listing.minValue, "Bid is below listing minimum value!");
require(bid.bidder != msg.sender, "Cannot accept a bid from yourself. How'd you get here?");
uint bidValue = bid.value;
address bidder = bid.bidder;
bids[_tokenId] = Bid(false, 0x0000000000000000000000000000000000000000, 0);
_transferToken(_tokenId, listing.owner, bidder, bidValue);
payable(owner).transfer(bidValue);
}
function cancelBid(uint _tokenId) public {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
Listing storage listing = tokenListings[_tokenId];
address owner = listing.owner;
require(owner != msg.sender, "Cannot cancel bids for others!");
Bid storage bid = bids[_tokenId];
require(bid.bidder == msg.sender, "Not owner of active bid!");
require(bid.isActive, "No bid active!");
uint bidValue = bid.value;
address bidder = bid.bidder;
bids[_tokenId] = Bid(false, 0x0000000000000000000000000000000000000000, 0);
payable(bidder).transfer(bidValue);
}
function createBid(uint _tokenId) public payable {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
TokenOwner storage bidderData = tokenOwners[msg.sender];
require(!uintArrContains(bidderData.tokens, _tokenId), "Cannot bid on your own tokens!");
Listing storage listing = tokenListings[_tokenId];
require(listing.owner != msg.sender, "Cannot bid on your own listing!");
require(msg.value >= listing.minValue, "Bid cannot be lower than listing's minimum value!");
Bid storage currentBid = bids[_tokenId];
if (currentBid.isActive) {
require(msg.value > currentBid.value, "Must be a higher value than the current bid!");
}
bids[_tokenId] = Bid(true, msg.sender, msg.value);
}
function listToken(uint _tokenId, uint listPrice) public {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
TokenOwner storage ownerData = tokenOwners[msg.sender];
require(uintArrContains(ownerData.tokens, _tokenId), "Cannot list token you do not own!");
require(listPrice >= price, "List price must be greater or equal to floor price!");
Listing storage existingListing = tokenListings[_tokenId];
require(!existingListing.isForSale, "Listing is already for sale!");
tokenListings[_tokenId] = Listing(msg.sender, true, listPrice);
tokensListed.push(_tokenId);
}
function cancelListing(uint _tokenId) public {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID");
TokenOwner storage ownerData = tokenOwners[msg.sender];
require(uintArrContains(ownerData.tokens, _tokenId), "Cannot cancel a token you do not own!");
Listing storage existingListing = tokenListings[_tokenId];
require(existingListing.isForSale, "Listing is already cancelled!");
uint oldListPrice = existingListing.minValue;
tokenListings[_tokenId] = Listing(msg.sender, false, oldListPrice);
_removeListing(_tokenId);
}
function mintAndBuy(uint _amount) public payable onlyAfterSale {
require(msg.value == (_amount * price), "Value must be equivalent to amount * price!");
require(_amount <= maxMint, "Requested to mint too many tokens!");
require(_amount > 0, "Requested to mint too little tokens!");
require((_amount + lastTokenIdMinted) <= maxTokens, "Not enough remaining NFTs to mint!");
for (uint i=0;i<_amount;i++) {
_mintToken(lastTokenIdMinted, msg.sender);
lastTokenIdMinted++;
}
payable(admin).transfer(msg.value);
}
function sendToken(uint _tokenId, address _to) public {
TokenOwner storage ownerData = tokenOwners[msg.sender];
require(uintArrContains(ownerData.tokens, _tokenId), "Not Owner of TokenID!");
require(_to != msg.sender, "Cannot send to yourself!");
_transferToken(_tokenId, msg.sender, _to);
}
function tokensOwned() public view returns (uint[] memory) {
return tokenOwners[msg.sender].tokens;
}
function tokensOwned(address owner) public view returns (uint[] memory) {
return tokenOwners[owner].tokens;
}
function getTokensListed() public view returns (uint[] memory) {
return tokensListed;
}
function getTokensRemaining() public view returns (uint) {
return maxTokens - (lastTokenIdMinted - 1);
}
function _mintToken(uint _tokenId, address _to) internal {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID Provided");
TokenOwner storage ownerData = tokenOwners[_to];
require(!uintArrContains(ownerData.tokens, _tokenId), "Cannot mint token you already own!");
require(_tokenId == lastTokenIdMinted, "Token ID Invalid!");
ownerData.tokens.push(_tokenId);
tokenListings[_tokenId] = Listing(_to, false, price);
}
function _removeListing(uint _tokenId) internal {
require(uintArrContains(tokensListed, _tokenId), "Token is not listed!");
uint listedIndex;
for (uint i=0;i<tokensListed.length;i++) {
if (tokensListed[i] == _tokenId) {
listedIndex = i;
}
}
tokensListed[listedIndex] = tokensListed[tokensListed.length-1];
tokensListed[tokensListed.length-1] = 0;
tokensListed.pop();
}
function _transferToken(uint _tokenId, address _from, address _to) internal {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID Provided");
TokenOwner storage ownerData = tokenOwners[_from];
require(uintArrContains(ownerData.tokens, _tokenId), "From is not owner!");
if (ownerData.tokens.length > 1) {
uint newSize = uint(ownerData.tokens.length) - 1;
uint[] memory newTokens = new uint[](newSize);
uint index = 0;
for (uint i=0;i<ownerData.tokens.length;i++) {
if (ownerData.tokens[i] != _tokenId) {
newTokens[index] = ownerData.tokens[i];
index++;
}
}
ownerData.tokens = newTokens;
} else {
uint[] memory newTokens;
ownerData.tokens = newTokens;
}
TokenOwner storage newOwnerData = tokenOwners[_to];
newOwnerData.tokens.push(_tokenId);
tokenListings[_tokenId] = Listing(_to, false, price);
_removeListing(_tokenId);
require(_confirmOwnership(_tokenId, _from, _to), "Transfer ownership failed!");
}
function _transferToken(uint _tokenId, address _from, address _to, uint value) internal {
require(_tokenId <= maxTokens, "Index Out of Range for Token ID Provided");
TokenOwner storage ownerData = tokenOwners[_from];
require(uintArrContains(ownerData.tokens, _tokenId), "From is not owner!");
if (ownerData.tokens.length > 1) {
uint newSize = uint(ownerData.tokens.length) - 1;
uint[] memory newTokens = new uint[](newSize);
uint index = 0;
for (uint i=0;i<ownerData.tokens.length;i++) {
if (ownerData.tokens[i] != _tokenId) {
newTokens[index] = ownerData.tokens[i];
index++;
}
}
ownerData.tokens = newTokens;
} else {
uint[] memory newTokens;
ownerData.tokens = newTokens;
}
TokenOwner storage newOwnerData = tokenOwners[_to];
newOwnerData.tokens.push(_tokenId);
tokenListings[_tokenId] = Listing(_to, false, value);
_removeListing(_tokenId);
require(_confirmOwnership(_tokenId, _from, _to), "Transfer ownership failed!");
}
function _confirmOwnership(uint _tokenId, address _old, address _to) internal view returns (bool) {
return !uintArrContains(tokenOwners[_old].tokens, _tokenId) && uintArrContains(tokenOwners[_to].tokens, _tokenId);
}
function updateMetadata(string memory _metadata) public onlyAdmin {
metadata = _metadata;
}
function uintArrContains(uint[] memory _arr, uint query) pure internal returns (bool) {
for (uint i=0;i<_arr.length;i++) {
if (_arr[i] == query) {
return true;
}
}
return false;
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
if (_i == 0) {
return "0";
}
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len;
while (_i != 0) {
k = k-1;
uint8 temp = (48 + uint8(_i - _i / 10 * 10));
bytes1 b1 = bytes1(temp);
bstr[k] = b1;
_i /= 10;
}
return string(bstr);
}
function uri(uint256 _id) public view returns (string memory) {
return string(abi.encodePacked(metadata, uint2str(_id), ".json"));
}
}
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithEthers script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
// 'web3Provider' is a remix global variable object
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer);
let contract = await factory.deploy(...constructorArgs);
console.log('Contract Address: ', contract.address);
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log('Deployment successful.')
} catch (e) {
console.log(e.message)
}
})()
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithWeb3 script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
const accounts = await web3.eth.getAccounts()
let contract = new web3.eth.Contract(metadata.abi)
contract = contract.deploy({
data: metadata.data.bytecode.object,
arguments: constructorArgs
})
const newContractInstance = await contract.send({
from: accounts[0],
gas: 1500000,
gasPrice: '30000000000'
})
console.log('Contract deployed at address: ', newContractInstance.options.address)
} catch (e) {
console.log(e.message)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment