Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
[ Download CSV Export ]
Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x1306cDe4788437b098F2287f505Ae7CC8E38ba66
Contract Name:
VaultRegistry
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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.0 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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: BSL-1.1 pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "./interfaces/IProtocolGovernance.sol"; import "./interfaces/vaults/IVault.sol"; import "./interfaces/IVaultRegistry.sol"; import "./libraries/ExceptionsLibrary.sol"; import "./libraries/PermissionIdsLibrary.sol"; import "./utils/ContractMeta.sol"; /// @notice This contract is used to manage ERC721 NFT for all Vaults. contract VaultRegistry is ContractMeta, IVaultRegistry, ERC721 { uint256 private _stagedProtocolGovernanceTimestamp; IProtocolGovernance private _protocolGovernance; IProtocolGovernance private _stagedProtocolGovernance; address[] private _vaults; mapping(address => uint256) private _nftIndex; mapping(uint256 => address) private _vaultIndex; mapping(uint256 => bool) private _locks; uint256 private _topNft = 1; /// @notice Creates a new contract. /// @param name ERC721 token name /// @param symbol ERC721 token symbol /// @param protocolGovernance_ Reference to ProtocolGovernance constructor( string memory name, string memory symbol, IProtocolGovernance protocolGovernance_ ) ERC721(name, symbol) { _protocolGovernance = protocolGovernance_; } // ------------------- EXTERNAL, VIEW ------------------- function vaults() external view returns (address[] memory) { return _vaults; } /// @inheritdoc IVaultRegistry function vaultForNft(uint256 nft) external view returns (address) { return _vaultIndex[nft]; } /// @inheritdoc IVaultRegistry function nftForVault(address vault) external view returns (uint256) { return _nftIndex[vault]; } /// @inheritdoc IVaultRegistry function isLocked(uint256 nft) external view returns (bool) { return _locks[nft]; } /// @inheritdoc IVaultRegistry function protocolGovernance() external view returns (IProtocolGovernance) { return _protocolGovernance; } /// @inheritdoc IVaultRegistry function stagedProtocolGovernance() external view returns (IProtocolGovernance) { return _stagedProtocolGovernance; } /// @inheritdoc IVaultRegistry function stagedProtocolGovernanceTimestamp() external view returns (uint256) { return _stagedProtocolGovernanceTimestamp; } /// @inheritdoc IVaultRegistry function vaultsCount() external view returns (uint256) { return _vaults.length; } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return super.supportsInterface(interfaceId) || type(IVaultRegistry).interfaceId == interfaceId; } // ------------------- EXTERNAL, MUTATING ------------------- /// @inheritdoc IVaultRegistry function registerVault(address vault, address owner) external returns (uint256 nft) { require(address(owner) != address(0), ExceptionsLibrary.ADDRESS_ZERO); require(ERC165(vault).supportsInterface(type(IVault).interfaceId), ExceptionsLibrary.INVALID_INTERFACE); require( _protocolGovernance.hasPermission(msg.sender, PermissionIdsLibrary.REGISTER_VAULT), ExceptionsLibrary.FORBIDDEN ); require(_nftIndex[vault] == 0, ExceptionsLibrary.DUPLICATE); nft = _topNft; _vaultIndex[nft] = vault; _nftIndex[vault] = nft; _vaults.push(vault); _topNft += 1; _safeMint(owner, nft); emit VaultRegistered(tx.origin, msg.sender, nft, vault, owner); } /// @inheritdoc IVaultRegistry function stageProtocolGovernance(IProtocolGovernance newProtocolGovernance) external { require(_isProtocolAdmin(msg.sender), ExceptionsLibrary.FORBIDDEN); require(address(newProtocolGovernance) != address(0), ExceptionsLibrary.ADDRESS_ZERO); _stagedProtocolGovernance = newProtocolGovernance; _stagedProtocolGovernanceTimestamp = (block.timestamp + _protocolGovernance.governanceDelay()); emit StagedProtocolGovernance(tx.origin, msg.sender, newProtocolGovernance, _stagedProtocolGovernanceTimestamp); } /// @inheritdoc IVaultRegistry function commitStagedProtocolGovernance() external { require(_isProtocolAdmin(msg.sender), ExceptionsLibrary.FORBIDDEN); require(_stagedProtocolGovernanceTimestamp != 0, ExceptionsLibrary.INIT); require(block.timestamp >= _stagedProtocolGovernanceTimestamp, ExceptionsLibrary.TIMESTAMP); _protocolGovernance = _stagedProtocolGovernance; delete _stagedProtocolGovernanceTimestamp; delete _stagedProtocolGovernance; emit CommitedProtocolGovernance(tx.origin, msg.sender, _protocolGovernance); } function lockNft(uint256 nft) external { require(ownerOf(nft) == msg.sender, ExceptionsLibrary.FORBIDDEN); _locks[nft] = true; emit TokenLocked(tx.origin, msg.sender, nft); } // ------------------- INTERNAL, VIEW ------------------- function _contractName() internal pure override returns (bytes32) { return bytes32("VaultRegistry"); } function _contractVersion() internal pure override returns (bytes32) { return bytes32("1.0.0"); } function _isProtocolAdmin(address sender) internal view returns (bool) { return _protocolGovernance.isAdmin(sender); } function _beforeTokenTransfer( address, address, uint256 tokenId ) internal view override { require(!_locks[tokenId], ExceptionsLibrary.LOCK); } // -------------------------- EVENTS -------------------------- /// @notice Emitted when token is locked for transfers /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param nft NFT to be locked event TokenLocked(address indexed origin, address indexed sender, uint256 indexed nft); /// @notice Emitted when new Vault is registered in VaultRegistry /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param nft VaultRegistry NFT of the vault /// @param vault Address of the Vault contract /// @param owner Owner of the VaultRegistry NFT event VaultRegistered( address indexed origin, address indexed sender, uint256 indexed nft, address vault, address owner ); /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param newProtocolGovernance Address of the new ProtocolGovernance /// @param start Timestamp of the start of the new ProtocolGovernance event StagedProtocolGovernance( address indexed origin, address indexed sender, IProtocolGovernance newProtocolGovernance, uint256 start ); /// @param origin Origin of the transaction (tx.origin) /// @param sender Sender of the call (msg.sender) /// @param newProtocolGovernance Address of the new ProtocolGovernance that has been committed event CommitedProtocolGovernance( address indexed origin, address indexed sender, IProtocolGovernance newProtocolGovernance ); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./utils/IDefaultAccessControl.sol"; import "./IUnitPricesGovernance.sol"; interface IProtocolGovernance is IDefaultAccessControl, IUnitPricesGovernance { /// @notice CommonLibrary protocol params. /// @param maxTokensPerVault Max different token addresses that could be managed by the vault /// @param governanceDelay The delay (in secs) that must pass before setting new pending params to commiting them /// @param protocolTreasury The address that collects protocolFees, if protocolFee is not zero /// @param forceAllowMask If a permission bit is set in this mask it forces all addresses to have this permission as true /// @param withdrawLimit Withdraw limit (in unit prices, i.e. usd) struct Params { uint256 maxTokensPerVault; uint256 governanceDelay; address protocolTreasury; uint256 forceAllowMask; uint256 withdrawLimit; } // ------------------- EXTERNAL, VIEW ------------------- /// @notice Timestamp after which staged granted permissions for the given address can be committed. /// @param target The given address /// @return Zero if there are no staged permission grants, timestamp otherwise function stagedPermissionGrantsTimestamps(address target) external view returns (uint256); /// @notice Staged granted permission bitmask for the given address. /// @param target The given address /// @return Bitmask function stagedPermissionGrantsMasks(address target) external view returns (uint256); /// @notice Permission bitmask for the given address. /// @param target The given address /// @return Bitmask function permissionMasks(address target) external view returns (uint256); /// @notice Timestamp after which staged pending protocol parameters can be committed /// @return Zero if there are no staged parameters, timestamp otherwise. function stagedParamsTimestamp() external view returns (uint256); /// @notice Staged pending protocol parameters. function stagedParams() external view returns (Params memory); /// @notice Current protocol parameters. function params() external view returns (Params memory); /// @notice Addresses for which non-zero permissions are set. function permissionAddresses() external view returns (address[] memory); /// @notice Permission addresses staged for commit. function stagedPermissionGrantsAddresses() external view returns (address[] memory); /// @notice Return all addresses where rawPermissionMask bit for permissionId is set to 1. /// @param permissionId Id of the permission to check. /// @return A list of dirty addresses. function addressesByPermission(uint8 permissionId) external view returns (address[] memory); /// @notice Checks if address has permission or given permission is force allowed for any address. /// @param addr Address to check /// @param permissionId Permission to check function hasPermission(address addr, uint8 permissionId) external view returns (bool); /// @notice Checks if address has all permissions. /// @param target Address to check /// @param permissionIds A list of permissions to check function hasAllPermissions(address target, uint8[] calldata permissionIds) external view returns (bool); /// @notice Max different ERC20 token addresses that could be managed by the protocol. function maxTokensPerVault() external view returns (uint256); /// @notice The delay for committing any governance params. function governanceDelay() external view returns (uint256); /// @notice The address of the protocol treasury. function protocolTreasury() external view returns (address); /// @notice Permissions mask which defines if ordinary permission should be reverted. /// This bitmask is xored with ordinary mask. function forceAllowMask() external view returns (uint256); /// @notice Withdraw limit per token per block. /// @param token Address of the token /// @return Withdraw limit per token per block function withdrawLimit(address token) external view returns (uint256); /// @notice Addresses that has staged validators. function stagedValidatorsAddresses() external view returns (address[] memory); /// @notice Timestamp after which staged granted permissions for the given address can be committed. /// @param target The given address /// @return Zero if there are no staged permission grants, timestamp otherwise function stagedValidatorsTimestamps(address target) external view returns (uint256); /// @notice Staged validator for the given address. /// @param target The given address /// @return Validator function stagedValidators(address target) external view returns (address); /// @notice Addresses that has validators. function validatorsAddresses() external view returns (address[] memory); /// @notice Address that has validators. /// @param i The number of address /// @return Validator address function validatorsAddress(uint256 i) external view returns (address); /// @notice Validator for the given address. /// @param target The given address /// @return Validator function validators(address target) external view returns (address); // ------------------- EXTERNAL, MUTATING, GOVERNANCE, IMMEDIATE ------------------- /// @notice Rollback all staged validators. function rollbackStagedValidators() external; /// @notice Revoke validator instantly from the given address. /// @param target The given address function revokeValidator(address target) external; /// @notice Stages a new validator for the given address /// @param target The given address /// @param validator The validator for the given address function stageValidator(address target, address validator) external; /// @notice Commits validator for the given address. /// @dev Reverts if governance delay has not passed yet. /// @param target The given address. function commitValidator(address target) external; /// @notice Commites all staged validators for which governance delay passed /// @return Addresses for which validators were committed function commitAllValidatorsSurpassedDelay() external returns (address[] memory); /// @notice Rollback all staged granted permission grant. function rollbackStagedPermissionGrants() external; /// @notice Commits permission grants for the given address. /// @dev Reverts if governance delay has not passed yet. /// @param target The given address. function commitPermissionGrants(address target) external; /// @notice Commites all staged permission grants for which governance delay passed. /// @return An array of addresses for which permission grants were committed. function commitAllPermissionGrantsSurpassedDelay() external returns (address[] memory); /// @notice Revoke permission instantly from the given address. /// @param target The given address. /// @param permissionIds A list of permission ids to revoke. function revokePermissions(address target, uint8[] memory permissionIds) external; /// @notice Commits staged protocol params. /// Reverts if governance delay has not passed yet. function commitParams() external; // ------------------- EXTERNAL, MUTATING, GOVERNANCE, DELAY ------------------- /// @notice Sets new pending params that could have been committed after governance delay expires. /// @param newParams New protocol parameters to set. function stageParams(Params memory newParams) external; /// @notice Stage granted permissions that could have been committed after governance delay expires. /// Resets commit delay and permissions if there are already staged permissions for this address. /// @param target Target address /// @param permissionIds A list of permission ids to grant function stagePermissionGrants(address target, uint8[] memory permissionIds) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "./utils/IDefaultAccessControl.sol"; interface IUnitPricesGovernance is IDefaultAccessControl, IERC165 { // ------------------- EXTERNAL, VIEW ------------------- /// @notice Estimated amount of token worth 1 USD staged for commit. /// @param token Address of the token /// @return The amount of token function stagedUnitPrices(address token) external view returns (uint256); /// @notice Timestamp after which staged unit prices for the given token can be committed. /// @param token Address of the token /// @return Timestamp function stagedUnitPricesTimestamps(address token) external view returns (uint256); /// @notice Estimated amount of token worth 1 USD. /// @param token Address of the token /// @return The amount of token function unitPrices(address token) external view returns (uint256); // ------------------- EXTERNAL, MUTATING ------------------- /// @notice Stage estimated amount of token worth 1 USD staged for commit. /// @param token Address of the token /// @param value The amount of token function stageUnitPrice(address token, uint256 value) external; /// @notice Reset staged value /// @param token Address of the token function rollbackUnitPrice(address token) external; /// @notice Commit staged unit price /// @param token Address of the token function commitUnitPrice(address token) external; }
// SPDX-License-Identifier: MIT pragma solidity =0.8.9; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./IProtocolGovernance.sol"; interface IVaultRegistry is IERC721 { /// @notice Get Vault for the giver NFT ID. /// @param nftId NFT ID /// @return vault Address of the Vault contract function vaultForNft(uint256 nftId) external view returns (address vault); /// @notice Get NFT ID for given Vault contract address. /// @param vault Address of the Vault contract /// @return nftId NFT ID function nftForVault(address vault) external view returns (uint256 nftId); /// @notice Checks if the nft is locked for all transfers /// @param nft NFT to check for lock /// @return `true` if locked, false otherwise function isLocked(uint256 nft) external view returns (bool); /// @notice Register new Vault and mint NFT. /// @param vault address of the vault /// @param owner owner of the NFT /// @return nft Nft minted for the given Vault function registerVault(address vault, address owner) external returns (uint256 nft); /// @notice Number of Vaults registered. function vaultsCount() external view returns (uint256); /// @notice All Vaults registered. function vaults() external view returns (address[] memory); /// @notice Address of the ProtocolGovernance. function protocolGovernance() external view returns (IProtocolGovernance); /// @notice Address of the staged ProtocolGovernance. function stagedProtocolGovernance() external view returns (IProtocolGovernance); /// @notice Minimal timestamp when staged ProtocolGovernance can be applied. function stagedProtocolGovernanceTimestamp() external view returns (uint256); /// @notice Stage new ProtocolGovernance. /// @param newProtocolGovernance new ProtocolGovernance function stageProtocolGovernance(IProtocolGovernance newProtocolGovernance) external; /// @notice Commit new ProtocolGovernance. function commitStagedProtocolGovernance() external; /// @notice Lock NFT for transfers /// @dev Use this method when vault structure is set up and should become immutable. Can be called by owner. /// @param nft - NFT to lock function lockNft(uint256 nft) external; }
// SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.9; interface IContractMeta { function contractName() external view returns (string memory); function contractNameBytes() external view returns (bytes32); function contractVersion() external view returns (string memory); function contractVersionBytes() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/access/IAccessControlEnumerable.sol"; interface IDefaultAccessControl is IAccessControlEnumerable { /// @notice Checks that the address is contract admin. /// @param who Address to check /// @return `true` if who is admin, `false` otherwise function isAdmin(address who) external view returns (bool); /// @notice Checks that the address is contract admin. /// @param who Address to check /// @return `true` if who is operator, `false` otherwise function isOperator(address who) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "./IVaultGovernance.sol"; interface IVault is IERC165 { /// @notice Checks if the vault is initialized function initialized() external view returns (bool); /// @notice VaultRegistry NFT for this vault function nft() external view returns (uint256); /// @notice Address of the Vault Governance for this contract. function vaultGovernance() external view returns (IVaultGovernance); /// @notice ERC20 tokens under Vault management. function vaultTokens() external view returns (address[] memory); /// @notice Checks if a token is vault token /// @param token Address of the token to check /// @return `true` if this token is managed by Vault function isVaultToken(address token) external view returns (bool); /// @notice Total value locked for this contract. /// @dev Generally it is the underlying token value of this contract in some /// other DeFi protocol. For example, for USDC Yearn Vault this would be total USDC balance that could be withdrawn for Yearn to this contract. /// The tvl itself is estimated in some range. Sometimes the range is exact, sometimes it's not /// @return minTokenAmounts Lower bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens) /// @return maxTokenAmounts Upper bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens) function tvl() external view returns (uint256[] memory minTokenAmounts, uint256[] memory maxTokenAmounts); /// @notice Existential amounts for each token function pullExistentials() external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../IProtocolGovernance.sol"; import "../IVaultRegistry.sol"; import "./IVault.sol"; interface IVaultGovernance { /// @notice Internal references of the contract. /// @param protocolGovernance Reference to Protocol Governance /// @param registry Reference to Vault Registry struct InternalParams { IProtocolGovernance protocolGovernance; IVaultRegistry registry; IVault singleton; } // ------------------- EXTERNAL, VIEW ------------------- /// @notice Timestamp in unix time seconds after which staged Delayed Strategy Params could be committed. /// @param nft Nft of the vault function delayedStrategyParamsTimestamp(uint256 nft) external view returns (uint256); /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params could be committed. function delayedProtocolParamsTimestamp() external view returns (uint256); /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params Per Vault could be committed. /// @param nft Nft of the vault function delayedProtocolPerVaultParamsTimestamp(uint256 nft) external view returns (uint256); /// @notice Timestamp in unix time seconds after which staged Internal Params could be committed. function internalParamsTimestamp() external view returns (uint256); /// @notice Internal Params of the contract. function internalParams() external view returns (InternalParams memory); /// @notice Staged new Internal Params. /// @dev The Internal Params could be committed after internalParamsTimestamp function stagedInternalParams() external view returns (InternalParams memory); // ------------------- EXTERNAL, MUTATING ------------------- /// @notice Stage new Internal Params. /// @param newParams New Internal Params function stageInternalParams(InternalParams memory newParams) external; /// @notice Commit staged Internal Params. function commitInternalParams() external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /// @notice Exceptions stores project`s smart-contracts exceptions library ExceptionsLibrary { string constant ADDRESS_ZERO = "AZ"; string constant VALUE_ZERO = "VZ"; string constant EMPTY_LIST = "EMPL"; string constant NOT_FOUND = "NF"; string constant INIT = "INIT"; string constant DUPLICATE = "DUP"; string constant NULL = "NULL"; string constant TIMESTAMP = "TS"; string constant FORBIDDEN = "FRB"; string constant ALLOWLIST = "ALL"; string constant LIMIT_OVERFLOW = "LIMO"; string constant LIMIT_UNDERFLOW = "LIMU"; string constant INVALID_VALUE = "INV"; string constant INVARIANT = "INVA"; string constant INVALID_TARGET = "INVTR"; string constant INVALID_TOKEN = "INVTO"; string constant INVALID_INTERFACE = "INVI"; string constant INVALID_SELECTOR = "INVS"; string constant INVALID_STATE = "INVST"; string constant INVALID_LENGTH = "INVL"; string constant LOCK = "LCKD"; string constant DISABLED = "DIS"; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.9; /// @notice Stores permission ids for addresses library PermissionIdsLibrary { // The msg.sender is allowed to register vault uint8 constant REGISTER_VAULT = 0; // The msg.sender is allowed to create vaults uint8 constant CREATE_VAULT = 1; // The token is allowed to be transfered by vault uint8 constant ERC20_TRANSFER = 2; // The token is allowed to be added to vault uint8 constant ERC20_VAULT_TOKEN = 3; // Trusted protocols that are allowed to be approved of vault ERC20 tokens by any strategy uint8 constant ERC20_APPROVE = 4; // Trusted protocols that are allowed to be approved of vault ERC20 tokens by trusted strategy uint8 constant ERC20_APPROVE_RESTRICTED = 5; // Strategy allowed using restricted API uint8 constant TRUSTED_STRATEGY = 6; }
// SPDX-License-Identifier: BSL-1.1 pragma solidity 0.8.9; import "../interfaces/utils/IContractMeta.sol"; abstract contract ContractMeta is IContractMeta { // ------------------- EXTERNAL, VIEW ------------------- function contractName() external pure returns (string memory) { return _bytes32ToString(_contractName()); } function contractNameBytes() external pure returns (bytes32) { return _contractName(); } function contractVersion() external pure returns (string memory) { return _bytes32ToString(_contractVersion()); } function contractVersionBytes() external pure returns (bytes32) { return _contractVersion(); } // ------------------- INTERNAL, VIEW ------------------- function _contractName() internal pure virtual returns (bytes32); function _contractVersion() internal pure virtual returns (bytes32); function _bytes32ToString(bytes32 b) internal pure returns (string memory s) { s = new string(32); uint256 len = 32; for (uint256 i = 0; i < 32; ++i) { if (uint8(b[i]) == 0) { len = i; break; } } assembly { mstore(s, len) mstore(add(s, 0x20), b) } } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"contract IProtocolGovernance","name":"protocolGovernance_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"contract IProtocolGovernance","name":"newProtocolGovernance","type":"address"}],"name":"CommitedProtocolGovernance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"contract IProtocolGovernance","name":"newProtocolGovernance","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"}],"name":"StagedProtocolGovernance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"}],"name":"TokenLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"VaultRegistered","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"commitStagedProtocolGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractNameBytes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractVersionBytes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"lockNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"}],"name":"nftForVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolGovernance","outputs":[{"internalType":"contract IProtocolGovernance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"registerVault","outputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IProtocolGovernance","name":"newProtocolGovernance","type":"address"}],"name":"stageProtocolGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stagedProtocolGovernance","outputs":[{"internalType":"contract IProtocolGovernance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stagedProtocolGovernanceTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"vaultForNft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaults","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526001600d553480156200001657600080fd5b50604051620021d3380380620021d3833981016040819052620000399162000208565b8251839083906200005290600090602085019062000095565b5080516200006890600190602084019062000095565b5050600780546001600160a01b0319166001600160a01b03939093169290921790915550620002d2915050565b828054620000a39062000295565b90600052602060002090601f016020900481019282620000c7576000855562000112565b82601f10620000e257805160ff191683800117855562000112565b8280016001018555821562000112579182015b8281111562000112578251825591602001919060010190620000f5565b506200012092915062000124565b5090565b5b8082111562000120576000815560010162000125565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016357600080fd5b81516001600160401b03808211156200018057620001806200013b565b604051601f8301601f19908116603f01168101908282118183101715620001ab57620001ab6200013b565b81604052838152602092508683858801011115620001c857600080fd5b600091505b83821015620001ec5785820183015181830184015290820190620001cd565b83821115620001fe5760008385830101525b9695505050505050565b6000806000606084860312156200021e57600080fd5b83516001600160401b03808211156200023657600080fd5b620002448783880162000151565b945060208601519150808211156200025b57600080fd5b506200026a8682870162000151565b604086015190935090506001600160a01b03811681146200028a57600080fd5b809150509250925092565b600181811c90821680620002aa57607f821691505b60208210811415620002cc57634e487b7160e01b600052602260045260246000fd5b50919050565b611ef180620002e26000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806370a08231116101045780639c94d853116100a2578063c87b56dd11610071578063c87b56dd146103be578063e985e9c5146103d1578063f6aacfb11461040d578063fcdabd271461043057600080fd5b80639c94d85314610367578063a0a8e46014610390578063a22cb46514610398578063b88d4fde146103ab57600080fd5b806382e9f71f116100de57806382e9f71f1461033e578063889777381461034f57806395cdb9a51461035757806395d89b411461035f57600080fd5b806370a082311461030e57806375d0c0dc146103215780638220ef5b1461032957600080fd5b80630e3e80ac1161017157806342842e0e1161014b57806342842e0e146102c45780634dcbc739146102d75780635227ce4c146102ea5780636352211e146102fb57600080fd5b80630e3e80ac1461028857806323b872dd1461029e5780633be0539c146102b157600080fd5b806306a46239116101ad57806306a462391461022757806306fdde0314610235578063081812fc1461024a578063095ea7b31461027557600080fd5b806301ffc9a7146101d45780630407ca13146101fc57806305c4fdf914610206575b600080fd5b6101e76101e2366004611972565b610459565b60405190151581526020015b60405180910390f35b610204610485565b005b6102196102143660046119a4565b6105b6565b6040519081526020016101f3565b640312e302e360dc1b610219565b61023d6108bb565b6040516101f39190611a35565b61025d610258366004611a48565b61094d565b6040516001600160a01b0390911681526020016101f3565b610204610283366004611a61565b6109e2565b6c5661756c74526567697374727960981b610219565b6102046102ac366004611a8d565b610af8565b6102046102bf366004611ace565b610b29565b6102046102d2366004611a8d565b610c9c565b6102046102e5366004611a48565b610cb7565b6007546001600160a01b031661025d565b61025d610309366004611a48565b610d4d565b61021961031c366004611ace565b610dc4565b61023d610e4b565b610331610e66565b6040516101f39190611aeb565b6008546001600160a01b031661025d565b600954610219565b600654610219565b61023d610ec7565b61025d610375366004611a48565b6000908152600b60205260409020546001600160a01b031690565b61023d610ed6565b6102046103a6366004611b46565b610ee9565b6102046103b9366004611b8a565b610ef8565b61023d6103cc366004611a48565b610f30565b6101e76103df3660046119a4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6101e761041b366004611a48565b6000908152600c602052604090205460ff1690565b61021961043e366004611ace565b6001600160a01b03166000908152600a602052604090205490565b600061046482611018565b8061047f575063aeb8111f60e01b6001600160e01b03198316145b92915050565b61048e33611068565b6040518060400160405280600381526020016223292160e91b815250906104d15760405162461bcd60e51b81526004016104c89190611a35565b60405180910390fd5b506006546040805180820190915260048152631253925560e21b60208201529061050e5760405162461bcd60e51b81526004016104c89190611a35565b5060065442101560405180604001604052806002815260200161545360f01b8152509061054e5760405162461bcd60e51b81526004016104c89190611a35565b5060088054600780546001600160a01b0383166001600160a01b031991821681179092556000600655909116909155604051908152339032907f4028a967f323e2e5c0f132491efcd9aab74518c58755d2902f68e15bddf7f0b99060200160405180910390a3565b60408051808201909152600281526120ad60f11b60208201526000906001600160a01b0383166105f95760405162461bcd60e51b81526004016104c89190611a35565b506040516301ffc9a760e01b815263305a640b60e21b60048201526001600160a01b038416906301ffc9a79060240160206040518083038186803b15801561064057600080fd5b505afa158015610654573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106789190611c6a565b60405180604001604052806004815260200163494e564960e01b815250906106b35760405162461bcd60e51b81526004016104c89190611a35565b506007546040516363e85d2d60e01b8152336004820152600060248201526001600160a01b03909116906363e85d2d9060440160206040518083038186803b1580156106fe57600080fd5b505afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107369190611c6a565b6040518060400160405280600381526020016223292160e91b815250906107705760405162461bcd60e51b81526004016104c89190611a35565b506001600160a01b0383166000908152600a6020908152604091829020548251808401909352600383526204455560ec1b91830191909152156107c65760405162461bcd60e51b81526004016104c89190611a35565b5050600d80546000818152600b6020908152604080832080546001600160a01b0389166001600160a01b03199182168117909255818552600a90935290832084905560098054600181810183559185527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018054909316909117909155835492939092909190610857908490611c9d565b90915550610867905082826110e6565b604080516001600160a01b038581168252841660208201528291339132917f2e7d565a40aae7fc212bb3ec8f236059403cc2a1687d17b98dfef745b5ff4eda910160405180910390a492915050565b905090565b6060600080546108ca90611cb5565b80601f01602080910402602001604051908101604052809291908181526020018280546108f690611cb5565b80156109435780601f1061091857610100808354040283529160200191610943565b820191906000526020600020905b81548152906001019060200180831161092657829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166109c65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016104c8565b506000908152600460205260409020546001600160a01b031690565b60006109ed82610d4d565b9050806001600160a01b0316836001600160a01b03161415610a5b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016104c8565b336001600160a01b0382161480610a775750610a7781336103df565b610ae95760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016104c8565b610af38383611100565b505050565b610b02338261116e565b610b1e5760405162461bcd60e51b81526004016104c890611cf0565b610af3838383611265565b610b3233611068565b6040518060400160405280600381526020016223292160e91b81525090610b6c5760405162461bcd60e51b81526004016104c89190611a35565b5060408051808201909152600281526120ad60f11b60208201526001600160a01b038216610bad5760405162461bcd60e51b81526004016104c89190611a35565b50600880546001600160a01b0319166001600160a01b03838116919091179091556007546040805163bba3293960e01b81529051919092169163bba32939916004808301926020929190829003018186803b158015610c0b57600080fd5b505afa158015610c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c439190611d41565b610c4d9042611c9d565b6006819055604080516001600160a01b03841681526020810192909252339132917f3a13629a2c6c5c36580157266cf38218a43645aaa8e24dde67543ed62063879b910160405180910390a350565b610af383838360405180602001604052806000815250610ef8565b33610cc182610d4d565b6001600160a01b0316146040518060400160405280600381526020016223292160e91b81525090610d055760405162461bcd60e51b81526004016104c89190611a35565b506000818152600c6020526040808220805460ff19166001179055518291339132917f991b8e8a2e2b8ff515f7045174eeb52eb4868e69c5bb4259da6146a93c77574d91a450565b6000818152600260205260408120546001600160a01b03168061047f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016104c8565b60006001600160a01b038216610e2f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016104c8565b506001600160a01b031660009081526003602052604090205490565b60606108b66c5661756c74526567697374727960981b611410565b6060600980548060200260200160405190810160405280929190818152602001828054801561094357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ea0575050505050905090565b6060600180546108ca90611cb5565b60606108b6640312e302e360dc1b611410565b610ef433838361147c565b5050565b610f02338361116e565b610f1e5760405162461bcd60e51b81526004016104c890611cf0565b610f2a8484848461154b565b50505050565b6000818152600260205260409020546060906001600160a01b0316610faf5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016104c8565b6000610fc660408051602081019091526000815290565b90506000815111610fe65760405180602001604052806000815250611011565b80610ff08461157e565b604051602001611001929190611d5a565b6040516020818303038152906040525b9392505050565b60006001600160e01b031982166380ac58cd60e01b148061104957506001600160e01b03198216635b5e139f60e01b145b8061047f57506301ffc9a760e01b6001600160e01b031983161461047f565b600754604051630935e01b60e21b81526001600160a01b03838116600483015260009216906324d7806c9060240160206040518083038186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047f9190611c6a565b610ef482826040518060200160405280600081525061167c565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061113582610d4d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166111e75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016104c8565b60006111f283610d4d565b9050806001600160a01b0316846001600160a01b0316148061122d5750836001600160a01b03166112228461094d565b6001600160a01b0316145b8061125d57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661127882610d4d565b6001600160a01b0316146112e05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016104c8565b6001600160a01b0382166113425760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104c8565b61134d8383836116af565b611358600082611100565b6001600160a01b0383166000908152600360205260408120805460019290611381908490611d89565b90915550506001600160a01b03821660009081526003602052604081208054600192906113af908490611c9d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b604080516020808252818301909252606091602082018180368337019050509050602060005b602081101561146e5783816020811061145157611451611da0565b1a61145e5780915061146e565b61146781611db6565b9050611436565b508152602081019190915290565b816001600160a01b0316836001600160a01b031614156114de5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016104c8565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611556848484611265565b611562848484846116fe565b610f2a5760405162461bcd60e51b81526004016104c890611dd1565b6060816115a25750506040805180820190915260018152600360fc1b602082015290565b8160005b81156115cc57806115b681611db6565b91506115c59050600a83611e39565b91506115a6565b60008167ffffffffffffffff8111156115e7576115e7611b74565b6040519080825280601f01601f191660200182016040528015611611576020820181803683370190505b5090505b841561125d57611626600183611d89565b9150611633600a86611e4d565b61163e906030611c9d565b60f81b81838151811061165357611653611da0565b60200101906001600160f81b031916908160001a905350611675600a86611e39565b9450611615565b611686838361180b565b61169360008484846116fe565b610af35760405162461bcd60e51b81526004016104c890611dd1565b6000818152600c602090815260409182902054825180840190935260048352631310d2d160e21b9183019190915260ff1615610f2a5760405162461bcd60e51b81526004016104c89190611a35565b60006001600160a01b0384163b1561180057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611742903390899088908890600401611e61565b602060405180830381600087803b15801561175c57600080fd5b505af192505050801561178c575060408051601f3d908101601f1916820190925261178991810190611e9e565b60015b6117e6573d8080156117ba576040519150601f19603f3d011682016040523d82523d6000602084013e6117bf565b606091505b5080516117de5760405162461bcd60e51b81526004016104c890611dd1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061125d565b506001949350505050565b6001600160a01b0382166118615760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104c8565b6000818152600260205260409020546001600160a01b0316156118c65760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016104c8565b6118d2600083836116af565b6001600160a01b03821660009081526003602052604081208054600192906118fb908490611c9d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461196f57600080fd5b50565b60006020828403121561198457600080fd5b813561101181611959565b6001600160a01b038116811461196f57600080fd5b600080604083850312156119b757600080fd5b82356119c28161198f565b915060208301356119d28161198f565b809150509250929050565b60005b838110156119f85781810151838201526020016119e0565b83811115610f2a5750506000910152565b60008151808452611a218160208601602086016119dd565b601f01601f19169290920160200192915050565b6020815260006110116020830184611a09565b600060208284031215611a5a57600080fd5b5035919050565b60008060408385031215611a7457600080fd5b8235611a7f8161198f565b946020939093013593505050565b600080600060608486031215611aa257600080fd5b8335611aad8161198f565b92506020840135611abd8161198f565b929592945050506040919091013590565b600060208284031215611ae057600080fd5b81356110118161198f565b6020808252825182820181905260009190848201906040850190845b81811015611b2c5783516001600160a01b031683529284019291840191600101611b07565b50909695505050505050565b801515811461196f57600080fd5b60008060408385031215611b5957600080fd5b8235611b648161198f565b915060208301356119d281611b38565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611ba057600080fd5b8435611bab8161198f565b93506020850135611bbb8161198f565b925060408501359150606085013567ffffffffffffffff80821115611bdf57600080fd5b818701915087601f830112611bf357600080fd5b813581811115611c0557611c05611b74565b604051601f8201601f19908116603f01168101908382118183101715611c2d57611c2d611b74565b816040528281528a6020848701011115611c4657600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600060208284031215611c7c57600080fd5b815161101181611b38565b634e487b7160e01b600052601160045260246000fd5b60008219821115611cb057611cb0611c87565b500190565b600181811c90821680611cc957607f821691505b60208210811415611cea57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600060208284031215611d5357600080fd5b5051919050565b60008351611d6c8184602088016119dd565b835190830190611d808183602088016119dd565b01949350505050565b600082821015611d9b57611d9b611c87565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611dca57611dca611c87565b5060010190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b600082611e4857611e48611e23565b500490565b600082611e5c57611e5c611e23565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611e9490830184611a09565b9695505050505050565b600060208284031215611eb057600080fd5b81516110118161195956fea26469706673582212205f6182fb8c451ea4ddf5c4858f1262aa812aa6bf983d1144b8d4b5bdc9d4f7d564736f6c63430008090033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ac28df66863ec17417a4a51662fbd87c95f03df800000000000000000000000000000000000000000000000000000000000000154d656c6c6f77205661756c74205265676973747279000000000000000000000000000000000000000000000000000000000000000000000000000000000000034d56520000000000000000000000000000000000000000000000000000000000
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.