More Info
Private Name Tags
Latest 25 from a total of 524 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Buy Item With Se... | 65766448 | 92 days ago | IN | 0 POL | 0.00354636 | ||||
Buy Item With Se... | 65766418 | 92 days ago | IN | 0 POL | 0.0047271 | ||||
Buy Item With Se... | 65766385 | 92 days ago | IN | 0 POL | 0.00365509 | ||||
Buy Item With Se... | 65766376 | 92 days ago | IN | 0 POL | 0.00378649 | ||||
Buy Item With Se... | 65766366 | 92 days ago | IN | 0 POL | 0.00398697 | ||||
Buy Item With Se... | 65766359 | 92 days ago | IN | 0 POL | 0.00512032 | ||||
Buy Item With Se... | 65766220 | 92 days ago | IN | 0 POL | 0.00458404 | ||||
Buy Item With Se... | 65766195 | 92 days ago | IN | 0 POL | 0.00491129 | ||||
Buy Item With Se... | 65766174 | 92 days ago | IN | 0 POL | 0.00516308 | ||||
Buy Item With Se... | 65766154 | 92 days ago | IN | 0 POL | 0.00502836 | ||||
Buy Item With Se... | 65766138 | 92 days ago | IN | 0 POL | 0.00460097 | ||||
Buy Item With Se... | 65766097 | 92 days ago | IN | 0 POL | 0.00465376 | ||||
Buy Item With Se... | 65766074 | 92 days ago | IN | 0 POL | 0.00454384 | ||||
Buy Item With Se... | 65766035 | 92 days ago | IN | 0 POL | 0.00584237 | ||||
Buy Item With Se... | 65765938 | 92 days ago | IN | 0 POL | 0.00578835 | ||||
Buy Item With Se... | 65765930 | 92 days ago | IN | 0 POL | 0.00507013 | ||||
Buy Item With Se... | 65765903 | 92 days ago | IN | 0 POL | 0.00625178 | ||||
Buy Item With Se... | 65765832 | 92 days ago | IN | 0 POL | 0.00779892 | ||||
Buy Item With Se... | 65765753 | 92 days ago | IN | 0 POL | 0.00489374 | ||||
Buy Item With Se... | 65765743 | 92 days ago | IN | 0 POL | 0.00739496 | ||||
Buy Item With Se... | 65765616 | 92 days ago | IN | 0 POL | 0.00351403 | ||||
Buy Item With Se... | 65765602 | 92 days ago | IN | 0 POL | 0.00503467 | ||||
Buy Item With Se... | 65765281 | 92 days ago | IN | 0 POL | 0.00362857 | ||||
Buy Item With Se... | 65765265 | 92 days ago | IN | 0 POL | 0.00367066 | ||||
Buy Item With Se... | 65765184 | 92 days ago | IN | 0 POL | 0.00370191 |
Loading...
Loading
Contract Name:
GOBMarket
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion, Audited
Contract Source Code (Solidity Standard Json-Input format)Audit Report
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/access/AccessControl.sol"; import "../base/GOBValidCurrencies/GOBValidCurrencies.sol"; import "../base/GOBWithdraw/GOBWithdraw.sol"; import "../token/vesting/IVesting.sol"; import "../token/base/ERC20/IERC20MetadataBurnable.sol"; import "../token/base/ERC1155/IERC1155Mint.sol"; /** * @author Alejandro Garrido - Guardians of the Ball. * @title Guardians of the Ball - GOBMarket. * @notice GOBMarket sales ERC1155 tokens in exchange for approved ERC20 tokens. * Tokens listed for sale can be viewed with `listedItems()` and `listedItem()`. * Tokens are minted to the buyer when the purchase is completed. * Tokens can be bought using one of three different payment methods: * - `buyItem()`: pay with ERC20 tokens listed in `validCurrencies()`. * - `buyItemWithVesting()`: pay with ERC20 tokens locked in `vesting`. * - `buyItemWithSeed()`: pay with ERC20 seed tokens used by `vesting`. */ contract GOBMarket is GOBValidCurrencies, GOBWithdraw, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.UintSet; using SafeERC20 for IERC20; using SafeERC20 for IERC20Metadata; bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); bytes32 public constant SELLER_ROLE = keccak256("SELLER_ROLE"); bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE"); /** * @dev Emitted when a token has been purchased. */ event TokenPurchased( address indexed erc1155, uint256 indexed tokenId, address indexed to, uint256 quantity, address currency, uint256 totalAmount ); /** * @dev Emitted when MANAGER_ROLE adds a new valid erc1155. */ event ERC1155Added(address indexed erc1155); /** * @dev Emitted when MANAGER_ROLE removes valid erc1155. */ event ERC1155Removed(address indexed erc1155); /** * @dev Emitted when MANAGER_ROLE changed the vesting address. */ event VestingChanged(address indexed newVesting); /** * @dev Emitted when MANAGER_ROLE changed `seedPrice`. */ event SeedPriceChanged(uint256 indexed newSeedPrice); /** * @dev Emitted when SELLER_ROLE lists an item for sale. */ event TokenListed( address indexed erc1155, uint256 indexed tokenId, uint256 price, uint256 salesCap ); /** * @dev Emitted when SELLER_ROLE removes an item selling list. */ event TokenUnlisted(address indexed erc1155, uint256 indexed tokenId); /** * @dev Emitted when SELLER_ROLE changes the price of a token. */ event PriceChanged( address indexed erc1155, uint256 indexed tokenId, uint256 oldPrice, uint256 newPrice ); /** * @dev Emitted when SELLER_ROLE changes the sale cap of a token listed for sale. */ event CapChanged( address indexed erc1155, uint256 indexed tokenId, uint256 oldCap, uint256 newCap ); modifier validERC1155(address erc1155) { require(_erc1155Set.contains(erc1155), "GOBMarket: Erc1155 not found"); _; } modifier validTokenId(address erc1155, uint256 tokenId) { require(_tokenIdSet[erc1155].contains(tokenId), "GOBMarket: TokenId not found"); _; } modifier isVestingSet() { require(address(vesting) != address(0), "GOBMarket: Vesting not set"); require(seedPrice > 0, "GOBMarket: Vesting price not set"); _; } struct ItemInfo { uint256 price; uint256 salesCap; uint256 sold; } enum BuyWith { ValidCurrency, SeedToken, SeedTokenVested } // Decimals use to set the price for `_currencies` and seedTokens in `vesting` uint8 public immutable priceDecimals; // erc1155 => tokenId => SaleInfo. Items may or me not be for sale. mapping(address => mapping(uint256 => ItemInfo)) public items; // Price of seedTokens with decimals `priceDecimals` uint256 public seedPrice; // Vesting contract IVesting public vesting; // Erc1155s listed as valid EnumerableSet.AddressSet private _erc1155Set; // Tokens available for sale. Erc1155 => tokenId set. mapping(address => EnumerableSet.UintSet) private _tokenIdSet; /** * @dev Sets the deployer with role DEFAULT_ADMIN_ROLE, set priceDecimals and currencies. * * Requirements: * - `currencies` cannot be empty. * - `priceDecimals_ must be >=2 and <=6. * * @param currencies ERC20 accepted as payment. Should be stablecoins pegged to the same asset. * @param priceDecimals_ Decimals used in `items.price` and `seedPrice`. */ constructor(address[] memory currencies, uint8 priceDecimals_) { uint256 len = currencies.length; require(len > 0, "Currencies cannot be empty"); // Cannot be greater than 6 to be able to work with USDT and USDC require(priceDecimals_ <= 6, "Price decimals must be <= 6"); require(priceDecimals_ >= 2, "Price decimals must be >= 2"); priceDecimals = priceDecimals_; for (uint256 i = 0; i < len; ) { _addCurrencyDec(currencies[i]); unchecked { i++; } } _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); } // --- PUBLIC --- /** * @notice Returns the selling info for a token in `erc1155`. * @param erc1155 ERC1155 addresss. * @param tokenId Token to query. Must be listed for sale. See `listedItems`. * @return item Struct of `ItemInfo` with the price, cap and sold data. */ function listedItem( address erc1155, uint256 tokenId ) external view validTokenId(erc1155, tokenId) returns (ItemInfo memory item) { return items[erc1155][tokenId]; } /** * @notice Returns the selling info for all tokens in `erc1155` available for sale. * @param erc1155 ERC1155 addresss. * @return tokenIds Array of all tokenIds. * @return listedItems_ Array of `ItemInfo`. Matched by index with `_tokenIds`. */ function listedItems( address erc1155 ) external view validERC1155(erc1155) returns (uint256[] memory tokenIds, ItemInfo[] memory listedItems_) { uint256 length = _tokenIdSet[erc1155].length(); listedItems_ = new ItemInfo[](length); tokenIds = new uint256[](length); for (uint256 i = 0; i < length; ) { listedItems_[i] = items[erc1155][_tokenIdSet[erc1155].at(i)]; tokenIds[i] = _tokenIdSet[erc1155].at(i); unchecked { i++; } } } /** * @notice Returns all the available ERC1155. * @return Array with all ERC1155 addresses. */ function erc1155List() external view returns (address[] memory) { return _erc1155Set.values(); } /** * @notice Returns the ERC1155 counter. * @return ERC1155 counter. */ function erc1155Length() external view returns (uint256) { return _erc1155Set.length(); } /** * @notice Returns the ERC1155 address at a specific `index`. * @return ERC1155 address. */ function erc1155At(uint256 index) external view returns (address) { return _erc1155Set.at(index); } /** * @notice Buy tokens of a listed ERC1155 using an approved ERC20 as payment. * The token's price is in `items` and it is expressed in `priceDecimals` * If the price of token id 1 is set at 300000 and priceDecimals is 4, the price in USDC is 30.00 * if paying with USDC as currency. * * Emits {TokenPurchased}. * * Requirements: * - `currency` must exists in validCurrencies(). * - `erc1155` and `tokenId` must be listed for sale. See `listedItems` and `listedItem`. * - Sender must have enough balance of selected `currency`. * - GOBMarket must have enough allowance of sender's selected `currency`. * * @param erc1155 ERC1155 addresss. * @param tokenId Token to purchase. * @param to Address to mint the `tokenId`. * @param quantity Amount of tokens to purchase. It cannot be zero. * @param currency ERC20 to be used as payment. */ function buyItem( address erc1155, uint256 tokenId, address to, uint256 quantity, address currency ) external validCurrency(currency) { _buyItem(erc1155, tokenId, to, quantity, currency, BuyWith.ValidCurrency); } /** * @notice Buy tokens of a listed ERC1155 using ERC20 tokens locked in `vesting`. * The token's price is in `items` and it is expressed in `priceDecimals`. * The value of the locked tokens is set in `seedPrice` and is also using `priceDecimals`. * (See buyItem) * * If `seedPrice` is 10000 and `priceDecimals` is 4, the convertion rate between * any `validCurrencies()` and locked tokens is 1:1 (10000 / 10**4) (ie: 1 LockedToken = 1 USDC) * If `seedPrice` is 5000 the convertion rate is 1:2 (5000 / 10**4) (ie: 1 LockedToken = 2 USDC) * * Emits {TokenPurchased}. * * Requirements: * - `erc1155` and `tokenId` must be listed for sale. See `listedItems` and `listedItem`. * - `vesting` and `seedPrice` must be set. * - Sender must have enough balance of locked tokens in `vesting`. * * @param erc1155 ERC1155 addresss. * @param tokenId Token to purchase. * @param to Address to mint the `tokenId`. * @param quantity Amount of tokens to purchase. It cannot be zero. */ function buyItemWithVesting( address erc1155, uint256 tokenId, address to, uint256 quantity ) external isVestingSet { _buyItem(erc1155, tokenId, to, quantity, vesting.token(), BuyWith.SeedTokenVested); } /** * @notice Buy tokens of a listed ERC1155 using ERC20 seed tokens used by `vesting`. * All price calculations are the same as `buyItemWithVesting()`. * * Emits {TokenPurchased}. * * Requirements: * - `erc1155` and `tokenId` must be listed for sale. See `listedItems` and `listedItem`. * - Sender must have enough balance of seed token used by `vesting`. * - GOBMarket must have enough allowance of sender's seed token. * - `vesting` and `seedPrice` must be set. * * @param erc1155 ERC1155 addresss. * @param to Address to mint the `tokenId`. * @param tokenId Token to purchase. * @param quantity Amount of tokens to purchase. It cannot be zero. */ function buyItemWithSeed( address erc1155, uint256 tokenId, address to, uint256 quantity ) external isVestingSet { _buyItem(erc1155, tokenId, to, quantity, vesting.token(), BuyWith.SeedToken); } // --- MANAGER --- /** * @notice Adds a new currency to the list of ERC20s accepted as payments. * * IMPORTANT: All ERC20s are assumed to be of the same market value. * There is only one price per token id listed for sale, and that price applies * to all currencies. * * Emits {CurrencyAdded}. * * @param newCurrency ERC20 address (ie: usdc). */ function addCurrency(address newCurrency) external onlyRole(MANAGER_ROLE) { _addCurrencyDec(newCurrency); } /** * @notice Removes an ERC20 from the accepted list of currencies. * * Emits {CurrencyRemoved}. * * @param currency ERC20 address. */ function removeCurrency(address currency) external onlyRole(MANAGER_ROLE) { _removeCurrency(currency); } /** * @notice Adds an ERC1155 that will hold the tokens to be sold (minted). * GOBMarket must have minting access in `erc1155` at purchase time. * * Emits {ERC1155Added}. * * @param erc1155 ERC1155 address */ function addERC1155(address erc1155) external onlyRole(MANAGER_ROLE) { require(erc1155 != address(0), "GOBMarket: Invalid erc1155 address"); require(!_erc1155Set.contains(erc1155), "GOBMarket: Erc1155 already exists"); _erc1155Set.add(erc1155); emit ERC1155Added(erc1155); } /** * @notice Removes an ERC1155. * * Emits {ERC1155Removed}. * * Requirements: * - `erc1155` must not have tokens listed for sale. * * @param erc1155 ERC1155 address */ function removeERC1155(address erc1155) external onlyRole(MANAGER_ROLE) validERC1155(erc1155) { require(_tokenIdSet[erc1155].length() == 0, "GOBMarket: Erc1155 has tokens listed"); _erc1155Set.remove(erc1155); emit ERC1155Removed(erc1155); } /** * @notice Sets the vesting contract that allows the purchase using vested tokens or seedTokens. * @param vesting_ Vesting address. * * Emits {VestingChanged}. * * Requirements: * - `vesting_` must have vesting token set. * - vested token decimals must be >= `priceDecimals`. */ function setVesting(address vesting_) external onlyRole(MANAGER_ROLE) { require(vesting_ != address(0), "GOBMarket: Zero address"); IERC20Metadata seedToken = IERC20Metadata(IVesting(vesting_).token()); require( seedToken.decimals() >= priceDecimals, "GOBMarket: Vesting token's decimals too low" ); vesting = IVesting(vesting_); emit VestingChanged(vesting_); } // --- SELLER --- /** * @notice Lists one tokenId for sale. `erc1155` must exists. * * Emits {TokenListed}. * * Requirements: * - `tokenId` Must no be listed. * * @param erc1155 ERC1155 address. * @param tokenId The token id to be minted in `erc1155`. . * @param price Token's price using validCurrencies() with priceDecimals. * @param salesCap Max amount of tokens that can be sold. */ function listItem( address erc1155, uint256 tokenId, uint256 price, uint256 salesCap ) external onlyRole(SELLER_ROLE) validERC1155(erc1155) { require(!_tokenIdSet[erc1155].contains(tokenId), "GOBMarket: Token aleready listed"); // Add tokenId if not present _tokenIdSet[erc1155].add(tokenId); // Set price (if different) _setPrice(erc1155, tokenId, price); // Set cap (if diffeerent) _setCap(erc1155, tokenId, salesCap); emit TokenListed(erc1155, tokenId, price, salesCap); } /** * @notice Unlists tokens from the selling list. * * Emits {TokenUnlisted}. * * Requirements: * - `tokenId` must be listed. * * @param erc1155 ERC1155 address. * @param tokenIds Array with the token ids to be removed. */ function unlistItems( address erc1155, uint256[] calldata tokenIds ) external onlyRole(SELLER_ROLE) { require(tokenIds.length > 0, "tokenIds cannot be empty"); for (uint256 i = 0; i < tokenIds.length; ) { require(_tokenIdSet[erc1155].contains(tokenIds[i]), "GOBMarket: TokenId not found"); _tokenIdSet[erc1155].remove(tokenIds[i]); emit TokenUnlisted(erc1155, tokenIds[i]); unchecked { i++; } } } /** * @notice Changes the priced of a token listed for sale. * * Emits {PriceChanged}. * * Requirements: * - `tokenId` must be listed. * - `newPrice` must be different than the previous price. * * @param erc1155 ERC1155 address. * @param tokenId The token id to be changed. * @param newPrice New price. */ function changePrice( address erc1155, uint256 tokenId, uint256 newPrice ) external onlyRole(SELLER_ROLE) validTokenId(erc1155, tokenId) { uint256 oldPrice = items[erc1155][tokenId].price; require(_setPrice(erc1155, tokenId, newPrice), "GOBMarket: Same price"); emit PriceChanged(erc1155, tokenId, oldPrice, newPrice); } /** * @notice Change the sale cap of a token listed for sale. * * Emits {CapChanged}. * * Requirements: * - `tokenId` must be listed. * - `newCap`Must be different than previous cap and cannot be less than the amount sold so far. * * @param erc1155 ERC1155 address. * @param tokenId The token id to be changed. * @param newCap New cap. */ function changeCap( address erc1155, uint256 tokenId, uint256 newCap ) external onlyRole(SELLER_ROLE) validTokenId(erc1155, tokenId) { uint256 oldCap = items[erc1155][tokenId].salesCap; require(_setCap(erc1155, tokenId, newCap), "GOBMarket: Same cap"); emit CapChanged(erc1155, tokenId, oldCap, newCap); } /** * @notice Sets the parity betwen the seed token in `vesting` and accepted currencies. * Calculations use `priceDecimals`. See `buyItemWithVesting()`. * * NOTE: If `seedPrice` is set to zero, buyItemWithVesting() and buyItemWithSeed() * will be disabled. * * Emits {SeedPriceChanged}. * * @param price New price. */ function setSeedPrice(uint256 price) external onlyRole(SELLER_ROLE) { seedPrice = price; emit SeedPriceChanged(price); } // --- WITHDRAW --- /** * @notice See {GOBWithdraw-_withdrawSet}. */ function withdrawCurrencies() external onlyRole(WITHDRAW_ROLE) { require(_withdrawSet(_currencies), "GOBMarket: No balance available"); } /** * @notice See {GOBWithdraw-_withdraw}. */ function withdraw(address currency_, uint256 amount) external onlyRole(WITHDRAW_ROLE) { require(amount > 0, "GOBMarket: Amount cannot be zero"); _withdraw(currency_, amount); } // --- PRIVATE --- /** * @dev Called by buyItem(), buyItemWithVesting() and buyItemWithSeed(). */ function _buyItem( address erc1155, uint256 tokenId, address to, uint256 quantity, address currency, BuyWith buywith ) private validTokenId(erc1155, tokenId) { require(to != address(0), "GOBMarket: Zero to address"); require(quantity > 0, "GOBMarket: Quantity cannot be zero"); require( items[erc1155][tokenId].salesCap - items[erc1155][tokenId].sold >= quantity, "GOBMarket: Not enough units available" ); items[erc1155][tokenId].sold += quantity; uint256 totalAmout; address sender = _msgSender(); if (buywith == BuyWith.ValidCurrency) { IERC20Metadata _currency = IERC20Metadata(currency); uint256 price = items[erc1155][tokenId].price; totalAmout = price * quantity * (10 ** (_currency.decimals() - priceDecimals)); _currency.safeTransferFrom(sender, address(this), totalAmout); } else { IERC20MetadataBurnable seedToken = IERC20MetadataBurnable(currency); uint256 factor = items[erc1155][tokenId].price * seedPrice; uint256 price = (factor * 10 ** (seedToken.decimals() - priceDecimals)) / 10 ** priceDecimals; totalAmout = price * quantity; if (buywith == BuyWith.SeedToken) { seedToken.burnFrom(sender, totalAmout); } else { // buywith == BuyWith.SeedTokenVested IVesting(vesting).withdrawFrom(sender, totalAmout); seedToken.burn(totalAmout); } } IERC1155Mint(erc1155).mint(to, tokenId, quantity, ""); emit TokenPurchased(erc1155, tokenId, to, quantity, currency, totalAmout); } /** * @dev Changes the token's price only if `newPrice` is different than stored price. * @return bool Returns true if the stored price was changed and false otherwise. */ function _setPrice(address erc1155, uint256 tokenId, uint256 newPrice) private returns (bool) { require(newPrice > 0, "GOBMarket: Price cannot be zero"); if (items[erc1155][tokenId].price == newPrice) { return false; } items[erc1155][tokenId].price = newPrice; return true; } /** * @dev Changes the token's salesCap only if `newCap` is different than stored salesCap. * @return bool Returns true if the stored salesCap was changed and false otherwise. */ function _setCap(address erc1155, uint256 tokenId, uint256 newCap) private returns (bool) { require(newCap > 0, "GOBMarket: SalesCap cannot be zero"); if (items[erc1155][tokenId].salesCap == newCap) { return false; } require( newCap >= items[erc1155][tokenId].sold, "GOBMarket: SalesCap cannot be less than sold" ); items[erc1155][tokenId].salesCap = newCap; return true; } function _addCurrencyDec(address newCurrency) private { require( IERC20Metadata(newCurrency).decimals() >= priceDecimals, "GOBMarket: Currency decimals too low" ); _addCurrency(newCurrency); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); 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 keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** * @author Alejandro Garrido - Guardians of the Ball. * @title Guardians of the Ball - GOBValidCurrencies. * @dev Helper to manage a list of accepted currencies in inherited contracts. * Child contracts can call _addCurrency(), _removeCurrency(), and use the modifier validCurrency(). * They can also access the list in the internal AddressSet `_currencies`. */ abstract contract GOBValidCurrencies { using EnumerableSet for EnumerableSet.AddressSet; /** * @dev Emitted when new valid currency is added. */ event CurrencyRemoved(address indexed newCurrency); /** * @dev Emitted when a valid currency is removed. */ event CurrencyAdded(address indexed newCurrency); modifier validCurrency(address currency) { require(_currencies.contains(currency), "GOBValidCurrencies: Invalid currency"); _; } // Accepted currencies. EnumerableSet.AddressSet internal _currencies; /** * @notice Returns all ERC20 accepted as payment. * @return Array with all ERC20 addresses. */ function validCurrencies() external view returns (address[] memory) { return _currencies.values(); } /** * @notice Check if a currency is listed. * @param currency The ERC20 address. * @return Whether the ERC20 is listed or not. */ function isValidCurrency(address currency) external view returns (bool) { return _currencies.contains(currency); } /** * @notice Adds a new currency to the list of ERC20s accepted. * * Emits {CurrencyAdded}. * * @param newCurrency ERC20 address (ie: usdc). */ function _addCurrency(address newCurrency) internal { require(newCurrency != address(0), "GOBValidCurrencies: Zero address"); require(!_currencies.contains(newCurrency), "GOBValidCurrencies: Currency already exists"); _currencies.add(newCurrency); emit CurrencyAdded(newCurrency); } /** * @notice Removes an ERC20 from the accepted list of currencies. * * Emits {CurrencyRemoved}. * * @param currency ERC20 address. */ function _removeCurrency(address currency) internal validCurrency(currency) { require(_currencies.length() > 1, "GOBValidCurrencies: Only one currency left"); _currencies.remove(currency); emit CurrencyRemoved(currency); } }
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** * @author Matias Arazi - Guardians of the Ball. * @title Guardians of the Ball - GOBWithdraw. * @dev Helper to manage withdraw functions in inherited contracts. * Child contracts can call _withdraw(), _withdrawSet(). */ abstract contract GOBWithdraw is Context { using EnumerableSet for EnumerableSet.AddressSet; using SafeERC20 for IERC20; /** * @dev Emitted when funds are withdrawn from the contract for a specific tokenAddress. * @param callerAddress The address of the caller who initiated the withdrawal. * @param tokenAddress The address of the tokenAddress from which funds are withdrawn. * @param amount The amount of tokenAddress withdrawn. */ event Withdrawn(address indexed callerAddress, address indexed tokenAddress, uint256 amount); /** * @notice Withdraw funds from the contract for a specific tokenAddress. * @param token The address of the tokenAddress to withdraw from. * @param amount The amount of tokenAddress withdrawn. * * Requirements: * - The token address must be a valid ERC20 token. (address must be an erc20) */ function _withdraw(address token, uint256 amount) internal { IERC20 currency = IERC20(token); currency.safeTransfer(msg.sender, amount); emit Withdrawn(_msgSender(), token, amount); } /** * @notice Withdraw funds from the contract for multiple token addresses. * @param tokenSet AddressSet of tokens in storage. * @return isWithdrawn Withdrawn at least one of the tokens in `tokenSet` */ function _withdrawSet( EnumerableSet.AddressSet storage tokenSet ) internal returns (bool isWithdrawn) { uint256 balance; uint256 len = tokenSet.length(); IERC20 currency; for (uint256 i = 0; i < len; ) { currency = IERC20(tokenSet.at(i)); balance = currency.balanceOf(address(this)); if (balance > 0) { _withdraw(address(currency), balance); isWithdrawn = true; } unchecked { i++; } } } }
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ /// @title Guardians of the Ball - ERC1155CrossmintAdapter /// @author Guardians of the Ball // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; interface IERC1155Mint { function mint(address to, uint256 id, uint256 amount, bytes memory data) external; }
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ /// @title Guardians of the Ball - IERC20MetadataBurnable /// @author Guardians of the Ball // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; interface IERC20MetadataBurnable is IERC20Metadata { function burn(uint256 amount) external; function burnFrom(address account, uint256 amount) external; }
//...........,,..,,,,,,,.................................. //......###(#######(,,,,.##########....######(((((*....... //......%%%%%%%%%%%%%.,#%%%%%%%%%%%%%..%%%%%%%%%%%%%...... //......%%%%%...%%%&%,,%%&&&,,,,&&%%%..%%%%%...%%%%%...... //......&&&&&...&&.,,,,&&&&&,***&&&&&..&&&&&...&&&&&...... //......&&&&&.,,,,,,,,*&@@@@///*@@&@&,.&&&&&...&&&&&...... //.....*@@@@@.@@@@@@&**@@@@@%%#/@@@@,,&@@@@@@@@@@@@....... //......@@@@@.@@@#@@@**&@@@@%&#(@@@@@,,@@@@@@@@@@@@@...... //......&&&&&...@@@@@,*&@@@@////@@@@@,,&&&&&...&&&&&...... //......&&&&&...&&&&&,,&&&&@***,&&&&&,.&&&&&...&&&&&...... //......%%%&&...&&&&&,,%&&&&,,,,&&&&&..&&&%%...&&&&&...... //......%%%%%%%%%%%%%..#%%%%%%%%%%%%#..%%%%%%%%%%%%%...... //........................................................ // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; /** * @title Guardians of the Ball - IVesting * @author Guardians of the Ball * @notice Vesting contract Interface */ interface IVesting { /** * @dev Agenda struct. * @param account The address of the agenda owner. * @param amount The amount of tokens currently being locked, amount is substracted for each withdrawal/authorizedWithdrawal. * @param endTime The end time of the vesting in unix timestamp. */ struct Agenda { uint256 amount; uint256 endTime; } /** * @notice Emitted when a new agenda is created by the `OTC_CONTROLLER_ROLE`. * @param account The address of the agenda owner. * @param amount The amount of tokens to be vested. * @param agendaId the hash identifier of the agenda * @param start The start time of the vesting in unix timestamp. * @param end The end time of the vesting in unix timestamp. */ event AgendaCreated( address indexed account, uint256 amount, bytes32 agendaId, uint256 start, uint256 end ); /** * @notice Emitted when a withdrawal or authorized withdrawal is made. * @param account The address of the agenda owner. * @param operator The address of the caller, if `operator` == `account` then it is a withdrawal, else, an authorized withdrawal. * @param amount The amount of tokens withdrawn. */ event Withdrawn(address indexed account, address indexed operator, uint256 amount); /** * @dev Returns the address of the token being vested. */ function token() external view returns (address); /** * @dev Returns available balance of `account`. * @param account The address to query. */ function balanceOf(address account) external view returns (uint256); /** * @dev Returns locked balance of `account`. * @param account The address to query. */ function totalLocked(address account) external view returns (uint256); /** * @dev Returns all vested balance of `account`. * @param account The address to query. */ function totalVested(address account) external view returns (uint256); /** * @dev withdraws all available tokens for the sender. * * Emits a {Withdrawn} event. * * Requirements: * - the agenda must be unlocked. * - the sender must have a non-zero balance. */ function withdraw() external; /** * @dev withdraws `amount` tokens for `agendaOwner`. * @param agendaOwner address to spend `amount` tokens from * @param amount The amount of tokens to spend. * * Emits a {Withdrawn} event. * * Requirements: * - `agendaOwner` must have a non-zero balance. * - Must be called by `AUTHORIZED_SPENDER_ROLE` * - `agendaOwner` must have approved operator or caller to spend `amount` tokens */ function withdrawFrom(address agendaOwner, uint256 amount) external; /** * @dev Creates a new agenda that locks `amount` tokens for `beneficiary` until `block.timestamp` + `durationPerAgenda`. * @param beneficiary The address of the agenda owner. * @param amount The amount of tokens to be vested. * * Emits a {AgendaCreated} event. * * Requirements: * - Must be called by `OTC_CONTROLLER_ROLE` * - `beneficiary` must not be the zero address. * - `amount` must be non-zero. * - `beneficiary` must have approved contract to spend `amount` tokens. */ function createAgenda(address beneficiary, uint256 amount) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- Certik - Nov 9th, 2023 - Security Audit Report
Contract ABI
API[{"inputs":[{"internalType":"address[]","name":"currencies","type":"address[]"},{"internalType":"uint8","name":"priceDecimals_","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldCap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"CapChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newCurrency","type":"address"}],"name":"CurrencyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newCurrency","type":"address"}],"name":"CurrencyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"}],"name":"ERC1155Added","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"}],"name":"ERC1155Removed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"PriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"newSeedPrice","type":"uint256"}],"name":"SeedPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"salesCap","type":"uint256"}],"name":"TokenListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"TokenPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc1155","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenUnlisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newVesting","type":"address"}],"name":"VestingChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"callerAddress","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SELLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newCurrency","type":"address"}],"name":"addCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"}],"name":"addERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"currency","type":"address"}],"name":"buyItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"buyItemWithSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"buyItemWithVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"changeCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"erc1155At","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc1155Length","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc1155List","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"}],"name":"isValidCurrency","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"items","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"salesCap","type":"uint256"},{"internalType":"uint256","name":"sold","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"salesCap","type":"uint256"}],"name":"listItem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"listedItem","outputs":[{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"salesCap","type":"uint256"},{"internalType":"uint256","name":"sold","type":"uint256"}],"internalType":"struct GOBMarket.ItemInfo","name":"item","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"}],"name":"listedItems","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"components":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"salesCap","type":"uint256"},{"internalType":"uint256","name":"sold","type":"uint256"}],"internalType":"struct GOBMarket.ItemInfo[]","name":"listedItems_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency","type":"address"}],"name":"removeCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"}],"name":"removeERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seedPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setSeedPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"vesting_","type":"address"}],"name":"setVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc1155","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unlistItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validCurrencies","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vesting","outputs":[{"internalType":"contract IVesting","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currency_","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawCurrencies","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b50604051620039693803806200396983398101604081905262000034916200051b565b815180620000895760405162461bcd60e51b815260206004820152601a60248201527f43757272656e636965732063616e6e6f7420626520656d70747900000000000060448201526064015b60405180910390fd5b60068260ff161115620000df5760405162461bcd60e51b815260206004820152601b60248201527f507269636520646563696d616c73206d757374206265203c3d20360000000000604482015260640162000080565b60028260ff161015620001355760405162461bcd60e51b815260206004820152601b60248201527f507269636520646563696d616c73206d757374206265203e3d20320000000000604482015260640162000080565b60ff821660805260005b818110156200017e576200017584828151811062000161576200016162000601565b60200260200101516200019560201b60201c565b6001016200013f565b506200018c6000336200026d565b50505062000635565b60805160ff16816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001da573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000200919062000617565b60ff1610156200025f5760405162461bcd60e51b8152602060048201526024808201527f474f424d61726b65743a2043757272656e637920646563696d616c7320746f6f604482015263206c6f7760e01b606482015260840162000080565b6200026a81620002f8565b50565b62000279828262000421565b620002f45760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620002b33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6001600160a01b038116620003505760405162461bcd60e51b815260206004820181905260248201527f474f4256616c696443757272656e636965733a205a65726f2061646472657373604482015260640162000080565b6200036b8160006200044e60201b620016bf1790919060201c565b15620003ce5760405162461bcd60e51b815260206004820152602b60248201527f474f4256616c696443757272656e636965733a2043757272656e637920616c7260448201526a656164792065786973747360a81b606482015260840162000080565b620003e98160006200047360201b620016e41790919060201c565b506040516001600160a01b038216907fe0390a89516146ccfb796a9fbfc3f7646282194c554d05020484599ee992dd5a90600090a250565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60006200046c836001600160a01b0384166000818152600183016020526040812054620004cd5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000448565b50600062000448565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200050457600080fd5b919050565b805160ff811681146200050457600080fd5b600080604083850312156200052f57600080fd5b82516001600160401b03808211156200054757600080fd5b818501915085601f8301126200055c57600080fd5b8151602082821115620005735762000573620004d6565b8160051b604051601f19603f830116810181811086821117156200059b576200059b620004d6565b604052928352818301935084810182019289841115620005ba57600080fd5b948201945b83861015620005e357620005d386620004ec565b85529482019493820193620005bf565b9650620005f4905087820162000509565b9450505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156200062a57600080fd5b6200046c8262000509565b6080516132f5620006746000396000818161026301528181610ba40152818161193501528181611a2401528181611a4c0152611eec01526132f56000f3fe608060405234801561001057600080fd5b506004361061021b5760003560e01c80638ab234b611610125578063d547741f116100ad578063e1a9109d1161007c578063e1a9109d1461051f578063eb5e443d14610532578063ec87621c14610545578063f3fef3a31461055a578063f8fad9931461056d57600080fd5b8063d547741f146104c8578063d61a4849146104db578063dbe4613d146104e3578063e02023a1146104f857600080fd5b8063a6dd562d116100f4578063a6dd562d14610469578063abc1877b1461047c578063b56da7121461048f578063bcb143ef146104a2578063c5d3a107146104b557600080fd5b80638ab234b61461043357806391d14854146104465780639570fc8714610459578063a217fddf1461046157600080fd5b80634370e108116101a85780635c80a435116101775780635c80a4351461039c5780636f6ff3bc146103f1578063741cbae4146104045780637e34cd3d1461041757806381b856001461042057600080fd5b80634370e1081461032b57806344c63eec1461034b5780634fb9255814610376578063534be8fb1461038957600080fd5b80631d28031f116101ef5780631d28031f146102b8578063248a9ca3146102cd5780632c27b071146102f05780632f2ff15d1461030557806336568abe1461031857600080fd5b80623bf96c1461022057806301ffc9a71461023b57806305300b281461025e5780630ea903d514610297575b600080fd5b610228610580565b6040519081526020015b60405180910390f35b61024e610249366004612b04565b610591565b6040519015158152602001610232565b6102857f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610232565b6102aa6102a5366004612b43565b6105c8565b604051610232929190612b60565b6102c06107b6565b6040516102329190612bf8565b6102286102db366004612c45565b60009081526002602052604090206001015490565b6103036102fe366004612c5e565b6107c2565b005b610303610313366004612cbd565b610801565b610303610326366004612cbd565b61082b565b61033e610339366004612ced565b6108a9565b6040516102329190612d19565b60055461035e906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b61024e610384366004612b43565b61095f565b610303610397366004612d3a565b61096b565b6103d66103aa366004612ced565b600360209081526000928352604080842090915290825290208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610232565b6103036103ff366004612b43565b610ace565b610303610412366004612dc2565b610cd9565b61022860045481565b61030361042e366004612df7565b610df6565b610303610441366004612b43565b610f2b565b61024e610454366004612cbd565b610f4c565b610303610f77565b610228600081565b610303610477366004612b43565b610ffa565b61030361048a366004612dc2565b611119565b61030361049d366004612b43565b61122a565b6103036104b0366004612e3f565b611329565b6103036104c3366004612b43565b611461565b6103036104d6366004612cbd565b611482565b6102c06114a7565b61022860008051602061328083398151915281565b6102287f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b61030361052d366004612c45565b6114b3565b61035e610540366004612c45565b6114ff565b6102286000805160206132a083398151915281565b610303610568366004612ced565b61150c565b61030361057b366004612df7565b611590565b600061058c60066116f9565b905090565b60006001600160e01b03198216637965db0b60e01b14806105c257506301ffc9a760e01b6001600160e01b03198316145b92915050565b606080826105d76006826116bf565b6105fc5760405162461bcd60e51b81526004016105f390612e7a565b60405180910390fd5b6001600160a01b038416600090815260086020526040812061061d906116f9565b90508067ffffffffffffffff81111561063857610638612eb1565b60405190808252806020026020018201604052801561068d57816020015b61067a60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816106565790505b5092508067ffffffffffffffff8111156106a9576106a9612eb1565b6040519080825280602002602001820160405280156106d2578160200160208202803683370190505b50935060005b818110156107ae576001600160a01b03861660009081526003602090815260408083206008909252822090919061070f9084611703565b8152602001908152602001600020604051806060016040529081600082015481526020016001820154815260200160028201548152505084828151811061075857610758612ec7565b6020908102919091018101919091526001600160a01b03871660009081526008909152604090206107899082611703565b85828151811061079b5761079b612ec7565b60209081029190910101526001016106d8565b505050915091565b606061058c600061170f565b806107ce6000826116bf565b6107ea5760405162461bcd60e51b81526004016105f390612edd565b6107f98686868686600061171c565b505050505050565b60008281526002602052604090206001015461081c81611d20565b6108268383611d2a565b505050565b6001600160a01b038116331461089b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105f3565b6108a58282611db0565b5050565b6108cd60405180606001604052806000815260200160008152602001600081525090565b6001600160a01b0383166000908152600860205260409020839083906108f39082611e17565b61090f5760405162461bcd60e51b81526004016105f390612f21565b5050506001600160a01b0391909116600090815260036020908152604080832093835292815290829020825160608101845281548152600182015492810192909252600201549181019190915290565b60006105c281836116bf565b60008051602061328083398151915261098381611d20565b816109d05760405162461bcd60e51b815260206004820152601860248201527f746f6b656e4964732063616e6e6f7420626520656d707479000000000000000060448201526064016105f3565b60005b82811015610ac757610a178484838181106109f0576109f0612ec7565b6001600160a01b038916600090815260086020908152604090912093910201359050611e17565b610a335760405162461bcd60e51b81526004016105f390612f21565b610a6f848483818110610a4857610a48612ec7565b6001600160a01b038916600090815260086020908152604090912093910201359050611e2f565b50838382818110610a8257610a82612ec7565b90506020020135856001600160a01b03167f24287c09523dfd960e13a9774c247fb28a2ccb301eb4208b0d4072bcd0f1826e60405160405180910390a36001016109d3565b5050505050565b6000805160206132a0833981519152610ae681611d20565b6001600160a01b038216610b3c5760405162461bcd60e51b815260206004820152601760248201527f474f424d61726b65743a205a65726f206164647265737300000000000000000060448201526064016105f3565b6000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190612f58565b90507f000000000000000000000000000000000000000000000000000000000000000060ff16816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190612f75565b60ff161015610c8d5760405162461bcd60e51b815260206004820152602b60248201527f474f424d61726b65743a2056657374696e6720746f6b656e277320646563696d60448201526a616c7320746f6f206c6f7760a81b60648201526084016105f3565b600580546001600160a01b0319166001600160a01b0385169081179091556040517fa382d6de23230b4513b2ee62dcfa30957a86ccaf67a224d61a08bbff48348e6390600090a2505050565b600080516020613280833981519152610cf181611d20565b6001600160a01b038416600090815260086020526040902084908490610d179082611e17565b610d335760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b0386166000908152600360209081526040808320888452909152902054610d62878787611e3b565b610da65760405162461bcd60e51b8152602060048201526015602482015274474f424d61726b65743a2053616d6520707269636560581b60448201526064016105f3565b604080518281526020810187905287916001600160a01b038a16917fdac6aecd066304d15a41e8e590fc5ab5bf93634f43cba363f743d5e158d7998891015b60405180910390a350505050505050565b6005546001600160a01b0316610e4e5760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a2056657374696e67206e6f742073657400000000000060448201526064016105f3565b600060045411610ea05760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a2056657374696e67207072696365206e6f742073657460448201526064016105f3565b610f2584848484600560009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1e9190612f58565b600161171c565b50505050565b6000805160206132a0833981519152610f4381611d20565b6108a582611eea565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec610fa181611d20565b610fab6000611fd6565b610ff75760405162461bcd60e51b815260206004820152601f60248201527f474f424d61726b65743a204e6f2062616c616e636520617661696c61626c650060448201526064016105f3565b50565b6000805160206132a083398151915261101281611d20565b6001600160a01b0382166110735760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a20496e76616c69642065726331313535206164647265604482015261737360f01b60648201526084016105f3565b61107e6006836116bf565b156110d55760405162461bcd60e51b815260206004820152602160248201527f474f424d61726b65743a204572633131353520616c72656164792065786973746044820152607360f81b60648201526084016105f3565b6110e06006836116e4565b506040516001600160a01b038316907f5501b95f3bff8ce106b3c09db9b2ffb02d9ca5ac1abcf8767f67d51adb87757d90600090a25050565b60008051602061328083398151915261113181611d20565b6001600160a01b0384166000908152600860205260409020849084906111579082611e17565b6111735760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b03861660009081526003602090815260408083208884529091529020600101546111a587878761208f565b6111e75760405162461bcd60e51b81526020600482015260136024820152720474f424d61726b65743a2053616d652063617606c1b60448201526064016105f3565b604080518281526020810187905287916001600160a01b038a16917f11525740b12fb21d5d301e8ce898dacdf8f3387741cfb3a28014c74e90ab40499101610de5565b6000805160206132a083398151915261124281611d20565b8161124e6006826116bf565b61126a5760405162461bcd60e51b81526004016105f390612e7a565b6001600160a01b038316600090815260086020526040902061128b906116f9565b156112e45760405162461bcd60e51b8152602060048201526024808201527f474f424d61726b65743a20457263313135352068617320746f6b656e73206c696044820152631cdd195960e21b60648201526084016105f3565b6112ef6006846121dd565b506040516001600160a01b038416907f34d19a3fc93e662c545004ca0e3326e0bd6a3758a4ee4479b77011480bc19f5390600090a2505050565b60008051602061328083398151915261134181611d20565b8461134d6006826116bf565b6113695760405162461bcd60e51b81526004016105f390612e7a565b6001600160a01b038616600090815260086020526040902061138b9086611e17565b156113d85760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a20546f6b656e20616c657265616479206c697374656460448201526064016105f3565b6001600160a01b03861660009081526008602052604090206113fa90866121f2565b50611406868686611e3b565b5061141286868561208f565b50604080518581526020810185905286916001600160a01b038916917fda2d7fa13c443a4ce51bb68b8ce92f41fac2c10d9d5bdb6a9e9a91429020b7c3910160405180910390a3505050505050565b6000805160206132a083398151915261147981611d20565b6108a5826121fe565b60008281526002602052604090206001015461149d81611d20565b6108268383611db0565b606061058c600661170f565b6000805160206132808339815191526114cb81611d20565b600482905560405182907f57618c193c7eac829ada16edd6c8f6f0e4491ee879135ee2248ef3185184382f90600090a25050565b60006105c2600683611703565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61153681611d20565b600082116115865760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a20416d6f756e742063616e6e6f74206265207a65726f60448201526064016105f3565b61082683836122d6565b6005546001600160a01b03166115e85760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a2056657374696e67206e6f742073657400000000000060448201526064016105f3565b60006004541161163a5760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a2056657374696e67207072696365206e6f742073657460448201526064016105f3565b610f2584848484600560009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b89190612f58565b600261171c565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60006116dd836001600160a01b038416612330565b60006105c2825490565b60006116dd838361237f565b606060006116dd836123a9565b6001600160a01b0386166000908152600860205260409020869086906117429082611e17565b61175e5760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b0386166117b45760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a205a65726f20746f206164647265737300000000000060448201526064016105f3565b6000851161180f5760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a205175616e746974792063616e6e6f74206265207a65604482015261726f60f01b60648201526084016105f3565b6001600160a01b03881660009081526003602090815260408083208a845290915290206002810154600190910154869161184891612fae565b10156118a45760405162461bcd60e51b815260206004820152602560248201527f474f424d61726b65743a204e6f7420656e6f75676820756e69747320617661696044820152646c61626c6560d81b60648201526084016105f3565b6001600160a01b03881660009081526003602090815260408083208a8452909152812060020180548792906118da908490612fc1565b909155506000905033818560028111156118f6576118f6612fd4565b036119e9576001600160a01b03808b1660009081526003602090815260408083208d845282529182902054825163313ce56760e01b815292518a9491937f0000000000000000000000000000000000000000000000000000000000000000939286169263313ce567926004808401938290030181865afa15801561197e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a29190612f75565b6119ac9190612fea565b6119b790600a6130e7565b6119c18a836130f6565b6119cb91906130f6565b93506119e26001600160a01b038316843087612405565b5050611c49565b6004546001600160a01b038b1660009081526003602090815260408083208d84529091528120548892611a1b916130f6565b90506000611a4a7f0000000000000000000000000000000000000000000000000000000000000000600a6130e7565b7f0000000000000000000000000000000000000000000000000000000000000000846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acd9190612f75565b611ad79190612fea565b611ae290600a6130e7565b611aec90846130f6565b611af6919061310d565b9050611b028a826130f6565b94506001886002811115611b1857611b18612fd4565b03611b845760405163079cc67960e41b81526001600160a01b038581166004830152602482018790528416906379cc679090604401600060405180830381600087803b158015611b6757600080fd5b505af1158015611b7b573d6000803e3d6000fd5b50505050611c45565b600554604051639470b0bd60e01b81526001600160a01b0386811660048301526024820188905290911690639470b0bd90604401600060405180830381600087803b158015611bd257600080fd5b505af1158015611be6573d6000803e3d6000fd5b5050604051630852cd8d60e31b8152600481018890526001600160a01b03861692506342966c689150602401600060405180830381600087803b158015611c2c57600080fd5b505af1158015611c40573d6000803e3d6000fd5b505050505b5050505b60405163731133e960e01b81526001600160a01b038981166004830152602482018b90526044820189905260806064830152600060848301528b169063731133e99060a401600060405180830381600087803b158015611ca857600080fd5b505af1158015611cbc573d6000803e3d6000fd5b5050604080518a81526001600160a01b038a81166020830152918101869052818c1693508c9250908d16907f0c06179431976ca809870adf5899b0c76b3cc196dcbe03c8fcf78fa88d4c6fb49060600160405180910390a450505050505050505050565b610ff78133612470565b611d348282610f4c565b6108a55760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d6c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611dba8282610f4c565b156108a55760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260018301602052604081205415156116dd565b60006116dd83836124c9565b6000808211611e8c5760405162461bcd60e51b815260206004820152601f60248201527f474f424d61726b65743a2050726963652063616e6e6f74206265207a65726f0060448201526064016105f3565b6001600160a01b0384166000908152600360209081526040808320868452909152902054829003611ebf575060006116dd565b506001600160a01b039290921660009081526003602090815260408083209383529290522055600190565b7f000000000000000000000000000000000000000000000000000000000000000060ff16816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f709190612f75565b60ff161015611fcd5760405162461bcd60e51b8152602060048201526024808201527f474f424d61726b65743a2043757272656e637920646563696d616c7320746f6f604482015263206c6f7760e01b60648201526084016105f3565b610ff7816125bc565b6000806000611fe4846116f9565b90506000805b8281101561208657611ffc8682611703565b6040516370a0823160e01b81523060048201529092506001600160a01b038316906370a0823190602401602060405180830381865afa158015612043573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612067919061312f565b9350831561207e5761207982856122d6565b600194505b600101611fea565b50505050919050565b60008082116120eb5760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a2053616c65734361702063616e6e6f74206265207a65604482015261726f60f01b60648201526084016105f3565b6001600160a01b0384166000908152600360209081526040808320868452909152902060010154829003612121575060006116dd565b6001600160a01b03841660009081526003602090815260408083208684529091529020600201548210156121ac5760405162461bcd60e51b815260206004820152602c60248201527f474f424d61726b65743a2053616c65734361702063616e6e6f74206265206c6560448201526b1cdcc81d1a185b881cdbdb1960a21b60648201526084016105f3565b506001600160a01b039290921660009081526003602090815260408083209383529290522060019081019190915590565b60006116dd836001600160a01b0384166124c9565b60006116dd8383612330565b8061220a6000826116bf565b6122265760405162461bcd60e51b81526004016105f390612edd565b600161223260006116f9565b116122925760405162461bcd60e51b815260206004820152602a60248201527f474f4256616c696443757272656e636965733a204f6e6c79206f6e65206375726044820152691c995b98de481b19599d60b21b60648201526084016105f3565b61229d6000836121dd565b506040516001600160a01b038316907fa40d69111be14f29022626d38310e47cc2d7f4cb728961509c2f65a4bee08c5b90600090a25050565b816122eb6001600160a01b03821633846126c1565b6040518281526001600160a01b0384169033907fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb9060200160405180910390a3505050565b6000818152600183016020526040812054612377575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105c2565b5060006105c2565b600082600001828154811061239657612396612ec7565b9060005260206000200154905092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156123f957602002820191906000526020600020905b8154815260200190600101908083116123e5575b50505050509050919050565b6040516001600160a01b0380851660248301528316604482015260648101829052610f259085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526126f1565b61247a8282610f4c565b6108a557612487816127c6565b6124928360206127d8565b6040516020016124a392919061316c565b60408051601f198184030181529082905262461bcd60e51b82526105f3916004016131e1565b600081815260018301602052604081205480156125b25760006124ed600183612fae565b855490915060009061250190600190612fae565b905081811461256657600086600001828154811061252157612521612ec7565b906000526020600020015490508087600001848154811061254457612544612ec7565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061257757612577613214565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105c2565b60009150506105c2565b6001600160a01b0381166126125760405162461bcd60e51b815260206004820181905260248201527f474f4256616c696443757272656e636965733a205a65726f206164647265737360448201526064016105f3565b61261d6000826116bf565b1561267e5760405162461bcd60e51b815260206004820152602b60248201527f474f4256616c696443757272656e636965733a2043757272656e637920616c7260448201526a656164792065786973747360a81b60648201526084016105f3565b6126896000826116e4565b506040516001600160a01b038216907fe0390a89516146ccfb796a9fbfc3f7646282194c554d05020484599ee992dd5a90600090a250565b6040516001600160a01b03831660248201526044810182905261082690849063a9059cbb60e01b90606401612439565b6000612746826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129749092919063ffffffff16565b9050805160001480612767575080806020019051810190612767919061322a565b6108265760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105f3565b60606105c26001600160a01b03831660145b606060006127e78360026130f6565b6127f2906002612fc1565b67ffffffffffffffff81111561280a5761280a612eb1565b6040519080825280601f01601f191660200182016040528015612834576020820181803683370190505b509050600360fc1b8160008151811061284f5761284f612ec7565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061287e5761287e612ec7565b60200101906001600160f81b031916908160001a90535060006128a28460026130f6565b6128ad906001612fc1565b90505b6001811115612925576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128e1576128e1612ec7565b1a60f81b8282815181106128f7576128f7612ec7565b60200101906001600160f81b031916908160001a90535060049490941c9361291e8161324c565b90506128b0565b5083156116dd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105f3565b6060612983848460008561298b565b949350505050565b6060824710156129ec5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105f3565b600080866001600160a01b03168587604051612a089190613263565b60006040518083038185875af1925050503d8060008114612a45576040519150601f19603f3d011682016040523d82523d6000602084013e612a4a565b606091505b5091509150612a5b87838387612a66565b979650505050505050565b60608315612ad5578251600003612ace576001600160a01b0385163b612ace5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105f3565b5081612983565b6129838383815115612aea5781518083602001fd5b8060405162461bcd60e51b81526004016105f391906131e1565b600060208284031215612b1657600080fd5b81356001600160e01b0319811681146116dd57600080fd5b6001600160a01b0381168114610ff757600080fd5b600060208284031215612b5557600080fd5b81356116dd81612b2e565b60408082528351908201819052600090606090818401906020808801855b83811015612b9a57815185529382019390820190600101612b7e565b5050858303818701528651808452878201938201925060005b81811015612bea57612bda8486518051825260208082015190830152604090810151910152565b9382019392850192600101612bb3565b509198975050505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612c395783516001600160a01b031683529284019291840191600101612c14565b50909695505050505050565b600060208284031215612c5757600080fd5b5035919050565b600080600080600060a08688031215612c7657600080fd5b8535612c8181612b2e565b9450602086013593506040860135612c9881612b2e565b9250606086013591506080860135612caf81612b2e565b809150509295509295909350565b60008060408385031215612cd057600080fd5b823591506020830135612ce281612b2e565b809150509250929050565b60008060408385031215612d0057600080fd5b8235612d0b81612b2e565b946020939093013593505050565b815181526020808301519082015260408083015190820152606081016105c2565b600080600060408486031215612d4f57600080fd5b8335612d5a81612b2e565b9250602084013567ffffffffffffffff80821115612d7757600080fd5b818601915086601f830112612d8b57600080fd5b813581811115612d9a57600080fd5b8760208260051b8501011115612daf57600080fd5b6020830194508093505050509250925092565b600080600060608486031215612dd757600080fd5b8335612de281612b2e565b95602085013595506040909401359392505050565b60008060008060808587031215612e0d57600080fd5b8435612e1881612b2e565b9350602085013592506040850135612e2f81612b2e565b9396929550929360600135925050565b60008060008060808587031215612e5557600080fd5b8435612e6081612b2e565b966020860135965060408601359560600135945092505050565b6020808252601c908201527f474f424d61726b65743a2045726331313535206e6f7420666f756e6400000000604082015260600190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60208082526024908201527f474f4256616c696443757272656e636965733a20496e76616c69642063757272604082015263656e637960e01b606082015260800190565b6020808252601c908201527f474f424d61726b65743a20546f6b656e4964206e6f7420666f756e6400000000604082015260600190565b600060208284031215612f6a57600080fd5b81516116dd81612b2e565b600060208284031215612f8757600080fd5b815160ff811681146116dd57600080fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156105c2576105c2612f98565b808201808211156105c2576105c2612f98565b634e487b7160e01b600052602160045260246000fd5b60ff82811682821603908111156105c2576105c2612f98565b600181815b8085111561303e57816000190482111561302457613024612f98565b8085161561303157918102915b93841c9390800290613008565b509250929050565b600082613055575060016105c2565b81613062575060006105c2565b816001811461307857600281146130825761309e565b60019150506105c2565b60ff84111561309357613093612f98565b50506001821b6105c2565b5060208310610133831016604e8410600b84101617156130c1575081810a6105c2565b6130cb8383613003565b80600019048211156130df576130df612f98565b029392505050565b60006116dd60ff841683613046565b80820281158282048414176105c2576105c2612f98565b60008261312a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561314157600080fd5b5051919050565b60005b8381101561316357818101518382015260200161314b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516131a4816017850160208801613148565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516131d5816028840160208801613148565b01602801949350505050565b6020815260008251806020840152613200816040850160208701613148565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561323c57600080fd5b815180151581146116dd57600080fd5b60008161325b5761325b612f98565b506000190190565b60008251613275818460208701613148565b919091019291505056fe43f25613eb2f15fb17222a5d424ca2655743e71265d98e4b93c05e5fb589ecde241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220042e506e2789bd3a90db0c0ebe2f04f4121b6b9585d8ef3c6f2494671500075264736f6c63430008120033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061021b5760003560e01c80638ab234b611610125578063d547741f116100ad578063e1a9109d1161007c578063e1a9109d1461051f578063eb5e443d14610532578063ec87621c14610545578063f3fef3a31461055a578063f8fad9931461056d57600080fd5b8063d547741f146104c8578063d61a4849146104db578063dbe4613d146104e3578063e02023a1146104f857600080fd5b8063a6dd562d116100f4578063a6dd562d14610469578063abc1877b1461047c578063b56da7121461048f578063bcb143ef146104a2578063c5d3a107146104b557600080fd5b80638ab234b61461043357806391d14854146104465780639570fc8714610459578063a217fddf1461046157600080fd5b80634370e108116101a85780635c80a435116101775780635c80a4351461039c5780636f6ff3bc146103f1578063741cbae4146104045780637e34cd3d1461041757806381b856001461042057600080fd5b80634370e1081461032b57806344c63eec1461034b5780634fb9255814610376578063534be8fb1461038957600080fd5b80631d28031f116101ef5780631d28031f146102b8578063248a9ca3146102cd5780632c27b071146102f05780632f2ff15d1461030557806336568abe1461031857600080fd5b80623bf96c1461022057806301ffc9a71461023b57806305300b281461025e5780630ea903d514610297575b600080fd5b610228610580565b6040519081526020015b60405180910390f35b61024e610249366004612b04565b610591565b6040519015158152602001610232565b6102857f000000000000000000000000000000000000000000000000000000000000000481565b60405160ff9091168152602001610232565b6102aa6102a5366004612b43565b6105c8565b604051610232929190612b60565b6102c06107b6565b6040516102329190612bf8565b6102286102db366004612c45565b60009081526002602052604090206001015490565b6103036102fe366004612c5e565b6107c2565b005b610303610313366004612cbd565b610801565b610303610326366004612cbd565b61082b565b61033e610339366004612ced565b6108a9565b6040516102329190612d19565b60055461035e906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b61024e610384366004612b43565b61095f565b610303610397366004612d3a565b61096b565b6103d66103aa366004612ced565b600360209081526000928352604080842090915290825290208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610232565b6103036103ff366004612b43565b610ace565b610303610412366004612dc2565b610cd9565b61022860045481565b61030361042e366004612df7565b610df6565b610303610441366004612b43565b610f2b565b61024e610454366004612cbd565b610f4c565b610303610f77565b610228600081565b610303610477366004612b43565b610ffa565b61030361048a366004612dc2565b611119565b61030361049d366004612b43565b61122a565b6103036104b0366004612e3f565b611329565b6103036104c3366004612b43565b611461565b6103036104d6366004612cbd565b611482565b6102c06114a7565b61022860008051602061328083398151915281565b6102287f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b61030361052d366004612c45565b6114b3565b61035e610540366004612c45565b6114ff565b6102286000805160206132a083398151915281565b610303610568366004612ced565b61150c565b61030361057b366004612df7565b611590565b600061058c60066116f9565b905090565b60006001600160e01b03198216637965db0b60e01b14806105c257506301ffc9a760e01b6001600160e01b03198316145b92915050565b606080826105d76006826116bf565b6105fc5760405162461bcd60e51b81526004016105f390612e7a565b60405180910390fd5b6001600160a01b038416600090815260086020526040812061061d906116f9565b90508067ffffffffffffffff81111561063857610638612eb1565b60405190808252806020026020018201604052801561068d57816020015b61067a60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816106565790505b5092508067ffffffffffffffff8111156106a9576106a9612eb1565b6040519080825280602002602001820160405280156106d2578160200160208202803683370190505b50935060005b818110156107ae576001600160a01b03861660009081526003602090815260408083206008909252822090919061070f9084611703565b8152602001908152602001600020604051806060016040529081600082015481526020016001820154815260200160028201548152505084828151811061075857610758612ec7565b6020908102919091018101919091526001600160a01b03871660009081526008909152604090206107899082611703565b85828151811061079b5761079b612ec7565b60209081029190910101526001016106d8565b505050915091565b606061058c600061170f565b806107ce6000826116bf565b6107ea5760405162461bcd60e51b81526004016105f390612edd565b6107f98686868686600061171c565b505050505050565b60008281526002602052604090206001015461081c81611d20565b6108268383611d2a565b505050565b6001600160a01b038116331461089b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105f3565b6108a58282611db0565b5050565b6108cd60405180606001604052806000815260200160008152602001600081525090565b6001600160a01b0383166000908152600860205260409020839083906108f39082611e17565b61090f5760405162461bcd60e51b81526004016105f390612f21565b5050506001600160a01b0391909116600090815260036020908152604080832093835292815290829020825160608101845281548152600182015492810192909252600201549181019190915290565b60006105c281836116bf565b60008051602061328083398151915261098381611d20565b816109d05760405162461bcd60e51b815260206004820152601860248201527f746f6b656e4964732063616e6e6f7420626520656d707479000000000000000060448201526064016105f3565b60005b82811015610ac757610a178484838181106109f0576109f0612ec7565b6001600160a01b038916600090815260086020908152604090912093910201359050611e17565b610a335760405162461bcd60e51b81526004016105f390612f21565b610a6f848483818110610a4857610a48612ec7565b6001600160a01b038916600090815260086020908152604090912093910201359050611e2f565b50838382818110610a8257610a82612ec7565b90506020020135856001600160a01b03167f24287c09523dfd960e13a9774c247fb28a2ccb301eb4208b0d4072bcd0f1826e60405160405180910390a36001016109d3565b5050505050565b6000805160206132a0833981519152610ae681611d20565b6001600160a01b038216610b3c5760405162461bcd60e51b815260206004820152601760248201527f474f424d61726b65743a205a65726f206164647265737300000000000000000060448201526064016105f3565b6000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba09190612f58565b90507f000000000000000000000000000000000000000000000000000000000000000460ff16816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c289190612f75565b60ff161015610c8d5760405162461bcd60e51b815260206004820152602b60248201527f474f424d61726b65743a2056657374696e6720746f6b656e277320646563696d60448201526a616c7320746f6f206c6f7760a81b60648201526084016105f3565b600580546001600160a01b0319166001600160a01b0385169081179091556040517fa382d6de23230b4513b2ee62dcfa30957a86ccaf67a224d61a08bbff48348e6390600090a2505050565b600080516020613280833981519152610cf181611d20565b6001600160a01b038416600090815260086020526040902084908490610d179082611e17565b610d335760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b0386166000908152600360209081526040808320888452909152902054610d62878787611e3b565b610da65760405162461bcd60e51b8152602060048201526015602482015274474f424d61726b65743a2053616d6520707269636560581b60448201526064016105f3565b604080518281526020810187905287916001600160a01b038a16917fdac6aecd066304d15a41e8e590fc5ab5bf93634f43cba363f743d5e158d7998891015b60405180910390a350505050505050565b6005546001600160a01b0316610e4e5760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a2056657374696e67206e6f742073657400000000000060448201526064016105f3565b600060045411610ea05760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a2056657374696e67207072696365206e6f742073657460448201526064016105f3565b610f2584848484600560009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1e9190612f58565b600161171c565b50505050565b6000805160206132a0833981519152610f4381611d20565b6108a582611eea565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec610fa181611d20565b610fab6000611fd6565b610ff75760405162461bcd60e51b815260206004820152601f60248201527f474f424d61726b65743a204e6f2062616c616e636520617661696c61626c650060448201526064016105f3565b50565b6000805160206132a083398151915261101281611d20565b6001600160a01b0382166110735760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a20496e76616c69642065726331313535206164647265604482015261737360f01b60648201526084016105f3565b61107e6006836116bf565b156110d55760405162461bcd60e51b815260206004820152602160248201527f474f424d61726b65743a204572633131353520616c72656164792065786973746044820152607360f81b60648201526084016105f3565b6110e06006836116e4565b506040516001600160a01b038316907f5501b95f3bff8ce106b3c09db9b2ffb02d9ca5ac1abcf8767f67d51adb87757d90600090a25050565b60008051602061328083398151915261113181611d20565b6001600160a01b0384166000908152600860205260409020849084906111579082611e17565b6111735760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b03861660009081526003602090815260408083208884529091529020600101546111a587878761208f565b6111e75760405162461bcd60e51b81526020600482015260136024820152720474f424d61726b65743a2053616d652063617606c1b60448201526064016105f3565b604080518281526020810187905287916001600160a01b038a16917f11525740b12fb21d5d301e8ce898dacdf8f3387741cfb3a28014c74e90ab40499101610de5565b6000805160206132a083398151915261124281611d20565b8161124e6006826116bf565b61126a5760405162461bcd60e51b81526004016105f390612e7a565b6001600160a01b038316600090815260086020526040902061128b906116f9565b156112e45760405162461bcd60e51b8152602060048201526024808201527f474f424d61726b65743a20457263313135352068617320746f6b656e73206c696044820152631cdd195960e21b60648201526084016105f3565b6112ef6006846121dd565b506040516001600160a01b038416907f34d19a3fc93e662c545004ca0e3326e0bd6a3758a4ee4479b77011480bc19f5390600090a2505050565b60008051602061328083398151915261134181611d20565b8461134d6006826116bf565b6113695760405162461bcd60e51b81526004016105f390612e7a565b6001600160a01b038616600090815260086020526040902061138b9086611e17565b156113d85760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a20546f6b656e20616c657265616479206c697374656460448201526064016105f3565b6001600160a01b03861660009081526008602052604090206113fa90866121f2565b50611406868686611e3b565b5061141286868561208f565b50604080518581526020810185905286916001600160a01b038916917fda2d7fa13c443a4ce51bb68b8ce92f41fac2c10d9d5bdb6a9e9a91429020b7c3910160405180910390a3505050505050565b6000805160206132a083398151915261147981611d20565b6108a5826121fe565b60008281526002602052604090206001015461149d81611d20565b6108268383611db0565b606061058c600661170f565b6000805160206132808339815191526114cb81611d20565b600482905560405182907f57618c193c7eac829ada16edd6c8f6f0e4491ee879135ee2248ef3185184382f90600090a25050565b60006105c2600683611703565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec61153681611d20565b600082116115865760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a20416d6f756e742063616e6e6f74206265207a65726f60448201526064016105f3565b61082683836122d6565b6005546001600160a01b03166115e85760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a2056657374696e67206e6f742073657400000000000060448201526064016105f3565b60006004541161163a5760405162461bcd60e51b815260206004820181905260248201527f474f424d61726b65743a2056657374696e67207072696365206e6f742073657460448201526064016105f3565b610f2584848484600560009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b89190612f58565b600261171c565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b60006116dd836001600160a01b038416612330565b60006105c2825490565b60006116dd838361237f565b606060006116dd836123a9565b6001600160a01b0386166000908152600860205260409020869086906117429082611e17565b61175e5760405162461bcd60e51b81526004016105f390612f21565b6001600160a01b0386166117b45760405162461bcd60e51b815260206004820152601a60248201527f474f424d61726b65743a205a65726f20746f206164647265737300000000000060448201526064016105f3565b6000851161180f5760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a205175616e746974792063616e6e6f74206265207a65604482015261726f60f01b60648201526084016105f3565b6001600160a01b03881660009081526003602090815260408083208a845290915290206002810154600190910154869161184891612fae565b10156118a45760405162461bcd60e51b815260206004820152602560248201527f474f424d61726b65743a204e6f7420656e6f75676820756e69747320617661696044820152646c61626c6560d81b60648201526084016105f3565b6001600160a01b03881660009081526003602090815260408083208a8452909152812060020180548792906118da908490612fc1565b909155506000905033818560028111156118f6576118f6612fd4565b036119e9576001600160a01b03808b1660009081526003602090815260408083208d845282529182902054825163313ce56760e01b815292518a9491937f0000000000000000000000000000000000000000000000000000000000000004939286169263313ce567926004808401938290030181865afa15801561197e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a29190612f75565b6119ac9190612fea565b6119b790600a6130e7565b6119c18a836130f6565b6119cb91906130f6565b93506119e26001600160a01b038316843087612405565b5050611c49565b6004546001600160a01b038b1660009081526003602090815260408083208d84529091528120548892611a1b916130f6565b90506000611a4a7f0000000000000000000000000000000000000000000000000000000000000004600a6130e7565b7f0000000000000000000000000000000000000000000000000000000000000004846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611acd9190612f75565b611ad79190612fea565b611ae290600a6130e7565b611aec90846130f6565b611af6919061310d565b9050611b028a826130f6565b94506001886002811115611b1857611b18612fd4565b03611b845760405163079cc67960e41b81526001600160a01b038581166004830152602482018790528416906379cc679090604401600060405180830381600087803b158015611b6757600080fd5b505af1158015611b7b573d6000803e3d6000fd5b50505050611c45565b600554604051639470b0bd60e01b81526001600160a01b0386811660048301526024820188905290911690639470b0bd90604401600060405180830381600087803b158015611bd257600080fd5b505af1158015611be6573d6000803e3d6000fd5b5050604051630852cd8d60e31b8152600481018890526001600160a01b03861692506342966c689150602401600060405180830381600087803b158015611c2c57600080fd5b505af1158015611c40573d6000803e3d6000fd5b505050505b5050505b60405163731133e960e01b81526001600160a01b038981166004830152602482018b90526044820189905260806064830152600060848301528b169063731133e99060a401600060405180830381600087803b158015611ca857600080fd5b505af1158015611cbc573d6000803e3d6000fd5b5050604080518a81526001600160a01b038a81166020830152918101869052818c1693508c9250908d16907f0c06179431976ca809870adf5899b0c76b3cc196dcbe03c8fcf78fa88d4c6fb49060600160405180910390a450505050505050505050565b610ff78133612470565b611d348282610f4c565b6108a55760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d6c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611dba8282610f4c565b156108a55760008281526002602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600081815260018301602052604081205415156116dd565b60006116dd83836124c9565b6000808211611e8c5760405162461bcd60e51b815260206004820152601f60248201527f474f424d61726b65743a2050726963652063616e6e6f74206265207a65726f0060448201526064016105f3565b6001600160a01b0384166000908152600360209081526040808320868452909152902054829003611ebf575060006116dd565b506001600160a01b039290921660009081526003602090815260408083209383529290522055600190565b7f000000000000000000000000000000000000000000000000000000000000000460ff16816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f709190612f75565b60ff161015611fcd5760405162461bcd60e51b8152602060048201526024808201527f474f424d61726b65743a2043757272656e637920646563696d616c7320746f6f604482015263206c6f7760e01b60648201526084016105f3565b610ff7816125bc565b6000806000611fe4846116f9565b90506000805b8281101561208657611ffc8682611703565b6040516370a0823160e01b81523060048201529092506001600160a01b038316906370a0823190602401602060405180830381865afa158015612043573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612067919061312f565b9350831561207e5761207982856122d6565b600194505b600101611fea565b50505050919050565b60008082116120eb5760405162461bcd60e51b815260206004820152602260248201527f474f424d61726b65743a2053616c65734361702063616e6e6f74206265207a65604482015261726f60f01b60648201526084016105f3565b6001600160a01b0384166000908152600360209081526040808320868452909152902060010154829003612121575060006116dd565b6001600160a01b03841660009081526003602090815260408083208684529091529020600201548210156121ac5760405162461bcd60e51b815260206004820152602c60248201527f474f424d61726b65743a2053616c65734361702063616e6e6f74206265206c6560448201526b1cdcc81d1a185b881cdbdb1960a21b60648201526084016105f3565b506001600160a01b039290921660009081526003602090815260408083209383529290522060019081019190915590565b60006116dd836001600160a01b0384166124c9565b60006116dd8383612330565b8061220a6000826116bf565b6122265760405162461bcd60e51b81526004016105f390612edd565b600161223260006116f9565b116122925760405162461bcd60e51b815260206004820152602a60248201527f474f4256616c696443757272656e636965733a204f6e6c79206f6e65206375726044820152691c995b98de481b19599d60b21b60648201526084016105f3565b61229d6000836121dd565b506040516001600160a01b038316907fa40d69111be14f29022626d38310e47cc2d7f4cb728961509c2f65a4bee08c5b90600090a25050565b816122eb6001600160a01b03821633846126c1565b6040518281526001600160a01b0384169033907fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb9060200160405180910390a3505050565b6000818152600183016020526040812054612377575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105c2565b5060006105c2565b600082600001828154811061239657612396612ec7565b9060005260206000200154905092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156123f957602002820191906000526020600020905b8154815260200190600101908083116123e5575b50505050509050919050565b6040516001600160a01b0380851660248301528316604482015260648101829052610f259085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526126f1565b61247a8282610f4c565b6108a557612487816127c6565b6124928360206127d8565b6040516020016124a392919061316c565b60408051601f198184030181529082905262461bcd60e51b82526105f3916004016131e1565b600081815260018301602052604081205480156125b25760006124ed600183612fae565b855490915060009061250190600190612fae565b905081811461256657600086600001828154811061252157612521612ec7565b906000526020600020015490508087600001848154811061254457612544612ec7565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061257757612577613214565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105c2565b60009150506105c2565b6001600160a01b0381166126125760405162461bcd60e51b815260206004820181905260248201527f474f4256616c696443757272656e636965733a205a65726f206164647265737360448201526064016105f3565b61261d6000826116bf565b1561267e5760405162461bcd60e51b815260206004820152602b60248201527f474f4256616c696443757272656e636965733a2043757272656e637920616c7260448201526a656164792065786973747360a81b60648201526084016105f3565b6126896000826116e4565b506040516001600160a01b038216907fe0390a89516146ccfb796a9fbfc3f7646282194c554d05020484599ee992dd5a90600090a250565b6040516001600160a01b03831660248201526044810182905261082690849063a9059cbb60e01b90606401612439565b6000612746826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129749092919063ffffffff16565b9050805160001480612767575080806020019051810190612767919061322a565b6108265760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105f3565b60606105c26001600160a01b03831660145b606060006127e78360026130f6565b6127f2906002612fc1565b67ffffffffffffffff81111561280a5761280a612eb1565b6040519080825280601f01601f191660200182016040528015612834576020820181803683370190505b509050600360fc1b8160008151811061284f5761284f612ec7565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061287e5761287e612ec7565b60200101906001600160f81b031916908160001a90535060006128a28460026130f6565b6128ad906001612fc1565b90505b6001811115612925576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128e1576128e1612ec7565b1a60f81b8282815181106128f7576128f7612ec7565b60200101906001600160f81b031916908160001a90535060049490941c9361291e8161324c565b90506128b0565b5083156116dd5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105f3565b6060612983848460008561298b565b949350505050565b6060824710156129ec5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105f3565b600080866001600160a01b03168587604051612a089190613263565b60006040518083038185875af1925050503d8060008114612a45576040519150601f19603f3d011682016040523d82523d6000602084013e612a4a565b606091505b5091509150612a5b87838387612a66565b979650505050505050565b60608315612ad5578251600003612ace576001600160a01b0385163b612ace5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105f3565b5081612983565b6129838383815115612aea5781518083602001fd5b8060405162461bcd60e51b81526004016105f391906131e1565b600060208284031215612b1657600080fd5b81356001600160e01b0319811681146116dd57600080fd5b6001600160a01b0381168114610ff757600080fd5b600060208284031215612b5557600080fd5b81356116dd81612b2e565b60408082528351908201819052600090606090818401906020808801855b83811015612b9a57815185529382019390820190600101612b7e565b5050858303818701528651808452878201938201925060005b81811015612bea57612bda8486518051825260208082015190830152604090810151910152565b9382019392850192600101612bb3565b509198975050505050505050565b6020808252825182820181905260009190848201906040850190845b81811015612c395783516001600160a01b031683529284019291840191600101612c14565b50909695505050505050565b600060208284031215612c5757600080fd5b5035919050565b600080600080600060a08688031215612c7657600080fd5b8535612c8181612b2e565b9450602086013593506040860135612c9881612b2e565b9250606086013591506080860135612caf81612b2e565b809150509295509295909350565b60008060408385031215612cd057600080fd5b823591506020830135612ce281612b2e565b809150509250929050565b60008060408385031215612d0057600080fd5b8235612d0b81612b2e565b946020939093013593505050565b815181526020808301519082015260408083015190820152606081016105c2565b600080600060408486031215612d4f57600080fd5b8335612d5a81612b2e565b9250602084013567ffffffffffffffff80821115612d7757600080fd5b818601915086601f830112612d8b57600080fd5b813581811115612d9a57600080fd5b8760208260051b8501011115612daf57600080fd5b6020830194508093505050509250925092565b600080600060608486031215612dd757600080fd5b8335612de281612b2e565b95602085013595506040909401359392505050565b60008060008060808587031215612e0d57600080fd5b8435612e1881612b2e565b9350602085013592506040850135612e2f81612b2e565b9396929550929360600135925050565b60008060008060808587031215612e5557600080fd5b8435612e6081612b2e565b966020860135965060408601359560600135945092505050565b6020808252601c908201527f474f424d61726b65743a2045726331313535206e6f7420666f756e6400000000604082015260600190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60208082526024908201527f474f4256616c696443757272656e636965733a20496e76616c69642063757272604082015263656e637960e01b606082015260800190565b6020808252601c908201527f474f424d61726b65743a20546f6b656e4964206e6f7420666f756e6400000000604082015260600190565b600060208284031215612f6a57600080fd5b81516116dd81612b2e565b600060208284031215612f8757600080fd5b815160ff811681146116dd57600080fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156105c2576105c2612f98565b808201808211156105c2576105c2612f98565b634e487b7160e01b600052602160045260246000fd5b60ff82811682821603908111156105c2576105c2612f98565b600181815b8085111561303e57816000190482111561302457613024612f98565b8085161561303157918102915b93841c9390800290613008565b509250929050565b600082613055575060016105c2565b81613062575060006105c2565b816001811461307857600281146130825761309e565b60019150506105c2565b60ff84111561309357613093612f98565b50506001821b6105c2565b5060208310610133831016604e8410600b84101617156130c1575081810a6105c2565b6130cb8383613003565b80600019048211156130df576130df612f98565b029392505050565b60006116dd60ff841683613046565b80820281158282048414176105c2576105c2612f98565b60008261312a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561314157600080fd5b5051919050565b60005b8381101561316357818101518382015260200161314b565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516131a4816017850160208801613148565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516131d5816028840160208801613148565b01602801949350505050565b6020815260008251806020840152613200816040850160208701613148565b601f01601f19169190910160400192915050565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561323c57600080fd5b815180151581146116dd57600080fd5b60008161325b5761325b612f98565b506000190190565b60008251613275818460208701613148565b919091019291505056fe43f25613eb2f15fb17222a5d424ca2655743e71265d98e4b93c05e5fb589ecde241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220042e506e2789bd3a90db0c0ebe2f04f4121b6b9585d8ef3c6f2494671500075264736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
-----Decoded View---------------
Arg [0] : currencies (address[]): 0xc2132D05D31c914a87C6611C10748AEb04B58e8F,0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
Arg [1] : priceDecimals_ (uint8): 4
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 000000000000000000000000c2132d05d31c914a87c6611c10748aeb04b58e8f
Arg [4] : 0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.