ERC-20
Overview
Max Total Supply
300,032 BBITS
Holders
69
Total Transfers
-
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
BBITS
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 420000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.25; import {ReentrancyGuard} from "@openzeppelin/utils/ReentrancyGuard.sol"; import {ERC20} from "@openzeppelin/token/ERC20/ERC20.sol"; import {IERC721} from "@openzeppelin/token/ERC721/IERC721.sol"; import {IBBITS} from "./interfaces/IBBITS.sol"; /// @title Based Bits Fungible Token /// @notice This contract allows Based Bits NFT holders to exchange their NFTs for a fungible ERC20 token /// equivalent. The fungible tokens may also be exchanged back for NFTs, with the option of users /// being able to decide which specific NFTs held by this contract are to be exchanged. contract BBITS is IBBITS, ERC20, ReentrancyGuard { /// @notice Based Bits NFT collection. IERC721 public immutable collection; /// @notice The amount of tokens received for 1 NFT. uint256 public immutable conversionRate; /// @notice An array of NFT token Ids held by this contract. uint256[] public tokenIds; constructor(IERC721 _collection, uint256 _conversionRate) ERC20("Based Bits", "BBITS") { collection = _collection; conversionRate = _conversionRate * (10 ** decimals()); } /// @notice This function allows users to exchange their NFTs for fungible tokens given the defined /// conversion rate. /// @param _tokenIds An array of Based Bits token Ids to exchange for fungible tokens. /// @dev The user must grant this contract approval to move their NFTs. function exchangeNFTsForTokens(uint256[] calldata _tokenIds) external nonReentrant { uint256 length = _tokenIds.length; if (length == 0) revert DepositZero(); for (uint256 i; i < length; i++) { collection.transferFrom(msg.sender, address(this), _tokenIds[i]); tokenIds.push(_tokenIds[i]); emit Deposit(msg.sender, _tokenIds[i]); } _mint(msg.sender, length * conversionRate); } /// @notice This function allows users to exchange their fungible BBITS tokens back to Based Bits NFTs. /// @param _amount The amount of fungible tokens to exchange. This amount must be a multiple of the /// conversion rate. function exchangeTokensForNFTs(uint256 _amount) external nonReentrant { if (_amount == 0) revert DepositZero(); if (_amount % conversionRate != 0) revert PartialRedemptionDisallowed(); _burn(msg.sender, _amount); uint256 length = _amount / conversionRate; for (uint256 i; i < length; i++) { collection.transferFrom(address(this), msg.sender, tokenIds[0]); emit Withdrawal(msg.sender, tokenIds[0]); tokenIds[0] = tokenIds[tokenIds.length - 1]; tokenIds.pop(); } } /// @notice This function allows users to exchange their fungible BBITS tokens back to Based Bits NFTs. /// Users can specify which NFTs held by this contract get exchanged with the _indices input array. /// @param _amount The amount of fungible tokens to exchange. This amount must be a multiple of the /// conversion rate. /// @param _indices An array of indices that specify which NFTs get exchanged. The indices correspond to /// the position of the NFTs held by this contract as recorded in the tokenIds array, and not the /// the token Ids of the NFTs themselves. /// @dev Elements in this indices array must be monotonically decreasing. function exchangeTokensForSpecificNFTs(uint256 _amount, uint256[] calldata _indices) external nonReentrant { if (_amount == 0) revert DepositZero(); if (_amount % conversionRate != 0) revert PartialRedemptionDisallowed(); uint256 length = _amount / conversionRate; if (length != _indices.length) revert IndicesMustEqualNumberToBeExchanged(); _burn(msg.sender, _amount); for (uint256 i; i < length; i++) { if ((i > 0) && (_indices[i - 1] <= _indices[i])) revert IndicesMustBeMonotonicallyDecreasing(); collection.transferFrom(address(this), msg.sender, getTokenIdAtIndex(_indices[i])); emit Withdrawal(msg.sender, tokenIds[_indices[i]]); tokenIds[_indices[i]] = tokenIds[tokenIds.length - 1]; tokenIds.pop(); } } /// @notice This view function returns the number of Based Bits NFTs held by this contract. /// @return _count The number of Based Bits NFTs held by this contract. /// @dev Any NFTs sent to this contract without using the exchange method will be lost forever, and not /// included in this count. function count() public view returns (uint256 _count) { _count = tokenIds.length; } /// @notice This view function returns the token Id of the Based Bit NFT in any given index location in the /// tokenIds array. /// @param _index The index location to query. /// @return _tokenId The token Id that is held in the index location in the tokenIds array. function getTokenIdAtIndex(uint256 _index) public view returns (uint256 _tokenId) { if (_index >= tokenIds.length) revert IndexOutOfBounds(); _tokenId = tokenIds[_index]; } }
// 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) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * 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 pragma solidity 0.8.25; interface IBBITS { error DepositZero(); error PartialRedemptionDisallowed(); error IndicesMustEqualNumberToBeExchanged(); error IndicesMustBeMonotonicallyDecreasing(); error IndexOutOfBounds(); event Deposit(address _user, uint256 _tokenId); event Withdrawal(address _user, uint256 _tokenId); }
// 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) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (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) (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); }
{ "remappings": [ "@openzeppelin/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 420000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC721","name":"_collection","type":"address"},{"internalType":"uint256","name":"_conversionRate","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DepositZero","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"IndicesMustBeMonotonicallyDecreasing","type":"error"},{"inputs":[],"name":"IndicesMustEqualNumberToBeExchanged","type":"error"},{"inputs":[],"name":"PartialRedemptionDisallowed","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collection","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"conversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"exchangeNFTsForTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"exchangeTokensForNFTs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256[]","name":"_indices","type":"uint256[]"}],"name":"exchangeTokensForSpecificNFTs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getTokenIdAtIndex","outputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b50604051611a98380380611a9883398101604081905261002f916100c2565b6040518060400160405280600a8152602001694261736564204269747360b01b81525060405180604001604052806005815260200164424249545360d81b815250816003908161007f919061019d565b50600461008c828261019d565b50506001600555506001600160a01b0382166080526100ad6012600a610358565b6100b7908261036e565b60a052506103859050565b600080604083850312156100d557600080fd5b82516001600160a01b03811681146100ec57600080fd5b6020939093015192949293505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061012657607f821691505b60208210810361014657634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610198576000816000526020600020601f850160051c810160208610156101755750805b601f850160051c820191505b8181101561019457828155600101610181565b5050505b505050565b81516001600160401b038111156101b6576101b66100fc565b6101ca816101c48454610112565b8461014c565b602080601f8311600181146101ff57600084156101e75750858301515b600019600386901b1c1916600185901b178555610194565b600085815260208120601f198616915b8281101561022e5788860151825594840194600190910190840161020f565b508582101561024c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156102ad5781600019048211156102935761029361025c565b808516156102a057918102915b93841c9390800290610277565b509250929050565b6000826102c457506001610352565b816102d157506000610352565b81600181146102e757600281146102f15761030d565b6001915050610352565b60ff8411156103025761030261025c565b50506001821b610352565b5060208310610133831016604e8410600b8410161715610330575081810a610352565b61033a8383610272565b806000190482111561034e5761034e61025c565b0290505b92915050565b600061036760ff8416836102b5565b9392505050565b80820281158282048414176103525761035261025c565b60805160a0516116b66103e2600039600081816102200152818161042a015281816104970152818161071f015281816107820152610c910152600081816101d4015281816104cb0152818161087c0152610afd01526116b66000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c80637ffdf53e116100b2578063b5eee13211610081578063c51450ca11610066578063c51450ca14610298578063d58778d6146102ab578063dd62ed3e146102be57600080fd5b8063b5eee13214610272578063b6a96eaa1461028557600080fd5b80637ffdf53e1461021b57806395d89b4114610242578063a245389a1461024a578063a9059cbb1461025f57600080fd5b806323b872dd116100ee57806323b872dd14610177578063313ce5671461018a57806370a08231146101995780637de1e536146101cf57600080fd5b806306661abd1461012057806306fdde0314610137578063095ea7b31461014c57806318160ddd1461016f575b600080fd5b6006545b6040519081526020015b60405180910390f35b61013f610304565b60405161012e91906112c8565b61015f61015a36600461135e565b610396565b604051901515815260200161012e565b600254610124565b61015f610185366004611388565b6103b0565b6040516012815260200161012e565b6101246101a73660046113c4565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101f67f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161012e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b61013f6103d4565b61025d6102583660046113e6565b6103e3565b005b61015f61026d36600461135e565b6106ca565b61025d61028036600461144b565b6106d8565b61025d610293366004611497565b610aac565b6101246102a63660046113e6565b610cca565b6101246102b93660046113e6565b610d2d565b6101246102cc3660046114d9565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6060600380546103139061150c565b80601f016020809104026020016040519081016040528092919081815260200182805461033f9061150c565b801561038c5780601f106103615761010080835404028352916020019161038c565b820191906000526020600020905b81548152906001019060200180831161036f57829003601f168201915b5050505050905090565b6000336103a4818585610d4e565b60019150505b92915050565b6000336103be858285610d5b565b6103c9858585610e2f565b506001949350505050565b6060600480546103139061150c565b6103eb610eda565b80600003610425576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61044f7f00000000000000000000000000000000000000000000000000000000000000008261158e565b15610486576040517f90823f3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104903382610f1d565b60006104bc7f0000000000000000000000000000000000000000000000000000000000000000836115d1565b905060005b818110156106bb577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd3033600660008154811061051b5761051b6115e5565b6000918252602090912001546040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561059b57600080fd5b505af11580156105af573d6000803e3d6000fd5b505050507f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b653360066000815481106105e9576105e96115e5565b600091825260209182902001546040805173ffffffffffffffffffffffffffffffffffffffff9094168452918301520160405180910390a16006805461063190600190611614565b81548110610641576106416115e5565b90600052602060002001546006600081548110610660576106606115e5565b600091825260209091200155600680548061067d5761067d611627565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101919091550190556001016104c1565b50506106c76001600555565b50565b6000336103a4818585610e2f565b6106e0610eda565b8260000361071a576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107447f00000000000000000000000000000000000000000000000000000000000000008461158e565b1561077b576040517f90823f3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107a77f0000000000000000000000000000000000000000000000000000000000000000856115d1565b90508181146107e2576040517f5ebc687200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107ec3385610f1d565b60005b81811015610a9b576000811180156108435750838382818110610814576108146115e5565b90506020020135848460018461082a9190611614565b818110610839576108396115e5565b9050602002013511155b1561087a576040517f451b9d5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd30336108d98888878181106108cd576108cd6115e5565b90506020020135610cca565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b505050507f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b6533600686868581811061099b5761099b6115e5565b90506020020135815481106109b2576109b26115e5565b600091825260209182902001546040805173ffffffffffffffffffffffffffffffffffffffff9094168452918301520160405180910390a1600680546109fa90600190611614565b81548110610a0a57610a0a6115e5565b90600052602060002001546006858584818110610a2957610a296115e5565b9050602002013581548110610a4057610a406115e5565b6000918252602090912001556006805480610a5d57610a5d611627565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101919091550190556001016107ef565b5050610aa76001600555565b505050565b610ab4610eda565b806000819003610af0576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610c87577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330878786818110610b4b57610b4b6115e5565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610bc757600080fd5b505af1158015610bdb573d6000803e3d6000fd5b505050506006848483818110610bf357610bf36115e5565b835460018101855560009485526020948590209190940292909201359190920155507fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c33858584818110610c4957610c496115e5565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526020918202939093013590840152500160405180910390a1600101610af3565b50610cbb33610cb67f000000000000000000000000000000000000000000000000000000000000000084611656565b610f79565b50610cc66001600555565b5050565b6006546000908210610d08576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60068281548110610d1b57610d1b6115e5565b90600052602060002001549050919050565b60068181548110610d3d57600080fd5b600091825260209091200154905081565b610aa78383836001610fd5565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610e295781811015610e1a576040517ffb8f41b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101829052604481018390526064015b60405180910390fd5b610e2984848484036000610fd5565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610e7f576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff8216610ecf576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610aa783838361111d565b600260055403610f16576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600555565b73ffffffffffffffffffffffffffffffffffffffff8216610f6d576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610cc68260008361111d565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610cc66000838361111d565b73ffffffffffffffffffffffffffffffffffffffff8416611025576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff8316611075576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526001602090815260408083209387168352929052208290558015610e29578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161110f91815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff831661115557806002600082825461114a919061166d565b909155506112079050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054818110156111db576040517fe450d38c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024810182905260448101839052606401610e11565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff82166112305760028054829003905561125c565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112bb91815260200190565b60405180910390a3505050565b60006020808352835180602085015260005b818110156112f6578581018301518582016040015282016112da565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461135957600080fd5b919050565b6000806040838503121561137157600080fd5b61137a83611335565b946020939093013593505050565b60008060006060848603121561139d57600080fd5b6113a684611335565b92506113b460208501611335565b9150604084013590509250925092565b6000602082840312156113d657600080fd5b6113df82611335565b9392505050565b6000602082840312156113f857600080fd5b5035919050565b60008083601f84011261141157600080fd5b50813567ffffffffffffffff81111561142957600080fd5b6020830191508360208260051b850101111561144457600080fd5b9250929050565b60008060006040848603121561146057600080fd5b83359250602084013567ffffffffffffffff81111561147e57600080fd5b61148a868287016113ff565b9497909650939450505050565b600080602083850312156114aa57600080fd5b823567ffffffffffffffff8111156114c157600080fd5b6114cd858286016113ff565b90969095509350505050565b600080604083850312156114ec57600080fd5b6114f583611335565b915061150360208401611335565b90509250929050565b600181811c9082168061152057607f821691505b602082108103611559577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261159d5761159d61155f565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000826115e0576115e061155f565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b818103818111156103aa576103aa6115a2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b80820281158282048414176103aa576103aa6115a2565b808201808211156103aa576103aa6115a256fea2646970667358221220969bcbeeb678ce4fb934119592eda258e8ecde536179f3301cb8444f6ad3df2164736f6c63430008190033000000000000000000000000617978b8af11570c2dab7c39163a8bde1d2824070000000000000000000000000000000000000000000000000000000000000400
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061011b5760003560e01c80637ffdf53e116100b2578063b5eee13211610081578063c51450ca11610066578063c51450ca14610298578063d58778d6146102ab578063dd62ed3e146102be57600080fd5b8063b5eee13214610272578063b6a96eaa1461028557600080fd5b80637ffdf53e1461021b57806395d89b4114610242578063a245389a1461024a578063a9059cbb1461025f57600080fd5b806323b872dd116100ee57806323b872dd14610177578063313ce5671461018a57806370a08231146101995780637de1e536146101cf57600080fd5b806306661abd1461012057806306fdde0314610137578063095ea7b31461014c57806318160ddd1461016f575b600080fd5b6006545b6040519081526020015b60405180910390f35b61013f610304565b60405161012e91906112c8565b61015f61015a36600461135e565b610396565b604051901515815260200161012e565b600254610124565b61015f610185366004611388565b6103b0565b6040516012815260200161012e565b6101246101a73660046113c4565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101f67f000000000000000000000000617978b8af11570c2dab7c39163a8bde1d28240781565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161012e565b6101247f00000000000000000000000000000000000000000000003782dace9d9000000081565b61013f6103d4565b61025d6102583660046113e6565b6103e3565b005b61015f61026d36600461135e565b6106ca565b61025d61028036600461144b565b6106d8565b61025d610293366004611497565b610aac565b6101246102a63660046113e6565b610cca565b6101246102b93660046113e6565b610d2d565b6101246102cc3660046114d9565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6060600380546103139061150c565b80601f016020809104026020016040519081016040528092919081815260200182805461033f9061150c565b801561038c5780601f106103615761010080835404028352916020019161038c565b820191906000526020600020905b81548152906001019060200180831161036f57829003601f168201915b5050505050905090565b6000336103a4818585610d4e565b60019150505b92915050565b6000336103be858285610d5b565b6103c9858585610e2f565b506001949350505050565b6060600480546103139061150c565b6103eb610eda565b80600003610425576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61044f7f00000000000000000000000000000000000000000000003782dace9d900000008261158e565b15610486576040517f90823f3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104903382610f1d565b60006104bc7f00000000000000000000000000000000000000000000003782dace9d90000000836115d1565b905060005b818110156106bb577f000000000000000000000000617978b8af11570c2dab7c39163a8bde1d28240773ffffffffffffffffffffffffffffffffffffffff166323b872dd3033600660008154811061051b5761051b6115e5565b6000918252602090912001546040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561059b57600080fd5b505af11580156105af573d6000803e3d6000fd5b505050507f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b653360066000815481106105e9576105e96115e5565b600091825260209182902001546040805173ffffffffffffffffffffffffffffffffffffffff9094168452918301520160405180910390a16006805461063190600190611614565b81548110610641576106416115e5565b90600052602060002001546006600081548110610660576106606115e5565b600091825260209091200155600680548061067d5761067d611627565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101919091550190556001016104c1565b50506106c76001600555565b50565b6000336103a4818585610e2f565b6106e0610eda565b8260000361071a576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107447f00000000000000000000000000000000000000000000003782dace9d900000008461158e565b1561077b576040517f90823f3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107a77f00000000000000000000000000000000000000000000003782dace9d90000000856115d1565b90508181146107e2576040517f5ebc687200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107ec3385610f1d565b60005b81811015610a9b576000811180156108435750838382818110610814576108146115e5565b90506020020135848460018461082a9190611614565b818110610839576108396115e5565b9050602002013511155b1561087a576040517f451b9d5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000617978b8af11570c2dab7c39163a8bde1d28240773ffffffffffffffffffffffffffffffffffffffff166323b872dd30336108d98888878181106108cd576108cd6115e5565b90506020020135610cca565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b505050507f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b6533600686868581811061099b5761099b6115e5565b90506020020135815481106109b2576109b26115e5565b600091825260209182902001546040805173ffffffffffffffffffffffffffffffffffffffff9094168452918301520160405180910390a1600680546109fa90600190611614565b81548110610a0a57610a0a6115e5565b90600052602060002001546006858584818110610a2957610a296115e5565b9050602002013581548110610a4057610a406115e5565b6000918252602090912001556006805480610a5d57610a5d611627565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101919091550190556001016107ef565b5050610aa76001600555565b505050565b610ab4610eda565b806000819003610af0576040517feca6f47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610c87577f000000000000000000000000617978b8af11570c2dab7c39163a8bde1d28240773ffffffffffffffffffffffffffffffffffffffff166323b872dd3330878786818110610b4b57610b4b6115e5565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610bc757600080fd5b505af1158015610bdb573d6000803e3d6000fd5b505050506006848483818110610bf357610bf36115e5565b835460018101855560009485526020948590209190940292909201359190920155507fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c33858584818110610c4957610c496115e5565b6040805173ffffffffffffffffffffffffffffffffffffffff90951685526020918202939093013590840152500160405180910390a1600101610af3565b50610cbb33610cb67f00000000000000000000000000000000000000000000003782dace9d9000000084611656565b610f79565b50610cc66001600555565b5050565b6006546000908210610d08576040517f4e23d03500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60068281548110610d1b57610d1b6115e5565b90600052602060002001549050919050565b60068181548110610d3d57600080fd5b600091825260209091200154905081565b610aa78383836001610fd5565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610e295781811015610e1a576040517ffb8f41b200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260248101829052604481018390526064015b60405180910390fd5b610e2984848484036000610fd5565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610e7f576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff8216610ecf576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610aa783838361111d565b600260055403610f16576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600555565b73ffffffffffffffffffffffffffffffffffffffff8216610f6d576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610cc68260008361111d565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b610cc66000838361111d565b73ffffffffffffffffffffffffffffffffffffffff8416611025576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff8316611075576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610e11565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526001602090815260408083209387168352929052208290558015610e29578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161110f91815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff831661115557806002600082825461114a919061166d565b909155506112079050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054818110156111db576040517fe450d38c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024810182905260448101839052606401610e11565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff82166112305760028054829003905561125c565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516112bb91815260200190565b60405180910390a3505050565b60006020808352835180602085015260005b818110156112f6578581018301518582016040015282016112da565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461135957600080fd5b919050565b6000806040838503121561137157600080fd5b61137a83611335565b946020939093013593505050565b60008060006060848603121561139d57600080fd5b6113a684611335565b92506113b460208501611335565b9150604084013590509250925092565b6000602082840312156113d657600080fd5b6113df82611335565b9392505050565b6000602082840312156113f857600080fd5b5035919050565b60008083601f84011261141157600080fd5b50813567ffffffffffffffff81111561142957600080fd5b6020830191508360208260051b850101111561144457600080fd5b9250929050565b60008060006040848603121561146057600080fd5b83359250602084013567ffffffffffffffff81111561147e57600080fd5b61148a868287016113ff565b9497909650939450505050565b600080602083850312156114aa57600080fd5b823567ffffffffffffffff8111156114c157600080fd5b6114cd858286016113ff565b90969095509350505050565b600080604083850312156114ec57600080fd5b6114f583611335565b915061150360208401611335565b90509250929050565b600181811c9082168061152057607f821691505b602082108103611559577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261159d5761159d61155f565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000826115e0576115e061155f565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b818103818111156103aa576103aa6115a2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b80820281158282048414176103aa576103aa6115a2565b808201808211156103aa576103aa6115a256fea2646970667358221220969bcbeeb678ce4fb934119592eda258e8ecde536179f3301cb8444f6ad3df2164736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000617978b8af11570c2dab7c39163a8bde1d2824070000000000000000000000000000000000000000000000000000000000000400
-----Decoded View---------------
Arg [0] : _collection (address): 0x617978b8af11570c2dAb7c39163A8bdE1D282407
Arg [1] : _conversionRate (uint256): 1024
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000617978b8af11570c2dab7c39163a8bde1d282407
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000400
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.