Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 80 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Collateral | 18753861 | 406 days ago | IN | 0 ETH | 0.00136172 | ||||
Cancel Multiple ... | 18559947 | 433 days ago | IN | 0 ETH | 0.00107444 | ||||
Cancel Multiple ... | 18559929 | 433 days ago | IN | 0 ETH | 0.00095843 | ||||
Fulfill Order | 18551440 | 434 days ago | IN | 0.38 ETH | 0.01361201 | ||||
Cancel Multiple ... | 18551276 | 434 days ago | IN | 0 ETH | 0.001558 | ||||
Cancel Multiple ... | 18551269 | 434 days ago | IN | 0 ETH | 0.00154477 | ||||
Claim Collateral | 18532322 | 437 days ago | IN | 0 ETH | 0.00149655 | ||||
Close Position | 18488447 | 443 days ago | IN | 0 ETH | 0.00275193 | ||||
Fulfill Order | 18449469 | 448 days ago | IN | 0.65 ETH | 0.00731604 | ||||
Cancel Multiple ... | 18281921 | 472 days ago | IN | 0 ETH | 0.00018333 | ||||
Cancel Multiple ... | 18281919 | 472 days ago | IN | 0 ETH | 0.00016319 | ||||
Cancel Multiple ... | 18281730 | 472 days ago | IN | 0 ETH | 0.000401 | ||||
Claim Collateral | 18221416 | 480 days ago | IN | 0 ETH | 0.00119772 | ||||
Close Position | 18071208 | 501 days ago | IN | 0 ETH | 0.00358952 | ||||
Fulfill Order | 17973397 | 515 days ago | IN | 0.38 ETH | 0.00947703 | ||||
Close Position | 17949557 | 518 days ago | IN | 0 ETH | 0.00202977 | ||||
Cancel Multiple ... | 17923264 | 522 days ago | IN | 0 ETH | 0.00120919 | ||||
Cancel Multiple ... | 17923262 | 522 days ago | IN | 0 ETH | 0.0012341 | ||||
Cancel Multiple ... | 17923258 | 522 days ago | IN | 0 ETH | 0.00126496 | ||||
Cancel Multiple ... | 17923255 | 522 days ago | IN | 0 ETH | 0.00133371 | ||||
Cancel Multiple ... | 17923252 | 522 days ago | IN | 0 ETH | 0.00130097 | ||||
Cancel Multiple ... | 17923250 | 522 days ago | IN | 0 ETH | 0.00129489 | ||||
Claim Collateral | 17896391 | 526 days ago | IN | 0 ETH | 0.00072229 | ||||
Close Position | 17886618 | 527 days ago | IN | 0 ETH | 0.00357893 | ||||
Fulfill Order | 17873337 | 529 days ago | IN | 11.26 ETH | 0.01321757 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
18753861 | 406 days ago | 0.35 ETH | ||||
18551440 | 434 days ago | 0.027 ETH | ||||
18551440 | 434 days ago | 0.003 ETH | ||||
18532322 | 437 days ago | 0.66 ETH | ||||
18488447 | 443 days ago | 0.58 ETH | ||||
18449469 | 448 days ago | 0.063 ETH | ||||
18449469 | 448 days ago | 0.007 ETH | ||||
18221416 | 480 days ago | 0.66 ETH | ||||
18071208 | 501 days ago | 0.35 ETH | ||||
17973397 | 515 days ago | 0.027 ETH | ||||
17973397 | 515 days ago | 0.003 ETH | ||||
17949557 | 518 days ago | 0.65 ETH | ||||
17896391 | 526 days ago | 0.73 ETH | ||||
17886618 | 527 days ago | 11 ETH | ||||
17873337 | 529 days ago | 0.234 ETH | ||||
17873337 | 529 days ago | 0.026 ETH | ||||
17852598 | 532 days ago | 0.027 ETH | ||||
17852598 | 532 days ago | 0.003 ETH | ||||
17843822 | 533 days ago | 0.009 ETH | ||||
17843822 | 533 days ago | 0.001 ETH | ||||
17843818 | 533 days ago | 0.009 ETH | ||||
17843818 | 533 days ago | 0.001 ETH | ||||
17831245 | 535 days ago | 0.0065394 ETH | ||||
17831245 | 535 days ago | 0.0007266 ETH | ||||
17682192 | 556 days ago | 1.2 ETH |
Loading...
Loading
Contract Name:
Dyve
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; // OZ libraries import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; // Dyve contacts/interfaces/libraries import {IWhitelistedCurrencies} from "./interfaces/IWhitelistedCurrencies.sol"; import {IProtocolFeeManager} from "./interfaces/IProtocolFeeManager.sol"; import {IReservoirOracle} from "./interfaces/IReservoirOracle.sol"; import {OrderTypes, OrderType} from "./libraries/OrderTypes.sol"; /** * @notice The Dyve Contract to handle lending and borrowing of NFTs */ contract Dyve is ReentrancyGuard, Ownable, EIP712("Dyve", "1") { using SafeERC20 for IERC20; using OrderTypes for OrderTypes.Order; IWhitelistedCurrencies public whitelistedCurrencies; IProtocolFeeManager public protocolFeeManager; IReservoirOracle public reservoirOracle; address public protocolFeeRecipient; bytes4 public constant INTERFACE_ID_ERC721 = type(IERC721).interfaceId; bytes4 public constant INTERFACE_ID_ERC1155 = type(IERC1155).interfaceId; uint256 public constant nonceLimit = 500000; uint256 public constant bps = 10000; mapping(address => uint256) public userMinOrderNonce; mapping(address => mapping(uint256 => bool)) private _isUserOrderNonceExecutedOrCancelled; mapping(bytes32 => Order) public orders; // The NFT's listing status enum OrderStatus { EMPTY, BORROWED, EXPIRED, CLOSED } struct Order { bytes32 orderHash; OrderType orderType; address payable lender; address payable borrower; address collection; uint256 tokenId; uint256 amount; // only applicable for ERC1155, set to 1 for ERC721 uint256 expiryDateTime; uint256 collateral; address currency; OrderStatus status; } error InvalidAddress(); error InvalidMinNonce(); error EmptyNonceArray(); error InvalidNonce(uint256 nonce); error InvalidMsgValue(); error InvalidSigner(); error ExpiredListing(); error ExpiredNonce(); error InvalidFee(); error InvalidCollateral(); error InvalidDuration(); error InvalidAmount(); error InvalidCurrency(); error InvalidSignature(); error TokenFlagged(); error InvalidSender(address sender); error InvalidOrderExpiration(); error InvalidOrderStatus(); error NotTokenOwner(address collection, uint256 tokenId); error InvalidMessage(); event CancelAllOrders(address indexed user, uint256 newMinNonce); event CancelMultipleOrders(address indexed user, uint256[] orderNonces); event ProtocolFeeManagerUpdated(address indexed protocolFeeManagerAddress); event WhitelistedCurrenciesUpdated(address indexed whitelistedCurrenciesAddress); event ReservoirOracleUpdated(address indexed reservoirOracle); event ProtocolFeeRecipientUpdated(address indexed _protocolFeeRecipient); event ReserovirOracleAddressUpadted(address indexed _reservoirOracleAddress); event OrderFulfilled( bytes32 orderHash, // ask hash of the maker order OrderType orderType, uint256 orderNonce, address indexed taker, address indexed maker, address collection, uint256 tokenId, uint256 amount, uint256 collateral, uint256 fee, address currency, uint256 duration, uint256 expiryDateTime, OrderStatus status ); event Close( bytes32 orderHash, OrderType orderType, address indexed borrower, address indexed lender, address collection, uint256 tokenId, uint256 amount, uint256 returnedTokenId, uint256 collateral, address currency, OrderStatus status ); event Claim( bytes32 orderHash, OrderType orderType, address indexed borrower, address indexed lender, address collection, uint256 tokenId, uint256 amount, uint256 collateral, address currency, OrderStatus status ); /** * @notice Constructor * @param whitelistedCurrenciesAddress address of the WhitelistedCurrencies contract * @param protocolFeeManagerAddress address of the ProtocolFeeManager contract * @param reservoirOracleAddress address of the Reservoir Oracle * @param _protocolFeeRecipient protocol fee recipient address */ constructor( address whitelistedCurrenciesAddress, address protocolFeeManagerAddress, address reservoirOracleAddress, address _protocolFeeRecipient ) { if ( whitelistedCurrenciesAddress == address(0) || protocolFeeManagerAddress == address(0) || reservoirOracleAddress == address(0) || _protocolFeeRecipient == address(0) ) revert InvalidAddress(); whitelistedCurrencies = IWhitelistedCurrencies(whitelistedCurrenciesAddress); protocolFeeManager = IProtocolFeeManager(protocolFeeManagerAddress); reservoirOracle = IReservoirOracle(reservoirOracleAddress); protocolFeeRecipient = _protocolFeeRecipient; emit WhitelistedCurrenciesUpdated(whitelistedCurrenciesAddress); emit ProtocolFeeManagerUpdated(protocolFeeManagerAddress); emit ProtocolFeeRecipientUpdated(_protocolFeeRecipient); } /** * @notice Cancel all pending orders for a sender * @param minNonce minimum user nonce */ function cancelAllOrdersForSender(uint256 minNonce) external { if (minNonce <= userMinOrderNonce[msg.sender]) revert InvalidMinNonce(); if (minNonce >= userMinOrderNonce[msg.sender] + nonceLimit) revert InvalidMinNonce(); userMinOrderNonce[msg.sender] = minNonce; emit CancelAllOrders(msg.sender, minNonce); } /** * @notice Cancel maker orders * @param orderNonces array of order nonces */ function cancelMultipleMakerOrders(uint256[] calldata orderNonces) external { if (orderNonces.length == 0) revert EmptyNonceArray(); for (uint256 i = 0; i < orderNonces.length; i++) { if (orderNonces[i] < userMinOrderNonce[msg.sender]) revert InvalidNonce(orderNonces[i]); _isUserOrderNonceExecutedOrCancelled[msg.sender][orderNonces[i]] = true; } emit CancelMultipleOrders(msg.sender, orderNonces); } /** * @notice Fullfills the order * @param order the order to be fulfilled * @param message the message from the oracle */ function fulfillOrder(OrderTypes.Order calldata order, IReservoirOracle.Message calldata message) external payable nonReentrant { if( (order.orderType == OrderType.ETH_TO_ERC721 || order.orderType == OrderType.ETH_TO_ERC1155) && msg.value != (order.fee + order.collateral) ) revert InvalidMsgValue(); if( (order.orderType != OrderType.ETH_TO_ERC721 && order.orderType != OrderType.ETH_TO_ERC1155) && msg.value != 0 ) revert InvalidMsgValue(); _validateTokenFlaggingMessage(message, order.collection, order.tokenId); // Check the maker ask order bytes32 orderHash = order.hash(); _validateOrder(order, _hashTypedDataV4(orderHash)); // Update maker ask order status to true (prevents replay) _isUserOrderNonceExecutedOrCancelled[order.signer][order.nonce] = true; // Goes through the follwing procedure: // 1. Creates an order // 2. transfers the NFT to the borrower // 3. transfers the funds from the borrower to the respecitve recipients if (order.orderType == OrderType.ETH_TO_ERC721) { _createOrder(order, orderHash, order.signer, msg.sender); IERC721(order.collection).safeTransferFrom(order.signer, msg.sender, order.tokenId); _transferETH(order.signer, order.fee, order.premiumCollection, order.premiumTokenId); } else if (order.orderType == OrderType.ETH_TO_ERC1155) { _createOrder(order, orderHash, order.signer, msg.sender); IERC1155(order.collection).safeTransferFrom(order.signer, msg.sender, order.tokenId, order.amount, ""); _transferETH(order.signer, order.fee, order.premiumCollection, order.premiumTokenId); } else if (order.orderType == OrderType.ERC20_TO_ERC721) { _createOrder(order, orderHash, order.signer, msg.sender); IERC721(order.collection).safeTransferFrom(order.signer, msg.sender, order.tokenId); _transferERC20(msg.sender, order.signer, order.fee, order.collateral, order.currency, order.premiumCollection, order.premiumTokenId); } else if (order.orderType == OrderType.ERC20_TO_ERC1155) { _createOrder(order, orderHash, order.signer, msg.sender); IERC1155(order.collection).safeTransferFrom(order.signer, msg.sender, order.tokenId, order.amount, ""); _transferERC20(msg.sender, order.signer, order.fee, order.collateral, order.currency, order.premiumCollection, order.premiumTokenId); } else if (order.orderType == OrderType.ERC721_TO_ERC20) { _createOrder(order, orderHash, msg.sender, order.signer); IERC721(order.collection).safeTransferFrom(msg.sender, order.signer, order.tokenId); _transferERC20(order.signer, msg.sender, order.fee, order.collateral, order.currency, order.premiumCollection, order.premiumTokenId); } else if (order.orderType == OrderType.ERC1155_TO_ERC20) { _createOrder(order, orderHash, msg.sender, order.signer); IERC1155(order.collection).safeTransferFrom(msg.sender, order.signer, order.tokenId, order.amount, ""); _transferERC20(order.signer, msg.sender, order.fee, order.collateral, order.currency, order.premiumCollection, order.premiumTokenId); } emit OrderFulfilled( orderHash, order.orderType, order.nonce, msg.sender, order.signer, order.collection, order.tokenId, order.amount, order.collateral, order.fee, order.currency, order.duration, orders[orderHash].expiryDateTime, OrderStatus.BORROWED ); } /** * @notice Return back an NFT to the lender and release collateral to the borrower * @dev we check that the borrower owns the incoming ID from the collection. * @param orderHash order hash of the maker order * @param returnTokenId the NFT to be returned * @param message the message from the oracle */ function closePosition(bytes32 orderHash, uint256 returnTokenId, IReservoirOracle.Message calldata message) external nonReentrant { Order memory order = orders[orderHash]; if (order.borrower != msg.sender) revert InvalidSender(msg.sender); if (order.expiryDateTime <= block.timestamp) revert InvalidOrderExpiration(); if (order.status != OrderStatus.BORROWED) revert InvalidOrderStatus(); if (IERC165(order.collection).supportsInterface(INTERFACE_ID_ERC721)) { if (IERC721(order.collection).ownerOf(returnTokenId) != msg.sender) revert NotTokenOwner(order.collection, returnTokenId); } else { if (IERC1155(order.collection).balanceOf(msg.sender, returnTokenId) < order.amount) revert NotTokenOwner(order.collection, returnTokenId); } _validateTokenFlaggingMessage(message, order.collection, returnTokenId); orders[orderHash].status = OrderStatus.CLOSED; // 1. Transfer the NFT back to the lender if (IERC165(order.collection).supportsInterface(INTERFACE_ID_ERC721)) { IERC721(order.collection).safeTransferFrom(order.borrower, order.lender, returnTokenId); } else { IERC1155(order.collection).safeTransferFrom(order.borrower, order.lender, returnTokenId, order.amount, ""); } // 2. Transfer the collateral from dyve to the borrower if (order.orderType == OrderType.ETH_TO_ERC721 || order.orderType == OrderType.ETH_TO_ERC1155) { (bool success, ) = order.borrower.call{ value: order.collateral }(""); require(success, "Collateral transfer to borrower failed"); } else { IERC20(order.currency).safeTransfer(order.borrower, order.collateral); } emit Close( order.orderHash, order.orderType, order.borrower, order.lender, order.collection, order.tokenId, order.amount, returnTokenId, order.collateral, order.currency, OrderStatus.CLOSED ); } /** * @notice Releases collateral to the lender for the expired borrow * @param orderHash order hash of the maker order */ function claimCollateral(bytes32 orderHash) external nonReentrant { Order memory order = orders[orderHash]; if (order.lender != msg.sender) revert InvalidSender(msg.sender); if (order.expiryDateTime > block.timestamp) revert InvalidOrderExpiration(); if (order.status != OrderStatus.BORROWED) revert InvalidOrderStatus(); orders[orderHash].status = OrderStatus.EXPIRED; // Transfer the collateral from dyve to the borrower if (order.orderType == OrderType.ETH_TO_ERC721 || order.orderType == OrderType.ETH_TO_ERC1155) { (bool success, ) = order.lender.call{ value: order.collateral }(""); require(success, "Collateral transfer to lender failed"); } else { IERC20(order.currency).safeTransfer(order.lender, order.collateral); } emit Claim( order.orderHash, order.orderType, order.borrower, order.lender, order.collection, order.tokenId, order.amount, order.collateral, order.currency, OrderStatus.EXPIRED ); } /** * @notice Creates an Order * @param order the order information * @param lender the lender of the order * @param borrower the borrower of the order */ function _createOrder( OrderTypes.Order calldata order, bytes32 orderHash, address lender, address borrower ) internal { // create order for future processing (ie: closing and claiming) orders[orderHash] = Order({ orderHash: orderHash, orderType: order.orderType, lender: payable(lender), borrower: payable(borrower), collection: order.collection, tokenId: order.tokenId, amount: order.amount, expiryDateTime: block.timestamp + order.duration, collateral: order.collateral, currency: order.currency, status: OrderStatus.BORROWED }); } /** * @notice Transfer fees and protocol fee to the Lender and procotol fee recipient respectively in ETH * @param to Address of recipient to receive the fees (Lender) * @param fee Fee amount being transffered to Lender * @param premiumCollection Address of the premium collection (Zero address if it doesn't exist) * @param premiumTokenId TokenId from the premium collection */ function _transferETH(address to, uint256 fee, address premiumCollection, uint256 premiumTokenId) internal { uint256 protocolFee = (fee * protocolFeeManager.determineProtocolFeeRate(premiumCollection, premiumTokenId, to)) / bps; bool success; // 1. Protocol fee transfer if (protocolFee != 0) { (success, ) = payable(protocolFeeRecipient).call{ value: protocolFee }(""); require(success, "Protocol fee transfer failed"); } // 2. Lender fee transfer (success, ) = payable(to).call{ value: fee - protocolFee }(""); require(success, "Lender fee transfer failed"); } /** * @notice Transfer fees, collateral and protocol fee to the Lender, Dyve and procotol fee recipient respectively in the given ERC20 currency * @param from Address of sender of the funds (Borrower) * @param to Address of recipient to receive the fees (Lender) * @param fee Fee amount being transffered to Lender * @param collateral Collateral amount being transffered to Dyve * @param currency Address of the ERC20 currency * @param premiumCollection Address of the premium collection (Zero address if it doesn't exist) * @param premiumTokenId TokenId from the premium collection */ function _transferERC20( address from, address to, uint256 fee, uint256 collateral, address currency, address premiumCollection, uint256 premiumTokenId ) internal { uint256 protocolFee = (fee * protocolFeeManager.determineProtocolFeeRate(premiumCollection, premiumTokenId, to)) / bps; // 1. Protocol fee transfer if (protocolFee != 0) { IERC20(currency).safeTransferFrom(from, protocolFeeRecipient, protocolFee); } // 2. Lender fee transfer IERC20(currency).safeTransferFrom(from, to, fee - protocolFee); // 3. Collateral transfer IERC20(currency).safeTransferFrom(from, address(this), collateral); } /** * @notice updates the ProtocolFeeManager instance * @param _protocolFeeManager the address of the new ProtocolFeeManager */ function updateProtocolFeeManager(address _protocolFeeManager) external onlyOwner { protocolFeeManager = IProtocolFeeManager(_protocolFeeManager); emit ProtocolFeeManagerUpdated(_protocolFeeManager); } /** * @notice updates the WhitelistedCurrencies instance * @param _whitelistedCurrencies the address of the new WhitelistedCurrencies */ function updateWhitelistedCurrencies(address _whitelistedCurrencies) external onlyOwner { whitelistedCurrencies = IWhitelistedCurrencies(_whitelistedCurrencies); emit WhitelistedCurrenciesUpdated(_whitelistedCurrencies); } /** * @notice updates the address of the ReservoirOracle Signer * @param _reservoirOracle the address of the ReservoirOracle Signer */ function updateReservoirOracle(address _reservoirOracle) external onlyOwner { reservoirOracle = IReservoirOracle(_reservoirOracle); emit ReservoirOracleUpdated(_reservoirOracle); } /** * @notice updates the ProtocolFeeRecipient instance * @param _protocolFeeRecipient the address of the new ProtocolFeeRecipient */ function updateProtocolFeeRecipient(address _protocolFeeRecipient) external onlyOwner { protocolFeeRecipient = _protocolFeeRecipient; emit ProtocolFeeRecipientUpdated(_protocolFeeRecipient); } function _validateTokenFlaggingMessage(IReservoirOracle.Message calldata message, address collection, uint256 tokenId) internal view { // Validate the message uint256 maxMessageAge = 5 minutes; bytes32 tokenStruct = keccak256("Token(address contract,uint256 tokenId)"); bytes32 messageId = keccak256(abi.encode(tokenStruct, collection, tokenId)); if (!reservoirOracle.verifyMessage(messageId, maxMessageAge, message)) revert InvalidMessage(); (bool flaggedStatus, /* uint256 */) = abi.decode(message.payload, (bool, uint256)); if (flaggedStatus) revert TokenFlagged(); } /** * @notice Verify the validity of the maker order * @param order the order to be verified * @param orderHash computed hash for the order */ function _validateOrder(OrderTypes.Order calldata order, bytes32 orderHash) internal view { // Verify the signer is not address(0) if (order.signer == address(0)) revert InvalidSigner(); // Verify the order listing is not expired if (order.endTime <= block.timestamp) revert ExpiredListing(); // Verify whether the nonce has expired if ( _isUserOrderNonceExecutedOrCancelled[order.signer][order.nonce] || order.nonce < userMinOrderNonce[order.signer] ) revert ExpiredNonce(); // Verify the fee, collateral and duration are not 0 if (order.fee == 0) revert InvalidFee(); if (order.collateral == 0) revert InvalidCollateral(); if (order.duration == 0) revert InvalidDuration(); // Verify that the amount is not 0 for ERC1155 orders if ( IERC165(order.collection).supportsInterface(INTERFACE_ID_ERC1155) && order.amount == 0 ) revert InvalidAmount(); // Verify that the amount is equal to 1 for ERC721 orders if ( IERC165(order.collection).supportsInterface(INTERFACE_ID_ERC721) && order.amount != 1 ) revert InvalidAmount(); // Verify that the currency is whitelisted for ERC20 orders if ( order.orderType != OrderType.ETH_TO_ERC721 && order.orderType != OrderType.ETH_TO_ERC1155 && !(whitelistedCurrencies.isCurrencyWhitelisted(order.currency)) ) revert InvalidCurrency(); // Verify that the currency is zero address for ETH orders if ( (order.orderType == OrderType.ETH_TO_ERC721 || order.orderType == OrderType.ETH_TO_ERC1155) && order.currency != address(0) ) revert InvalidCurrency(); // Verify the validity of the signature if ( !(SignatureChecker.isValidSignatureNow( order.signer, orderHash, order.signature )) ) revert InvalidSignature(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `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 memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - 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[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * 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 _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/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 // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); 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) { _requireMinted(tokenId); 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 overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual 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 token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); 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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @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 from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 (last updated v4.8.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`. * * 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 (last updated v4.6.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 `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [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://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 functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.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._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* 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]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../Address.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Gnosis Safe. * * _Available since v4.1._ */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); if (error == ECDSA.RecoverError.NoError && recovered == signer) { return true; } (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length == 32 && abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/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 pragma solidity ^0.8.16; interface IProtocolFeeManager { function determineProtocolFeeRate(address collection, uint256 tokenId, address lender) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IReservoirOracle { struct Message { bytes32 id; bytes payload; uint256 timestamp; bytes signature; } function verifyMessage(bytes32 id, uint256 validFor, Message memory message) external view returns (bool success); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IWhitelistedCurrencies { function isCurrencyWhitelisted(address currency) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; enum OrderType { ETH_TO_ERC721, ETH_TO_ERC1155, ERC20_TO_ERC721, ERC20_TO_ERC1155, ERC721_TO_ERC20, ERC1155_TO_ERC20 } /** * @title OrderTypes * @notice This library contains order types for Dyve */ library OrderTypes { // keccak256("Order(uint256 orderType,address signer,address collection,uint256 tokenId,uint256 amount,uint256 duration,uint256 collateral,uint256 fee,address currency,uint256 nonce,uint256 endTime)") bytes32 internal constant ORDER_HASH = 0xaad599fc66ff6b968ccb16010214cc3102e0a7e009000f61cab3f208682c3088; struct Order { OrderType orderType; // the type of order address signer; // signer of the maker order address collection; // collection address uint256 tokenId; // id of the token uint256 amount; // amount of the token (only applicable for ERC1155, always set to 1 for ERC721) uint256 duration; // duration of the borrow uint256 collateral; // collateral amount uint256 fee; // fee for the lender address currency; // currency (e.g., WETH) address premiumCollection; // premium collection address uint256 premiumTokenId; // premium token id uint256 nonce; // order nonce (must be unique unless new maker order is meant to override existing one e.g., lower ask price) uint256 endTime; // time when the order expires in epoch seconds bytes signature; // signature of the maker order } function hash(Order memory order) internal pure returns (bytes32) { return keccak256( abi.encode( ORDER_HASH, order.orderType, order.signer, order.collection, order.tokenId, order.amount, order.duration, order.collateral, order.fee, order.currency, order.nonce, order.endTime ) ); } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"whitelistedCurrenciesAddress","type":"address"},{"internalType":"address","name":"protocolFeeManagerAddress","type":"address"},{"internalType":"address","name":"reservoirOracleAddress","type":"address"},{"internalType":"address","name":"_protocolFeeRecipient","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EmptyNonceArray","type":"error"},{"inputs":[],"name":"ExpiredListing","type":"error"},{"inputs":[],"name":"ExpiredNonce","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCollateral","type":"error"},{"inputs":[],"name":"InvalidCurrency","type":"error"},{"inputs":[],"name":"InvalidDuration","type":"error"},{"inputs":[],"name":"InvalidFee","type":"error"},{"inputs":[],"name":"InvalidMessage","type":"error"},{"inputs":[],"name":"InvalidMinNonce","type":"error"},{"inputs":[],"name":"InvalidMsgValue","type":"error"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"InvalidNonce","type":"error"},{"inputs":[],"name":"InvalidOrderExpiration","type":"error"},{"inputs":[],"name":"InvalidOrderStatus","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"TokenFlagged","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"newMinNonce","type":"uint256"}],"name":"CancelAllOrders","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"orderNonces","type":"uint256[]"}],"name":"CancelMultipleOrders","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"enum OrderType","name":"orderType","type":"uint8"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"enum Dyve.OrderStatus","name":"status","type":"uint8"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"enum OrderType","name":"orderType","type":"uint8"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"lender","type":"address"},{"indexed":false,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"returnedTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"enum Dyve.OrderStatus","name":"status","type":"uint8"}],"name":"Close","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"enum OrderType","name":"orderType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"orderNonce","type":"uint256"},{"indexed":true,"internalType":"address","name":"taker","type":"address"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiryDateTime","type":"uint256"},{"indexed":false,"internalType":"enum Dyve.OrderStatus","name":"status","type":"uint8"}],"name":"OrderFulfilled","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":true,"internalType":"address","name":"protocolFeeManagerAddress","type":"address"}],"name":"ProtocolFeeManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_protocolFeeRecipient","type":"address"}],"name":"ProtocolFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_reservoirOracleAddress","type":"address"}],"name":"ReserovirOracleAddressUpadted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"reservoirOracle","type":"address"}],"name":"ReservoirOracleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"whitelistedCurrenciesAddress","type":"address"}],"name":"WhitelistedCurrenciesUpdated","type":"event"},{"inputs":[],"name":"INTERFACE_ID_ERC1155","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INTERFACE_ID_ERC721","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"minNonce","type":"uint256"}],"name":"cancelAllOrdersForSender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"orderNonces","type":"uint256[]"}],"name":"cancelMultipleMakerOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"claimCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"uint256","name":"returnTokenId","type":"uint256"},{"components":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IReservoirOracle.Message","name":"message","type":"tuple"}],"name":"closePosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum OrderType","name":"orderType","type":"uint8"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"collateral","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"premiumCollection","type":"address"},{"internalType":"uint256","name":"premiumTokenId","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct OrderTypes.Order","name":"order","type":"tuple"},{"components":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IReservoirOracle.Message","name":"message","type":"tuple"}],"name":"fulfillOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"nonceLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"orders","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"internalType":"enum OrderType","name":"orderType","type":"uint8"},{"internalType":"address payable","name":"lender","type":"address"},{"internalType":"address payable","name":"borrower","type":"address"},{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"expiryDateTime","type":"uint256"},{"internalType":"uint256","name":"collateral","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"enum Dyve.OrderStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeManager","outputs":[{"internalType":"contract IProtocolFeeManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservoirOracle","outputs":[{"internalType":"contract IReservoirOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolFeeManager","type":"address"}],"name":"updateProtocolFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolFeeRecipient","type":"address"}],"name":"updateProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reservoirOracle","type":"address"}],"name":"updateReservoirOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelistedCurrencies","type":"address"}],"name":"updateWhitelistedCurrencies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userMinOrderNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistedCurrencies","outputs":[{"internalType":"contract IWhitelistedCurrencies","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101406040523480156200001257600080fd5b5060405162006571380380620065718339818101604052810190620000389190620005d9565b6040518060400160405280600481526020017f44797665000000000000000000000000000000000000000000000000000000008152506040518060400160405280600181526020017f31000000000000000000000000000000000000000000000000000000000000008152506001600081905550620000cc620000c06200046560201b60201c565b6200046d60201b60201c565b60008280519060200120905060008280519060200120905060007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f90508260e081815250508161010081815250504660a08181525050620001358184846200053360201b60201c565b608081815250503073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508061012081815250505050505050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480620001e65750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806200021e5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80620002565750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b156200028e576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff167feb39fbfe62cd81bf043dd1846171d40a2f6dbc586cef7036f61bc37f5e4d65ca60405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167f8b44d36e369609ade2fc102f828b54440ff5d5ac4090d827eed2aef751d7b1a260405160405180910390a28073ffffffffffffffffffffffffffffffffffffffff167fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d60405160405180910390a250505050620006ef565b600033905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600083838346306040516020016200055095949392919062000692565b6040516020818303038152906040528051906020012090509392505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005a18262000574565b9050919050565b620005b38162000594565b8114620005bf57600080fd5b50565b600081519050620005d381620005a8565b92915050565b60008060008060808587031215620005f657620005f56200056f565b5b60006200060687828801620005c2565b94505060206200061987828801620005c2565b93505060406200062c87828801620005c2565b92505060606200063f87828801620005c2565b91505092959194509250565b6000819050919050565b62000660816200064b565b82525050565b6000819050919050565b6200067b8162000666565b82525050565b6200068c8162000594565b82525050565b600060a082019050620006a9600083018862000655565b620006b8602083018762000655565b620006c7604083018662000655565b620006d6606083018562000670565b620006e5608083018462000681565b9695505050505050565b60805160a05160c05160e0516101005161012051615e326200073f6000396000613b9c01526000613bde01526000613bbd01526000613af201526000613b4801526000613b710152615e326000f3fe6080604052600436106101355760003560e01c80638c748e12116100ab578063a70dbaeb1161006f578063a70dbaeb146103e9578063bc6bc0cd14610414578063cbd2ec651461043f578063e3fc028d14610468578063f2ed9b0e14610491578063f2fde38b146104bc57610135565b80638c748e12146102fa5780638da5cb5b14610323578063904fa21b1461034e5780639c3f1e90146103795780639e53a69a146103c057610135565b80635410d098116100fd5780635410d0981461021d57806364df049e1461024857806368237329146102735780636df1d48a1461029e578063715018a6146102c757806378634f37146102de57610135565b80630aef54561461013a578063127d71f7146101635780631df47f801461018c57806333bf6156146101b55780634266581e146101e0575b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190614268565b6104e5565b005b34801561016f57600080fd5b5061018a60048036038101906101859190614335565b610e83565b005b34801561019857600080fd5b506101b360048036038101906101ae9190614335565b610f12565b005b3480156101c157600080fd5b506101ca610fa1565b6040516101d7919061439d565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190614335565b610fc5565b60405161021491906143c7565b60405180910390f35b34801561022957600080fd5b50610232610fdd565b60405161023f9190614441565b60405180910390f35b34801561025457600080fd5b5061025d611003565b60405161026a919061446b565b60405180910390f35b34801561027f57600080fd5b50610288611029565b60405161029591906143c7565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c09190614335565b61102f565b005b3480156102d357600080fd5b506102dc6110be565b005b6102f860048036038101906102f391906144a6565b6110d2565b005b34801561030657600080fd5b50610321600480360381019061031c9190614335565b611bdd565b005b34801561032f57600080fd5b50610338611c6c565b604051610345919061446b565b60405180910390f35b34801561035a57600080fd5b50610363611c96565b60405161037091906143c7565b60405180910390f35b34801561038557600080fd5b506103a0600480360381019061039b919061451e565b611c9d565b6040516103b79b9a9998979695949392919061463a565b60405180910390f35b3480156103cc57600080fd5b506103e760048036038101906103e2919061474a565b611d91565b005b3480156103f557600080fd5b506103fe611f7c565b60405161040b91906147b8565b60405180910390f35b34801561042057600080fd5b50610429611fa2565b604051610436919061439d565b60405180910390f35b34801561044b57600080fd5b50610466600480360381019061046191906147d3565b611fc6565b005b34801561047457600080fd5b5061048f600480360381019061048a919061451e565b612159565b005b34801561049d57600080fd5b506104a66126d7565b6040516104b39190614821565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190614335565b6126fd565b005b6104ed612780565b60006008600085815260200190815260200160002060405180610160016040529081600082015481526020016001820160009054906101000a900460ff16600581111561053d5761053c61455a565b5b600581111561054f5761054e61455a565b5b81526020016001820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016008820160149054906101000a900460ff1660038111156106f8576106f761455a565b5b600381111561070a5761070961455a565b5b8152505090503373ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff161461078457336040517f4c14f64c00000000000000000000000000000000000000000000000000000000815260040161077b919061446b565b60405180910390fd5b428160e00151116107c1576040517f12a900d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160038111156107d5576107d461455a565b5b81610140015160038111156107ed576107ec61455a565b5b14610824576040517f2916ae3300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806080015173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610881919061439d565b602060405180830381865afa15801561089e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c29190614874565b156109bf573373ffffffffffffffffffffffffffffffffffffffff16816080015173ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b815260040161091b91906143c7565b602060405180830381865afa158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906148b6565b73ffffffffffffffffffffffffffffffffffffffff16146109ba578060800151836040517f58a5e2220000000000000000000000000000000000000000000000000000000081526004016109b19291906148e3565b60405180910390fd5b610a8d565b8060c00151816080015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e33866040518363ffffffff1660e01b8152600401610a029291906148e3565b602060405180830381865afa158015610a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a439190614921565b1015610a8c578060800151836040517f58a5e222000000000000000000000000000000000000000000000000000000008152600401610a839291906148e3565b60405180910390fd5b5b610a9c828260800151856127cf565b60036008600086815260200190815260200160002060080160146101000a81548160ff02191690836003811115610ad657610ad561455a565b5b0217905550806080015173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610b38919061439d565b602060405180830381865afa158015610b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b799190614874565b15610bfe57806080015173ffffffffffffffffffffffffffffffffffffffff166342842e0e82606001518360400151866040518463ffffffff1660e01b8152600401610bc79392919061496f565b600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b50505050610c80565b806080015173ffffffffffffffffffffffffffffffffffffffff1663f242432a82606001518360400151868560c001516040518563ffffffff1660e01b8152600401610c4d94939291906149dd565b600060405180830381600087803b158015610c6757600080fd5b505af1158015610c7b573d6000803e3d6000fd5b505050505b60006005811115610c9457610c9361455a565b5b81602001516005811115610cab57610caa61455a565b5b1480610cdf575060016005811115610cc657610cc561455a565b5b81602001516005811115610cdd57610cdc61455a565b5b145b15610d9f576000816060015173ffffffffffffffffffffffffffffffffffffffff16826101000151604051610d1390614a63565b60006040518083038185875af1925050503d8060008114610d50576040519150601f19603f3d011682016040523d82523d6000602084013e610d55565b606091505b5050905080610d99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9090614afb565b60405180910390fd5b50610dd9565b610dd8816060015182610100015183610120015173ffffffffffffffffffffffffffffffffffffffff166129639092919063ffffffff16565b5b806040015173ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff167f812a98acec74c199b628d4ef642eaedeb7cafab94a9843bb0e847d01c0b080458360000151846020015185608001518660a001518760c001518a8961010001518a61012001516003604051610e6d99989796959493929190614b1b565b60405180910390a350610e7e6129e9565b505050565b610e8b6129f3565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f8b44d36e369609ade2fc102f828b54440ff5d5ac4090d827eed2aef751d7b1a260405160405180910390a250565b610f1a6129f3565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d60405160405180910390a250565b7fd9b67a260000000000000000000000000000000000000000000000000000000081565b60066020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61271081565b6110376129f3565b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fa75f06c1fcb711f11e4fe2a1e8b84e798cce8ea1c6d6db252abe31ebd836e21f60405160405180910390a250565b6110c66129f3565b6110d06000612a71565b565b6110da612780565b600060058111156110ee576110ed61455a565b5b8260000160208101906111019190614bcd565b60058111156111135761111261455a565b5b148061115557506001600581111561112e5761112d61455a565b5b8260000160208101906111419190614bcd565b60058111156111535761115261455a565b5b145b801561117457508160c001358260e001356111709190614c29565b3414155b156111ab576040517f1841b4e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156111bf576111be61455a565b5b8260000160208101906111d29190614bcd565b60058111156111e4576111e361455a565b5b141580156112295750600160058111156112015761120061455a565b5b8260000160208101906112149190614bcd565b60058111156112265761122561455a565b5b14155b8015611236575060003414155b1561126d576040517f1841b4e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61128e818360400160208101906112849190614335565b84606001356127cf565b60006112a28361129d90614f12565b612b37565b90506112b6836112b183612bcf565b612be9565b6001600760008560200160208101906112cf9190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000856101600135815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600581111561134a5761134961455a565b5b83600001602081019061135d9190614bcd565b600581111561136f5761136e61455a565b5b0361146857611392838285602001602081019061138c9190614335565b33613361565b8260400160208101906113a59190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e8460200160208101906113d39190614335565b3386606001356040518463ffffffff1660e01b81526004016113f793929190614f25565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b5050505061146383602001602081019061143f9190614335565b8460e00135856101200160208101906114589190614335565b866101400135613649565b611adc565b6001600581111561147c5761147b61455a565b5b83600001602081019061148f9190614bcd565b60058111156114a1576114a061455a565b5b036115a0576114c483828560200160208101906114be9190614335565b33613361565b8260400160208101906114d79190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a8460200160208101906115059190614335565b33866060013587608001356040518563ffffffff1660e01b815260040161152f9493929190614f5c565b600060405180830381600087803b15801561154957600080fd5b505af115801561155d573d6000803e3d6000fd5b5050505061159b8360200160208101906115779190614335565b8460e00135856101200160208101906115909190614335565b866101400135613649565b611adb565b600260058111156115b4576115b361455a565b5b8360000160208101906115c79190614bcd565b60058111156115d9576115d861455a565b5b036116ec576115fc83828560200160208101906115f69190614335565b33613361565b82604001602081019061160f9190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e84602001602081019061163d9190614335565b3386606001356040518463ffffffff1660e01b815260040161166193929190614f25565b600060405180830381600087803b15801561167b57600080fd5b505af115801561168f573d6000803e3d6000fd5b505050506116e7338460200160208101906116aa9190614335565b8560e001358660c00135876101000160208101906116c89190614335565b886101200160208101906116dc9190614335565b89610140013561389c565b611ada565b60036005811115611700576116ff61455a565b5b8360000160208101906117139190614bcd565b60058111156117255761172461455a565b5b0361183e5761174883828560200160208101906117429190614335565b33613361565b82604001602081019061175b9190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a8460200160208101906117899190614335565b33866060013587608001356040518563ffffffff1660e01b81526004016117b39493929190614f5c565b600060405180830381600087803b1580156117cd57600080fd5b505af11580156117e1573d6000803e3d6000fd5b50505050611839338460200160208101906117fc9190614335565b8560e001358660c001358761010001602081019061181a9190614335565b8861012001602081019061182e9190614335565b89610140013561389c565b611ad9565b600460058111156118525761185161455a565b5b8360000160208101906118659190614bcd565b60058111156118775761187661455a565b5b0361198a5761189a8382338660200160208101906118959190614335565b613361565b8260400160208101906118ad9190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e338560200160208101906118dc9190614335565b86606001356040518463ffffffff1660e01b81526004016118ff93929190614f25565b600060405180830381600087803b15801561191957600080fd5b505af115801561192d573d6000803e3d6000fd5b505050506119858360200160208101906119479190614335565b338560e001358660c00135876101000160208101906119669190614335565b8861012001602081019061197a9190614335565b89610140013561389c565b611ad8565b60058081111561199d5761199c61455a565b5b8360000160208101906119b09190614bcd565b60058111156119c2576119c161455a565b5b03611ad7576119e58382338660200160208101906119e09190614335565b613361565b8260400160208101906119f89190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a33856020016020810190611a279190614335565b866060013587608001356040518563ffffffff1660e01b8152600401611a509493929190614f5c565b600060405180830381600087803b158015611a6a57600080fd5b505af1158015611a7e573d6000803e3d6000fd5b50505050611ad6836020016020810190611a989190614335565b338560e001358660c0013587610100016020810190611ab79190614335565b88610120016020810190611acb9190614335565b89610140013561389c565b5b5b5b5b5b5b826020016020810190611aef9190614335565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3579bc5d2d326a9fa2884fcf85ad732183d582b60ee996f43168b97ced76407e83866000016020810190611b519190614bcd565b876101600135886040016020810190611b6a9190614335565b89606001358a608001358b60c001358c60e001358d610100016020810190611b929190614335565b8e60a00135600860008f8152602001908152602001600020600601546001604051611bc89c9b9a99989796959493929190614fb4565b60405180910390a350611bd96129e9565b5050565b611be56129f3565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167feb39fbfe62cd81bf043dd1846171d40a2f6dbc586cef7036f61bc37f5e4d65ca60405160405180910390a250565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6207a12081565b60086020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060080160149054906101000a900460ff1690508b565b60008282905003611dce576040517f36f370bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82829050811015611f2757600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054838383818110611e2f57611e2e61506e565b5b905060200201351015611e9257828282818110611e4f57611e4e61506e565b5b905060200201356040517fb1373a6c000000000000000000000000000000000000000000000000000000008152600401611e8991906143c7565b60405180910390fd5b6001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858585818110611ee857611ee761506e565b5b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611f1f9061509d565b915050611dd1565b503373ffffffffffffffffffffffffffffffffffffffff167ffa0ae5d80fe3763c880a3839fab0294171a6f730d1f82c4cd5392c6f67b417328383604051611f70929190615160565b60405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811161203e576040517fe6e02e5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6207a120600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c9190614c29565b81106120c4576040517fe6e02e5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f1e7178d84f0b0825c65795cd62e7972809ad3aac6917843aaec596161b2c0a978260405161214e91906143c7565b60405180910390a250565b612161612780565b60006008600083815260200190815260200160002060405180610160016040529081600082015481526020016001820160009054906101000a900460ff1660058111156121b1576121b061455a565b5b60058111156121c3576121c261455a565b5b81526020016001820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016008820160149054906101000a900460ff16600381111561236c5761236b61455a565b5b600381111561237e5761237d61455a565b5b8152505090503373ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16146123f857336040517f4c14f64c0000000000000000000000000000000000000000000000000000000081526004016123ef919061446b565b60405180910390fd5b428160e001511115612436576040517f12a900d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600381111561244a5761244961455a565b5b81610140015160038111156124625761246161455a565b5b14612499576040517f2916ae3300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026008600084815260200190815260200160002060080160146101000a81548160ff021916908360038111156124d3576124d261455a565b5b0217905550600060058111156124ec576124eb61455a565b5b816020015160058111156125035761250261455a565b5b148061253757506001600581111561251e5761251d61455a565b5b816020015160058111156125355761253461455a565b5b145b156125f7576000816040015173ffffffffffffffffffffffffffffffffffffffff1682610100015160405161256b90614a63565b60006040518083038185875af1925050503d80600081146125a8576040519150601f19603f3d011682016040523d82523d6000602084013e6125ad565b606091505b50509050806125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e8906151f6565b60405180910390fd5b50612631565b612630816040015182610100015183610120015173ffffffffffffffffffffffffffffffffffffffff166129639092919063ffffffff16565b5b806040015173ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff167f70e6751813ebc947b04a24249d538344392b12f251dbd7e705fadfd297914b318360000151846020015185608001518660a001518760c0015188610100015189610120015160026040516126c3989796959493929190615216565b60405180910390a3506126d46129e9565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6127056129f3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90615306565b60405180910390fd5b61277d81612a71565b50565b6002600054036127c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127bc90615372565b60405180910390fd5b6002600081905550565b600061012c905060007fc0a1ebc1ee06dbc8c69ee4d865db358058921259f8d3cb15d2133d87fa20322e9050600081858560405160200161281293929190615392565b604051602081830303815290604052805190602001209050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b299fd808285896040518463ffffffff1660e01b815260040161288993929190615553565b602060405180830381865afa1580156128a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ca9190614874565b612900576040517f6eca2e4b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600086806020019061291291906155a0565b81019061291f9190615618565b509050801561295a576040517f0e5d9df300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b6129e48363a9059cbb60e01b84846040516024016129829291906148e3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a1f565b505050565b6001600081905550565b6129fb613ae6565b73ffffffffffffffffffffffffffffffffffffffff16612a19611c6c565b73ffffffffffffffffffffffffffffffffffffffff1614612a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a66906156a4565b60405180910390fd5b565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60007faad599fc66ff6b968ccb16010214cc3102e0a7e009000f61cab3f208682c308860001b826000015183602001518460400151856060015186608001518760a001518860c001518960e001518a61010001518b61016001518c6101800151604051602001612bb29c9b9a999897969594939291906156c4565b604051602081830303815290604052805190602001209050919050565b6000612be2612bdc613aee565b83613c08565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff16826020016020810190612c149190614335565b73ffffffffffffffffffffffffffffffffffffffff1603612c61576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4282610180013511612c9f576040517f55b551b000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60076000836020016020810190612cb69190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836101600135815260200190815260200160002060009054906101000a900460ff1680612d74575060066000836020016020810190612d319190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826101600135105b15612dab576040517fa83b143200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260e0013503612de9576040517f58d620b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260c0013503612e27576040517fd1ef4cea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260a0013503612e65576040517f7616640100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816040016020810190612e789190614335565b73ffffffffffffffffffffffffffffffffffffffff166301ffc9a77fd9b67a26000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401612ed0919061439d565b602060405180830381865afa158015612eed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f119190614874565b8015612f21575060008260800135145b15612f58576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816040016020810190612f6b9190614335565b73ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401612fc3919061439d565b602060405180830381865afa158015612fe0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130049190614874565b801561301557506001826080013514155b1561304c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156130605761305f61455a565b5b8260000160208101906130739190614bcd565b60058111156130855761308461455a565b5b141580156130ca5750600160058111156130a2576130a161455a565b5b8260000160208101906130b59190614bcd565b60058111156130c7576130c661455a565b5b14155b80156131825750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166343b938c5836101000160208101906131239190614335565b6040518263ffffffff1660e01b815260040161313f919061446b565b602060405180830381865afa15801561315c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131809190614874565b155b156131b9576040517ff599342800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156131cd576131cc61455a565b5b8260000160208101906131e09190614bcd565b60058111156131f2576131f161455a565b5b148061323457506001600581111561320d5761320c61455a565b5b8260000160208101906132209190614bcd565b60058111156132325761323161455a565b5b145b80156132805750600073ffffffffffffffffffffffffffffffffffffffff16826101000160208101906132679190614335565b73ffffffffffffffffffffffffffffffffffffffff1614155b156132b7576040517ff599342800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6133278260200160208101906132cd9190614335565b8284806101a001906132df91906155a0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050613c3b565b61335d576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6040518061016001604052808481526020018560000160208101906133869190614bcd565b60058111156133985761339761455a565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020018560400160208101906133e89190614335565b73ffffffffffffffffffffffffffffffffffffffff16815260200185606001358152602001856080013581526020018560a00135426134279190614c29565b81526020018560c0013581526020018561010001602081019061344a9190614335565b73ffffffffffffffffffffffffffffffffffffffff168152602001600160038111156134795761347861455a565b5b815250600860008581526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff021916908360058111156134c4576134c361455a565b5b021790555060408201518160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060808201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a0820151816004015560c0820151816005015560e0820151816006015561010082015181600701556101208201518160080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101408201518160080160146101000a81548160ff0219169083600381111561363b5761363a61455a565b5b021790555090505050505050565b6000612710600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2cf4a258585896040518463ffffffff1660e01b81526004016136ad9392919061577e565b602060405180830381865afa1580156136ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ee9190614921565b856136f991906157b5565b613703919061583e565b905060008082146137dd57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405161375490614a63565b60006040518083038185875af1925050503d8060008114613791576040519150601f19603f3d011682016040523d82523d6000602084013e613796565b606091505b505080915050806137dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137d3906158bb565b60405180910390fd5b5b8573ffffffffffffffffffffffffffffffffffffffff16828661380091906158db565b60405161380c90614a63565b60006040518083038185875af1925050503d8060008114613849576040519150601f19603f3d011682016040523d82523d6000602084013e61384e565b606091505b50508091505080613894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161388b9061595b565b60405180910390fd5b505050505050565b6000612710600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2cf4a2585858b6040518463ffffffff1660e01b81526004016139009392919061577e565b602060405180830381865afa15801561391d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139419190614921565b8761394c91906157b5565b613956919061583e565b9050600081146139b0576139af88600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b5b6139e8888883896139c191906158db565b8773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b613a158830878773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b5050505050505050565b6000613a81826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613e8a9092919063ffffffff16565b9050600081511115613ae15780806020019051810190613aa19190614874565b613ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ad7906159ed565b60405180910390fd5b5b505050565b600033905090565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148015613b6a57507f000000000000000000000000000000000000000000000000000000000000000046145b15613b97577f00000000000000000000000000000000000000000000000000000000000000009050613c05565b613c027f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000613ea2565b90505b90565b60008282604051602001613c1d929190615a85565b60405160208183030381529060405280519060200120905092915050565b6000806000613c4a8585613edc565b9150915060006004811115613c6257613c6161455a565b5b816004811115613c7557613c7461455a565b5b148015613cad57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15613cbd57600192505050613dfa565b6000808773ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8888604051602401613cf2929190615b2a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051613d5c9190615b8b565b600060405180830381855afa9150503d8060008114613d97576040519150601f19603f3d011682016040523d82523d6000602084013e613d9c565b606091505b5091509150818015613daf575060208151145b8015613df35750631626ba7e60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681806020019051810190613df19190615bb7565b145b9450505050505b9392505050565b613e84846323b872dd60e01b858585604051602401613e2293929190614f25565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a1f565b50505050565b6060613e998484600085613f2d565b90509392505050565b60008383834630604051602001613ebd959493929190615be4565b6040516020818303038152906040528051906020012090509392505050565b6000806041835103613f1d5760008060006020860151925060408601519150606086015160001a9050613f1187828585613ffa565b94509450505050613f26565b60006002915091505b9250929050565b606082471015613f72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f6990615ca9565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613f9b9190615b8b565b60006040518083038185875af1925050503d8060008114613fd8576040519150601f19603f3d011682016040523d82523d6000602084013e613fdd565b606091505b5091509150613fee878383876140dc565b92505050949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156140355760006003915091506140d3565b60006001878787876040516000815260200160405260405161405a9493929190615ce5565b6020604051602081039080840390855afa15801561407c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036140ca576000600192509250506140d3565b80600092509250505b94509492505050565b6060831561413e576000835103614136576140f685614151565b614135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161412c90615d76565b60405180910390fd5b5b829050614149565b6141488383614174565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156141875781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016141bb9190615dda565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6141eb816141d8565b81146141f657600080fd5b50565b600081359050614208816141e2565b92915050565b6000819050919050565b6142218161420e565b811461422c57600080fd5b50565b60008135905061423e81614218565b92915050565b600080fd5b60006080828403121561425f5761425e614244565b5b81905092915050565b600080600060608486031215614281576142806141ce565b5b600061428f868287016141f9565b93505060206142a08682870161422f565b925050604084013567ffffffffffffffff8111156142c1576142c06141d3565b5b6142cd86828701614249565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614302826142d7565b9050919050565b614312816142f7565b811461431d57600080fd5b50565b60008135905061432f81614309565b92915050565b60006020828403121561434b5761434a6141ce565b5b600061435984828501614320565b91505092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61439781614362565b82525050565b60006020820190506143b2600083018461438e565b92915050565b6143c18161420e565b82525050565b60006020820190506143dc60008301846143b8565b92915050565b6000819050919050565b60006144076144026143fd846142d7565b6143e2565b6142d7565b9050919050565b6000614419826143ec565b9050919050565b600061442b8261440e565b9050919050565b61443b81614420565b82525050565b60006020820190506144566000830184614432565b92915050565b614465816142f7565b82525050565b6000602082019050614480600083018461445c565b92915050565b60006101c0828403121561449d5761449c614244565b5b81905092915050565b600080604083850312156144bd576144bc6141ce565b5b600083013567ffffffffffffffff8111156144db576144da6141d3565b5b6144e785828601614486565b925050602083013567ffffffffffffffff811115614508576145076141d3565b5b61451485828601614249565b9150509250929050565b600060208284031215614534576145336141ce565b5b6000614542848285016141f9565b91505092915050565b614554816141d8565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6006811061459a5761459961455a565b5b50565b60008190506145ab82614589565b919050565b60006145bb8261459d565b9050919050565b6145cb816145b0565b82525050565b60006145dc826142d7565b9050919050565b6145ec816145d1565b82525050565b600481106146035761460261455a565b5b50565b6000819050614614826145f2565b919050565b600061462482614606565b9050919050565b61463481614619565b82525050565b600061016082019050614650600083018e61454b565b61465d602083018d6145c2565b61466a604083018c6145e3565b614677606083018b6145e3565b614684608083018a61445c565b61469160a08301896143b8565b61469e60c08301886143b8565b6146ab60e08301876143b8565b6146b96101008301866143b8565b6146c761012083018561445c565b6146d561014083018461462b565b9c9b505050505050505050505050565b600080fd5b600080fd5b600080fd5b60008083601f84011261470a576147096146e5565b5b8235905067ffffffffffffffff811115614727576147266146ea565b5b602083019150836020820283011115614743576147426146ef565b5b9250929050565b60008060208385031215614761576147606141ce565b5b600083013567ffffffffffffffff81111561477f5761477e6141d3565b5b61478b858286016146f4565b92509250509250929050565b60006147a28261440e565b9050919050565b6147b281614797565b82525050565b60006020820190506147cd60008301846147a9565b92915050565b6000602082840312156147e9576147e86141ce565b5b60006147f78482850161422f565b91505092915050565b600061480b8261440e565b9050919050565b61481b81614800565b82525050565b60006020820190506148366000830184614812565b92915050565b60008115159050919050565b6148518161483c565b811461485c57600080fd5b50565b60008151905061486e81614848565b92915050565b60006020828403121561488a576148896141ce565b5b60006148988482850161485f565b91505092915050565b6000815190506148b081614309565b92915050565b6000602082840312156148cc576148cb6141ce565b5b60006148da848285016148a1565b91505092915050565b60006040820190506148f8600083018561445c565b61490560208301846143b8565b9392505050565b60008151905061491b81614218565b92915050565b600060208284031215614937576149366141ce565b5b60006149458482850161490c565b91505092915050565b60006149598261440e565b9050919050565b6149698161494e565b82525050565b60006060820190506149846000830186614960565b6149916020830185614960565b61499e60408301846143b8565b949350505050565b600082825260208201905092915050565b50565b60006149c76000836149a6565b91506149d2826149b7565b600082019050919050565b600060a0820190506149f26000830187614960565b6149ff6020830186614960565b614a0c60408301856143b8565b614a1960608301846143b8565b8181036080830152614a2a816149ba565b905095945050505050565b600081905092915050565b6000614a4d600083614a35565b9150614a58826149b7565b600082019050919050565b6000614a6e82614a40565b9150819050919050565b600082825260208201905092915050565b7f436f6c6c61746572616c207472616e7366657220746f20626f72726f7765722060008201527f6661696c65640000000000000000000000000000000000000000000000000000602082015250565b6000614ae5602683614a78565b9150614af082614a89565b604082019050919050565b60006020820190508181036000830152614b1481614ad8565b9050919050565b600061012082019050614b31600083018c61454b565b614b3e602083018b6145c2565b614b4b604083018a61445c565b614b5860608301896143b8565b614b6560808301886143b8565b614b7260a08301876143b8565b614b7f60c08301866143b8565b614b8c60e083018561445c565b614b9a61010083018461462b565b9a9950505050505050505050565b60068110614bb557600080fd5b50565b600081359050614bc781614ba8565b92915050565b600060208284031215614be357614be26141ce565b5b6000614bf184828501614bb8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c348261420e565b9150614c3f8361420e565b9250828201905080821115614c5757614c56614bfa565b5b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614cab82614c62565b810181811067ffffffffffffffff82111715614cca57614cc9614c73565b5b80604052505050565b6000614cdd6141c4565b9050614ce98282614ca2565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115614d1357614d12614c73565b5b614d1c82614c62565b9050602081019050919050565b82818337600083830152505050565b6000614d4b614d4684614cf8565b614cd3565b905082815260208101848484011115614d6757614d66614cf3565b5b614d72848285614d29565b509392505050565b600082601f830112614d8f57614d8e6146e5565b5b8135614d9f848260208601614d38565b91505092915050565b60006101c08284031215614dbf57614dbe614c5d565b5b614dca6101c0614cd3565b90506000614dda84828501614bb8565b6000830152506020614dee84828501614320565b6020830152506040614e0284828501614320565b6040830152506060614e168482850161422f565b6060830152506080614e2a8482850161422f565b60808301525060a0614e3e8482850161422f565b60a08301525060c0614e528482850161422f565b60c08301525060e0614e668482850161422f565b60e083015250610100614e7b84828501614320565b61010083015250610120614e9184828501614320565b61012083015250610140614ea78482850161422f565b61014083015250610160614ebd8482850161422f565b61016083015250610180614ed38482850161422f565b610180830152506101a082013567ffffffffffffffff811115614ef957614ef8614cee565b5b614f0584828501614d7a565b6101a08301525092915050565b6000614f1e3683614da8565b9050919050565b6000606082019050614f3a600083018661445c565b614f47602083018561445c565b614f5460408301846143b8565b949350505050565b600060a082019050614f71600083018761445c565b614f7e602083018661445c565b614f8b60408301856143b8565b614f9860608301846143b8565b8181036080830152614fa9816149ba565b905095945050505050565b600061018082019050614fca600083018f61454b565b614fd7602083018e6145c2565b614fe4604083018d6143b8565b614ff1606083018c61445c565b614ffe608083018b6143b8565b61500b60a083018a6143b8565b61501860c08301896143b8565b61502560e08301886143b8565b61503361010083018761445c565b6150416101208301866143b8565b61504f6101408301856143b8565b61505d61016083018461462b565b9d9c50505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006150a88261420e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036150da576150d9614bfa565b5b600182019050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b600061511083856150e5565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115615143576151426150f6565b5b6020830292506151548385846150fb565b82840190509392505050565b6000602082019050818103600083015261517b818486615104565b90509392505050565b7f436f6c6c61746572616c207472616e7366657220746f206c656e64657220666160008201527f696c656400000000000000000000000000000000000000000000000000000000602082015250565b60006151e0602483614a78565b91506151eb82615184565b604082019050919050565b6000602082019050818103600083015261520f816151d3565b9050919050565b60006101008201905061522c600083018b61454b565b615239602083018a6145c2565b615246604083018961445c565b61525360608301886143b8565b61526060808301876143b8565b61526d60a08301866143b8565b61527a60c083018561445c565b61528760e083018461462b565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006152f0602683614a78565b91506152fb82615294565b604082019050919050565b6000602082019050818103600083015261531f816152e3565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061535c601f83614a78565b915061536782615326565b602082019050919050565b6000602082019050818103600083015261538b8161534f565b9050919050565b60006060820190506153a7600083018661454b565b6153b4602083018561445c565b6153c160408301846143b8565b949350505050565b60006153d860208401846141f9565b905092915050565b6153e9816141d8565b82525050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261541b5761541a6153f9565b5b83810192508235915060208301925067ffffffffffffffff821115615443576154426153ef565b5b600182023603831315615459576154586153f4565b5b509250929050565b600082825260208201905092915050565b600061547e8385615461565b935061548b838584614d29565b61549483614c62565b840190509392505050565b60006154ae602084018461422f565b905092915050565b6154bf8161420e565b82525050565b6000608083016154d860008401846153c9565b6154e560008601826153e0565b506154f360208401846153fe565b8583036020870152615506838284615472565b92505050615517604084018461549f565b61552460408601826154b6565b5061553260608401846153fe565b8583036060870152615545838284615472565b925050508091505092915050565b6000606082019050615568600083018661454b565b61557560208301856143b8565b818103604083015261558781846154c5565b9050949350505050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126155bd576155bc615591565b5b80840192508235915067ffffffffffffffff8211156155df576155de615596565b5b6020830192506001820236038313156155fb576155fa61559b565b5b509250929050565b60008135905061561281614848565b92915050565b6000806040838503121561562f5761562e6141ce565b5b600061563d85828601615603565b925050602061564e8582860161422f565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061568e602083614a78565b915061569982615658565b602082019050919050565b600060208201905081810360008301526156bd81615681565b9050919050565b6000610180820190506156da600083018f61454b565b6156e7602083018e6145c2565b6156f4604083018d61445c565b615701606083018c61445c565b61570e608083018b6143b8565b61571b60a083018a6143b8565b61572860c08301896143b8565b61573560e08301886143b8565b6157436101008301876143b8565b61575161012083018661445c565b61575f6101408301856143b8565b61576d6101608301846143b8565b9d9c50505050505050505050505050565b6000606082019050615793600083018661445c565b6157a060208301856143b8565b6157ad604083018461445c565b949350505050565b60006157c08261420e565b91506157cb8361420e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561580457615803614bfa565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006158498261420e565b91506158548361420e565b9250826158645761586361580f565b5b828204905092915050565b7f50726f746f636f6c20666565207472616e73666572206661696c656400000000600082015250565b60006158a5601c83614a78565b91506158b08261586f565b602082019050919050565b600060208201905081810360008301526158d481615898565b9050919050565b60006158e68261420e565b91506158f18361420e565b925082820390508181111561590957615908614bfa565b5b92915050565b7f4c656e64657220666565207472616e73666572206661696c6564000000000000600082015250565b6000615945601a83614a78565b91506159508261590f565b602082019050919050565b6000602082019050818103600083015261597481615938565b9050919050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006159d7602a83614a78565b91506159e28261597b565b604082019050919050565b60006020820190508181036000830152615a06816159ca565b9050919050565b600081905092915050565b7f1901000000000000000000000000000000000000000000000000000000000000600082015250565b6000615a4e600283615a0d565b9150615a5982615a18565b600282019050919050565b6000819050919050565b615a7f615a7a826141d8565b615a64565b82525050565b6000615a9082615a41565b9150615a9c8285615a6e565b602082019150615aac8284615a6e565b6020820191508190509392505050565b600081519050919050565b60005b83811015615ae5578082015181840152602081019050615aca565b60008484015250505050565b6000615afc82615abc565b615b0681856149a6565b9350615b16818560208601615ac7565b615b1f81614c62565b840191505092915050565b6000604082019050615b3f600083018561454b565b8181036020830152615b518184615af1565b90509392505050565b6000615b6582615abc565b615b6f8185614a35565b9350615b7f818560208601615ac7565b80840191505092915050565b6000615b978284615b5a565b915081905092915050565b600081519050615bb1816141e2565b92915050565b600060208284031215615bcd57615bcc6141ce565b5b6000615bdb84828501615ba2565b91505092915050565b600060a082019050615bf9600083018861454b565b615c06602083018761454b565b615c13604083018661454b565b615c2060608301856143b8565b615c2d608083018461445c565b9695505050505050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615c93602683614a78565b9150615c9e82615c37565b604082019050919050565b60006020820190508181036000830152615cc281615c86565b9050919050565b600060ff82169050919050565b615cdf81615cc9565b82525050565b6000608082019050615cfa600083018761454b565b615d076020830186615cd6565b615d14604083018561454b565b615d21606083018461454b565b95945050505050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615d60601d83614a78565b9150615d6b82615d2a565b602082019050919050565b60006020820190508181036000830152615d8f81615d53565b9050919050565b600081519050919050565b6000615dac82615d96565b615db68185614a78565b9350615dc6818560208601615ac7565b615dcf81614c62565b840191505092915050565b60006020820190508181036000830152615df48184615da1565b90509291505056fea2646970667358221220fca8384de01fb0994d44275eb9d31518b348a4c290807d777299e83cdbc2f05b64736f6c6343000810003300000000000000000000000064b737f2ecc3a5fbad58f448d4e9d52a14d701830000000000000000000000001b732f57af5e045ce6f6eac19733e083796d4a070000000000000000000000001d76c8e2591899f6bd86937268e7e9e6b168e0940000000000000000000000003872d1b3f493c497bfbdb0c32cc539457c926f8e
Deployed Bytecode
0x6080604052600436106101355760003560e01c80638c748e12116100ab578063a70dbaeb1161006f578063a70dbaeb146103e9578063bc6bc0cd14610414578063cbd2ec651461043f578063e3fc028d14610468578063f2ed9b0e14610491578063f2fde38b146104bc57610135565b80638c748e12146102fa5780638da5cb5b14610323578063904fa21b1461034e5780639c3f1e90146103795780639e53a69a146103c057610135565b80635410d098116100fd5780635410d0981461021d57806364df049e1461024857806368237329146102735780636df1d48a1461029e578063715018a6146102c757806378634f37146102de57610135565b80630aef54561461013a578063127d71f7146101635780631df47f801461018c57806333bf6156146101b55780634266581e146101e0575b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190614268565b6104e5565b005b34801561016f57600080fd5b5061018a60048036038101906101859190614335565b610e83565b005b34801561019857600080fd5b506101b360048036038101906101ae9190614335565b610f12565b005b3480156101c157600080fd5b506101ca610fa1565b6040516101d7919061439d565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190614335565b610fc5565b60405161021491906143c7565b60405180910390f35b34801561022957600080fd5b50610232610fdd565b60405161023f9190614441565b60405180910390f35b34801561025457600080fd5b5061025d611003565b60405161026a919061446b565b60405180910390f35b34801561027f57600080fd5b50610288611029565b60405161029591906143c7565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c09190614335565b61102f565b005b3480156102d357600080fd5b506102dc6110be565b005b6102f860048036038101906102f391906144a6565b6110d2565b005b34801561030657600080fd5b50610321600480360381019061031c9190614335565b611bdd565b005b34801561032f57600080fd5b50610338611c6c565b604051610345919061446b565b60405180910390f35b34801561035a57600080fd5b50610363611c96565b60405161037091906143c7565b60405180910390f35b34801561038557600080fd5b506103a0600480360381019061039b919061451e565b611c9d565b6040516103b79b9a9998979695949392919061463a565b60405180910390f35b3480156103cc57600080fd5b506103e760048036038101906103e2919061474a565b611d91565b005b3480156103f557600080fd5b506103fe611f7c565b60405161040b91906147b8565b60405180910390f35b34801561042057600080fd5b50610429611fa2565b604051610436919061439d565b60405180910390f35b34801561044b57600080fd5b50610466600480360381019061046191906147d3565b611fc6565b005b34801561047457600080fd5b5061048f600480360381019061048a919061451e565b612159565b005b34801561049d57600080fd5b506104a66126d7565b6040516104b39190614821565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190614335565b6126fd565b005b6104ed612780565b60006008600085815260200190815260200160002060405180610160016040529081600082015481526020016001820160009054906101000a900460ff16600581111561053d5761053c61455a565b5b600581111561054f5761054e61455a565b5b81526020016001820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016008820160149054906101000a900460ff1660038111156106f8576106f761455a565b5b600381111561070a5761070961455a565b5b8152505090503373ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff161461078457336040517f4c14f64c00000000000000000000000000000000000000000000000000000000815260040161077b919061446b565b60405180910390fd5b428160e00151116107c1576040517f12a900d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160038111156107d5576107d461455a565b5b81610140015160038111156107ed576107ec61455a565b5b14610824576040517f2916ae3300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806080015173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610881919061439d565b602060405180830381865afa15801561089e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c29190614874565b156109bf573373ffffffffffffffffffffffffffffffffffffffff16816080015173ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b815260040161091b91906143c7565b602060405180830381865afa158015610938573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095c91906148b6565b73ffffffffffffffffffffffffffffffffffffffff16146109ba578060800151836040517f58a5e2220000000000000000000000000000000000000000000000000000000081526004016109b19291906148e3565b60405180910390fd5b610a8d565b8060c00151816080015173ffffffffffffffffffffffffffffffffffffffff1662fdd58e33866040518363ffffffff1660e01b8152600401610a029291906148e3565b602060405180830381865afa158015610a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a439190614921565b1015610a8c578060800151836040517f58a5e222000000000000000000000000000000000000000000000000000000008152600401610a839291906148e3565b60405180910390fd5b5b610a9c828260800151856127cf565b60036008600086815260200190815260200160002060080160146101000a81548160ff02191690836003811115610ad657610ad561455a565b5b0217905550806080015173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610b38919061439d565b602060405180830381865afa158015610b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b799190614874565b15610bfe57806080015173ffffffffffffffffffffffffffffffffffffffff166342842e0e82606001518360400151866040518463ffffffff1660e01b8152600401610bc79392919061496f565b600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b50505050610c80565b806080015173ffffffffffffffffffffffffffffffffffffffff1663f242432a82606001518360400151868560c001516040518563ffffffff1660e01b8152600401610c4d94939291906149dd565b600060405180830381600087803b158015610c6757600080fd5b505af1158015610c7b573d6000803e3d6000fd5b505050505b60006005811115610c9457610c9361455a565b5b81602001516005811115610cab57610caa61455a565b5b1480610cdf575060016005811115610cc657610cc561455a565b5b81602001516005811115610cdd57610cdc61455a565b5b145b15610d9f576000816060015173ffffffffffffffffffffffffffffffffffffffff16826101000151604051610d1390614a63565b60006040518083038185875af1925050503d8060008114610d50576040519150601f19603f3d011682016040523d82523d6000602084013e610d55565b606091505b5050905080610d99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9090614afb565b60405180910390fd5b50610dd9565b610dd8816060015182610100015183610120015173ffffffffffffffffffffffffffffffffffffffff166129639092919063ffffffff16565b5b806040015173ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff167f812a98acec74c199b628d4ef642eaedeb7cafab94a9843bb0e847d01c0b080458360000151846020015185608001518660a001518760c001518a8961010001518a61012001516003604051610e6d99989796959493929190614b1b565b60405180910390a350610e7e6129e9565b505050565b610e8b6129f3565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f8b44d36e369609ade2fc102f828b54440ff5d5ac4090d827eed2aef751d7b1a260405160405180910390a250565b610f1a6129f3565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d60405160405180910390a250565b7fd9b67a260000000000000000000000000000000000000000000000000000000081565b60066020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61271081565b6110376129f3565b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fa75f06c1fcb711f11e4fe2a1e8b84e798cce8ea1c6d6db252abe31ebd836e21f60405160405180910390a250565b6110c66129f3565b6110d06000612a71565b565b6110da612780565b600060058111156110ee576110ed61455a565b5b8260000160208101906111019190614bcd565b60058111156111135761111261455a565b5b148061115557506001600581111561112e5761112d61455a565b5b8260000160208101906111419190614bcd565b60058111156111535761115261455a565b5b145b801561117457508160c001358260e001356111709190614c29565b3414155b156111ab576040517f1841b4e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156111bf576111be61455a565b5b8260000160208101906111d29190614bcd565b60058111156111e4576111e361455a565b5b141580156112295750600160058111156112015761120061455a565b5b8260000160208101906112149190614bcd565b60058111156112265761122561455a565b5b14155b8015611236575060003414155b1561126d576040517f1841b4e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61128e818360400160208101906112849190614335565b84606001356127cf565b60006112a28361129d90614f12565b612b37565b90506112b6836112b183612bcf565b612be9565b6001600760008560200160208101906112cf9190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000856101600135815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600581111561134a5761134961455a565b5b83600001602081019061135d9190614bcd565b600581111561136f5761136e61455a565b5b0361146857611392838285602001602081019061138c9190614335565b33613361565b8260400160208101906113a59190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e8460200160208101906113d39190614335565b3386606001356040518463ffffffff1660e01b81526004016113f793929190614f25565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b5050505061146383602001602081019061143f9190614335565b8460e00135856101200160208101906114589190614335565b866101400135613649565b611adc565b6001600581111561147c5761147b61455a565b5b83600001602081019061148f9190614bcd565b60058111156114a1576114a061455a565b5b036115a0576114c483828560200160208101906114be9190614335565b33613361565b8260400160208101906114d79190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a8460200160208101906115059190614335565b33866060013587608001356040518563ffffffff1660e01b815260040161152f9493929190614f5c565b600060405180830381600087803b15801561154957600080fd5b505af115801561155d573d6000803e3d6000fd5b5050505061159b8360200160208101906115779190614335565b8460e00135856101200160208101906115909190614335565b866101400135613649565b611adb565b600260058111156115b4576115b361455a565b5b8360000160208101906115c79190614bcd565b60058111156115d9576115d861455a565b5b036116ec576115fc83828560200160208101906115f69190614335565b33613361565b82604001602081019061160f9190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e84602001602081019061163d9190614335565b3386606001356040518463ffffffff1660e01b815260040161166193929190614f25565b600060405180830381600087803b15801561167b57600080fd5b505af115801561168f573d6000803e3d6000fd5b505050506116e7338460200160208101906116aa9190614335565b8560e001358660c00135876101000160208101906116c89190614335565b886101200160208101906116dc9190614335565b89610140013561389c565b611ada565b60036005811115611700576116ff61455a565b5b8360000160208101906117139190614bcd565b60058111156117255761172461455a565b5b0361183e5761174883828560200160208101906117429190614335565b33613361565b82604001602081019061175b9190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a8460200160208101906117899190614335565b33866060013587608001356040518563ffffffff1660e01b81526004016117b39493929190614f5c565b600060405180830381600087803b1580156117cd57600080fd5b505af11580156117e1573d6000803e3d6000fd5b50505050611839338460200160208101906117fc9190614335565b8560e001358660c001358761010001602081019061181a9190614335565b8861012001602081019061182e9190614335565b89610140013561389c565b611ad9565b600460058111156118525761185161455a565b5b8360000160208101906118659190614bcd565b60058111156118775761187661455a565b5b0361198a5761189a8382338660200160208101906118959190614335565b613361565b8260400160208101906118ad9190614335565b73ffffffffffffffffffffffffffffffffffffffff166342842e0e338560200160208101906118dc9190614335565b86606001356040518463ffffffff1660e01b81526004016118ff93929190614f25565b600060405180830381600087803b15801561191957600080fd5b505af115801561192d573d6000803e3d6000fd5b505050506119858360200160208101906119479190614335565b338560e001358660c00135876101000160208101906119669190614335565b8861012001602081019061197a9190614335565b89610140013561389c565b611ad8565b60058081111561199d5761199c61455a565b5b8360000160208101906119b09190614bcd565b60058111156119c2576119c161455a565b5b03611ad7576119e58382338660200160208101906119e09190614335565b613361565b8260400160208101906119f89190614335565b73ffffffffffffffffffffffffffffffffffffffff1663f242432a33856020016020810190611a279190614335565b866060013587608001356040518563ffffffff1660e01b8152600401611a509493929190614f5c565b600060405180830381600087803b158015611a6a57600080fd5b505af1158015611a7e573d6000803e3d6000fd5b50505050611ad6836020016020810190611a989190614335565b338560e001358660c0013587610100016020810190611ab79190614335565b88610120016020810190611acb9190614335565b89610140013561389c565b5b5b5b5b5b5b826020016020810190611aef9190614335565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f3579bc5d2d326a9fa2884fcf85ad732183d582b60ee996f43168b97ced76407e83866000016020810190611b519190614bcd565b876101600135886040016020810190611b6a9190614335565b89606001358a608001358b60c001358c60e001358d610100016020810190611b929190614335565b8e60a00135600860008f8152602001908152602001600020600601546001604051611bc89c9b9a99989796959493929190614fb4565b60405180910390a350611bd96129e9565b5050565b611be56129f3565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167feb39fbfe62cd81bf043dd1846171d40a2f6dbc586cef7036f61bc37f5e4d65ca60405160405180910390a250565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6207a12081565b60086020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060080160149054906101000a900460ff1690508b565b60008282905003611dce576040517f36f370bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b82829050811015611f2757600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054838383818110611e2f57611e2e61506e565b5b905060200201351015611e9257828282818110611e4f57611e4e61506e565b5b905060200201356040517fb1373a6c000000000000000000000000000000000000000000000000000000008152600401611e8991906143c7565b60405180910390fd5b6001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000858585818110611ee857611ee761506e565b5b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611f1f9061509d565b915050611dd1565b503373ffffffffffffffffffffffffffffffffffffffff167ffa0ae5d80fe3763c880a3839fab0294171a6f730d1f82c4cd5392c6f67b417328383604051611f70929190615160565b60405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811161203e576040517fe6e02e5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6207a120600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461208c9190614c29565b81106120c4576040517fe6e02e5300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f1e7178d84f0b0825c65795cd62e7972809ad3aac6917843aaec596161b2c0a978260405161214e91906143c7565b60405180910390a250565b612161612780565b60006008600083815260200190815260200160002060405180610160016040529081600082015481526020016001820160009054906101000a900460ff1660058111156121b1576121b061455a565b5b60058111156121c3576121c261455a565b5b81526020016001820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016008820160149054906101000a900460ff16600381111561236c5761236b61455a565b5b600381111561237e5761237d61455a565b5b8152505090503373ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16146123f857336040517f4c14f64c0000000000000000000000000000000000000000000000000000000081526004016123ef919061446b565b60405180910390fd5b428160e001511115612436576040517f12a900d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600381111561244a5761244961455a565b5b81610140015160038111156124625761246161455a565b5b14612499576040517f2916ae3300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026008600084815260200190815260200160002060080160146101000a81548160ff021916908360038111156124d3576124d261455a565b5b0217905550600060058111156124ec576124eb61455a565b5b816020015160058111156125035761250261455a565b5b148061253757506001600581111561251e5761251d61455a565b5b816020015160058111156125355761253461455a565b5b145b156125f7576000816040015173ffffffffffffffffffffffffffffffffffffffff1682610100015160405161256b90614a63565b60006040518083038185875af1925050503d80600081146125a8576040519150601f19603f3d011682016040523d82523d6000602084013e6125ad565b606091505b50509050806125f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e8906151f6565b60405180910390fd5b50612631565b612630816040015182610100015183610120015173ffffffffffffffffffffffffffffffffffffffff166129639092919063ffffffff16565b5b806040015173ffffffffffffffffffffffffffffffffffffffff16816060015173ffffffffffffffffffffffffffffffffffffffff167f70e6751813ebc947b04a24249d538344392b12f251dbd7e705fadfd297914b318360000151846020015185608001518660a001518760c0015188610100015189610120015160026040516126c3989796959493929190615216565b60405180910390a3506126d46129e9565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6127056129f3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276b90615306565b60405180910390fd5b61277d81612a71565b50565b6002600054036127c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127bc90615372565b60405180910390fd5b6002600081905550565b600061012c905060007fc0a1ebc1ee06dbc8c69ee4d865db358058921259f8d3cb15d2133d87fa20322e9050600081858560405160200161281293929190615392565b604051602081830303815290604052805190602001209050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b299fd808285896040518463ffffffff1660e01b815260040161288993929190615553565b602060405180830381865afa1580156128a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128ca9190614874565b612900576040517f6eca2e4b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600086806020019061291291906155a0565b81019061291f9190615618565b509050801561295a576040517f0e5d9df300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050505050565b6129e48363a9059cbb60e01b84846040516024016129829291906148e3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a1f565b505050565b6001600081905550565b6129fb613ae6565b73ffffffffffffffffffffffffffffffffffffffff16612a19611c6c565b73ffffffffffffffffffffffffffffffffffffffff1614612a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a66906156a4565b60405180910390fd5b565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60007faad599fc66ff6b968ccb16010214cc3102e0a7e009000f61cab3f208682c308860001b826000015183602001518460400151856060015186608001518760a001518860c001518960e001518a61010001518b61016001518c6101800151604051602001612bb29c9b9a999897969594939291906156c4565b604051602081830303815290604052805190602001209050919050565b6000612be2612bdc613aee565b83613c08565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff16826020016020810190612c149190614335565b73ffffffffffffffffffffffffffffffffffffffff1603612c61576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4282610180013511612c9f576040517f55b551b000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60076000836020016020810190612cb69190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836101600135815260200190815260200160002060009054906101000a900460ff1680612d74575060066000836020016020810190612d319190614335565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826101600135105b15612dab576040517fa83b143200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260e0013503612de9576040517f58d620b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260c0013503612e27576040517fd1ef4cea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008260a0013503612e65576040517f7616640100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816040016020810190612e789190614335565b73ffffffffffffffffffffffffffffffffffffffff166301ffc9a77fd9b67a26000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401612ed0919061439d565b602060405180830381865afa158015612eed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f119190614874565b8015612f21575060008260800135145b15612f58576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816040016020810190612f6b9190614335565b73ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f80ac58cd000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401612fc3919061439d565b602060405180830381865afa158015612fe0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130049190614874565b801561301557506001826080013514155b1561304c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156130605761305f61455a565b5b8260000160208101906130739190614bcd565b60058111156130855761308461455a565b5b141580156130ca5750600160058111156130a2576130a161455a565b5b8260000160208101906130b59190614bcd565b60058111156130c7576130c661455a565b5b14155b80156131825750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166343b938c5836101000160208101906131239190614335565b6040518263ffffffff1660e01b815260040161313f919061446b565b602060405180830381865afa15801561315c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131809190614874565b155b156131b9576040517ff599342800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060058111156131cd576131cc61455a565b5b8260000160208101906131e09190614bcd565b60058111156131f2576131f161455a565b5b148061323457506001600581111561320d5761320c61455a565b5b8260000160208101906132209190614bcd565b60058111156132325761323161455a565b5b145b80156132805750600073ffffffffffffffffffffffffffffffffffffffff16826101000160208101906132679190614335565b73ffffffffffffffffffffffffffffffffffffffff1614155b156132b7576040517ff599342800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6133278260200160208101906132cd9190614335565b8284806101a001906132df91906155a0565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050613c3b565b61335d576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6040518061016001604052808481526020018560000160208101906133869190614bcd565b60058111156133985761339761455a565b5b81526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020018560400160208101906133e89190614335565b73ffffffffffffffffffffffffffffffffffffffff16815260200185606001358152602001856080013581526020018560a00135426134279190614c29565b81526020018560c0013581526020018561010001602081019061344a9190614335565b73ffffffffffffffffffffffffffffffffffffffff168152602001600160038111156134795761347861455a565b5b815250600860008581526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff021916908360058111156134c4576134c361455a565b5b021790555060408201518160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060808201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a0820151816004015560c0820151816005015560e0820151816006015561010082015181600701556101208201518160080160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101408201518160080160146101000a81548160ff0219169083600381111561363b5761363a61455a565b5b021790555090505050505050565b6000612710600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2cf4a258585896040518463ffffffff1660e01b81526004016136ad9392919061577e565b602060405180830381865afa1580156136ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ee9190614921565b856136f991906157b5565b613703919061583e565b905060008082146137dd57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260405161375490614a63565b60006040518083038185875af1925050503d8060008114613791576040519150601f19603f3d011682016040523d82523d6000602084013e613796565b606091505b505080915050806137dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137d3906158bb565b60405180910390fd5b5b8573ffffffffffffffffffffffffffffffffffffffff16828661380091906158db565b60405161380c90614a63565b60006040518083038185875af1925050503d8060008114613849576040519150601f19603f3d011682016040523d82523d6000602084013e61384e565b606091505b50508091505080613894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161388b9061595b565b60405180910390fd5b505050505050565b6000612710600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2cf4a2585858b6040518463ffffffff1660e01b81526004016139009392919061577e565b602060405180830381865afa15801561391d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139419190614921565b8761394c91906157b5565b613956919061583e565b9050600081146139b0576139af88600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b5b6139e8888883896139c191906158db565b8773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b613a158830878773ffffffffffffffffffffffffffffffffffffffff16613e01909392919063ffffffff16565b5050505050505050565b6000613a81826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613e8a9092919063ffffffff16565b9050600081511115613ae15780806020019051810190613aa19190614874565b613ae0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ad7906159ed565b60405180910390fd5b5b505050565b600033905090565b60007f0000000000000000000000006ef7d9a6edb147e95eb884bb077983da2b29877773ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148015613b6a57507f000000000000000000000000000000000000000000000000000000000000000146145b15613b97577ff2d0f8b51dea1cf832f0e0114e8b7afda0deb57996114a6be52aa38fcaad466c9050613c05565b613c027f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f5ba1c976ab8ccf6a5989edf209a623864756135194c073f47cac79e46eff2be37fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6613ea2565b90505b90565b60008282604051602001613c1d929190615a85565b60405160208183030381529060405280519060200120905092915050565b6000806000613c4a8585613edc565b9150915060006004811115613c6257613c6161455a565b5b816004811115613c7557613c7461455a565b5b148015613cad57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15613cbd57600192505050613dfa565b6000808773ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8888604051602401613cf2929190615b2a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051613d5c9190615b8b565b600060405180830381855afa9150503d8060008114613d97576040519150601f19603f3d011682016040523d82523d6000602084013e613d9c565b606091505b5091509150818015613daf575060208151145b8015613df35750631626ba7e60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681806020019051810190613df19190615bb7565b145b9450505050505b9392505050565b613e84846323b872dd60e01b858585604051602401613e2293929190614f25565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613a1f565b50505050565b6060613e998484600085613f2d565b90509392505050565b60008383834630604051602001613ebd959493929190615be4565b6040516020818303038152906040528051906020012090509392505050565b6000806041835103613f1d5760008060006020860151925060408601519150606086015160001a9050613f1187828585613ffa565b94509450505050613f26565b60006002915091505b9250929050565b606082471015613f72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f6990615ca9565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613f9b9190615b8b565b60006040518083038185875af1925050503d8060008114613fd8576040519150601f19603f3d011682016040523d82523d6000602084013e613fdd565b606091505b5091509150613fee878383876140dc565b92505050949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156140355760006003915091506140d3565b60006001878787876040516000815260200160405260405161405a9493929190615ce5565b6020604051602081039080840390855afa15801561407c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036140ca576000600192509250506140d3565b80600092509250505b94509492505050565b6060831561413e576000835103614136576140f685614151565b614135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161412c90615d76565b60405180910390fd5b5b829050614149565b6141488383614174565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156141875781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016141bb9190615dda565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b6000819050919050565b6141eb816141d8565b81146141f657600080fd5b50565b600081359050614208816141e2565b92915050565b6000819050919050565b6142218161420e565b811461422c57600080fd5b50565b60008135905061423e81614218565b92915050565b600080fd5b60006080828403121561425f5761425e614244565b5b81905092915050565b600080600060608486031215614281576142806141ce565b5b600061428f868287016141f9565b93505060206142a08682870161422f565b925050604084013567ffffffffffffffff8111156142c1576142c06141d3565b5b6142cd86828701614249565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614302826142d7565b9050919050565b614312816142f7565b811461431d57600080fd5b50565b60008135905061432f81614309565b92915050565b60006020828403121561434b5761434a6141ce565b5b600061435984828501614320565b91505092915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61439781614362565b82525050565b60006020820190506143b2600083018461438e565b92915050565b6143c18161420e565b82525050565b60006020820190506143dc60008301846143b8565b92915050565b6000819050919050565b60006144076144026143fd846142d7565b6143e2565b6142d7565b9050919050565b6000614419826143ec565b9050919050565b600061442b8261440e565b9050919050565b61443b81614420565b82525050565b60006020820190506144566000830184614432565b92915050565b614465816142f7565b82525050565b6000602082019050614480600083018461445c565b92915050565b60006101c0828403121561449d5761449c614244565b5b81905092915050565b600080604083850312156144bd576144bc6141ce565b5b600083013567ffffffffffffffff8111156144db576144da6141d3565b5b6144e785828601614486565b925050602083013567ffffffffffffffff811115614508576145076141d3565b5b61451485828601614249565b9150509250929050565b600060208284031215614534576145336141ce565b5b6000614542848285016141f9565b91505092915050565b614554816141d8565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6006811061459a5761459961455a565b5b50565b60008190506145ab82614589565b919050565b60006145bb8261459d565b9050919050565b6145cb816145b0565b82525050565b60006145dc826142d7565b9050919050565b6145ec816145d1565b82525050565b600481106146035761460261455a565b5b50565b6000819050614614826145f2565b919050565b600061462482614606565b9050919050565b61463481614619565b82525050565b600061016082019050614650600083018e61454b565b61465d602083018d6145c2565b61466a604083018c6145e3565b614677606083018b6145e3565b614684608083018a61445c565b61469160a08301896143b8565b61469e60c08301886143b8565b6146ab60e08301876143b8565b6146b96101008301866143b8565b6146c761012083018561445c565b6146d561014083018461462b565b9c9b505050505050505050505050565b600080fd5b600080fd5b600080fd5b60008083601f84011261470a576147096146e5565b5b8235905067ffffffffffffffff811115614727576147266146ea565b5b602083019150836020820283011115614743576147426146ef565b5b9250929050565b60008060208385031215614761576147606141ce565b5b600083013567ffffffffffffffff81111561477f5761477e6141d3565b5b61478b858286016146f4565b92509250509250929050565b60006147a28261440e565b9050919050565b6147b281614797565b82525050565b60006020820190506147cd60008301846147a9565b92915050565b6000602082840312156147e9576147e86141ce565b5b60006147f78482850161422f565b91505092915050565b600061480b8261440e565b9050919050565b61481b81614800565b82525050565b60006020820190506148366000830184614812565b92915050565b60008115159050919050565b6148518161483c565b811461485c57600080fd5b50565b60008151905061486e81614848565b92915050565b60006020828403121561488a576148896141ce565b5b60006148988482850161485f565b91505092915050565b6000815190506148b081614309565b92915050565b6000602082840312156148cc576148cb6141ce565b5b60006148da848285016148a1565b91505092915050565b60006040820190506148f8600083018561445c565b61490560208301846143b8565b9392505050565b60008151905061491b81614218565b92915050565b600060208284031215614937576149366141ce565b5b60006149458482850161490c565b91505092915050565b60006149598261440e565b9050919050565b6149698161494e565b82525050565b60006060820190506149846000830186614960565b6149916020830185614960565b61499e60408301846143b8565b949350505050565b600082825260208201905092915050565b50565b60006149c76000836149a6565b91506149d2826149b7565b600082019050919050565b600060a0820190506149f26000830187614960565b6149ff6020830186614960565b614a0c60408301856143b8565b614a1960608301846143b8565b8181036080830152614a2a816149ba565b905095945050505050565b600081905092915050565b6000614a4d600083614a35565b9150614a58826149b7565b600082019050919050565b6000614a6e82614a40565b9150819050919050565b600082825260208201905092915050565b7f436f6c6c61746572616c207472616e7366657220746f20626f72726f7765722060008201527f6661696c65640000000000000000000000000000000000000000000000000000602082015250565b6000614ae5602683614a78565b9150614af082614a89565b604082019050919050565b60006020820190508181036000830152614b1481614ad8565b9050919050565b600061012082019050614b31600083018c61454b565b614b3e602083018b6145c2565b614b4b604083018a61445c565b614b5860608301896143b8565b614b6560808301886143b8565b614b7260a08301876143b8565b614b7f60c08301866143b8565b614b8c60e083018561445c565b614b9a61010083018461462b565b9a9950505050505050505050565b60068110614bb557600080fd5b50565b600081359050614bc781614ba8565b92915050565b600060208284031215614be357614be26141ce565b5b6000614bf184828501614bb8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c348261420e565b9150614c3f8361420e565b9250828201905080821115614c5757614c56614bfa565b5b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614cab82614c62565b810181811067ffffffffffffffff82111715614cca57614cc9614c73565b5b80604052505050565b6000614cdd6141c4565b9050614ce98282614ca2565b919050565b600080fd5b600080fd5b600067ffffffffffffffff821115614d1357614d12614c73565b5b614d1c82614c62565b9050602081019050919050565b82818337600083830152505050565b6000614d4b614d4684614cf8565b614cd3565b905082815260208101848484011115614d6757614d66614cf3565b5b614d72848285614d29565b509392505050565b600082601f830112614d8f57614d8e6146e5565b5b8135614d9f848260208601614d38565b91505092915050565b60006101c08284031215614dbf57614dbe614c5d565b5b614dca6101c0614cd3565b90506000614dda84828501614bb8565b6000830152506020614dee84828501614320565b6020830152506040614e0284828501614320565b6040830152506060614e168482850161422f565b6060830152506080614e2a8482850161422f565b60808301525060a0614e3e8482850161422f565b60a08301525060c0614e528482850161422f565b60c08301525060e0614e668482850161422f565b60e083015250610100614e7b84828501614320565b61010083015250610120614e9184828501614320565b61012083015250610140614ea78482850161422f565b61014083015250610160614ebd8482850161422f565b61016083015250610180614ed38482850161422f565b610180830152506101a082013567ffffffffffffffff811115614ef957614ef8614cee565b5b614f0584828501614d7a565b6101a08301525092915050565b6000614f1e3683614da8565b9050919050565b6000606082019050614f3a600083018661445c565b614f47602083018561445c565b614f5460408301846143b8565b949350505050565b600060a082019050614f71600083018761445c565b614f7e602083018661445c565b614f8b60408301856143b8565b614f9860608301846143b8565b8181036080830152614fa9816149ba565b905095945050505050565b600061018082019050614fca600083018f61454b565b614fd7602083018e6145c2565b614fe4604083018d6143b8565b614ff1606083018c61445c565b614ffe608083018b6143b8565b61500b60a083018a6143b8565b61501860c08301896143b8565b61502560e08301886143b8565b61503361010083018761445c565b6150416101208301866143b8565b61504f6101408301856143b8565b61505d61016083018461462b565b9d9c50505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006150a88261420e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036150da576150d9614bfa565b5b600182019050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b600061511083856150e5565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115615143576151426150f6565b5b6020830292506151548385846150fb565b82840190509392505050565b6000602082019050818103600083015261517b818486615104565b90509392505050565b7f436f6c6c61746572616c207472616e7366657220746f206c656e64657220666160008201527f696c656400000000000000000000000000000000000000000000000000000000602082015250565b60006151e0602483614a78565b91506151eb82615184565b604082019050919050565b6000602082019050818103600083015261520f816151d3565b9050919050565b60006101008201905061522c600083018b61454b565b615239602083018a6145c2565b615246604083018961445c565b61525360608301886143b8565b61526060808301876143b8565b61526d60a08301866143b8565b61527a60c083018561445c565b61528760e083018461462b565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006152f0602683614a78565b91506152fb82615294565b604082019050919050565b6000602082019050818103600083015261531f816152e3565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061535c601f83614a78565b915061536782615326565b602082019050919050565b6000602082019050818103600083015261538b8161534f565b9050919050565b60006060820190506153a7600083018661454b565b6153b4602083018561445c565b6153c160408301846143b8565b949350505050565b60006153d860208401846141f9565b905092915050565b6153e9816141d8565b82525050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261541b5761541a6153f9565b5b83810192508235915060208301925067ffffffffffffffff821115615443576154426153ef565b5b600182023603831315615459576154586153f4565b5b509250929050565b600082825260208201905092915050565b600061547e8385615461565b935061548b838584614d29565b61549483614c62565b840190509392505050565b60006154ae602084018461422f565b905092915050565b6154bf8161420e565b82525050565b6000608083016154d860008401846153c9565b6154e560008601826153e0565b506154f360208401846153fe565b8583036020870152615506838284615472565b92505050615517604084018461549f565b61552460408601826154b6565b5061553260608401846153fe565b8583036060870152615545838284615472565b925050508091505092915050565b6000606082019050615568600083018661454b565b61557560208301856143b8565b818103604083015261558781846154c5565b9050949350505050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126155bd576155bc615591565b5b80840192508235915067ffffffffffffffff8211156155df576155de615596565b5b6020830192506001820236038313156155fb576155fa61559b565b5b509250929050565b60008135905061561281614848565b92915050565b6000806040838503121561562f5761562e6141ce565b5b600061563d85828601615603565b925050602061564e8582860161422f565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061568e602083614a78565b915061569982615658565b602082019050919050565b600060208201905081810360008301526156bd81615681565b9050919050565b6000610180820190506156da600083018f61454b565b6156e7602083018e6145c2565b6156f4604083018d61445c565b615701606083018c61445c565b61570e608083018b6143b8565b61571b60a083018a6143b8565b61572860c08301896143b8565b61573560e08301886143b8565b6157436101008301876143b8565b61575161012083018661445c565b61575f6101408301856143b8565b61576d6101608301846143b8565b9d9c50505050505050505050505050565b6000606082019050615793600083018661445c565b6157a060208301856143b8565b6157ad604083018461445c565b949350505050565b60006157c08261420e565b91506157cb8361420e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561580457615803614bfa565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006158498261420e565b91506158548361420e565b9250826158645761586361580f565b5b828204905092915050565b7f50726f746f636f6c20666565207472616e73666572206661696c656400000000600082015250565b60006158a5601c83614a78565b91506158b08261586f565b602082019050919050565b600060208201905081810360008301526158d481615898565b9050919050565b60006158e68261420e565b91506158f18361420e565b925082820390508181111561590957615908614bfa565b5b92915050565b7f4c656e64657220666565207472616e73666572206661696c6564000000000000600082015250565b6000615945601a83614a78565b91506159508261590f565b602082019050919050565b6000602082019050818103600083015261597481615938565b9050919050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006159d7602a83614a78565b91506159e28261597b565b604082019050919050565b60006020820190508181036000830152615a06816159ca565b9050919050565b600081905092915050565b7f1901000000000000000000000000000000000000000000000000000000000000600082015250565b6000615a4e600283615a0d565b9150615a5982615a18565b600282019050919050565b6000819050919050565b615a7f615a7a826141d8565b615a64565b82525050565b6000615a9082615a41565b9150615a9c8285615a6e565b602082019150615aac8284615a6e565b6020820191508190509392505050565b600081519050919050565b60005b83811015615ae5578082015181840152602081019050615aca565b60008484015250505050565b6000615afc82615abc565b615b0681856149a6565b9350615b16818560208601615ac7565b615b1f81614c62565b840191505092915050565b6000604082019050615b3f600083018561454b565b8181036020830152615b518184615af1565b90509392505050565b6000615b6582615abc565b615b6f8185614a35565b9350615b7f818560208601615ac7565b80840191505092915050565b6000615b978284615b5a565b915081905092915050565b600081519050615bb1816141e2565b92915050565b600060208284031215615bcd57615bcc6141ce565b5b6000615bdb84828501615ba2565b91505092915050565b600060a082019050615bf9600083018861454b565b615c06602083018761454b565b615c13604083018661454b565b615c2060608301856143b8565b615c2d608083018461445c565b9695505050505050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615c93602683614a78565b9150615c9e82615c37565b604082019050919050565b60006020820190508181036000830152615cc281615c86565b9050919050565b600060ff82169050919050565b615cdf81615cc9565b82525050565b6000608082019050615cfa600083018761454b565b615d076020830186615cd6565b615d14604083018561454b565b615d21606083018461454b565b95945050505050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000615d60601d83614a78565b9150615d6b82615d2a565b602082019050919050565b60006020820190508181036000830152615d8f81615d53565b9050919050565b600081519050919050565b6000615dac82615d96565b615db68185614a78565b9350615dc6818560208601615ac7565b615dcf81614c62565b840191505092915050565b60006020820190508181036000830152615df48184615da1565b90509291505056fea2646970667358221220fca8384de01fb0994d44275eb9d31518b348a4c290807d777299e83cdbc2f05b64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000064b737f2ecc3a5fbad58f448d4e9d52a14d701830000000000000000000000001b732f57af5e045ce6f6eac19733e083796d4a070000000000000000000000001d76c8e2591899f6bd86937268e7e9e6b168e0940000000000000000000000003872d1b3f493c497bfbdb0c32cc539457c926f8e
-----Decoded View---------------
Arg [0] : whitelistedCurrenciesAddress (address): 0x64b737f2eCc3a5fbaD58f448d4E9d52a14d70183
Arg [1] : protocolFeeManagerAddress (address): 0x1b732F57aF5e045Ce6F6Eac19733e083796D4A07
Arg [2] : reservoirOracleAddress (address): 0x1D76C8e2591899f6Bd86937268e7e9E6B168E094
Arg [3] : _protocolFeeRecipient (address): 0x3872D1b3f493C497BFbdb0C32CC539457C926F8E
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000064b737f2ecc3a5fbad58f448d4e9d52a14d70183
Arg [1] : 0000000000000000000000001b732f57af5e045ce6f6eac19733e083796d4a07
Arg [2] : 0000000000000000000000001d76c8e2591899f6bd86937268e7e9e6b168e094
Arg [3] : 0000000000000000000000003872d1b3f493c497bfbdb0c32cc539457c926f8e
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,227.95 | 0.02 | $64.56 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.