Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 18569036 | 350 days ago | IN | 0 ETH | 0.05644363 |
Loading...
Loading
Contract Name:
Port3BQLSharesV2
Compiler Version
v0.8.20+commit.a1b79de6
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "ERC721.sol"; import "IERC20.sol"; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "Initializable.sol"; contract Port3BQLSharesV2 is Initializable, Ownable, ReentrancyGuard, ERC721{ uint256 private _supply; // total supply uint256 private _tokenId; // current tokenId string private _proxiedName; string private _proxiedSymbol; string private _baseUri; bool public allowRescueFund = true; // === FT Model ==== address public protocolFeeDestination; uint256 public protocolFeePercent = 50_000_000_000_000_000; // 5% address public sharesSubject; uint256 public subjectFeePercent = 50_000_000_000_000_000; // 5% uint256 public curveBase; event Trade(address trader, string symbol, address subject, bool isBuy, uint256 shareAmount, uint256 ethAmount, uint256 protocolEthAmount, uint256 subjectEthAmount, uint256 supply); constructor(address _owner, string memory _name, string memory _symbol) Ownable(_owner) ERC721(_name, _symbol) { _disableInitializers(); } function initialize( address _owner, string memory _name, string memory _symbol, string memory _uri, address _sharesSubject, address _protocolFeeDestination, uint256 _curveBase ) public initializer { _proxiedName = _name; _proxiedSymbol = _symbol; _baseUri = _uri; sharesSubject = _sharesSubject; protocolFeeDestination = _protocolFeeDestination; curveBase = _curveBase; super._transferOwnership(_owner); } // === onlyOwner ==== function setTokenURI( string memory _uri ) public onlyOwner{ _baseUri = _uri; } function setSharesSubject( address _sharesSubject ) public onlyOwner{ sharesSubject = _sharesSubject; } function renounceRescueFund() public onlyOwner { allowRescueFund = false; } function setFeeDestination(address _feeDestination) public onlyOwner { protocolFeeDestination = _feeDestination; } function setProtocolFeePercent(uint256 _feePercent) public onlyOwner { protocolFeePercent = _feePercent; } function setSubjectFeePercent(uint256 _feePercent) public onlyOwner { subjectFeePercent = _feePercent; } function getPrice(uint256 supply, uint256 amount) public view returns (uint256) { uint256 sum1 = supply == 0 ? 0 : (supply - 1) * (supply) * (2 * (supply - 1) + 1) / 6; uint256 sum2 = supply == 0 && amount == 1 ? 0 : (supply - 1 + amount) * (supply + amount) * (2 * (supply - 1 + amount) + 1) / 6; uint256 summation = sum2 - sum1; return summation * 1 ether / curveBase; } function getBuyPrice(uint256 amount) public view returns (uint256) { return getPrice(_supply, amount); } function getSellPrice(uint256 amount) public view returns (uint256) { return getPrice(_supply - amount, amount); } function getBuyPriceAfterFee(uint256 amount) public view returns (uint256) { uint256 price = getBuyPrice(amount); uint256 protocolFee = price * protocolFeePercent / 1 ether; uint256 subjectFee = price * subjectFeePercent / 1 ether; return price + protocolFee + subjectFee; } function getSellPriceAfterFee(uint256 amount) public view returns (uint256) { uint256 price = getSellPrice(amount); uint256 protocolFee = price * protocolFeePercent / 1 ether; uint256 subjectFee = price * subjectFeePercent / 1 ether; return price - protocolFee - subjectFee; } // mint function mintShare() public payable nonReentrant { uint256 amount = 1; uint256 supply = _supply; require(supply > 0 || super.owner() == msg.sender || sharesSubject == msg.sender, "Only the owner/sponsor can buy the first share"); uint256 price = getPrice(supply, amount); uint256 protocolFee = price * protocolFeePercent / 1 ether; uint256 subjectFee = price * subjectFeePercent / 1 ether; require(msg.value >= price + protocolFee + subjectFee, "Insufficient payment"); super._safeMint(msg.sender, _tokenId); // update balance automaticly _supply++; _tokenId++; emit Trade(msg.sender, _proxiedSymbol, sharesSubject, true, amount, price, protocolFee, subjectFee, supply + amount); (bool success1, ) = protocolFeeDestination.call{value: protocolFee}(""); (bool success2, ) = sharesSubject.call{value: subjectFee}(""); require(success1 && success2, "Unable to send funds"); } // burn function burnShare(uint256 tokenId) public payable nonReentrant { uint256 amount = 1; uint256 supply = _supply; require(supply > amount, "Cannot sell the last share"); uint256 price = getPrice(supply - amount, amount); uint256 protocolFee = price * protocolFeePercent / 1 ether; uint256 subjectFee = price * subjectFeePercent / 1 ether; require(super.ownerOf(tokenId) == msg.sender, "Not holder"); require(super.balanceOf(msg.sender) >= amount, "Insufficient shares"); super._burn(tokenId); _supply = supply - amount; emit Trade(msg.sender, _proxiedSymbol, sharesSubject, false, amount, price, protocolFee, subjectFee, supply - amount); (bool success1, ) = msg.sender.call{value: price - protocolFee - subjectFee}(""); (bool success2, ) = protocolFeeDestination.call{value: protocolFee}(""); (bool success3, ) = sharesSubject.call{value: subjectFee}(""); require(success1 && success2 && success3, "Unable to send funds"); } /** * @dev All tokens share the same URI */ function tokenURI(uint256 tokenId) public override view returns (string memory) { return _baseUri; } /** * @dev Get token name */ function name() public view virtual override returns (string memory) { if (bytes(_proxiedName).length > 0) { return _proxiedName; } return super.name(); } /** * @dev Get token symbol */ function symbol() public view virtual override returns (string memory) { if (bytes(_proxiedSymbol).length > 0) { return _proxiedSymbol; } return super.symbol(); } /** * @dev Total supply of NFT */ function totalSupply() public view returns (uint256) { return _supply; } /** * @dev latest tokenId of NFT */ function currTokenId() public view returns (uint256) { return _tokenId; } /** * @dev Rescure fund of mistake deposit */ function rescueFund(address _recipient, address _tokenAddr, uint256 _tokenAmount) external onlyOwner{ require(allowRescueFund == true, "Not allow for rescure fund"); if (_tokenAmount > 0) { if (_tokenAddr == address(0)) { payable(_recipient).call{value: _tokenAmount}(""); } else { IERC20(_tokenAddr).transfer(_recipient, _tokenAmount); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "IERC721.sol"; import {IERC721Receiver} from "IERC721Receiver.sol"; import {IERC721Metadata} from "IERC721Metadata.sol"; import {Context} from "Context.sol"; import {Strings} from "Strings.sol"; import {IERC165, ERC165} from "ERC165.sol"; import {IERC721Errors} from "draft-IERC6093.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}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => 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 returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(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 overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * 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 { _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); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - 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) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. 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 */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "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`. * * 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; /** * @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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 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 address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @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 `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "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 // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "Math.sol"; import {SignedMath} from "SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; 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_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "Port3BQLSharesV2.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"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":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"trader","type":"address"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"subject","type":"address"},{"indexed":false,"internalType":"bool","name":"isBuy","type":"bool"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolEthAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"subjectEthAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"Trade","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":"allowRescueFund","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burnShare","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"currTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveBase","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":"uint256","name":"amount","type":"uint256"}],"name":"getBuyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getBuyPriceAfterFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getSellPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getSellPriceAfterFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"address","name":"_sharesSubject","type":"address"},{"internalType":"address","name":"_protocolFeeDestination","type":"address"},{"internalType":"uint256","name":"_curveBase","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"mintShare","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceRescueFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_tokenAddr","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"rescueFund","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":"address","name":"_feeDestination","type":"address"}],"name":"setFeeDestination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"setProtocolFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sharesSubject","type":"address"}],"name":"setSharesSubject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"setSubjectFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharesSubject","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"subjectFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600d805460ff1916600117905566b1a2bc2ec50000600e8190556010553480156200002e57600080fd5b506040516200289438038062002894833981016040819052620000519162000290565b8181846001600160a01b0381166200008357604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200008e81620000c7565b50600180556002620000a18382620003a9565b506003620000b08282620003a9565b50620000be91505062000117565b50505062000475565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620001685760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620001c85780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f357600080fd5b81516001600160401b0380821115620002105762000210620001cb565b604051601f8301601f19908116603f011681019082821181831017156200023b576200023b620001cb565b816040528381526020925086838588010111156200025857600080fd5b600091505b838210156200027c57858201830151818301840152908201906200025d565b600093810190920192909252949350505050565b600080600060608486031215620002a657600080fd5b83516001600160a01b0381168114620002be57600080fd5b60208501519093506001600160401b0380821115620002dc57600080fd5b620002ea87838801620001e1565b935060408601519150808211156200030157600080fd5b506200031086828701620001e1565b9150509250925092565b600181811c908216806200032f57607f821691505b6020821081036200035057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003a457600081815260208120601f850160051c810160208610156200037f5750805b601f850160051c820191505b81811015620003a0578281556001016200038b565b5050505b505050565b81516001600160401b03811115620003c557620003c5620001cb565b620003dd81620003d684546200031a565b8462000356565b602080601f831160018114620004155760008415620003fc5750858301515b600019600386901b1c1916600185901b178555620003a0565b600085815260208120601f198616915b82811015620004465788860151825594840194600190910190840162000425565b5085821015620004655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61240f80620004856000396000f3fe6080604052600436106102305760003560e01c80636b4ed02a1161012e578063ba730e53116100ab578063e1a6fb551161006f578063e1a6fb5514610642578063e985e9c514610657578063ea2b331614610677578063f2fde38b14610697578063fbe53234146106b757600080fd5b8063ba730e53146105b7578063c87b56dd146105d7578063cc4f30eb146105f7578063d6e6eb9f1461060c578063e0df5b6f1461062257600080fd5b806395d89b41116100f257806395d89b4114610522578063a22cb46514610537578063a498342114610557578063ac353d6114610577578063b88d4fde1461059757600080fd5b80636b4ed02a1461049557806370a08231146104b5578063715018a6146104d5578063737293db146104ea5780638da5cb5b1461050457600080fd5b806313b34792116101bc5780634ce7957c116101805780634ce7957c146104085780635a8a764e1461042d5780635cf4ee911461044d5780636352211e1461046d5780636a3356d31461048d57600080fd5b806313b347921461038757806318160ddd1461039d57806323b872dd146103b257806324dc441d146103d257806342842e0e146103e857600080fd5b806308d4db141161020357806308d4db14146102e657806308f97dd814610314578063095ea7b3146103345780630ebc2d23146103545780630fcdeafc1461036757600080fd5b806301ffc9a71461023557806306690ccb1461026a57806306fdde031461028c578063081812fc146102ae575b600080fd5b34801561024157600080fd5b50610255610250366004611cd2565b6106d7565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028a610285366004611d12565b610729565b005b34801561029857600080fd5b506102a1610871565b6040516102619190611d94565b3480156102ba57600080fd5b506102ce6102c9366004611da7565b610927565b6040516001600160a01b039091168152602001610261565b3480156102f257600080fd5b50610306610301366004611da7565b610950565b604051908152602001610261565b34801561032057600080fd5b5061030661032f366004611da7565b61095e565b34801561034057600080fd5b5061028a61034f366004611dc0565b6109d4565b61028a610362366004611da7565b6109e3565b34801561037357600080fd5b5061028a610382366004611dea565b610d2f565b34801561039357600080fd5b5061030660115481565b3480156103a957600080fd5b50600854610306565b3480156103be57600080fd5b5061028a6103cd366004611d12565b610d59565b3480156103de57600080fd5b5061030660105481565b3480156103f457600080fd5b5061028a610403366004611d12565b610dde565b34801561041457600080fd5b50600d546102ce9061010090046001600160a01b031681565b34801561043957600080fd5b5061028a610448366004611da7565b610df9565b34801561045957600080fd5b50610306610468366004611e05565b610e06565b34801561047957600080fd5b506102ce610488366004611da7565b610f28565b61028a610f33565b3480156104a157600080fd5b506103066104b0366004611da7565b61123c565b3480156104c157600080fd5b506103066104d0366004611dea565b6112a9565b3480156104e157600080fd5b5061028a6112f1565b3480156104f657600080fd5b50600d546102559060ff1681565b34801561051057600080fd5b506000546001600160a01b03166102ce565b34801561052e57600080fd5b506102a1611303565b34801561054357600080fd5b5061028a610552366004611e35565b611331565b34801561056357600080fd5b5061028a610572366004611da7565b61133c565b34801561058357600080fd5b50600f546102ce906001600160a01b031681565b3480156105a357600080fd5b5061028a6105b2366004611ef8565b611349565b3480156105c357600080fd5b506103066105d2366004611da7565b611360565b3480156105e357600080fd5b506102a16105f2366004611da7565b611379565b34801561060357600080fd5b5061028a61140d565b34801561061857600080fd5b50610306600e5481565b34801561062e57600080fd5b5061028a61063d366004611f94565b611421565b34801561064e57600080fd5b50600954610306565b34801561066357600080fd5b50610255610672366004611fc9565b611435565b34801561068357600080fd5b5061028a610692366004611ffc565b611463565b3480156106a357600080fd5b5061028a6106b2366004611dea565b6115e4565b3480156106c357600080fd5b5061028a6106d2366004611dea565b61161f565b60006001600160e01b031982166380ac58cd60e01b148061070857506001600160e01b03198216635b5e139f60e01b145b8061072357506301ffc9a760e01b6001600160e01b03198316145b92915050565b61073161164f565b600d5460ff16151560011461078d5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420616c6c6f7720666f7220726573637572652066756e6400000000000060448201526064015b60405180910390fd5b801561086c576001600160a01b0382166107f7576040516001600160a01b038416908290600081818185875af1925050503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b505050505050565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a91906120c0565b505b505050565b60606000600a8054610882906120dd565b9050111561091a57600a8054610897906120dd565b80601f01602080910402602001604051908101604052809291908181526020018280546108c3906120dd565b80156109105780601f106108e557610100808354040283529160200191610910565b820191906000526020600020905b8154815290600101906020018083116108f357829003601f168201915b5050505050905090565b61092261167c565b905090565b60006109328261168b565b506000828152600660205260409020546001600160a01b0316610723565b600061072360085483610e06565b60008061096a83611360565b90506000670de0b6b3a7640000600e5483610985919061212d565b61098f9190612144565b90506000670de0b6b3a7640000601054846109aa919061212d565b6109b49190612144565b9050806109c18385612166565b6109cb9190612166565b95945050505050565b6109df8282336116c4565b5050565b6109eb6116d1565b600854600190818111610a405760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742073656c6c20746865206c6173742073686172650000000000006044820152606401610784565b6000610a55610a4f8484612166565b84610e06565b90506000670de0b6b3a7640000600e5483610a70919061212d565b610a7a9190612144565b90506000670de0b6b3a764000060105484610a95919061212d565b610a9f9190612144565b905033610aab87610f28565b6001600160a01b031614610aee5760405162461bcd60e51b815260206004820152600a6024820152692737ba103437b63232b960b11b6044820152606401610784565b84610af8336112a9565b1015610b3c5760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742073686172657360681b6044820152606401610784565b610b45866116fb565b610b4f8585612166565b600855600f547f8a43f99a275de31c61b4df5fe52540eb82e4dbd5d254fdcfe76913210e03ac0b903390600b906001600160a01b0316600089888888610b95848e612166565b604051610baa99989796959493929190612179565b60405180910390a160003382610bc08587612166565b610bca9190612166565b604051600081818185875af1925050503d8060008114610c06576040519150601f19603f3d011682016040523d82523d6000602084013e610c0b565b606091505b5050600d546040519192506000916101009091046001600160a01b03169085908381818185875af1925050503d8060008114610c63576040519150601f19603f3d011682016040523d82523d6000602084013e610c68565b606091505b5050600f546040519192506000916001600160a01b039091169085908381818185875af1925050503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b50509050828015610ccf5750815b8015610cd85750805b610d1b5760405162461bcd60e51b8152602060048201526014602482015273556e61626c6520746f2073656e642066756e647360601b6044820152606401610784565b5050505050505050610d2c60018055565b50565b610d3761164f565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216610d8357604051633250574960e11b815260006004820152602401610784565b6000610d90838333611736565b9050836001600160a01b0316816001600160a01b03161461086a576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610784565b61086c83838360405180602001604052806000815250611349565b610e0161164f565b601055565b6000808315610e61576006610e1c600186612166565b610e2790600261212d565b610e32906001612257565b85610e3e600182612166565b610e48919061212d565b610e52919061212d565b610e5c9190612144565b610e64565b60005b9050600084158015610e765750836001145b610eeb57600684610e88600188612166565b610e929190612257565b610e9d90600261212d565b610ea8906001612257565b610eb28688612257565b86610ebe60018a612166565b610ec89190612257565b610ed2919061212d565b610edc919061212d565b610ee69190612144565b610eee565b60005b90506000610efc8383612166565b601154909150610f1482670de0b6b3a764000061212d565b610f1e9190612144565b9695505050505050565b60006107238261168b565b610f3b6116d1565b60085460019080151580610f68575033610f5d6000546001600160a01b031690565b6001600160a01b0316145b80610f7d5750600f546001600160a01b031633145b610fe05760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c7920746865206f776e65722f73706f6e736f722063616e20627579207460448201526d686520666972737420736861726560901b6064820152608401610784565b6000610fec8284610e06565b90506000670de0b6b3a7640000600e5483611007919061212d565b6110119190612144565b90506000670de0b6b3a76400006010548461102c919061212d565b6110369190612144565b9050806110438385612257565b61104d9190612257565b3410156110935760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401610784565b61109f3360095461182f565b600880549060006110af8361226a565b9091555050600980549060006110c48361226a565b9091555050600f547f8a43f99a275de31c61b4df5fe52540eb82e4dbd5d254fdcfe76913210e03ac0b903390600b906001600160a01b031660018988888861110c848e612257565b60405161112199989796959493929190612179565b60405180910390a1600d5460405160009161010090046001600160a01b03169084908381818185875af1925050503d806000811461117b576040519150601f19603f3d011682016040523d82523d6000602084013e611180565b606091505b5050600f546040519192506000916001600160a01b039091169084908381818185875af1925050503d80600081146111d4576040519150601f19603f3d011682016040523d82523d6000602084013e6111d9565b606091505b505090508180156111e75750805b61122a5760405162461bcd60e51b8152602060048201526014602482015273556e61626c6520746f2073656e642066756e647360601b6044820152606401610784565b5050505050505061123a60018055565b565b60008061124883610950565b90506000670de0b6b3a7640000600e5483611263919061212d565b61126d9190612144565b90506000670de0b6b3a764000060105484611288919061212d565b6112929190612144565b90508061129f8385612257565b6109cb9190612257565b60006001600160a01b0382166112d5576040516322718ad960e21b815260006004820152602401610784565b506001600160a01b031660009081526005602052604090205490565b6112f961164f565b61123a6000611849565b60606000600b8054611314906120dd565b9050111561132957600b8054610897906120dd565b610922611899565b6109df3383836118a8565b61134461164f565b600e55565b611354848484610d59565b61086a84848484611947565b6000610723826008546113739190612166565b83610e06565b6060600c8054611388906120dd565b80601f01602080910402602001604051908101604052809291908181526020018280546113b4906120dd565b80156114015780601f106113d657610100808354040283529160200191611401565b820191906000526020600020905b8154815290600101906020018083116113e457829003601f168201915b50505050509050919050565b61141561164f565b600d805460ff19169055565b61142961164f565b600c6109df82826122c9565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156114a95750825b905060008267ffffffffffffffff1660011480156114c65750303b155b9050811580156114d4575080155b156114f25760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561151c57845460ff60401b1916600160401b1785555b600a6115288c826122c9565b50600b6115358b826122c9565b50600c6115428a826122c9565b50600f80546001600160a01b0319166001600160a01b038a811691909117909155600d8054610100600160a81b031916610100928a169290920291909117905560118690556115908c611849565b83156115d657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6115ec61164f565b6001600160a01b03811661161657604051631e4fbdf760e01b815260006004820152602401610784565b610d2c81611849565b61162761164f565b600d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000546001600160a01b0316331461123a5760405163118cdaa760e01b8152336004820152602401610784565b606060028054610897906120dd565b6000818152600460205260408120546001600160a01b03168061072357604051637e27328960e01b815260048101849052602401610784565b61086c8383836001611a70565b6002600154036116f457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600061170a6000836000611736565b90506001600160a01b0381166109df57604051637e27328960e01b815260048101839052602401610784565b6000828152600460205260408120546001600160a01b039081169083161561176357611763818486611b76565b6001600160a01b038116156117a157611780600085600080611a70565b6001600160a01b038116600090815260056020526040902080546000190190555b6001600160a01b038516156117d0576001600160a01b0385166000908152600560205260409020805460010190555b60008481526004602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6109df828260405180602001604052806000815250611bda565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060038054610897906120dd565b6001600160a01b0382166118da57604051630b61174360e31b81526001600160a01b0383166004820152602401610784565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561086a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611989903390889087908790600401612389565b6020604051808303816000875af19250505080156119c4575060408051601f3d908101601f191682019092526119c1918101906123bc565b60015b611a2d573d8080156119f2576040519150601f19603f3d011682016040523d82523d6000602084013e6119f7565b606091505b508051600003611a2557604051633250574960e11b81526001600160a01b0385166004820152602401610784565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611a6957604051633250574960e11b81526001600160a01b0385166004820152602401610784565b5050505050565b8080611a8457506001600160a01b03821615155b15611b46576000611a948461168b565b90506001600160a01b03831615801590611ac05750826001600160a01b0316816001600160a01b031614155b8015611ad35750611ad18184611435565b155b15611afc5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610784565b8115611b445783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260066020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b611b81838383611bf1565b61086c576001600160a01b038316611baf57604051637e27328960e01b815260048101829052602401610784565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610784565b611be48383611c57565b61086c6000848484611947565b60006001600160a01b03831615801590611c4f5750826001600160a01b0316846001600160a01b03161480611c2b5750611c2b8484611435565b80611c4f57506000828152600660205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b038216611c8157604051633250574960e11b815260006004820152602401610784565b6000611c8f83836000611736565b90506001600160a01b0381161561086c576040516339e3563760e11b815260006004820152602401610784565b6001600160e01b031981168114610d2c57600080fd5b600060208284031215611ce457600080fd5b8135611cef81611cbc565b9392505050565b80356001600160a01b0381168114611d0d57600080fd5b919050565b600080600060608486031215611d2757600080fd5b611d3084611cf6565b9250611d3e60208501611cf6565b9150604084013590509250925092565b6000815180845260005b81811015611d7457602081850181015186830182015201611d58565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611cef6020830184611d4e565b600060208284031215611db957600080fd5b5035919050565b60008060408385031215611dd357600080fd5b611ddc83611cf6565b946020939093013593505050565b600060208284031215611dfc57600080fd5b611cef82611cf6565b60008060408385031215611e1857600080fd5b50508035926020909101359150565b8015158114610d2c57600080fd5b60008060408385031215611e4857600080fd5b611e5183611cf6565b91506020830135611e6181611e27565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611e9d57611e9d611e6c565b604051601f8501601f19908116603f01168101908282118183101715611ec557611ec5611e6c565b81604052809350858152868686011115611ede57600080fd5b858560208301376000602087830101525050509392505050565b60008060008060808587031215611f0e57600080fd5b611f1785611cf6565b9350611f2560208601611cf6565b925060408501359150606085013567ffffffffffffffff811115611f4857600080fd5b8501601f81018713611f5957600080fd5b611f6887823560208401611e82565b91505092959194509250565b600082601f830112611f8557600080fd5b611cef83833560208501611e82565b600060208284031215611fa657600080fd5b813567ffffffffffffffff811115611fbd57600080fd5b611c4f84828501611f74565b60008060408385031215611fdc57600080fd5b611fe583611cf6565b9150611ff360208401611cf6565b90509250929050565b600080600080600080600060e0888a03121561201757600080fd5b61202088611cf6565b9650602088013567ffffffffffffffff8082111561203d57600080fd5b6120498b838c01611f74565b975060408a013591508082111561205f57600080fd5b61206b8b838c01611f74565b965060608a013591508082111561208157600080fd5b5061208e8a828b01611f74565b94505061209d60808901611cf6565b92506120ab60a08901611cf6565b915060c0880135905092959891949750929550565b6000602082840312156120d257600080fd5b8151611cef81611e27565b600181811c908216806120f157607f821691505b60208210810361211157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761072357610723612117565b60008261216157634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561072357610723612117565b600061012060018060a01b038c16835280602084015260008b5461219c816120dd565b92850183905261014092600182811680156121be57600181146121d857612208565b60ff1984168887015282151560051b880186019450612208565b8f600052602060002060005b848110156122005781548a8201890152908301906020016121e4565b890187019550505b5050506001600160a01b038c1660408601525091506122249050565b9615156060820152608081019590955260a085019390935260c084019190915260e0830152610100909101529392505050565b8082018082111561072357610723612117565b60006001820161227c5761227c612117565b5060010190565b601f82111561086c57600081815260208120601f850160051c810160208610156122aa5750805b601f850160051c820191505b818110156107ef578281556001016122b6565b815167ffffffffffffffff8111156122e3576122e3611e6c565b6122f7816122f184546120dd565b84612283565b602080601f83116001811461232c57600084156123145750858301515b600019600386901b1c1916600185901b1785556107ef565b600085815260208120601f198616915b8281101561235b5788860151825594840194600190910190840161233c565b50858210156123795787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610f1e90830184611d4e565b6000602082840312156123ce57600080fd5b8151611cef81611cbc56fea26469706673582212205105e3be96ed487b64d61bb24f74a4047e1fcd4cb411a9f9848867597d01b1cb64736f6c6343000814003300000000000000000000000012458f85a2f5edba82d9c4abe66db3c6803443a9000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000d42514c2053686172657320563200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b42514c5368617265735632000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102305760003560e01c80636b4ed02a1161012e578063ba730e53116100ab578063e1a6fb551161006f578063e1a6fb5514610642578063e985e9c514610657578063ea2b331614610677578063f2fde38b14610697578063fbe53234146106b757600080fd5b8063ba730e53146105b7578063c87b56dd146105d7578063cc4f30eb146105f7578063d6e6eb9f1461060c578063e0df5b6f1461062257600080fd5b806395d89b41116100f257806395d89b4114610522578063a22cb46514610537578063a498342114610557578063ac353d6114610577578063b88d4fde1461059757600080fd5b80636b4ed02a1461049557806370a08231146104b5578063715018a6146104d5578063737293db146104ea5780638da5cb5b1461050457600080fd5b806313b34792116101bc5780634ce7957c116101805780634ce7957c146104085780635a8a764e1461042d5780635cf4ee911461044d5780636352211e1461046d5780636a3356d31461048d57600080fd5b806313b347921461038757806318160ddd1461039d57806323b872dd146103b257806324dc441d146103d257806342842e0e146103e857600080fd5b806308d4db141161020357806308d4db14146102e657806308f97dd814610314578063095ea7b3146103345780630ebc2d23146103545780630fcdeafc1461036757600080fd5b806301ffc9a71461023557806306690ccb1461026a57806306fdde031461028c578063081812fc146102ae575b600080fd5b34801561024157600080fd5b50610255610250366004611cd2565b6106d7565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028a610285366004611d12565b610729565b005b34801561029857600080fd5b506102a1610871565b6040516102619190611d94565b3480156102ba57600080fd5b506102ce6102c9366004611da7565b610927565b6040516001600160a01b039091168152602001610261565b3480156102f257600080fd5b50610306610301366004611da7565b610950565b604051908152602001610261565b34801561032057600080fd5b5061030661032f366004611da7565b61095e565b34801561034057600080fd5b5061028a61034f366004611dc0565b6109d4565b61028a610362366004611da7565b6109e3565b34801561037357600080fd5b5061028a610382366004611dea565b610d2f565b34801561039357600080fd5b5061030660115481565b3480156103a957600080fd5b50600854610306565b3480156103be57600080fd5b5061028a6103cd366004611d12565b610d59565b3480156103de57600080fd5b5061030660105481565b3480156103f457600080fd5b5061028a610403366004611d12565b610dde565b34801561041457600080fd5b50600d546102ce9061010090046001600160a01b031681565b34801561043957600080fd5b5061028a610448366004611da7565b610df9565b34801561045957600080fd5b50610306610468366004611e05565b610e06565b34801561047957600080fd5b506102ce610488366004611da7565b610f28565b61028a610f33565b3480156104a157600080fd5b506103066104b0366004611da7565b61123c565b3480156104c157600080fd5b506103066104d0366004611dea565b6112a9565b3480156104e157600080fd5b5061028a6112f1565b3480156104f657600080fd5b50600d546102559060ff1681565b34801561051057600080fd5b506000546001600160a01b03166102ce565b34801561052e57600080fd5b506102a1611303565b34801561054357600080fd5b5061028a610552366004611e35565b611331565b34801561056357600080fd5b5061028a610572366004611da7565b61133c565b34801561058357600080fd5b50600f546102ce906001600160a01b031681565b3480156105a357600080fd5b5061028a6105b2366004611ef8565b611349565b3480156105c357600080fd5b506103066105d2366004611da7565b611360565b3480156105e357600080fd5b506102a16105f2366004611da7565b611379565b34801561060357600080fd5b5061028a61140d565b34801561061857600080fd5b50610306600e5481565b34801561062e57600080fd5b5061028a61063d366004611f94565b611421565b34801561064e57600080fd5b50600954610306565b34801561066357600080fd5b50610255610672366004611fc9565b611435565b34801561068357600080fd5b5061028a610692366004611ffc565b611463565b3480156106a357600080fd5b5061028a6106b2366004611dea565b6115e4565b3480156106c357600080fd5b5061028a6106d2366004611dea565b61161f565b60006001600160e01b031982166380ac58cd60e01b148061070857506001600160e01b03198216635b5e139f60e01b145b8061072357506301ffc9a760e01b6001600160e01b03198316145b92915050565b61073161164f565b600d5460ff16151560011461078d5760405162461bcd60e51b815260206004820152601a60248201527f4e6f7420616c6c6f7720666f7220726573637572652066756e6400000000000060448201526064015b60405180910390fd5b801561086c576001600160a01b0382166107f7576040516001600160a01b038416908290600081818185875af1925050503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b505050505050565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a91906120c0565b505b505050565b60606000600a8054610882906120dd565b9050111561091a57600a8054610897906120dd565b80601f01602080910402602001604051908101604052809291908181526020018280546108c3906120dd565b80156109105780601f106108e557610100808354040283529160200191610910565b820191906000526020600020905b8154815290600101906020018083116108f357829003601f168201915b5050505050905090565b61092261167c565b905090565b60006109328261168b565b506000828152600660205260409020546001600160a01b0316610723565b600061072360085483610e06565b60008061096a83611360565b90506000670de0b6b3a7640000600e5483610985919061212d565b61098f9190612144565b90506000670de0b6b3a7640000601054846109aa919061212d565b6109b49190612144565b9050806109c18385612166565b6109cb9190612166565b95945050505050565b6109df8282336116c4565b5050565b6109eb6116d1565b600854600190818111610a405760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742073656c6c20746865206c6173742073686172650000000000006044820152606401610784565b6000610a55610a4f8484612166565b84610e06565b90506000670de0b6b3a7640000600e5483610a70919061212d565b610a7a9190612144565b90506000670de0b6b3a764000060105484610a95919061212d565b610a9f9190612144565b905033610aab87610f28565b6001600160a01b031614610aee5760405162461bcd60e51b815260206004820152600a6024820152692737ba103437b63232b960b11b6044820152606401610784565b84610af8336112a9565b1015610b3c5760405162461bcd60e51b8152602060048201526013602482015272496e73756666696369656e742073686172657360681b6044820152606401610784565b610b45866116fb565b610b4f8585612166565b600855600f547f8a43f99a275de31c61b4df5fe52540eb82e4dbd5d254fdcfe76913210e03ac0b903390600b906001600160a01b0316600089888888610b95848e612166565b604051610baa99989796959493929190612179565b60405180910390a160003382610bc08587612166565b610bca9190612166565b604051600081818185875af1925050503d8060008114610c06576040519150601f19603f3d011682016040523d82523d6000602084013e610c0b565b606091505b5050600d546040519192506000916101009091046001600160a01b03169085908381818185875af1925050503d8060008114610c63576040519150601f19603f3d011682016040523d82523d6000602084013e610c68565b606091505b5050600f546040519192506000916001600160a01b039091169085908381818185875af1925050503d8060008114610cbc576040519150601f19603f3d011682016040523d82523d6000602084013e610cc1565b606091505b50509050828015610ccf5750815b8015610cd85750805b610d1b5760405162461bcd60e51b8152602060048201526014602482015273556e61626c6520746f2073656e642066756e647360601b6044820152606401610784565b5050505050505050610d2c60018055565b50565b610d3761164f565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216610d8357604051633250574960e11b815260006004820152602401610784565b6000610d90838333611736565b9050836001600160a01b0316816001600160a01b03161461086a576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610784565b61086c83838360405180602001604052806000815250611349565b610e0161164f565b601055565b6000808315610e61576006610e1c600186612166565b610e2790600261212d565b610e32906001612257565b85610e3e600182612166565b610e48919061212d565b610e52919061212d565b610e5c9190612144565b610e64565b60005b9050600084158015610e765750836001145b610eeb57600684610e88600188612166565b610e929190612257565b610e9d90600261212d565b610ea8906001612257565b610eb28688612257565b86610ebe60018a612166565b610ec89190612257565b610ed2919061212d565b610edc919061212d565b610ee69190612144565b610eee565b60005b90506000610efc8383612166565b601154909150610f1482670de0b6b3a764000061212d565b610f1e9190612144565b9695505050505050565b60006107238261168b565b610f3b6116d1565b60085460019080151580610f68575033610f5d6000546001600160a01b031690565b6001600160a01b0316145b80610f7d5750600f546001600160a01b031633145b610fe05760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c7920746865206f776e65722f73706f6e736f722063616e20627579207460448201526d686520666972737420736861726560901b6064820152608401610784565b6000610fec8284610e06565b90506000670de0b6b3a7640000600e5483611007919061212d565b6110119190612144565b90506000670de0b6b3a76400006010548461102c919061212d565b6110369190612144565b9050806110438385612257565b61104d9190612257565b3410156110935760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401610784565b61109f3360095461182f565b600880549060006110af8361226a565b9091555050600980549060006110c48361226a565b9091555050600f547f8a43f99a275de31c61b4df5fe52540eb82e4dbd5d254fdcfe76913210e03ac0b903390600b906001600160a01b031660018988888861110c848e612257565b60405161112199989796959493929190612179565b60405180910390a1600d5460405160009161010090046001600160a01b03169084908381818185875af1925050503d806000811461117b576040519150601f19603f3d011682016040523d82523d6000602084013e611180565b606091505b5050600f546040519192506000916001600160a01b039091169084908381818185875af1925050503d80600081146111d4576040519150601f19603f3d011682016040523d82523d6000602084013e6111d9565b606091505b505090508180156111e75750805b61122a5760405162461bcd60e51b8152602060048201526014602482015273556e61626c6520746f2073656e642066756e647360601b6044820152606401610784565b5050505050505061123a60018055565b565b60008061124883610950565b90506000670de0b6b3a7640000600e5483611263919061212d565b61126d9190612144565b90506000670de0b6b3a764000060105484611288919061212d565b6112929190612144565b90508061129f8385612257565b6109cb9190612257565b60006001600160a01b0382166112d5576040516322718ad960e21b815260006004820152602401610784565b506001600160a01b031660009081526005602052604090205490565b6112f961164f565b61123a6000611849565b60606000600b8054611314906120dd565b9050111561132957600b8054610897906120dd565b610922611899565b6109df3383836118a8565b61134461164f565b600e55565b611354848484610d59565b61086a84848484611947565b6000610723826008546113739190612166565b83610e06565b6060600c8054611388906120dd565b80601f01602080910402602001604051908101604052809291908181526020018280546113b4906120dd565b80156114015780601f106113d657610100808354040283529160200191611401565b820191906000526020600020905b8154815290600101906020018083116113e457829003601f168201915b50505050509050919050565b61141561164f565b600d805460ff19169055565b61142961164f565b600c6109df82826122c9565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156114a95750825b905060008267ffffffffffffffff1660011480156114c65750303b155b9050811580156114d4575080155b156114f25760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561151c57845460ff60401b1916600160401b1785555b600a6115288c826122c9565b50600b6115358b826122c9565b50600c6115428a826122c9565b50600f80546001600160a01b0319166001600160a01b038a811691909117909155600d8054610100600160a81b031916610100928a169290920291909117905560118690556115908c611849565b83156115d657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050505050565b6115ec61164f565b6001600160a01b03811661161657604051631e4fbdf760e01b815260006004820152602401610784565b610d2c81611849565b61162761164f565b600d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000546001600160a01b0316331461123a5760405163118cdaa760e01b8152336004820152602401610784565b606060028054610897906120dd565b6000818152600460205260408120546001600160a01b03168061072357604051637e27328960e01b815260048101849052602401610784565b61086c8383836001611a70565b6002600154036116f457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600061170a6000836000611736565b90506001600160a01b0381166109df57604051637e27328960e01b815260048101839052602401610784565b6000828152600460205260408120546001600160a01b039081169083161561176357611763818486611b76565b6001600160a01b038116156117a157611780600085600080611a70565b6001600160a01b038116600090815260056020526040902080546000190190555b6001600160a01b038516156117d0576001600160a01b0385166000908152600560205260409020805460010190555b60008481526004602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6109df828260405180602001604052806000815250611bda565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060038054610897906120dd565b6001600160a01b0382166118da57604051630b61174360e31b81526001600160a01b0383166004820152602401610784565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561086a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611989903390889087908790600401612389565b6020604051808303816000875af19250505080156119c4575060408051601f3d908101601f191682019092526119c1918101906123bc565b60015b611a2d573d8080156119f2576040519150601f19603f3d011682016040523d82523d6000602084013e6119f7565b606091505b508051600003611a2557604051633250574960e11b81526001600160a01b0385166004820152602401610784565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611a6957604051633250574960e11b81526001600160a01b0385166004820152602401610784565b5050505050565b8080611a8457506001600160a01b03821615155b15611b46576000611a948461168b565b90506001600160a01b03831615801590611ac05750826001600160a01b0316816001600160a01b031614155b8015611ad35750611ad18184611435565b155b15611afc5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610784565b8115611b445783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260066020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b611b81838383611bf1565b61086c576001600160a01b038316611baf57604051637e27328960e01b815260048101829052602401610784565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610784565b611be48383611c57565b61086c6000848484611947565b60006001600160a01b03831615801590611c4f5750826001600160a01b0316846001600160a01b03161480611c2b5750611c2b8484611435565b80611c4f57506000828152600660205260409020546001600160a01b038481169116145b949350505050565b6001600160a01b038216611c8157604051633250574960e11b815260006004820152602401610784565b6000611c8f83836000611736565b90506001600160a01b0381161561086c576040516339e3563760e11b815260006004820152602401610784565b6001600160e01b031981168114610d2c57600080fd5b600060208284031215611ce457600080fd5b8135611cef81611cbc565b9392505050565b80356001600160a01b0381168114611d0d57600080fd5b919050565b600080600060608486031215611d2757600080fd5b611d3084611cf6565b9250611d3e60208501611cf6565b9150604084013590509250925092565b6000815180845260005b81811015611d7457602081850181015186830182015201611d58565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611cef6020830184611d4e565b600060208284031215611db957600080fd5b5035919050565b60008060408385031215611dd357600080fd5b611ddc83611cf6565b946020939093013593505050565b600060208284031215611dfc57600080fd5b611cef82611cf6565b60008060408385031215611e1857600080fd5b50508035926020909101359150565b8015158114610d2c57600080fd5b60008060408385031215611e4857600080fd5b611e5183611cf6565b91506020830135611e6181611e27565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611e9d57611e9d611e6c565b604051601f8501601f19908116603f01168101908282118183101715611ec557611ec5611e6c565b81604052809350858152868686011115611ede57600080fd5b858560208301376000602087830101525050509392505050565b60008060008060808587031215611f0e57600080fd5b611f1785611cf6565b9350611f2560208601611cf6565b925060408501359150606085013567ffffffffffffffff811115611f4857600080fd5b8501601f81018713611f5957600080fd5b611f6887823560208401611e82565b91505092959194509250565b600082601f830112611f8557600080fd5b611cef83833560208501611e82565b600060208284031215611fa657600080fd5b813567ffffffffffffffff811115611fbd57600080fd5b611c4f84828501611f74565b60008060408385031215611fdc57600080fd5b611fe583611cf6565b9150611ff360208401611cf6565b90509250929050565b600080600080600080600060e0888a03121561201757600080fd5b61202088611cf6565b9650602088013567ffffffffffffffff8082111561203d57600080fd5b6120498b838c01611f74565b975060408a013591508082111561205f57600080fd5b61206b8b838c01611f74565b965060608a013591508082111561208157600080fd5b5061208e8a828b01611f74565b94505061209d60808901611cf6565b92506120ab60a08901611cf6565b915060c0880135905092959891949750929550565b6000602082840312156120d257600080fd5b8151611cef81611e27565b600181811c908216806120f157607f821691505b60208210810361211157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761072357610723612117565b60008261216157634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561072357610723612117565b600061012060018060a01b038c16835280602084015260008b5461219c816120dd565b92850183905261014092600182811680156121be57600181146121d857612208565b60ff1984168887015282151560051b880186019450612208565b8f600052602060002060005b848110156122005781548a8201890152908301906020016121e4565b890187019550505b5050506001600160a01b038c1660408601525091506122249050565b9615156060820152608081019590955260a085019390935260c084019190915260e0830152610100909101529392505050565b8082018082111561072357610723612117565b60006001820161227c5761227c612117565b5060010190565b601f82111561086c57600081815260208120601f850160051c810160208610156122aa5750805b601f850160051c820191505b818110156107ef578281556001016122b6565b815167ffffffffffffffff8111156122e3576122e3611e6c565b6122f7816122f184546120dd565b84612283565b602080601f83116001811461232c57600084156123145750858301515b600019600386901b1c1916600185901b1785556107ef565b600085815260208120601f198616915b8281101561235b5788860151825594840194600190910190840161233c565b50858210156123795787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610f1e90830184611d4e565b6000602082840312156123ce57600080fd5b8151611cef81611cbc56fea26469706673582212205105e3be96ed487b64d61bb24f74a4047e1fcd4cb411a9f9848867597d01b1cb64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000012458f85a2f5edba82d9c4abe66db3c6803443a9000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000d42514c2053686172657320563200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b42514c5368617265735632000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _owner (address): 0x12458f85a2F5EdBa82d9c4ABe66dB3C6803443a9
Arg [1] : _name (string): BQL Shares V2
Arg [2] : _symbol (string): BQLSharesV2
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000012458f85a2f5edba82d9c4abe66db3c6803443a9
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [4] : 42514c2053686172657320563200000000000000000000000000000000000000
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [6] : 42514c5368617265735632000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.