Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
ViciERC20UtilityToken
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "ViciERC20.sol"; import "IERC20UtilityOperations.sol"; /** * @title Vici ERC20 Utility Token * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @notice This contract extends the behavior of the base Vici ERC20 contract by * providing a limitations to how airdropped tokens can be used by earmarking * tokens or by timelocking tokens. * @notice Earmarked tokens are airdropped to a user for the purpose of allowing * them to attend an event, purchase an NFT, or participate in other experiences * or utilities offered by ViciNFT. * @notice Time-locked tokens are airdropped to VIPs. Over time, time-locked * tokens become unlocked tokens according to a vesting schedule. Time-locked * tokens may also be spent in the same manner as earmarked tokens. * @notice If a user has earmarked tokens and time-locked tokens, the earmarked * tokens are spent first. * @dev Roles used by the access management are * - DEFAULT_ADMIN_ROLE: administers the other roles * - MODERATOR_ROLE_NAME: administers the banned role * - MINTER_ROLE_NAME: can mint/burn tokens * - AIRDROP_ROLE_NAME: can airdrop tokens and manage the list of addresses * where earmarked tokens may be transferred. * - BANNED_ROLE: cannot send or receive tokens */ contract ViciERC20UtilityToken is ViciERC20 { event LostTokensRecovered(address from, address to, uint256 value); function utilityOps() internal view virtual returns (IERC20UtilityOperations) { return IERC20UtilityOperations(address(tokenData)); } /** * @notice Transfers tokens from the caller to a recipient and establishes * a vesting schedule. * If `recipient` already has a locked balance, then * - if `amount` is greater than the airdropThreshold AND `release` is later than the current * lockReleaseDate, the lockReleaseDate will be updated. * - if `amount` is less than the airdropThreshold OR `release` is earlier than the current * lockReleaseDate, the lockReleaseDate will be left unchanged. * @param recipient the user receiving the airdrop * @param amount the amount to transfer * @param release the new lock release date, as a Unix timestamp in seconds * * Requirements: * - caller MUST have the AIRDROPPER role * - the transaction MUST meet all requirements for a transfer * @dev see IERC20Operations.transfer */ function airdropTimelockedTokens( address recipient, uint256 amount, uint256 release ) public virtual { utilityOps().airdropTimelockedTokens( this, ERC20TransferData(_msgSender(), _msgSender(), recipient, amount), release ); _post_transfer_hook(_msgSender(), recipient, amount); } /** * @notice Unlocks some or all of `account`'s locked tokens. * @param account the user * @param unlockAmount the amount to unlock * * Requirements: * - caller MUST be the owner or have the UNLOCK_LOCKED_TOKENS role * - `unlockAmount` MAY be greater than the locked balance, in which case * all of the account's locked tokens are unlocked. */ function unlockLockedTokens( address account, uint256 unlockAmount ) public virtual { utilityOps().unlockLockedTokens( this, msg.sender, account, unlockAmount ); } /** * @notice Resets the lock period for a batch of addresses * @notice This function has no effect on accounts without a locked token balance * @param release the new lock release date, as a Unix timestamp in seconds * @param addresses the list of addresses to be reset * * Requirements: * - caller MUST be the owner or have the UNLOCK_LOCKED_TOKENS role * - `release` MAY be zero or in the past, in which case the users' entire locked balances become unlocked * - `addresses` MAY contain accounts without a locked balance, in which case the account is unaffected */ function updateTimelocks( uint256 release, address[] calldata addresses ) public virtual { utilityOps().updateTimelocks(this, msg.sender, release, addresses); } /** * @notice Returns the amount of locked tokens for `account`. * @param account the user address */ function lockedBalanceOf( address account ) public view virtual returns (uint256) { return utilityOps().lockedBalanceOf(account); } /** * @notice Returns the Unix timestamp when a user's locked tokens will be * released. * @param account the user address */ function lockReleaseDate( address account ) public view virtual returns (uint256) { return utilityOps().lockReleaseDate(account); } /** * @notice Returns the difference between `account`'s total balance and its * locked balance. * @param account the user address */ function unlockedBalanceOf( address account ) public view virtual returns (uint256) { return utilityOps().unlockedBalanceOf(account); } /** * @notice recovers tokens from lost wallets * @dev emits LostTokensRecovered * * Requirements * - `operator` MUST be the contract owner. * - `fromAddress` MUST have been marked as a "lost wallet". * - `toAddress` MUST NOT be banned or OFAC sanctioned */ function recoverMisplacedTokens( address lostWallet, address toAddress ) public virtual onlyOwner { uint256 amount = utilityOps().recoverMisplacedTokens( this, msg.sender, lostWallet, toAddress ); emit LostTokensRecovered(lostWallet, toAddress, amount); _post_transfer_hook(lostWallet, toAddress, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "IERC20Metadata.sol"; import "ERC677ReceiverInterface.sol"; import "IBridgeable.sol"; import "BaseViciContract.sol"; import "EIP712.sol"; import "Monotonic.sol"; import "IERC677.sol"; import "IERC20Operations.sol"; /** * @title Vici ERC20 * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev This contract provides base functionality for an ERC20 token. * @dev It adds support for pausible, ownable, access roles, and OFAC sanctions * compliance. * @dev Roles used by the access management are * - DEFAULT_ADMIN_ROLE: administers the other roles * - MODERATOR_ROLE_NAME: administers the banned role * - MINTER_ROLE_NAME: can mint/burn tokens * - BRIDGE_CONTRACT: a registered bridge * - BANNED_ROLE: cannot send or receive tokens */ contract ViciERC20 is BaseViciContract, IERC20Metadata, IERC677, IBridgeable, EIP712 { using Monotonic for Monotonic.Increaser; event SanctionedAssetsRecovered(address from, address to, uint256 value); // Creator can create a new token type and mint an initial supply. bytes32 public constant MINTER_ROLE_NAME = "minter"; // solhint-disable-next-line var-name-mixedcase bytes32 private constant _PERMIT_TYPEHASH = keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ); /** * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`. * However, to ensure consistency with the upgradeable transpiler, we will continue * to reserve a slot. * @custom:oz-renamed-from _PERMIT_TYPEHASH */ // solhint-disable-next-line var-name-mixedcase bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT; mapping(address => Monotonic.Increaser) private _nonces; string public name; string public symbol; uint8 public decimals; IERC20Operations public tokenData; bool public isMain; address public vault; /* ################################################################ * Initialization * ##############################################################*/ /** * @dev Use this one when deploying for the first time on a new chain. * @dev Use reinit when upgrading from a v1 token * @param _accessServer The Access Server contract * @param _tokenData The ERC20 Operations contract. You MUST set this contract as the owner of that contract. * @param _name the name of the token. * @param _symbol the token symbol. * @param _decimals the number of decimals. */ function initialize( IAccessServer _accessServer, IERC20Operations _tokenData, string calldata _name, string calldata _symbol, uint8 _decimals, bool _isMain ) public virtual reinitializer(2) { __ViciERC20_init( _accessServer, _tokenData, _name, _symbol, _decimals, _isMain ); } function __ViciERC20_init( IAccessServer _accessServer, IERC20Operations _tokenData, string calldata _name, string calldata _symbol, uint8 _decimals, bool _isMain ) internal onlyInitializing { EIP712.__EIP712_init(_name, "1"); BaseViciContract.__BaseViciContract_init(_accessServer); __ViciERC20_init_unchained( _tokenData, _name, _symbol, _decimals, _isMain ); } function __ViciERC20_init_unchained( IERC20Operations _tokenData, string calldata _name, string calldata _symbol, uint8 _decimals, bool _isMain ) internal onlyInitializing { tokenData = _tokenData; name = _name; symbol = _symbol; decimals = _decimals; __ViciCoinV02_reinit(_isMain); } /** * @dev Use this one when upgrading from a v1 token * @dev Use initialize when deploying for the first time on a new chain. */ function reinit(bool _isMain) public reinitializer(2) { __ViciCoinV02_reinit(_isMain); } function __ViciCoinV02_reinit(bool _isMain) internal onlyInitializing { isMain = _isMain; if (isMain) { vault = address(tokenData); } } /* ################################################################ * Queries * ##############################################################*/ /** * @notice Returns the total maximum possible tokens. */ function maxSupply() public view virtual returns (uint256) { return tokenData.getMaxSupply(); } /** * @inheritdoc IERC20 */ function totalSupply() public view virtual returns (uint256) { return tokenData.totalSupply(); } function circulatingSupply() public view virtual returns (uint256) { if (isMain) { return totalSupply() - balanceOf(vault); } return totalSupply(); } /** * @notice Returns the total maximum possible tokens. */ function availableSupply() public view virtual returns (uint256) { return tokenData.availableSupply(); } /** * @dev see IERC20 */ function balanceOf( address owner ) public view virtual returns (uint256 balance) { return tokenData.balanceOf(owner); } /** * @dev Returns the number of distict owners. * @dev use with `getOwnerAtIndex()` to iterate. */ function getOwnerCount() public view virtual returns (uint256) { return tokenData.ownerCount(); } /** * @dev Returns the address of the owner at the index. * @dev use with `ownerCount()` to iterate. * * @param index the index into the list of owners * * Requirements * - `index` MUST be less than the number of owners. */ function getOwnerAtIndex( uint256 index ) public view virtual returns (address) { return tokenData.ownerAtIndex(index); } /* ################################################################ * Bridging / Transferring * ##############################################################*/ /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer( address toAddress, uint256 amount ) public virtual override returns (bool) { tokenData.transfer( this, ERC20TransferData(_msgSender(), _msgSender(), toAddress, amount) ); _post_transfer_hook(_msgSender(), toAddress, amount); return true; } /** * @dev See {IERC20-transferFrom}. * @dev See {safeTransferFrom}. * * Requirements * * - `fromAddress` and `toAddress` MUST NOT be the zero address. * - `toAddress`, `fromAddress`, and calling user MUST NOT be banned. * - `_tokenId` MUST belong to `fromAddress`. * - Calling user must be the `fromAddress` or be approved by the `fromAddress`. * - `_tokenId` must exist * * @inheritdoc IERC20 */ function transferFrom( address fromAddress, address toAddress, uint256 amount ) public virtual override returns (bool) { tokenData.transfer( this, ERC20TransferData(_msgSender(), fromAddress, toAddress, amount) ); _post_transfer_hook(fromAddress, toAddress, amount); return true; } /** * @inheritdoc IERC677 */ function transferAndCall( address to, uint256 value, bytes calldata data ) public virtual override returns (bool success) { transfer(to, value); ERC677ReceiverInterface receiver = ERC677ReceiverInterface(to); receiver.onTokenTransfer(_msgSender(), value, data); return true; } /** * Requirements: * - caller MUST be a registered bridge contract * - * * @inheritdoc IBridgeable */ function sentToBridge( BridgeArgs calldata args ) public payable onlyRole(BRIDGE_CONTRACT) { if (isMain) { tokenData.transfer( this, ERC20TransferData( args.caller, args.fromAddress, vault, args.amount ) ); _post_transfer_hook(args.fromAddress, vault, args.amount); } else { tokenData.burn( this, ERC20BurnData( args.caller, ANY_ROLE, args.fromAddress, args.amount ) ); _post_burn_hook(args.fromAddress, args.amount); } emit SentToBridge( args.fromAddress, args.toAddress, 1, args.amount, args.caller, args.remoteChainId ); } function receivedFromBridge( BridgeArgs calldata args ) public payable onlyRole(BRIDGE_CONTRACT) { if (isMain) { tokenData.transfer( this, ERC20TransferData(vault, vault, args.toAddress, args.amount) ); _post_transfer_hook(vault, args.toAddress, args.amount); } else { tokenData.mint( this, ERC20MintData( _msgSender(), ANY_ROLE, args.toAddress, args.amount ) ); _post_mint_hook(args.toAddress, args.amount); } emit ReceivedFromBridge( args.fromAddress, args.toAddress, 1, args.amount, args.caller, args.remoteChainId ); } /* ################################################################ * Approvals / Allowances * ##############################################################*/ /** * @dev See {IERC20-allowance}. */ function allowance( address owner, address spender ) public view virtual override returns (uint256) { return tokenData.allowance(owner, spender); //return _allowances[owner][spender]; } /** * Requirements * * - caller MUST be the token owner or be approved for all by the token * owner. * - `operator` MUST NOT be the zero address. * - `operator` and calling user MUST NOT be banned. * * @inheritdoc IERC20 */ function approve( address operator, uint256 amount ) public virtual override returns (bool) { tokenData.permit(this, _msgSender(), operator, amount); emit Approval(_msgSender(), operator, amount); return true; } /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256( abi.encode( _PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline ) ); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); tokenData.permit(this, owner, spender, value); emit Approval(owner, spender, value); } function getChainId() public view returns (uint256) { return block.chainid; } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual returns (uint256) { return _nonces[owner].current(); } /** * @notice recover assets in banned or sanctioned accounts * @dev emits SanctionedAssetsRecovered * * Requirements * - `operator` MUST be the contract owner. * - `fromAddress` MUST be banned or OFAC sanctioned * - `toAddress` MAY be the zero address, in which case the * assets are burned. * - `toAddress` MUST NOT be banned or OFAC sanctioned */ function recoverSanctionedAssets( address fromAddress, address toAddress ) public virtual onlyOwner { uint256 amount = tokenData.recoverSanctionedAssets( this, msg.sender, fromAddress, toAddress ); emit SanctionedAssetsRecovered(fromAddress, toAddress, amount); _post_transfer_hook(fromAddress, toAddress, amount); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce( address owner ) internal virtual returns (uint256 current) { Monotonic.Increaser storage nonce = _nonces[owner]; current = nonce.current(); nonce.add(1); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return _domainSeparatorV4(); } /* ################################################################ * Hooks * ##############################################################*/ function _post_mint_hook( address toAddress, uint256 amount ) internal virtual { _post_transfer_hook(address(0), toAddress, amount); } function _post_burn_hook( address fromAddress, uint256 amount ) internal virtual { _post_transfer_hook(fromAddress, address(0), amount); } function _post_transfer_hook( address fromAddress, address toAddress, uint256 amount ) internal virtual { emit Transfer(fromAddress, toAddress, amount); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[43] private __gap; }
// 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.6.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 pragma solidity ^0.8.6; interface ERC677ReceiverInterface { function onTokenTransfer( address sender, uint256 amount, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "AccessConstants.sol"; struct BridgeArgs { address caller; address fromAddress; address toAddress; uint256 remoteChainId; uint256 itemId; uint256 amount; } struct SendParams { address fromAddress; uint256 dstChainId; address toAddress; uint256 itemId; uint256 amount; } /** * @title Bridgeable Interface * @dev common interface for bridgeable tokens */ interface IBridgeable { event SentToBridge( address indexed fromAddress, address indexed toAddress, uint256 indexed itemId, uint256 amount, address caller, uint256 dstChainId ); event ReceivedFromBridge( address indexed fromAddress, address indexed toAddress, uint256 indexed itemId, uint256 amount, address caller, uint256 srcChainId ); /** * @dev Callback function to notify when tokens have been sent through a bridge. * @dev Implementations SHOULD either lock or burn these tokens. * @param args.caller the original message sender * @param args.fromAddress the owner of the tokens that were sent * @param args.toAddress the destination address on the other chain * @param args.remoteChainId the chain id for the destination * @param args.itemId the token id for ERC721 or ERC1155 tokens. Ignored for ERC20 tokens. * @param args.amount the amount of tokens sent for ERC20 and ERC1155 tokens. Ignored for ERC721 tokens. */ function sentToBridge(BridgeArgs calldata args) external payable; /** * @dev Callback function to notify when tokens have been sent through a bridge. * @dev Implementations SHOULD either unlock or mint these tokens and send them to the `toAddress`. * @dev IMPORTANT: access to this function MUST be tightly controlled. Otherwise it's an infinite free tokens function. * @param args.caller the original message sender * @param args.fromAddress the owner of the tokens that were sent * @param args.toAddress the destination address on this chain * @param args.srcChainId the chain id for the source * @param args.itemId the token id for ERC721 or ERC1155 tokens. Ignored for ERC20 tokens. * @param args.amount the amount of tokens sent for ERC20 and ERC1155 tokens. Ignored for ERC721 tokens. */ function receivedFromBridge(BridgeArgs calldata args) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; bytes32 constant DEFAULT_ADMIN = 0x00; bytes32 constant BANNED = "banned"; bytes32 constant MODERATOR = "moderator"; bytes32 constant ANY_ROLE = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; bytes32 constant BRIDGE_CONTRACT = keccak256("BRIDGE_CONTRACT"); bytes32 constant BRIDGE_ROLE_MGR = keccak256("BRIDGE_ROLE_MGR");
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "IERC20.sol"; import "IERC721.sol"; import "IERC1155.sol"; import "IAccessServer.sol"; import "Pausable.sol"; import "ViciAccess.sol"; /** * @title Base Vici Contract * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev This abstract base contract grants the following features to subclasses * - Owner and role based access * - Ability to pause / unpause * - Rescue functions for crypto and tokens transferred to the contract */ abstract contract BaseViciContract is ViciAccess, Pausable { function __BaseViciContract_init(IAccessServer _accessServer) internal onlyInitializing { __ViciAccess_init(_accessServer); __Pausable_init(); __BaseViciContract_init_unchained(); } function __BaseViciContract_init_unchained() internal onlyInitializing {} /** * @dev Triggers stopped state. * * Requirements: * * - Calling user MUST be owner. * - The contract must not be paused. */ function pause() external onlyOwner { _pause(); } /** * @dev Returns to normal state. * * Requirements: * * - Calling user MUST be owner. * - The contract must be paused. */ function unpause() external onlyOwner { _unpause(); } function _withdrawERC20( uint256 amount, address payable toAddress, IERC20 tokenContract ) internal virtual { tokenContract.transfer(toAddress, amount); } function withdrawERC20( uint256 amount, address payable toAddress, IERC20 tokenContract ) public onlyOwner virtual { _withdrawERC20(amount, toAddress, tokenContract); } function _withdrawERC721( uint256 tokenId, address payable toAddress, IERC721 tokenContract ) internal virtual { tokenContract.safeTransferFrom(address(this), toAddress, tokenId); } function withdrawERC721( uint256 tokenId, address payable toAddress, IERC721 tokenContract ) public virtual onlyOwner { _withdrawERC721(tokenId, toAddress, tokenContract); } function _withdrawERC1155( uint256 tokenId, uint256 amount, address payable toAddress, bytes calldata data, IERC1155 tokenContract ) internal virtual { tokenContract.safeTransferFrom( address(this), toAddress, tokenId, amount, data ); } function withdrawERC1155( uint256 tokenId, uint256 amount, address payable toAddress, bytes calldata data, IERC1155 tokenContract ) public virtual onlyOwner { _withdrawERC1155(tokenId, amount, toAddress, data, tokenContract); } function _withdraw( address payable toAddress ) internal virtual { toAddress.transfer(address(this).balance); } function withdraw( address payable toAddress ) public virtual onlyOwner { _withdraw(toAddress); } receive() external payable virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; interface ChainalysisSanctionsList { function isSanctioned(address addr) external view returns (bool); } /** * @title Access Server Interface * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev Interface for the AccessServer. * @dev AccessServer client contracts SHOULD refer to the server contract via * this interface. */ interface IAccessServer { /** * @notice Emitted when a new administrator is added. */ event AdminAddition(address indexed admin); /** * @notice Emitted when an administrator is removed. */ event AdminRemoval(address indexed admin); /** * @notice Emitted when a resource is registered. */ event ResourceRegistration(address indexed resource); /** * @notice Emitted when `newAdminRole` is set globally as ``role``'s admin * role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {GlobalRoleAdminChanged} not being emitted signaling this. */ event GlobalRoleAdminChanged( bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole ); /** * @notice Emitted when `account` is granted `role` globally. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event GlobalRoleGranted( bytes32 indexed role, address indexed account, address indexed sender ); /** * @notice Emitted when `account` is revoked `role` globally. * @notice `account` will still have `role` where it was granted * specifically for any resources * * `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 GlobalRoleRevoked( bytes32 indexed role, address indexed account, address indexed sender ); /* ################################################################ * Modifiers / Rule Enforcement * ##############################################################*/ /** * @dev Throws if the account is not the resource's owner. */ function enforceIsOwner(address resource, address account) external view; /** * @dev Throws if the account is not the calling resource's owner. */ function enforceIsMyOwner(address account) external view; /** * @dev Reverts if the account is not the resource owner or doesn't have * the moderator role for the resource. */ function enforceIsModerator(address resource, address account) external view; /** * @dev Reverts if the account is not the resource owner or doesn't have * the moderator role for the calling resource. */ function enforceIsMyModerator(address account) external view; /** * @dev Reverts if the account is under OFAC sanctions or is banned for the * resource */ function enforceIsNotBanned(address resource, address account) external view; /** * @dev Reverts if the account is under OFAC sanctions or is banned for the * calling resource */ function enforceIsNotBannedForMe(address account) external view; /** * @dev Reverts the account is on the OFAC sanctions list. */ function enforceIsNotSanctioned(address account) external view; /** * @dev Reverts if the account is not the resource owner or doesn't have * the required role for the resource. */ function enforceOwnerOrRole( address resource, bytes32 role, address account ) external view; /** * @dev Reverts if the account is not the resource owner or doesn't have * the required role for the calling resource. */ function enforceOwnerOrRoleForMe(bytes32 role, address account) external view; /* ################################################################ * Administration * ##############################################################*/ /** * @dev Returns `true` if `admin` is an administrator of this AccessServer. */ function isAdministrator(address admin) external view returns (bool); /** * @dev Adds `admin` as an administrator of this AccessServer. */ function addAdministrator(address admin) external; /** * @dev Removes `admin` as an administrator of this AccessServer. */ function removeAdministrator(address admin) external; /** * @dev Returns the number of administrators of this AccessServer. * @dev Use with `getAdminAt()` to enumerate. */ function getAdminCount() external view returns (uint256); /** * @dev Returns the administrator at the index. * @dev Use with `getAdminCount()` to enumerate. */ function getAdminAt(uint256 index) external view returns (address); /** * @dev Returns the list of administrators */ function getAdmins() external view returns (address[] memory); /** * @dev returns the Chainalysis sanctions oracle. */ function sanctionsList() external view returns (ChainalysisSanctionsList); /** * @dev Sets the Chainalysis sanctions oracle. * @dev setting this to the zero address disables sanctions compliance. * @dev Don't disable sanctions compliance unless there is some problem * with the sanctions oracle. */ function setSanctionsList(ChainalysisSanctionsList _sanctionsList) external; /** * @dev Returns `true` if `account` is under OFAC sanctions. * @dev Returns `false` if sanctions compliance is disabled. */ function isSanctioned(address account) external view returns (bool); /* ################################################################ * Registration / Ownership * ##############################################################*/ /** * @dev Registers the calling resource and sets the resource owner. * @dev Grants the default administrator role for the resource to the * resource owner. * * Requirements: * - caller SHOULD be a contract * - caller MUST NOT be already registered * - `owner` MUST NOT be the zero address * - `owner` MUST NOT be globally banned * - `owner` MUST NOT be under OFAC sanctions */ function register(address owner) external; /** * @dev Returns `true` if `resource` is registered. */ function isRegistered(address resource) external view returns (bool); /** * @dev Returns the owner of `resource`. */ function getResourceOwner(address resource) external view returns (address); /** * @dev Returns the owner of the calling resource. */ function getMyOwner() external view returns (address); /** * @dev Sets the owner for the calling resource. * * Requirements: * - caller MUST be a registered resource * - `operator` MUST be the current owner * - `newOwner` MUST NOT be the zero address * - `newOwner` MUST NOT be globally banned * - `newOwner` MUST NOT be banned by the calling resource * - `newOwner` MUST NOT be under OFAC sanctions * - `newOwner` MUST NOT be the current owner */ function setMyOwner(address operator, address newOwner) external; /* ################################################################ * Role Administration * ##############################################################*/ /** * @dev Returns the admin role that controls `role` by default for all * resources. See {grantRole} and {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getGlobalRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Returns the admin role that controls `role` for a resource. * See {grantRole} and {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdminForResource(address resource, bytes32 role) external view returns (bytes32); /** * @dev Returns the admin role that controls `role` for the calling resource. * See {grantRole} and {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getMyRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Sets `adminRole` as ``role``'s admin role on as default all * resources. * * Requirements: * - caller MUST be an an administrator of this AccessServer */ function setGlobalRoleAdmin(bytes32 role, bytes32 adminRole) external; /** * @dev Sets `adminRole` as ``role``'s admin role on the calling resource. * @dev There is no set roleAdminForResource vs setRoleAdminForMe. * @dev Resources must manage their own role admins or use the global * defaults. * * Requirements: * - caller MUST be a registered resource */ function setRoleAdmin( address operator, bytes32 role, bytes32 adminRole ) external; /* ################################################################ * Checking Role Membership * ##############################################################*/ /** * @dev Returns `true` if `account` has been granted `role` as default for * all resources. */ function hasGlobalRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns `true` if `account` has been granted `role` globally or for * `resource`. */ function hasRole( address resource, bytes32 role, address account ) external view returns (bool); /** * @dev Returns `true` if `account` has been granted `role` for `resource`. */ function hasLocalRole( address resource, bytes32 role, address account ) external view returns (bool); /** * @dev Returns `true` if `account` has been granted `role` globally or for * the calling resource. */ function hasRoleForMe(bytes32 role, address account) external view returns (bool); /** * @dev Returns `true` if account` is banned globally or from `resource`. */ function isBanned(address resource, address account) external view returns (bool); /** * @dev Returns `true` if account` is banned globally or from the calling * resource. */ function isBannedForMe(address account) external view returns (bool); /** * @dev Reverts if `account` has not been granted `role` globally or for * `resource`. */ function checkRole( address resource, bytes32 role, address account ) external view; /** * @dev Reverts if `account` has not been granted `role` globally or for * the calling resource. */ function checkRoleForMe(bytes32 role, address account) external view; /* ################################################################ * Granting Roles * ##############################################################*/ /** * @dev Grants `role` to `account` as default for all resources. * @dev Warning: This function can do silly things like applying a global * ban to a resource owner. * * Requirements: * - caller MUST be an an administrator of this AccessServer * - If `role` is not BANNED_ROLE_NAME, `account` MUST NOT be banned or * under OFAC sanctions. Roles cannot be granted to such accounts. */ function grantGlobalRole(bytes32 role, address account) external; /** * @dev Grants `role` to `account` for the calling resource as `operator`. * @dev There is no set grantRoleForResource vs grantRoleForMe. * @dev Resources must manage their own roles or use the global defaults. * * Requirements: * - caller MUST be a registered resource * - `operator` SHOULD be the account that called `grantRole()` on the * calling resource. * - `operator` MUST be the resource owner or have the role admin role * for `role` on the calling resource. * - If `role` is BANNED_ROLE_NAME, `account` MUST NOT be the resource * owner. You can't ban the owner. * - If `role` is not BANNED_ROLE_NAME, `account` MUST NOT be banned or * under OFAC sanctions. Roles cannot be granted to such accounts. */ function grantRole( address operator, bytes32 role, address account ) external; /* ################################################################ * Revoking / Renouncing Roles * ##############################################################*/ /** * @dev Revokes `role` as default for all resources from `account`. * * Requirements: * - caller MUST be an an administrator of this AccessServer */ function revokeGlobalRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account` for the calling resource as * `operator`. * * Requirements: * - caller MUST be a registered resource * - `operator` SHOULD be the account that called `revokeRole()` on the * calling resource. * - `operator` MUST be the resource owner or have the role admin role * for `role` on the calling resource. * - if `role` is DEFAULT_ADMIN_ROLE, `account` MUST NOT be the calling * resource's owner. The admin role cannot be revoked from the owner. */ function revokeRole( address operator, bytes32 role, address account ) external; /** * @dev Remove the default role for yourself. You will still have the role * for any resources where it was granted individually. * * Requirements: * - caller MUST have the role they are renouncing at the global level. * - `role` MUST NOT be BANNED_ROLE_NAME. You can't unban yourself. */ function renounceRoleGlobally(bytes32 role) external; /** * @dev Renounces `role` for the calling resource as `operator`. * * Requirements: * - caller MUST be a registered resource * - `operator` SHOULD be the account that called `renounceRole()` on the * calling resource. * - `operator` MUST have the role they are renouncing on the calling * resource. * - if `role` is DEFAULT_ADMIN_ROLE, `operator` MUST NOT be the calling * resource's owner. The owner cannot renounce the admin role. * - `role` MUST NOT be BANNED_ROLE_NAME. You can't unban yourself. */ function renounceRole(address operator, bytes32 role) external; /* ################################################################ * Enumerating Role Members * ##############################################################*/ /** * @dev Returns the number of accounts that have `role` set at the global * level. * @dev Use with `getGlobalRoleMember()` to enumerate. */ function getGlobalRoleMemberCount(bytes32 role) external view returns (uint256); /** * @dev Returns one of the accounts that have `role` set at the global * level. * @dev Use with `getGlobalRoleMemberCount()` to enumerate. * * Requirements: * `index` MUST be >= 0 and < `getGlobalRoleMemberCount(role)` */ function getGlobalRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the list of accounts that have `role` set at the global * level. */ function getGlobalRoleMembers(bytes32 role) external view returns (address[] memory); /** * @dev Returns the number of accounts that have `role` set globally or for * `resource`. * @dev Use with `getRoleMember()` to enumerate. */ function getRoleMemberCount(address resource, bytes32 role) external view returns (uint256); /** * @dev Returns one of the accounts that have `role` set globally or for * `resource`. * @dev If a role has global and local members, the global members * will be returned first. * @dev If a user has the role globally and locally, the same user will be * returned at two different indexes. * @dev If you only want locally assigned role members, start the index at * `getGlobalRoleMemberCount(role)`. * @dev Use with `getRoleMemberCount()` to enumerate. * * Requirements: * `index` MUST be >= 0 and < `getRoleMemberCount(role)` */ function getRoleMember( address resource, bytes32 role, uint256 index ) external view returns (address); /** * @dev Returns the number of accounts that have `role` set globally or for * the calling resource. * @dev Use with `getMyRoleMember()` to enumerate. */ function getMyRoleMemberCount(bytes32 role) external view returns (uint256); /** * @dev Returns one of the accounts that have `role` set globally or for * the calling resource. * @dev If a role has global and local members, the global members * will be returned first. * @dev If a user has the role globally and locally, the same user will be * returned at two different indexes. * @dev If you only want locally assigned role members, start the index at * `getGlobalRoleMemberCount(role)`. * @dev Use with `getMyRoleMemberCount()` to enumerate. * * Requirements: * `index` MUST be >= 0 and < `getMyRoleMemberCount(role)` */ function getMyRoleMember(bytes32 role, uint256 index) external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.17; import "Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. * * @dev This contract is a direct copy of OpenZeppelin's PauseableUpgradeable, * moved here, renamed, and modified to use our Context and Initializable * contracts so we don't have to deal with incompatibilities between OZ's * contracts and contracts-upgradeable packages. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.17; import "Initializable.sol"; /** * @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. * * @dev This contract is a direct copy of OpenZeppelin's ContextUpgradeable, * moved here, renamed, and modified to use our Initializable interface so we * don't have to deal with incompatibilities between OZ'` contracts and * contracts-upgradeable ` */ abstract contract Context is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.17; import "AddressUtils.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== * * @dev This contract is a direct copy of OpenZeppelin's InitializableUpgradeable, * moved here, renamed, and modified to use our AddressUtils library so we * don't have to deal with incompatibilities between OZ'` contracts and * contracts-upgradeable ` */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUtils.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require( !_initializing && _initialized < version, "Initializable: contract is already initialized" ); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.17; /** * @dev Collection of functions related to the address type * * @dev This contract is a direct copy of OpenZeppelin's AddressUpgradeable, * moved here and renamed so we don't have to deal with incompatibilities * between OZ'` contracts and contracts-upgradeable ` */ library AddressUtils { /** * @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 * ==== * * [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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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 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 pragma solidity ^0.8.17; import "ERC165.sol"; import "Context.sol"; import "AccessConstants.sol"; import "IViciAccess.sol"; import {IAccessServer} from "IAccessServer.sol"; /** * @title ViciAccess * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev This contract implements OpenZeppelin's IAccessControl and * IAccessControlEnumerable interfaces as well as the behavior of their * Ownable contract. * @dev The differences are: * - Use of an external AccessServer contract to track roles and ownership. * - Support for OFAC sanctions compliance * - Support for a negative BANNED role * - A contract owner is automatically granted the DEFAULT ADMIN role. * - Contract owner cannot renounce ownership, can only transfer it. * - DEFAULT ADMIN role cannot be revoked from the Contract owner, nor can they * renouce that role. * @dev see `AccessControl`, `AccessControlEnumerable`, and `Ownable` for * additional documentation. */ abstract contract ViciAccess is Context, IViciAccess, ERC165 { IAccessServer public accessServer; bytes32 public constant DEFAULT_ADMIN_ROLE = DEFAULT_ADMIN; // Role for banned users. bytes32 public constant BANNED_ROLE_NAME = BANNED; // Role for moderator. bytes32 public constant MODERATOR_ROLE_NAME = MODERATOR; /* ################################################################ * Initialization * ##############################################################*/ function __ViciAccess_init( IAccessServer _accessServer ) internal onlyInitializing { __ViciAccess_init_unchained(_accessServer); } function __ViciAccess_init_unchained( IAccessServer _accessServer ) internal onlyInitializing { accessServer = _accessServer; accessServer.register(_msgSender()); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || interfaceId == type(IAccessControlEnumerable).interfaceId || ERC165.supportsInterface(interfaceId); } /* ################################################################ * Checking Roles * ##############################################################*/ /** * @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, _msgSender()); _; } /** * @dev reverts if called by an account that is not the owner and doesn't * have the required role. */ modifier onlyOwnerOrRole(bytes32 role) { enforceOwnerOrRole(role, _msgSender()); _; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { accessServer.enforceIsMyOwner(_msgSender()); _; } /** * @dev reverts if the caller is banned or on the OFAC sanctions list. */ modifier noBannedAccounts() { enforceIsNotBanned(_msgSender()); _; } /** * @dev reverts if the account is banned or on the OFAC sanctions list. */ modifier notBanned(address account) { enforceIsNotBanned(account); _; } /** * @dev Revert if the address is on the OFAC sanctions list */ modifier notSanctioned(address account) { enforceIsNotSanctioned(account); _; } /** * @dev reverts if the account is not the owner and doesn't have the required role. */ function enforceOwnerOrRole( bytes32 role, address account ) public view virtual override { if (account != owner()) { _checkRole(role, account); } } /** * @dev reverts if the account is banned or on the OFAC sanctions list. */ function enforceIsNotBanned(address account) public view virtual override { accessServer.enforceIsNotBannedForMe(account); } /** * @dev Revert if the address is on the OFAC sanctions list */ function enforceIsNotSanctioned( address account ) public view virtual override { accessServer.enforceIsNotSanctioned(account); } /** * @dev returns true if the account is banned. */ function isBanned( address account ) public view virtual override returns (bool) { return accessServer.isBannedForMe(account); } /** * @dev returns true if the account is on the OFAC sanctions list. */ function isSanctioned( address account ) public view virtual override returns (bool) { return accessServer.isSanctioned(account); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole( bytes32 role, address account ) public view virtual override returns (bool) { return accessServer.hasRoleForMe(role, account); } /** * @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 (role != ANY_ROLE) { accessServer.checkRoleForMe(role, account); } } /* ################################################################ * Owner management * ##############################################################*/ /** * @dev Returns the address of the current owner. */ function owner() public view virtual override returns (address) { return accessServer.getMyOwner(); } /** * Make another account the owner of this contract. * @param newOwner the new owner. * * Requirements: * * - Calling user MUST be owner. * - `newOwner` MUST NOT have the banned role. */ function transferOwnership(address newOwner) public virtual { address oldOwner = owner(); accessServer.setMyOwner(_msgSender(), newOwner); emit OwnershipTransferred(oldOwner, newOwner); } /* ################################################################ * Role Administration * ##############################################################*/ /** * @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 accessServer.getMyRoleAdmin(role); } /** * @dev Sets the admin role that controls a role. * * Requirements: * - caller MUST be the owner or have the admin role. */ function setRoleAdmin(bytes32 role, bytes32 adminRole) public virtual { accessServer.setRoleAdmin(_msgSender(), role, adminRole); } /* ################################################################ * Enumerating role members * ##############################################################*/ /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember( bytes32 role, uint256 index ) public view virtual override returns (address) { return accessServer.getMyRoleMember(role, index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount( bytes32 role ) public view virtual override returns (uint256) { return accessServer.getMyRoleMemberCount(role); } /* ################################################################ * Granting / Revoking / Renouncing roles * ##############################################################*/ /** * Requirements: * * - Calling user MUST have the admin role * - If `role` is banned, calling user MUST be the owner * and `address` MUST NOT be the owner. * - If `role` is not banned, `account` MUST NOT be under sanctions. * * @inheritdoc IAccessControl */ function grantRole(bytes32 role, address account) public virtual override { if (!hasRole(role, account)) { accessServer.grantRole(_msgSender(), role, account); emit RoleGranted(role, account, _msgSender()); } } /** * Take the role away from the account. This will throw an exception * if you try to take the admin role (0x00) away from the owner. * * Requirements: * * - Calling user has admin role. * - If `role` is admin, `address` MUST NOT be owner. * - if `role` is banned, calling user MUST be owner. * * @inheritdoc IAccessControl */ function revokeRole(bytes32 role, address account) public virtual override { if (hasRole(role, account)) { accessServer.revokeRole(_msgSender(), role, account); emit RoleRevoked(role, account, _msgSender()); } } /** * Take a role away from yourself. This will throw an exception if you * are the contract owner and you are trying to renounce the admin role (0x00). * * Requirements: * * - if `role` is admin, calling user MUST NOT be owner. * - `account` is ignored. * - `role` MUST NOT be banned. * * @inheritdoc IAccessControl */ function renounceRole(bytes32 role, address) public virtual override { renounceRole(role); } /** * Take a role away from yourself. This will throw an exception if you * are the contract owner and you are trying to renounce the admin role (0x00). * * Requirements: * * - if `role` is admin, calling user MUST NOT be owner. * - `role` MUST NOT be banned. */ function renounceRole(bytes32 role) public virtual { accessServer.renounceRole(_msgSender(), role); emit RoleRevoked(role, _msgSender(), _msgSender()); // if (hasRole(role, _msgSender())) { // } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// 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 pragma solidity ^0.8.17; import "IAccessControlEnumerable.sol"; /** * @title ViciAccess Interface * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev Interface for ViciAccess. * @dev External contracts SHOULD refer to implementers via this interface. */ interface IViciAccess is IAccessControlEnumerable { /** * @dev emitted when the owner changes. */ event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Revert if the address is on the OFAC sanctions list */ function enforceIsNotSanctioned(address account) external view; /** * @dev reverts if the account is banned or on the OFAC sanctions list. */ function enforceIsNotBanned(address account) external view; /** * @dev reverts if the account is not the owner and doesn't have the required role. */ function enforceOwnerOrRole(bytes32 role, address account) external view; /** * @dev returns true if the account is on the OFAC sanctions list. */ function isSanctioned(address account) external view returns (bool); /** * @dev returns true if the account is banned. */ function isBanned(address account) external view returns (bool); /** * @dev Returns the address of the current owner. */ function owner() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// 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 (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.17; import "ECDSA.sol"; import "Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ * * @custom:storage-size 52 */ abstract contract EIP712 is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "Math.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 `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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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 10, 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 * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity ^0.8.17; /** @notice Provides monotonic increasing and decreasing values, similar to OpenZeppelin's Counter but (a) limited in direction, and (b) allowing for steps > 1. */ library Monotonic { /** @notice Holds a value that can only increase. @dev The internal value MUST NOT be accessed directly. Instead use current() and add(). */ struct Increaser { uint256 value; } /// @notice Returns the current value of the Increaser. function current(Increaser storage incr) internal view returns (uint256) { return incr.value; } /// @notice Adds x to the Increaser's value. function add(Increaser storage incr, uint256 x) internal { incr.value += x; } /** @notice Holds a value that can only decrease. @dev The internal value MUST NOT be accessed directly. Instead use current() and subtract(). */ struct Decreaser { uint256 value; } /// @notice Returns the current value of the Decreaser. function current(Decreaser storage decr) internal view returns (uint256) { return decr.value; } /// @notice Subtracts x from the Decreaser's value. function subtract(Decreaser storage decr, uint256 x) internal { decr.value -= x; } struct Counter{ uint256 value; } function current(Counter storage _counter) internal view returns (uint256) { return _counter.value; } function add(Counter storage _augend, uint256 _addend) internal returns (uint256) { _augend.value += _addend; return _augend.value; } function subtract(Counter storage _minuend, uint256 _subtrahend) internal returns (uint256) { _minuend.value -= _subtrahend; return _minuend.value; } function increment(Counter storage _counter) internal returns (uint256) { return add(_counter, 1); } function decrement(Counter storage _counter) internal returns (uint256) { return subtract(_counter, 1); } function reset(Counter storage _counter) internal { _counter.value = 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "IERC20Metadata.sol"; /** * @title IERC677 interface * @notice ERC677 extends ERC20 by adding the transfer and call function. */ interface IERC677 is IERC20Metadata { /** * @notice transfers `value` to `to` and calls `onTokenTransfer()`. * @param to the ERC677 Receiver * @param value the amount to transfer * @param data the abi encoded call data * * Requirements: * - `to` MUST implement ERC677ReceiverInterface. * - `value` MUST be sufficient to cover the receiving contract's fee. * - `data` MUST be the types expected by the receiving contract. * - caller MUST be a contract that implements the callback function * required by the receiving contract. * - this contract must represent a token that is accepted by the receiving * contract. */ function transferAndCall( address to, uint256 value, bytes memory data ) external returns (bool success); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "IViciAccess.sol"; import "IOwnerOperator.sol"; /** * Information needed to mint a single token. */ struct ERC20MintData { address operator; bytes32 requiredRole; address toAddress; uint256 amount; } /** * Information needed to transfer a token. */ struct ERC20TransferData { address operator; address fromAddress; address toAddress; uint256 amount; } /** * Information needed to burn a token. */ struct ERC20BurnData { address operator; bytes32 requiredRole; address fromAddress; uint256 amount; } /** * @title ERC20 Operations Interface * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev Interface for ERC20 Operations. * @dev Main contracts SHOULD refer to the ops contract via the this interface. */ interface IERC20Operations is IOwnerOperator { /* ################################################################ * Queries * ##############################################################*/ /** * @dev Returns the total maximum possible that can be minted. */ function getMaxSupply() external view returns (uint256); /** * @dev Returns the amount that has been minted so far. */ function totalSupply() external view returns (uint256); /** * @dev returns the amount available to be minted. * @dev {total available} = {max supply} - {amount minted so far} */ function availableSupply() external view returns (uint256); /** * @dev see IERC20 */ function balanceOf(address account) external view returns (uint256 balance); /* ################################################################ * Minting / Burning / Transferring * ##############################################################*/ /** * @dev Safely mints a new token and transfers it to the specified address. * @dev Updates available quantities * * Requirements: * * - `mintData.operator` MUST be owner or have the required role. * - `mintData.operator` MUST NOT be banned. * - `mintData.toAddress` MUST NOT be 0x0. * - `mintData.toAddress` MUST NOT be banned. * - If `mintData.toAddress` refers to a smart contract, it must implement * {IERC20Receiver-onERC20Received}, which is called upon a safe * transfer. */ function mint(IViciAccess ams, ERC20MintData memory mintData) external; /** * @dev see IERC20 */ function transfer( IViciAccess ams, ERC20TransferData memory transferData ) external; /** * @dev Burns the identified token. * @dev Updates available quantities * * Requirements: * * - `burnData.operator` MUST be owner or have the required role. * - `burnData.operator` MUST NOT be banned. * - `burnData.operator` MUST own the token or be authorized by the * owner to transfer the token. */ function burn(IViciAccess ams, ERC20BurnData memory burnData) external; /* ################################################################ * Approvals / Allowances * ##############################################################*/ /** * @dev see IERC20 */ function allowance( address owner, address spender ) external view returns (uint256); /** * @dev See {IERC20Permit-permit}. */ function permit( IViciAccess ams, address owner, address spender, uint256 amount ) external; /** * @notice recover assets in banned or sanctioned accounts * * Requirements * - `operator` MUST be the contract owner. * - `fromAddress` MUST be banned or OFAC sanctioned * - `toAddress` MAY be the zero address, in which case the * assets are burned. * - `toAddress` MUST NOT be banned or OFAC sanctioned */ function recoverSanctionedAssets( IViciAccess ams, address operator, address fromAddress, address toAddress ) external returns (uint256 amount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /** * @title Owner Operator Interface * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev public interface for the Owner Operator contract */ interface IOwnerOperator { /** * @dev revert if the item does not exist */ function enforceItemExists(uint256 thing) external view; /* ################################################################ * Queries * ##############################################################*/ /** * @dev Returns whether `thing` exists. Things are created by transferring * from the null address, and things are destroyed by tranferring to * the null address. * @dev COINS: returns whether any have been minted and are not all burned. * * @param thing identifies the thing. * * Requirements: * - COINS: `thing` SHOULD be 1. */ function exists(uint256 thing) external view returns (bool); /** * @dev Returns the number of distict owners. * @dev use with `ownerAtIndex()` to iterate. */ function ownerCount() external view returns (uint256); /** * @dev Returns the address of the owner at the index. * @dev use with `ownerCount()` to iterate. * * @param index the index into the list of owners * * Requirements * - `index` MUST be less than the number of owners. */ function ownerAtIndex(uint256 index) external view returns (address); /** * @dev Returns the number of distict items. * @dev use with `itemAtIndex()` to iterate. * @dev COINS: returns 1 or 0 depending on whether any tokens exist. */ function itemCount() external view returns (uint256); /** * @dev Returns the ID of the item at the index. * @dev use with `itemCount()` to iterate. * @dev COINS: don't use this function. The ID is always 1. * * @param index the index into the list of items * * Requirements * - `index` MUST be less than the number of items. */ function itemAtIndex(uint256 index) external view returns (uint256); /** * @dev for a given item, returns the number that exist. * @dev NFTS: don't use this function. It returns 1 or 0 depending on * whether the item exists. Use `exists()` instead. */ function itemSupply(uint256 thing) external view returns (uint256); /** * @dev Returns how much of an item is held by an address. * @dev NFTS: Returns 0 or 1 depending on whether the address owns the item. * * @param owner the owner * @param thing identifies the item. * * Requirements: * - `owner` MUST NOT be the null address. * - `thing` MUST exist. */ function getBalance(address owner, uint256 thing) external view returns (uint256); /** * @dev Returns the list of distinct items held by an address. * @dev COINS: Don't use this function. * * @param user the user * * Requirements: * - `owner` MUST NOT be the null address. */ function userWallet(address user) external view returns (uint256[] memory); /** * @dev For a given address, returns the number of distinct items. * @dev Returns 0 if the address doesn't own anything here. * @dev use with `itemOfOwnerByIndex()` to iterate. * @dev COINS: don't use this function. It returns 1 or 0 depending on * whether the address has a balance. Use `balance()` instead. * * Requirements: * - `owner` MUST NOT be the null address. * - `thing` MUST exist. */ function ownerItemCount(address owner) external view returns (uint256); /** * @dev For a given address, returns the id of the item at the index. * @dev COINS: don't use this function. * * @param owner the owner. * @param index the index in the list of items. * * Requirements: * - `owner` MUST NOT be the null address. * - `index` MUST be less than the number of items. */ function itemOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev For a given item, returns the number of owners. * @dev use with `ownerOfItemAtIndex()` to iterate. * @dev COINS: don't use this function. Use `ownerCount()` instead. * @dev NFTS: don't use this function. If `thing` exists, the answer is 1. * * Requirements: * - `thing` MUST exist. */ function itemOwnerCount(uint256 thing) external view returns (uint256); /** * @dev For a given item, returns the owner at the index. * @dev use with `itemOwnerCount()` to iterate. * @dev COINS: don't use this function. Use `ownerAtIndex()` instead. * @dev NFTS: Returns the owner. * * @param thing identifies the item. * @param index the index in the list of owners. * * Requirements: * - `thing` MUST exist. * - `index` MUST be less than the number of owners. * - NFTS: `index` MUST be 0. */ function ownerOfItemAtIndex(uint256 thing, uint256 index) external view returns (address owner); /* ################################################################ * Minting / Burning / Transferring * ##############################################################*/ /** * @dev transfers an amount of thing from one address to another. * @dev if `fromAddress` is the null address, `amount` of `thing` is * created. * @dev if `toAddress` is the null address, `amount` of `thing` is * destroyed. * * @param operator the operator * @param fromAddress the current owner * @param toAddress the current owner * @param thing identifies the item. * @param amount the amount * * Requirements: * - NFTS: `amount` SHOULD be 1 * - COINS: `thing` SHOULD be 1 * - `fromAddress` and `toAddress` MUST NOT both be the null address * - `amount` MUST be greater than 0 * - if `fromAddress` is not the null address * - `amount` MUST NOT be greater than the current owner's balance * - `operator` MUST be approved */ function doTransfer( address operator, address fromAddress, address toAddress, uint256 thing, uint256 amount ) external; /* ################################################################ * Allowances / Approvals * ##############################################################*/ /** * @dev Reverts if `operator` is allowed to transfer `amount` of `thing` on * behalf of `fromAddress`. * @dev Reverts if `fromAddress` is not an owner of at least `amount` of * `thing`. * * @param operator the operator * @param fromAddress the owner * @param thing identifies the item. * @param amount the amount * * Requirements: * - NFTS: `amount` SHOULD be 1 * - COINS: `thing` SHOULD be 1 */ function enforceAccess( address operator, address fromAddress, uint256 thing, uint256 amount ) external view; /** * @dev Returns whether `operator` is allowed to transfer `amount` of * `thing` on behalf of `fromAddress`. * * @param operator the operator * @param fromAddress the owner * @param thing identifies the item. * @param amount the amount * * Requirements: * - NFTS: `amount` SHOULD be 1 * - COINS: `thing` SHOULD be 1 */ function isApproved( address operator, address fromAddress, uint256 thing, uint256 amount ) external view returns (bool); /** * @dev Returns whether an operator is approved for all items belonging to * an owner. * * @param fromAddress the owner * @param operator the operator */ function isApprovedForAll(address fromAddress, address operator) external view returns (bool); /** * @dev Toggles whether an operator is approved for all items belonging to * an owner. * * @param fromAddress the owner * @param operator the operator * @param approved the new approval status * * Requirements: * - `fromUser` MUST NOT be the null address * - `operator` MUST NOT be the null address * - `operator` MUST NOT be the `fromUser` */ function setApprovalForAll( address fromAddress, address operator, bool approved ) external; /** * @dev returns the approved allowance for an operator. * @dev NFTS: Don't use this function. Use `getApprovedForItem()` * * @param fromAddress the owner * @param operator the operator * @param thing identifies the item. * * Requirements: * - COINS: `thing` SHOULD be 1 */ function allowance( address fromAddress, address operator, uint256 thing ) external view returns (uint256); /** * @dev sets the approval amount for an operator. * @dev NFTS: Don't use this function. Use `approveForItem()` * * @param fromAddress the owner * @param operator the operator * @param thing identifies the item. * @param amount the allowance amount. * * Requirements: * - COINS: `thing` SHOULD be 1 * - `fromUser` MUST NOT be the null address * - `operator` MUST NOT be the null address * - `operator` MUST NOT be the `fromUser` */ function approve( address fromAddress, address operator, uint256 thing, uint256 amount ) external; /** * @dev Returns the address of the operator who is approved for an item. * @dev Returns the null address if there is no approved operator. * @dev COINS: Don't use this function. * * @param fromAddress the owner * @param thing identifies the item. * * Requirements: * - `thing` MUST exist */ function getApprovedForItem(address fromAddress, uint256 thing) external view returns (address); /** * @dev Approves `operator` to transfer `thing` to another account. * @dev COINS: Don't use this function. Use `setApprovalForAll()` or * `approve()` * * @param fromAddress the owner * @param operator the operator * @param thing identifies the item. * * Requirements: * - `fromUser` MUST NOT be the null address * - `operator` MAY be the null address * - `operator` MUST NOT be the `fromUser` * - `fromUser` MUST be an owner of `thing` */ function approveForItem( address fromAddress, address operator, uint256 thing ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "IERC20Operations.sol"; import "Vesting.sol"; bytes32 constant AIRDROP_ROLE_NAME = "airdrop"; bytes32 constant LOST_WALLET = keccak256("lost wallet"); bytes32 constant UNLOCK_LOCKED_TOKENS = keccak256("UNLOCK_LOCKED_TOKENS"); /** * @title ERC20 Utility Operations Interface * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev Interface for ERC20 utiity token operations * @dev Main contracts SHOULD refer to the ops contract via the this interface. */ interface IERC20UtilityOperations is IERC20Operations { /** * @notice Transfers tokens from the caller to a recipient and establishes * a vesting schedule. * If `transferData.toAddress` already has a locked balance, then * - if `transferData.amount` is greater than the airdropThreshold AND `release` is later than the current * lockReleaseDate, the lockReleaseDate will be updated. * - if `transferData.amount` is less than the airdropThreshold OR `release` is earlier than the current * lockReleaseDate, the lockReleaseDate will be left unchanged. * @param transferData describes the token transfer * @param release the new lock release date, as a Unix timestamp in seconds * * Requirements: * - caller MUST have the AIRDROPPER role * - the transaction MUST meet all requirements for a transfer * @dev see IERC20Operations.transfer */ function airdropTimelockedTokens( IViciAccess ams, ERC20TransferData memory transferData, uint256 release ) external; /** * @notice Unlocks some or all of `account`'s locked tokens. * @param account the user * @param unlockAmount the amount to unlock * * Requirements: * - caller MUST be the owner or have the UNLOCK_LOCKED_TOKENS role * - `unlockAmount` MAY be greater than the locked balance, in which case * all of the account's locked tokens are unlocked. */ function unlockLockedTokens( IViciAccess ams, address operator, address account, uint256 unlockAmount ) external; /** * @notice Resets the lock period for a batch of addresses * @notice This function has no effect on accounts without a locked token balance * @param release the new lock release date, as a Unix timestamp in seconds * @param addresses the list of addresses to be reset * * Requirements: * - caller MUST be the owner or have the UNLOCK_LOCKED_TOKENS role * - `release` MAY be zero or in the past, in which case the users' entire locked balances become unlocked * - `addresses` MAY contain accounts without a locked balance, in which case the account is unaffected */ function updateTimelocks( IViciAccess ams, address operator, uint256 release, address[] calldata addresses ) external; /** * @notice Returns the amount of locked tokens for `account`. * @param account the user address */ function lockedBalanceOf(address account) external view returns (uint256); /** * @notice Returns the Unix timestamp when a user's locked tokens will be * released. * @param account the user address */ function lockReleaseDate(address account) external view returns (uint256); /** * @notice Returns the difference between `account`'s total balance and its * locked balance. * @param account the user address */ function unlockedBalanceOf(address account) external view returns (uint256); /** * @notice recovers tokens from lost wallets */ function recoverMisplacedTokens( IViciAccess ams, address operator, address fromAddress, address toAddress ) external returns (uint256 amount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /** * @title Vesting library * @notice (c) 2023 ViciNFT https://vicinft.com/ * @author Josh Davis <[email protected]> * * @dev This library defines a struct and provides utility functions for * tracking an amount that vests over time. * @dev Unvested amounts may be spent to attend events, purchase NFTs, or * participate in other experiences or utilities offered by ViciNFT. */ struct VestingSchedule { // the initial amount of the airdrop uint256 startingAmount; // total funds spent purchasing from ViciNFT uint256 amountSpent; // vesting start time uint64 start; // length of the vesting period uint64 duration; } library Vesting { /** * @dev Returns the portion of the original amount that remains unvested, * less any amount that has been spent through ViciNFT. */ function getLockedAmount( VestingSchedule storage schedule, uint256 timestamp ) internal view returns (uint256) { // start == 0 means the thing is uninitialized // current time after start+duration means fully vested if ( schedule.start == 0 || timestamp >= schedule.start + schedule.duration ) { return 0; } // current time before start means not vested if (timestamp <= schedule.start) { return schedule.startingAmount - schedule.amountSpent; } // total amount * percent of vesting period past uint256 preSpendingLockAmount = schedule.startingAmount - (schedule.startingAmount * (timestamp - schedule.start)) / schedule.duration; // we've spent all the remaining locked tokens if (schedule.amountSpent > preSpendingLockAmount) { return 0; } // remaining locked tokens less tokens spent through ViciNFT return preSpendingLockAmount - schedule.amountSpent; } }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "ViciERC20UtilityToken.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LostTokensRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcChainId","type":"uint256"}],"name":"ReceivedFromBridge","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":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"SanctionedAssetsRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"dstChainId","type":"uint256"}],"name":"SentToBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BANNED_ROLE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MODERATOR_ROLE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessServer","outputs":[{"internalType":"contract IAccessServer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"release","type":"uint256"}],"name":"airdropTimelockedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"circulatingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"enforceIsNotBanned","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"enforceIsNotSanctioned","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"enforceOwnerOrRole","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getOwnerAtIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwnerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"contract IAccessServer","name":"_accessServer","type":"address"},{"internalType":"contract IERC20Operations","name":"_tokenData","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"bool","name":"_isMain","type":"bool"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBanned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isSanctioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"lockReleaseDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"lockedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"fromAddress","type":"address"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"remoteChainId","type":"uint256"},{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BridgeArgs","name":"args","type":"tuple"}],"name":"receivedFromBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"lostWallet","type":"address"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"recoverMisplacedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromAddress","type":"address"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"recoverSanctionedAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isMain","type":"bool"}],"name":"reinit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"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":[{"components":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"fromAddress","type":"address"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"remoteChainId","type":"uint256"},{"internalType":"uint256","name":"itemId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BridgeArgs","name":"args","type":"tuple"}],"name":"sentToBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"bytes32","name":"adminRole","type":"bytes32"}],"name":"setRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenData","outputs":[{"internalType":"contract IERC20Operations","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"transferAndCall","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromAddress","type":"address"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"unlockAmount","type":"uint256"}],"name":"unlockLockedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"unlockedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"release","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"updateTimelocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"toAddress","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"toAddress","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"contract IERC1155","name":"tokenContract","type":"address"}],"name":"withdrawERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"toAddress","type":"address"},{"internalType":"contract IERC20","name":"tokenContract","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable","name":"toAddress","type":"address"},{"internalType":"contract IERC721","name":"tokenContract","type":"address"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b613dac80620000f36000396000f3fe6080604052600436106103bc5760003560e01c80638456cb59116101f2578063a8360ff01161010d578063dd62ed3e116100a0578063ef18374a1161006f578063ef18374a14610ad9578063f1e152df14610aee578063f2fde38b14610b0e578063fbfa77cf14610b2e57600080fd5b8063dd62ed3e14610a66578063df592f7d14610a86578063ec27e0b714610aa6578063ec3dce6914610ab957600080fd5b8063d505accf116100dc578063d505accf146109f1578063d547741f14610a11578063d5abeb0114610a31578063d91eff6114610a4657600080fd5b8063a8360ff014610971578063a8aa987a14610991578063a9059cbb146109b1578063ca15c873146109d157600080fd5b806395d89b4111610185578063a24a517d11610154578063a24a517d146108fe578063a50fdd551461091e578063a58b409b1461093e578063a7a2bba41461095157600080fd5b806395d89b411461089457806397f735d5146108a95780639df49d86146108c9578063a217fddf146108e957600080fd5b80639010d07c116101c15780639010d07c1461081f57806391d148541461083f57806392e3a3e21461085f5780639358928b1461087f57600080fd5b80638456cb59146107b557806384955c88146107ca5780638bb9c5bf146107ea5780638da5cb5b1461080a57600080fd5b806336568abe116102e25780635c975abb1161027557806370a082311161024457806370a08231146107405780637ecc2b56146107605780637ecebe00146107755780638387aa041461079557600080fd5b80635c975abb146106c95780635d29dab4146106e15780635e6fa3b614610701578063604269d11461071e57600080fd5b806340910fd9116102b157806340910fd91461064957806351cff8d91461066957806359355736146106895780635c6d61eb146106a957600080fd5b806336568abe146105d45780633c6182ef146105f45780633f4ba83a146106145780634000aea01461062957600080fd5b806323b872dd1161035a578063313ce56711610329578063313ce5671461056257806332e7a3cb1461058f5780633408e470146105ac5780633644e515146105bf57600080fd5b806323b872dd146104e2578063248a9ca31461050257806326bdf121146105225780632f2ff15d1461054257600080fd5b8063095ea7b311610396578063095ea7b31461045d578063129cb7e51461047d57806318160ddd1461049f5780631e4e0091146104c257600080fd5b806301ffc9a7146103c8578063024fd650146103fd57806306fdde031461043b57600080fd5b366103c357005b600080fd5b3480156103d457600080fd5b506103e86103e336600461337e565b610b4f565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610101546104239061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016103f4565b34801561044757600080fd5b50610450610ba1565b6040516103f491906133a8565b34801561046957600080fd5b506103e861047836600461340b565b610c2f565b34801561048957600080fd5b5061049d610498366004613437565b610cfa565b005b3480156104ab57600080fd5b506104b4610d76565b6040519081526020016103f4565b3480156104ce57600080fd5b5061049d6104dd3660046134b6565b610df5565b3480156104ee57600080fd5b506103e86104fd3660046134d8565b610e65565b34801561050e57600080fd5b506104b461051d366004613519565b610f34565b34801561052e57600080fd5b5061042361053d366004613519565b610fa3565b34801561054e57600080fd5b5061049d61055d366004613532565b611017565b34801561056e57600080fd5b506101015461057d9060ff1681565b60405160ff90911681526020016103f4565b34801561059b57600080fd5b506104b46518985b9b995960d21b81565b3480156105b857600080fd5b50466104b4565b3480156105cb57600080fd5b506104b46110eb565b3480156105e057600080fd5b5061049d6105ef366004613532565b6110f5565b34801561060057600080fd5b5061049d61060f3660046135ab565b6110fe565b34801561062057600080fd5b5061049d611175565b34801561063557600080fd5b506103e8610644366004613627565b6111e8565b34801561065557600080fd5b5061049d6106643660046136a7565b611267565b34801561067557600080fd5b5061049d610684366004613761565b61131e565b34801561069557600080fd5b506104b46106a4366004613761565b611393565b3480156106b557600080fd5b5061049d6106c436600461340b565b6113cc565b3480156106d557600080fd5b5060655460ff166103e8565b3480156106ed57600080fd5b5061049d6106fc36600461377e565b61140f565b34801561070d57600080fd5b506104b46536b4b73a32b960d11b81565b34801561072a57600080fd5b50610101546103e890600160a81b900460ff1681565b34801561074c57600080fd5b506104b461075b366004613761565b611488565b34801561076c57600080fd5b506104b46114c1565b34801561078157600080fd5b506104b4610790366004613761565b611517565b3480156107a157600080fd5b5061049d6107b0366004613761565b611535565b3480156107c157600080fd5b5061049d611596565b3480156107d657600080fd5b506104b46107e5366004613761565b611607565b3480156107f657600080fd5b5061049d610805366004613519565b611640565b34801561081657600080fd5b506104236116fc565b34801561082b57600080fd5b5061042361083a3660046134b6565b61176a565b34801561084b57600080fd5b506103e861085a366004613532565b6117df565b34801561086b57600080fd5b5061049d61087a3660046137c0565b611855565b34801561088b57600080fd5b506104b46118f5565b3480156108a057600080fd5b5061045061193b565b3480156108b557600080fd5b506103e86108c4366004613761565b611949565b3480156108d557600080fd5b5061049d6108e43660046137dd565b6119b9565b3480156108f557600080fd5b506104b4600081565b34801561090a57600080fd5b5061049d610919366004613761565b611b19565b34801561092a57600080fd5b50603354610423906001600160a01b031681565b61049d61094c36600461380b565b611b4b565b34801561095d57600080fd5b5061049d61096c366004613532565b611de6565b34801561097d57600080fd5b5061049d61098c36600461381d565b611e10565b34801561099d57600080fd5b5061049d6109ac36600461377e565b611ed5565b3480156109bd57600080fd5b506103e86109cc36600461340b565b611f49565b3480156109dd57600080fd5b506104b46109ec366004613519565b612015565b3480156109fd57600080fd5b5061049d610a0c366004613852565b612047565b348015610a1d57600080fd5b5061049d610a2c366004613532565b61225a565b348015610a3d57600080fd5b506104b461232e565b348015610a5257600080fd5b506104b46836b7b232b930ba37b960b91b81565b348015610a7257600080fd5b506104b4610a813660046137dd565b612384565b348015610a9257600080fd5b506103e8610aa1366004613761565b612401565b61049d610ab436600461380b565b612434565b348015610ac557600080fd5b5061049d610ad43660046137dd565b6126b9565b348015610ae557600080fd5b506104b46127fb565b348015610afa57600080fd5b506104b4610b09366004613761565b612851565b348015610b1a57600080fd5b5061049d610b29366004613761565b61288a565b348015610b3a57600080fd5b5061010254610423906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b1480610b8057506001600160e01b03198216635a05180f60e01b145b80610b9b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60ff8054610bae906138c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610bda906138c0565b8015610c275780601f10610bfc57610100808354040283529160200191610c27565b820191906000526020600020905b815481529060010190602001808311610c0a57829003601f168201915b505050505081565b61010154604051630332eb2d60e21b815260009161010090046001600160a01b031690630ccbacb490610c6c9030903390889088906004016138f4565b600060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b50505050826001600160a01b0316610caf3390565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610ce991815260200190565b60405180910390a350600192915050565b6101015461010090046001600160a01b03166001600160a01b031663c4ade39030338686866040518663ffffffff1660e01b8152600401610d3f95949392919061391e565b600060405180830381600087803b158015610d5957600080fd5b505af1158015610d6d573d6000803e3d6000fd5b50505050505050565b600061010160019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df0919061398d565b905090565b603354604051630997ce7160e01b815233600482015260248101849052604481018390526001600160a01b0390911690630997ce71906064015b600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b505050505050565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634bbe5516306040518060800160405280610e9f3390565b6001600160a01b03168152602001886001600160a01b03168152602001876001600160a01b03168152602001868152506040518363ffffffff1660e01b8152600401610eec9291906139a6565b600060405180830381600087803b158015610f0657600080fd5b505af1158015610f1a573d6000803e3d6000fd5b50505050610f29848484612946565b5060015b9392505050565b603354604051632b25c9c760e01b8152600481018390526000916001600160a01b031690632b25c9c7906024015b602060405180830381865afa158015610f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b919061398d565b61010154604051638ea6902960e01b81526004810183905260009161010090046001600160a01b031690638ea6902990602401602060405180830381865afa158015610ff3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b91906139f1565b61102182826117df565b6110e7576033546001600160a01b0316633290f93a336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152602481018690529084166044820152606401600060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506110a63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000610df0612998565b6110e782611640565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561114f57600080fd5b505afa158015611163573d6000803e3d6000fd5b50505050610e5d868686868686612a13565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506111e6612a83565b565b60006111f48585611f49565b50604051635260769b60e11b815285906001600160a01b0382169063a4c0ed3690611229903390899089908990600401613a37565b600060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b5060019998505050505050505050565b600054600290610100900460ff16158015611289575060005460ff8083169116105b6112ae5760405162461bcd60e51b81526004016112a590613a69565b60405180910390fd5b6000805461ffff191660ff8316176101001790556112d28989898989898989612ad5565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050505050565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561136f57600080fd5b505afa158015611383573d6000803e3d6000fd5b5050505061139081612b76565b50565b61010154604051632c9aab9b60e11b81526001600160a01b03838116600483015260009261010090041690635935573690602401610f62565b6101015461010090046001600160a01b03166001600160a01b0316636200906a303385856040518563ffffffff1660e01b8152600401610e2f94939291906138f4565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561146057600080fd5b505afa158015611474573d6000803e3d6000fd5b50505050611483838383612bab565b505050565b610101546040516370a0823160e01b81526001600160a01b038381166004830152600092610100900416906370a0823190602401610f62565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316637ecc2b566040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b6001600160a01b038116600090815260fe6020526040812054610b9b565b6033546040516320e1ea8160e21b81526001600160a01b03838116600483015290911690638387aa04906024015b60006040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b5050505050565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506111e6612c24565b61010154604051631092ab9160e31b81526001600160a01b038381166004830152600092610100900416906384955c8890602401610f62565b6033546001600160a01b031663f3c3437d336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561169a57600080fd5b505af11580156116ae573d6000803e3d6000fd5b505050506116b93390565b6001600160a01b0316336001600160a01b0316827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a450565b6033546040805163208f1f9960e01b815290516000926001600160a01b03169163208f1f999160048083019260209291908290030181865afa158015611746573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906139f1565b6033546040516338c43adf60e11b815260048101849052602481018390526000916001600160a01b03169063718875be90604401602060405180830381865afa1580156117bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d91906139f1565b603354604051635219898160e11b8152600481018490526001600160a01b038381166024830152600092169063a433130290604401602060405180830381865afa158015611831573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190613ab7565b600054600290610100900460ff16158015611877575060005460ff8083169116105b6118935760405162461bcd60e51b81526004016112a590613a69565b6000805461ffff191660ff8316176101001790556118b082612c61565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b61010154600090600160a81b900460ff16156119335761010254611921906001600160a01b0316611488565b611929610d76565b610df09190613aea565b610df0610d76565b6101008054610bae906138c0565b60335460405163b924698760e01b81526001600160a01b038381166004830152600092169063b9246987906024015b602060405180830381865afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b9190613ab7565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b158015611a0a57600080fd5b505afa158015611a1e573d6000803e3d6000fd5b505050506000611a3d610101546001600160a01b036101009091041690565b6040516397144fc760e01b81523060048201523360248201526001600160a01b038581166044830152848116606483015291909116906397144fc7906084016020604051808303816000875af1158015611a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abf919061398d565b604080516001600160a01b038087168252851660208201529081018290529091507f2283dd8f0aa4512bb878b51898d84e80c33b3620cba1edaad7f13e555e097c9c906060015b60405180910390a1611483838383612946565b6033546040516389c75e1160e01b81526001600160a01b038381166004830152909116906389c75e1190602401611563565b7f3fd4a614bd02c8fb908a3b3a05852476cf4c63cfc1b7280860fd956aa0982f9f611b768133612cdd565b61010154600160a81b900460ff1615611c6b576101015460408051608081018252610102546001600160a01b03908116808352602083015261010090930490921691634bbe55169130919081810190611bd59060608901908901613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401611c089291906139a6565b600060405180830381600087803b158015611c2257600080fd5b505af1158015611c36573d6000803e3d6000fd5b505061010254611c6692506001600160a01b03169050611c5c6060850160408601613761565b8460a00135612946565b611d50565b61010160019054906101000a90046001600160a01b03166001600160a01b031663631c363e306040518060800160405280611ca33390565b6001600160a01b031681526000196020820152604090810190611ccc9060608901908901613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401611cff929190613afd565b600060405180830381600087803b158015611d1957600080fd5b505af1158015611d2d573d6000803e3d6000fd5b50611d509250611d469150506060840160408501613761565b8360a00135612d46565b6001611d626060840160408501613761565b6001600160a01b0316611d7b6040850160208601613761565b6001600160a01b03167ff4ea29784a8ad7456fb8ea0b9af463d31bde69edb825d92a73ca63096227b76d60a0860135611db76020880188613761565b604080519283526001600160a01b03919091166020830152606088810135838301529051918290030190a45050565b611dee6116fc565b6001600160a01b0316816001600160a01b0316146110e7576110e78282612cdd565b6101015461010090046001600160a01b03166001600160a01b031663ee33e191306040518060800160405280611e433390565b6001600160a01b03168152602001336001600160a01b03168152602001876001600160a01b0316815260200186815250846040518463ffffffff1660e01b8152600401611e9293929190613b46565b600060405180830381600087803b158015611eac57600080fd5b505af1158015611ec0573d6000803e3d6000fd5b50505050611483611ece3390565b8484612946565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b158015611f2657600080fd5b505afa158015611f3a573d6000803e3d6000fd5b50505050611483838383612d52565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634bbe5516306040518060800160405280611f833390565b6001600160a01b03168152602001336001600160a01b03168152602001876001600160a01b03168152602001868152506040518363ffffffff1660e01b8152600401611fd09291906139a6565b600060405180830381600087803b158015611fea57600080fd5b505af1158015611ffe573d6000803e3d6000fd5b5050505061200c611ece3390565b50600192915050565b60335460405163bdb44f2960e01b8152600481018390526000916001600160a01b03169063bdb44f2990602401610f62565b834211156120975760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016112a5565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886120c68c612d8d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061212182612db9565b9050600061213182878787612e07565b9050896001600160a01b0316816001600160a01b0316146121945760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016112a5565b61010154604051630332eb2d60e21b81526101009091046001600160a01b031690630ccbacb4906121cf9030908e908e908e906004016138f4565b600060405180830381600087803b1580156121e957600080fd5b505af11580156121fd573d6000803e3d6000fd5b50505050886001600160a01b03168a6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258a60405161224691815260200190565b60405180910390a350505050505050505050565b61226482826117df565b156110e7576033546001600160a01b0316638c63a1a1336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152602481018690529084166044820152606401600060405180830381600087803b1580156122cb57600080fd5b505af11580156122df573d6000803e3d6000fd5b505050506122ea3390565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634c0f38c26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b61010154604051636eb1769f60e11b81526001600160a01b03848116600483015283811660248301526000926101009004169063dd62ed3e90604401602060405180830381865afa1580156123dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d919061398d565b60335460405163df592f7d60e01b81526001600160a01b038381166004830152600092169063df592f7d90602401611978565b7f3fd4a614bd02c8fb908a3b3a05852476cf4c63cfc1b7280860fd956aa0982f9f61245f8133612cdd565b61010154600160a81b900460ff161561256d576101015460408051608081019091526101009091046001600160a01b031690634bbe5516903090806124a76020880188613761565b6001600160a01b031681526020018660200160208101906124c89190613761565b6001600160a01b0390811682526101025416602082015260a0870135604091820152516001600160e01b031960e085901b16815261250a9291906004016139a6565b600060405180830381600087803b15801561252457600080fd5b505af1158015612538573d6000803e3d6000fd5b5061256892506125519150506040840160208501613761565b610102546001600160a01b031660a0850135612946565b612652565b6101015460408051608081019091526101009091046001600160a01b03169063bf0f4a7e903090806125a26020880188613761565b6001600160a01b0316815260200160001960001b81526020018660200160208101906125ce9190613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401612601929190613afd565b600060405180830381600087803b15801561261b57600080fd5b505af115801561262f573d6000803e3d6000fd5b5061265292506126489150506040840160208501613761565b8360a00135612e2f565b60016126646060840160408501613761565b6001600160a01b031661267d6040850160208601613761565b6001600160a01b03167f49e86899b41934ffa93d6db47f37670313228803b4c819af30cd42637d84096a60a0860135611db76020880188613761565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561270a57600080fd5b505afa15801561271e573d6000803e3d6000fd5b505061010154604051633a3d9aa360e01b81523060048201523360248201526001600160a01b0386811660448301528581166064830152600094506101009092049091169150633a3d9aa3906084016020604051808303816000875af115801561278c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b0919061398d565b604080516001600160a01b038087168252851660208201529081018290529091507fb6153b6bd7894806f48017bc32f1de542ca0b4b97bf5dd9a43ec5c52fabd21a890606001611b06565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316630db026226040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b6101015460405163f1e152df60e01b81526001600160a01b0383811660048301526000926101009004169063f1e152df90602401610f62565b60006128946116fc565b6033549091506001600160a01b0316634001303f336040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401600060405180830381600087803b1580156128f257600080fd5b505af1158015612906573d6000803e3d6000fd5b50506040516001600160a01b038086169350841691507f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161298b91815260200190565b60405180910390a3505050565b6000610df07f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6129c760c95490565b60ca546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b604051637921219560e11b81526001600160a01b0382169063f242432a90612a4990309088908b908b908a908a90600401613b9f565b600060405180830381600087803b158015612a6357600080fd5b505af1158015612a77573d6000803e3d6000fd5b50505050505050505050565b612a8b612e3b565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16612afc5760405162461bcd60e51b81526004016112a590613be6565b612b5486868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b60208201529150612e849050565b612b5d88612eb5565b612b6c87878787878787612ef5565b5050505050505050565b6040516001600160a01b038216904780156108fc02916000818181858888f193505050501580156110e7573d6000803e3d6000fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820185905282169063a9059cbb906044016020604051808303816000875af1158015612bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1e9190613ab7565b50505050565b612c2c612f73565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ab83390565b600054610100900460ff16612c885760405162461bcd60e51b81526004016112a590613be6565b610101805460ff60a81b1916600160a81b8315158102919091179182905560ff9104161561139057506101015461010280546101009092046001600160a01b03166001600160a01b0319909216919091179055565b60001982146110e7576033546040516377b59c2f60e11b8152600481018490526001600160a01b0383811660248301529091169063ef6b385e9060440160006040518083038186803b158015612d3257600080fd5b505afa158015610e5d573d6000803e3d6000fd5b6110e760008383612946565b604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018590528216906342842e0e90606401610d3f565b6001600160a01b038116600090815260fe60205260409020805490612db3816001612fb9565b50919050565b6000610b9b612dc6612998565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612e1887878787612fd6565b91509150612e258161309a565b5095945050505050565b6110e782600083612946565b60655460ff166111e65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016112a5565b600054610100900460ff16612eab5760405162461bcd60e51b81526004016112a590613be6565b6110e782826131e4565b600054610100900460ff16612edc5760405162461bcd60e51b81526004016112a590613be6565b612ee581613225565b612eed613255565b611390613284565b600054610100900460ff16612f1c5760405162461bcd60e51b81526004016112a590613be6565b6101018054610100600160a81b0319166101006001600160a01b038a160217905560ff612f4a868883613c8d565b50610100612f59848683613c8d565b50610101805460ff191660ff8416179055610d6d81612c61565b60655460ff16156111e65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016112a5565b80826000016000828254612fcd9190613d4d565b90915550505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561300d5750600090506003613091565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613061573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661308a57600060019250925050613091565b9150600090505b94509492505050565b60008160048111156130ae576130ae613d60565b036130b65750565b60018160048111156130ca576130ca613d60565b036131175760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016112a5565b600281600481111561312b5761312b613d60565b036131785760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016112a5565b600381600481111561318c5761318c613d60565b036113905760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016112a5565b600054610100900460ff1661320b5760405162461bcd60e51b81526004016112a590613be6565b81516020928301208151919092012060c99190915560ca55565b600054610100900460ff1661324c5760405162461bcd60e51b81526004016112a590613be6565b611390816132ab565b600054610100900460ff1661327c5760405162461bcd60e51b81526004016112a590613be6565b6111e661334b565b600054610100900460ff166111e65760405162461bcd60e51b81526004016112a590613be6565b600054610100900460ff166132d25760405162461bcd60e51b81526004016112a590613be6565b603380546001600160a01b0319166001600160a01b038316908117909155634420e486336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561333757600080fd5b505af115801561158f573d6000803e3d6000fd5b600054610100900460ff166133725760405162461bcd60e51b81526004016112a590613be6565b6065805460ff19169055565b60006020828403121561339057600080fd5b81356001600160e01b031981168114610f2d57600080fd5b600060208083528351808285015260005b818110156133d5578581018301518582016040015282016133b9565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461139057600080fd5b6000806040838503121561341e57600080fd5b8235613429816133f6565b946020939093013593505050565b60008060006040848603121561344c57600080fd5b83359250602084013567ffffffffffffffff8082111561346b57600080fd5b818601915086601f83011261347f57600080fd5b81358181111561348e57600080fd5b8760208260051b85010111156134a357600080fd5b6020830194508093505050509250925092565b600080604083850312156134c957600080fd5b50508035926020909101359150565b6000806000606084860312156134ed57600080fd5b83356134f8816133f6565b92506020840135613508816133f6565b929592945050506040919091013590565b60006020828403121561352b57600080fd5b5035919050565b6000806040838503121561354557600080fd5b823591506020830135613557816133f6565b809150509250929050565b60008083601f84011261357457600080fd5b50813567ffffffffffffffff81111561358c57600080fd5b6020830191508360208285010111156135a457600080fd5b9250929050565b60008060008060008060a087890312156135c457600080fd5b863595506020870135945060408701356135dd816133f6565b9350606087013567ffffffffffffffff8111156135f957600080fd5b61360589828a01613562565b9094509250506080870135613619816133f6565b809150509295509295509295565b6000806000806060858703121561363d57600080fd5b8435613648816133f6565b935060208501359250604085013567ffffffffffffffff81111561366b57600080fd5b61367787828801613562565b95989497509550505050565b803560ff8116811461369457600080fd5b919050565b801515811461139057600080fd5b60008060008060008060008060c0898b0312156136c357600080fd5b88356136ce816133f6565b975060208901356136de816133f6565b9650604089013567ffffffffffffffff808211156136fb57600080fd5b6137078c838d01613562565b909850965060608b013591508082111561372057600080fd5b5061372d8b828c01613562565b9095509350613740905060808a01613683565b915060a089013561375081613699565b809150509295985092959890939650565b60006020828403121561377357600080fd5b8135610f2d816133f6565b60008060006060848603121561379357600080fd5b8335925060208401356137a5816133f6565b915060408401356137b5816133f6565b809150509250925092565b6000602082840312156137d257600080fd5b8135610f2d81613699565b600080604083850312156137f057600080fd5b82356137fb816133f6565b91506020830135613557816133f6565b600060c08284031215612db357600080fd5b60008060006060848603121561383257600080fd5b833561383d816133f6565b95602085013595506040909401359392505050565b600080600080600080600060e0888a03121561386d57600080fd5b8735613878816133f6565b96506020880135613888816133f6565b955060408801359450606088013593506138a460808901613683565b925060a0880135915060c0880135905092959891949750929550565b600181811c908216806138d457607f821691505b602082108103612db357634e487b7160e01b600052602260045260246000fd5b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6001600160a01b038681168252858116602080840191909152604083018690526080606084018190528301849052600091859160a08501845b8781101561397e57843561396a816133f6565b841682529382019390820190600101613957565b509a9950505050505050505050565b60006020828403121561399f57600080fd5b5051919050565b6001600160a01b038316815260a08101610f2d602083018480516001600160a01b03908116835260208083015182169084015260408083015190911690830152606090810151910152565b600060208284031215613a0357600080fd5b8151610f2d816133f6565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b0385168152836020820152606060408201526000613a5f606083018486613a0e565b9695505050505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215613ac957600080fd5b8151610f2d81613699565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b9b57610b9b613ad4565b6001600160a01b038316815260a08101610f2d602083018480516001600160a01b0390811683526020808301519084015260408083015190911690830152606090810151910152565b6001600160a01b038416815260c08101613b91602083018580516001600160a01b03908116835260208083015182169084015260408083015190911690830152606090810151910152565b8260a0830152949350505050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a060808201819052600090613bda9083018486613a0e565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f82111561148357600081815260208120601f850160051c81016020861015613c6e5750805b601f850160051c820191505b81811015610e5d57828155600101613c7a565b67ffffffffffffffff831115613ca557613ca5613c31565b613cb983613cb383546138c0565b83613c47565b6000601f841160018114613ced5760008515613cd55750838201355b600019600387901b1c1916600186901b17835561158f565b600083815260209020601f19861690835b82811015613d1e5786850135825560209485019460019092019101613cfe565b5086821015613d3b5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b80820180821115610b9b57610b9b613ad4565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c924cd590ad48f09bb3d393aae23fd12f3158c5d170bf424d88f0f9979265c8d64736f6c63430008110033
Deployed Bytecode
0x6080604052600436106103bc5760003560e01c80638456cb59116101f2578063a8360ff01161010d578063dd62ed3e116100a0578063ef18374a1161006f578063ef18374a14610ad9578063f1e152df14610aee578063f2fde38b14610b0e578063fbfa77cf14610b2e57600080fd5b8063dd62ed3e14610a66578063df592f7d14610a86578063ec27e0b714610aa6578063ec3dce6914610ab957600080fd5b8063d505accf116100dc578063d505accf146109f1578063d547741f14610a11578063d5abeb0114610a31578063d91eff6114610a4657600080fd5b8063a8360ff014610971578063a8aa987a14610991578063a9059cbb146109b1578063ca15c873146109d157600080fd5b806395d89b4111610185578063a24a517d11610154578063a24a517d146108fe578063a50fdd551461091e578063a58b409b1461093e578063a7a2bba41461095157600080fd5b806395d89b411461089457806397f735d5146108a95780639df49d86146108c9578063a217fddf146108e957600080fd5b80639010d07c116101c15780639010d07c1461081f57806391d148541461083f57806392e3a3e21461085f5780639358928b1461087f57600080fd5b80638456cb59146107b557806384955c88146107ca5780638bb9c5bf146107ea5780638da5cb5b1461080a57600080fd5b806336568abe116102e25780635c975abb1161027557806370a082311161024457806370a08231146107405780637ecc2b56146107605780637ecebe00146107755780638387aa041461079557600080fd5b80635c975abb146106c95780635d29dab4146106e15780635e6fa3b614610701578063604269d11461071e57600080fd5b806340910fd9116102b157806340910fd91461064957806351cff8d91461066957806359355736146106895780635c6d61eb146106a957600080fd5b806336568abe146105d45780633c6182ef146105f45780633f4ba83a146106145780634000aea01461062957600080fd5b806323b872dd1161035a578063313ce56711610329578063313ce5671461056257806332e7a3cb1461058f5780633408e470146105ac5780633644e515146105bf57600080fd5b806323b872dd146104e2578063248a9ca31461050257806326bdf121146105225780632f2ff15d1461054257600080fd5b8063095ea7b311610396578063095ea7b31461045d578063129cb7e51461047d57806318160ddd1461049f5780631e4e0091146104c257600080fd5b806301ffc9a7146103c8578063024fd650146103fd57806306fdde031461043b57600080fd5b366103c357005b600080fd5b3480156103d457600080fd5b506103e86103e336600461337e565b610b4f565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610101546104239061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016103f4565b34801561044757600080fd5b50610450610ba1565b6040516103f491906133a8565b34801561046957600080fd5b506103e861047836600461340b565b610c2f565b34801561048957600080fd5b5061049d610498366004613437565b610cfa565b005b3480156104ab57600080fd5b506104b4610d76565b6040519081526020016103f4565b3480156104ce57600080fd5b5061049d6104dd3660046134b6565b610df5565b3480156104ee57600080fd5b506103e86104fd3660046134d8565b610e65565b34801561050e57600080fd5b506104b461051d366004613519565b610f34565b34801561052e57600080fd5b5061042361053d366004613519565b610fa3565b34801561054e57600080fd5b5061049d61055d366004613532565b611017565b34801561056e57600080fd5b506101015461057d9060ff1681565b60405160ff90911681526020016103f4565b34801561059b57600080fd5b506104b46518985b9b995960d21b81565b3480156105b857600080fd5b50466104b4565b3480156105cb57600080fd5b506104b46110eb565b3480156105e057600080fd5b5061049d6105ef366004613532565b6110f5565b34801561060057600080fd5b5061049d61060f3660046135ab565b6110fe565b34801561062057600080fd5b5061049d611175565b34801561063557600080fd5b506103e8610644366004613627565b6111e8565b34801561065557600080fd5b5061049d6106643660046136a7565b611267565b34801561067557600080fd5b5061049d610684366004613761565b61131e565b34801561069557600080fd5b506104b46106a4366004613761565b611393565b3480156106b557600080fd5b5061049d6106c436600461340b565b6113cc565b3480156106d557600080fd5b5060655460ff166103e8565b3480156106ed57600080fd5b5061049d6106fc36600461377e565b61140f565b34801561070d57600080fd5b506104b46536b4b73a32b960d11b81565b34801561072a57600080fd5b50610101546103e890600160a81b900460ff1681565b34801561074c57600080fd5b506104b461075b366004613761565b611488565b34801561076c57600080fd5b506104b46114c1565b34801561078157600080fd5b506104b4610790366004613761565b611517565b3480156107a157600080fd5b5061049d6107b0366004613761565b611535565b3480156107c157600080fd5b5061049d611596565b3480156107d657600080fd5b506104b46107e5366004613761565b611607565b3480156107f657600080fd5b5061049d610805366004613519565b611640565b34801561081657600080fd5b506104236116fc565b34801561082b57600080fd5b5061042361083a3660046134b6565b61176a565b34801561084b57600080fd5b506103e861085a366004613532565b6117df565b34801561086b57600080fd5b5061049d61087a3660046137c0565b611855565b34801561088b57600080fd5b506104b46118f5565b3480156108a057600080fd5b5061045061193b565b3480156108b557600080fd5b506103e86108c4366004613761565b611949565b3480156108d557600080fd5b5061049d6108e43660046137dd565b6119b9565b3480156108f557600080fd5b506104b4600081565b34801561090a57600080fd5b5061049d610919366004613761565b611b19565b34801561092a57600080fd5b50603354610423906001600160a01b031681565b61049d61094c36600461380b565b611b4b565b34801561095d57600080fd5b5061049d61096c366004613532565b611de6565b34801561097d57600080fd5b5061049d61098c36600461381d565b611e10565b34801561099d57600080fd5b5061049d6109ac36600461377e565b611ed5565b3480156109bd57600080fd5b506103e86109cc36600461340b565b611f49565b3480156109dd57600080fd5b506104b46109ec366004613519565b612015565b3480156109fd57600080fd5b5061049d610a0c366004613852565b612047565b348015610a1d57600080fd5b5061049d610a2c366004613532565b61225a565b348015610a3d57600080fd5b506104b461232e565b348015610a5257600080fd5b506104b46836b7b232b930ba37b960b91b81565b348015610a7257600080fd5b506104b4610a813660046137dd565b612384565b348015610a9257600080fd5b506103e8610aa1366004613761565b612401565b61049d610ab436600461380b565b612434565b348015610ac557600080fd5b5061049d610ad43660046137dd565b6126b9565b348015610ae557600080fd5b506104b46127fb565b348015610afa57600080fd5b506104b4610b09366004613761565b612851565b348015610b1a57600080fd5b5061049d610b29366004613761565b61288a565b348015610b3a57600080fd5b5061010254610423906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b1480610b8057506001600160e01b03198216635a05180f60e01b145b80610b9b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60ff8054610bae906138c0565b80601f0160208091040260200160405190810160405280929190818152602001828054610bda906138c0565b8015610c275780601f10610bfc57610100808354040283529160200191610c27565b820191906000526020600020905b815481529060010190602001808311610c0a57829003601f168201915b505050505081565b61010154604051630332eb2d60e21b815260009161010090046001600160a01b031690630ccbacb490610c6c9030903390889088906004016138f4565b600060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b50505050826001600160a01b0316610caf3390565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610ce991815260200190565b60405180910390a350600192915050565b6101015461010090046001600160a01b03166001600160a01b031663c4ade39030338686866040518663ffffffff1660e01b8152600401610d3f95949392919061391e565b600060405180830381600087803b158015610d5957600080fd5b505af1158015610d6d573d6000803e3d6000fd5b50505050505050565b600061010160019054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df0919061398d565b905090565b603354604051630997ce7160e01b815233600482015260248101849052604481018390526001600160a01b0390911690630997ce71906064015b600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b505050505050565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634bbe5516306040518060800160405280610e9f3390565b6001600160a01b03168152602001886001600160a01b03168152602001876001600160a01b03168152602001868152506040518363ffffffff1660e01b8152600401610eec9291906139a6565b600060405180830381600087803b158015610f0657600080fd5b505af1158015610f1a573d6000803e3d6000fd5b50505050610f29848484612946565b5060015b9392505050565b603354604051632b25c9c760e01b8152600481018390526000916001600160a01b031690632b25c9c7906024015b602060405180830381865afa158015610f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b919061398d565b61010154604051638ea6902960e01b81526004810183905260009161010090046001600160a01b031690638ea6902990602401602060405180830381865afa158015610ff3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b91906139f1565b61102182826117df565b6110e7576033546001600160a01b0316633290f93a336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152602481018690529084166044820152606401600060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506110a63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000610df0612998565b6110e782611640565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561114f57600080fd5b505afa158015611163573d6000803e3d6000fd5b50505050610e5d868686868686612a13565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b1580156111c657600080fd5b505afa1580156111da573d6000803e3d6000fd5b505050506111e6612a83565b565b60006111f48585611f49565b50604051635260769b60e11b815285906001600160a01b0382169063a4c0ed3690611229903390899089908990600401613a37565b600060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b5060019998505050505050505050565b600054600290610100900460ff16158015611289575060005460ff8083169116105b6112ae5760405162461bcd60e51b81526004016112a590613a69565b60405180910390fd5b6000805461ffff191660ff8316176101001790556112d28989898989898989612ad5565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050505050565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561136f57600080fd5b505afa158015611383573d6000803e3d6000fd5b5050505061139081612b76565b50565b61010154604051632c9aab9b60e11b81526001600160a01b03838116600483015260009261010090041690635935573690602401610f62565b6101015461010090046001600160a01b03166001600160a01b0316636200906a303385856040518563ffffffff1660e01b8152600401610e2f94939291906138f4565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561146057600080fd5b505afa158015611474573d6000803e3d6000fd5b50505050611483838383612bab565b505050565b610101546040516370a0823160e01b81526001600160a01b038381166004830152600092610100900416906370a0823190602401610f62565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316637ecc2b566040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b6001600160a01b038116600090815260fe6020526040812054610b9b565b6033546040516320e1ea8160e21b81526001600160a01b03838116600483015290911690638387aa04906024015b60006040518083038186803b15801561157b57600080fd5b505afa15801561158f573d6000803e3d6000fd5b5050505050565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b1580156115e757600080fd5b505afa1580156115fb573d6000803e3d6000fd5b505050506111e6612c24565b61010154604051631092ab9160e31b81526001600160a01b038381166004830152600092610100900416906384955c8890602401610f62565b6033546001600160a01b031663f3c3437d336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561169a57600080fd5b505af11580156116ae573d6000803e3d6000fd5b505050506116b93390565b6001600160a01b0316336001600160a01b0316827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a450565b6033546040805163208f1f9960e01b815290516000926001600160a01b03169163208f1f999160048083019260209291908290030181865afa158015611746573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906139f1565b6033546040516338c43adf60e11b815260048101849052602481018390526000916001600160a01b03169063718875be90604401602060405180830381865afa1580156117bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d91906139f1565b603354604051635219898160e11b8152600481018490526001600160a01b038381166024830152600092169063a433130290604401602060405180830381865afa158015611831573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190613ab7565b600054600290610100900460ff16158015611877575060005460ff8083169116105b6118935760405162461bcd60e51b81526004016112a590613a69565b6000805461ffff191660ff8316176101001790556118b082612c61565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b61010154600090600160a81b900460ff16156119335761010254611921906001600160a01b0316611488565b611929610d76565b610df09190613aea565b610df0610d76565b6101008054610bae906138c0565b60335460405163b924698760e01b81526001600160a01b038381166004830152600092169063b9246987906024015b602060405180830381865afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b9190613ab7565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b158015611a0a57600080fd5b505afa158015611a1e573d6000803e3d6000fd5b505050506000611a3d610101546001600160a01b036101009091041690565b6040516397144fc760e01b81523060048201523360248201526001600160a01b038581166044830152848116606483015291909116906397144fc7906084016020604051808303816000875af1158015611a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abf919061398d565b604080516001600160a01b038087168252851660208201529081018290529091507f2283dd8f0aa4512bb878b51898d84e80c33b3620cba1edaad7f13e555e097c9c906060015b60405180910390a1611483838383612946565b6033546040516389c75e1160e01b81526001600160a01b038381166004830152909116906389c75e1190602401611563565b7f3fd4a614bd02c8fb908a3b3a05852476cf4c63cfc1b7280860fd956aa0982f9f611b768133612cdd565b61010154600160a81b900460ff1615611c6b576101015460408051608081018252610102546001600160a01b03908116808352602083015261010090930490921691634bbe55169130919081810190611bd59060608901908901613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401611c089291906139a6565b600060405180830381600087803b158015611c2257600080fd5b505af1158015611c36573d6000803e3d6000fd5b505061010254611c6692506001600160a01b03169050611c5c6060850160408601613761565b8460a00135612946565b611d50565b61010160019054906101000a90046001600160a01b03166001600160a01b031663631c363e306040518060800160405280611ca33390565b6001600160a01b031681526000196020820152604090810190611ccc9060608901908901613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401611cff929190613afd565b600060405180830381600087803b158015611d1957600080fd5b505af1158015611d2d573d6000803e3d6000fd5b50611d509250611d469150506060840160408501613761565b8360a00135612d46565b6001611d626060840160408501613761565b6001600160a01b0316611d7b6040850160208601613761565b6001600160a01b03167ff4ea29784a8ad7456fb8ea0b9af463d31bde69edb825d92a73ca63096227b76d60a0860135611db76020880188613761565b604080519283526001600160a01b03919091166020830152606088810135838301529051918290030190a45050565b611dee6116fc565b6001600160a01b0316816001600160a01b0316146110e7576110e78282612cdd565b6101015461010090046001600160a01b03166001600160a01b031663ee33e191306040518060800160405280611e433390565b6001600160a01b03168152602001336001600160a01b03168152602001876001600160a01b0316815260200186815250846040518463ffffffff1660e01b8152600401611e9293929190613b46565b600060405180830381600087803b158015611eac57600080fd5b505af1158015611ec0573d6000803e3d6000fd5b50505050611483611ece3390565b8484612946565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b158015611f2657600080fd5b505afa158015611f3a573d6000803e3d6000fd5b50505050611483838383612d52565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634bbe5516306040518060800160405280611f833390565b6001600160a01b03168152602001336001600160a01b03168152602001876001600160a01b03168152602001868152506040518363ffffffff1660e01b8152600401611fd09291906139a6565b600060405180830381600087803b158015611fea57600080fd5b505af1158015611ffe573d6000803e3d6000fd5b5050505061200c611ece3390565b50600192915050565b60335460405163bdb44f2960e01b8152600481018390526000916001600160a01b03169063bdb44f2990602401610f62565b834211156120975760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e6500000060448201526064016112a5565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886120c68c612d8d565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061212182612db9565b9050600061213182878787612e07565b9050896001600160a01b0316816001600160a01b0316146121945760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e6174757265000060448201526064016112a5565b61010154604051630332eb2d60e21b81526101009091046001600160a01b031690630ccbacb4906121cf9030908e908e908e906004016138f4565b600060405180830381600087803b1580156121e957600080fd5b505af11580156121fd573d6000803e3d6000fd5b50505050886001600160a01b03168a6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258a60405161224691815260200190565b60405180910390a350505050505050505050565b61226482826117df565b156110e7576033546001600160a01b0316638c63a1a1336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152602481018690529084166044820152606401600060405180830381600087803b1580156122cb57600080fd5b505af11580156122df573d6000803e3d6000fd5b505050506122ea3390565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316634c0f38c26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b61010154604051636eb1769f60e11b81526001600160a01b03848116600483015283811660248301526000926101009004169063dd62ed3e90604401602060405180830381865afa1580156123dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d919061398d565b60335460405163df592f7d60e01b81526001600160a01b038381166004830152600092169063df592f7d90602401611978565b7f3fd4a614bd02c8fb908a3b3a05852476cf4c63cfc1b7280860fd956aa0982f9f61245f8133612cdd565b61010154600160a81b900460ff161561256d576101015460408051608081019091526101009091046001600160a01b031690634bbe5516903090806124a76020880188613761565b6001600160a01b031681526020018660200160208101906124c89190613761565b6001600160a01b0390811682526101025416602082015260a0870135604091820152516001600160e01b031960e085901b16815261250a9291906004016139a6565b600060405180830381600087803b15801561252457600080fd5b505af1158015612538573d6000803e3d6000fd5b5061256892506125519150506040840160208501613761565b610102546001600160a01b031660a0850135612946565b612652565b6101015460408051608081019091526101009091046001600160a01b03169063bf0f4a7e903090806125a26020880188613761565b6001600160a01b0316815260200160001960001b81526020018660200160208101906125ce9190613761565b6001600160a01b031681526020018660a001358152506040518363ffffffff1660e01b8152600401612601929190613afd565b600060405180830381600087803b15801561261b57600080fd5b505af115801561262f573d6000803e3d6000fd5b5061265292506126489150506040840160208501613761565b8360a00135612e2f565b60016126646060840160408501613761565b6001600160a01b031661267d6040850160208601613761565b6001600160a01b03167f49e86899b41934ffa93d6db47f37670313228803b4c819af30cd42637d84096a60a0860135611db76020880188613761565b6033546001600160a01b031663765e9fa6336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160006040518083038186803b15801561270a57600080fd5b505afa15801561271e573d6000803e3d6000fd5b505061010154604051633a3d9aa360e01b81523060048201523360248201526001600160a01b0386811660448301528581166064830152600094506101009092049091169150633a3d9aa3906084016020604051808303816000875af115801561278c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b0919061398d565b604080516001600160a01b038087168252851660208201529081018290529091507fb6153b6bd7894806f48017bc32f1de542ca0b4b97bf5dd9a43ec5c52fabd21a890606001611b06565b600061010160019054906101000a90046001600160a01b03166001600160a01b0316630db026226040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcc573d6000803e3d6000fd5b6101015460405163f1e152df60e01b81526001600160a01b0383811660048301526000926101009004169063f1e152df90602401610f62565b60006128946116fc565b6033549091506001600160a01b0316634001303f336040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401600060405180830381600087803b1580156128f257600080fd5b505af1158015612906573d6000803e3d6000fd5b50506040516001600160a01b038086169350841691507f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161298b91815260200190565b60405180910390a3505050565b6000610df07f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6129c760c95490565b60ca546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b604051637921219560e11b81526001600160a01b0382169063f242432a90612a4990309088908b908b908a908a90600401613b9f565b600060405180830381600087803b158015612a6357600080fd5b505af1158015612a77573d6000803e3d6000fd5b50505050505050505050565b612a8b612e3b565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16612afc5760405162461bcd60e51b81526004016112a590613be6565b612b5486868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b60208201529150612e849050565b612b5d88612eb5565b612b6c87878787878787612ef5565b5050505050505050565b6040516001600160a01b038216904780156108fc02916000818181858888f193505050501580156110e7573d6000803e3d6000fd5b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820185905282169063a9059cbb906044016020604051808303816000875af1158015612bfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1e9190613ab7565b50505050565b612c2c612f73565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612ab83390565b600054610100900460ff16612c885760405162461bcd60e51b81526004016112a590613be6565b610101805460ff60a81b1916600160a81b8315158102919091179182905560ff9104161561139057506101015461010280546101009092046001600160a01b03166001600160a01b0319909216919091179055565b60001982146110e7576033546040516377b59c2f60e11b8152600481018490526001600160a01b0383811660248301529091169063ef6b385e9060440160006040518083038186803b158015612d3257600080fd5b505afa158015610e5d573d6000803e3d6000fd5b6110e760008383612946565b604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018590528216906342842e0e90606401610d3f565b6001600160a01b038116600090815260fe60205260409020805490612db3816001612fb9565b50919050565b6000610b9b612dc6612998565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000612e1887878787612fd6565b91509150612e258161309a565b5095945050505050565b6110e782600083612946565b60655460ff166111e65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016112a5565b600054610100900460ff16612eab5760405162461bcd60e51b81526004016112a590613be6565b6110e782826131e4565b600054610100900460ff16612edc5760405162461bcd60e51b81526004016112a590613be6565b612ee581613225565b612eed613255565b611390613284565b600054610100900460ff16612f1c5760405162461bcd60e51b81526004016112a590613be6565b6101018054610100600160a81b0319166101006001600160a01b038a160217905560ff612f4a868883613c8d565b50610100612f59848683613c8d565b50610101805460ff191660ff8416179055610d6d81612c61565b60655460ff16156111e65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016112a5565b80826000016000828254612fcd9190613d4d565b90915550505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561300d5750600090506003613091565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613061573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661308a57600060019250925050613091565b9150600090505b94509492505050565b60008160048111156130ae576130ae613d60565b036130b65750565b60018160048111156130ca576130ca613d60565b036131175760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016112a5565b600281600481111561312b5761312b613d60565b036131785760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016112a5565b600381600481111561318c5761318c613d60565b036113905760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016112a5565b600054610100900460ff1661320b5760405162461bcd60e51b81526004016112a590613be6565b81516020928301208151919092012060c99190915560ca55565b600054610100900460ff1661324c5760405162461bcd60e51b81526004016112a590613be6565b611390816132ab565b600054610100900460ff1661327c5760405162461bcd60e51b81526004016112a590613be6565b6111e661334b565b600054610100900460ff166111e65760405162461bcd60e51b81526004016112a590613be6565b600054610100900460ff166132d25760405162461bcd60e51b81526004016112a590613be6565b603380546001600160a01b0319166001600160a01b038316908117909155634420e486336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401600060405180830381600087803b15801561333757600080fd5b505af115801561158f573d6000803e3d6000fd5b600054610100900460ff166133725760405162461bcd60e51b81526004016112a590613be6565b6065805460ff19169055565b60006020828403121561339057600080fd5b81356001600160e01b031981168114610f2d57600080fd5b600060208083528351808285015260005b818110156133d5578581018301518582016040015282016133b9565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461139057600080fd5b6000806040838503121561341e57600080fd5b8235613429816133f6565b946020939093013593505050565b60008060006040848603121561344c57600080fd5b83359250602084013567ffffffffffffffff8082111561346b57600080fd5b818601915086601f83011261347f57600080fd5b81358181111561348e57600080fd5b8760208260051b85010111156134a357600080fd5b6020830194508093505050509250925092565b600080604083850312156134c957600080fd5b50508035926020909101359150565b6000806000606084860312156134ed57600080fd5b83356134f8816133f6565b92506020840135613508816133f6565b929592945050506040919091013590565b60006020828403121561352b57600080fd5b5035919050565b6000806040838503121561354557600080fd5b823591506020830135613557816133f6565b809150509250929050565b60008083601f84011261357457600080fd5b50813567ffffffffffffffff81111561358c57600080fd5b6020830191508360208285010111156135a457600080fd5b9250929050565b60008060008060008060a087890312156135c457600080fd5b863595506020870135945060408701356135dd816133f6565b9350606087013567ffffffffffffffff8111156135f957600080fd5b61360589828a01613562565b9094509250506080870135613619816133f6565b809150509295509295509295565b6000806000806060858703121561363d57600080fd5b8435613648816133f6565b935060208501359250604085013567ffffffffffffffff81111561366b57600080fd5b61367787828801613562565b95989497509550505050565b803560ff8116811461369457600080fd5b919050565b801515811461139057600080fd5b60008060008060008060008060c0898b0312156136c357600080fd5b88356136ce816133f6565b975060208901356136de816133f6565b9650604089013567ffffffffffffffff808211156136fb57600080fd5b6137078c838d01613562565b909850965060608b013591508082111561372057600080fd5b5061372d8b828c01613562565b9095509350613740905060808a01613683565b915060a089013561375081613699565b809150509295985092959890939650565b60006020828403121561377357600080fd5b8135610f2d816133f6565b60008060006060848603121561379357600080fd5b8335925060208401356137a5816133f6565b915060408401356137b5816133f6565b809150509250925092565b6000602082840312156137d257600080fd5b8135610f2d81613699565b600080604083850312156137f057600080fd5b82356137fb816133f6565b91506020830135613557816133f6565b600060c08284031215612db357600080fd5b60008060006060848603121561383257600080fd5b833561383d816133f6565b95602085013595506040909401359392505050565b600080600080600080600060e0888a03121561386d57600080fd5b8735613878816133f6565b96506020880135613888816133f6565b955060408801359450606088013593506138a460808901613683565b925060a0880135915060c0880135905092959891949750929550565b600181811c908216806138d457607f821691505b602082108103612db357634e487b7160e01b600052602260045260246000fd5b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b6001600160a01b038681168252858116602080840191909152604083018690526080606084018190528301849052600091859160a08501845b8781101561397e57843561396a816133f6565b841682529382019390820190600101613957565b509a9950505050505050505050565b60006020828403121561399f57600080fd5b5051919050565b6001600160a01b038316815260a08101610f2d602083018480516001600160a01b03908116835260208083015182169084015260408083015190911690830152606090810151910152565b600060208284031215613a0357600080fd5b8151610f2d816133f6565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b0385168152836020820152606060408201526000613a5f606083018486613a0e565b9695505050505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215613ac957600080fd5b8151610f2d81613699565b634e487b7160e01b600052601160045260246000fd5b81810381811115610b9b57610b9b613ad4565b6001600160a01b038316815260a08101610f2d602083018480516001600160a01b0390811683526020808301519084015260408083015190911690830152606090810151910152565b6001600160a01b038416815260c08101613b91602083018580516001600160a01b03908116835260208083015182169084015260408083015190911690830152606090810151910152565b8260a0830152949350505050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a060808201819052600090613bda9083018486613a0e565b98975050505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f82111561148357600081815260208120601f850160051c81016020861015613c6e5750805b601f850160051c820191505b81811015610e5d57828155600101613c7a565b67ffffffffffffffff831115613ca557613ca5613c31565b613cb983613cb383546138c0565b83613c47565b6000601f841160018114613ced5760008515613cd55750838201355b600019600387901b1c1916600186901b17835561158f565b600083815260209020601f19861690835b82811015613d1e5786850135825560209485019460019092019101613cfe565b5086821015613d3b5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b80820180821115610b9b57610b9b613ad4565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c924cd590ad48f09bb3d393aae23fd12f3158c5d170bf424d88f0f9979265c8d64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.