Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21461317 | 5 days ago | 0 ETH | ||||
21461317 | 5 days ago | Contract Creation | 0 ETH | |||
21445937 | 8 days ago | 0 ETH | ||||
21445937 | 8 days ago | Contract Creation | 0 ETH | |||
21421401 | 11 days ago | 0 ETH | ||||
21421401 | 11 days ago | Contract Creation | 0 ETH | |||
21407995 | 13 days ago | 0 ETH | ||||
21407995 | 13 days ago | Contract Creation | 0 ETH | |||
21377212 | 17 days ago | 0 ETH | ||||
21377212 | 17 days ago | Contract Creation | 0 ETH | |||
21334478 | 23 days ago | 0 ETH | ||||
21334478 | 23 days ago | Contract Creation | 0 ETH | |||
21247345 | 35 days ago | 0 ETH | ||||
21247345 | 35 days ago | Contract Creation | 0 ETH | |||
21182587 | 44 days ago | 0 ETH | ||||
21182587 | 44 days ago | Contract Creation | 0 ETH | |||
21096387 | 56 days ago | 0 ETH | ||||
21096387 | 56 days ago | Contract Creation | 0 ETH | |||
21096384 | 56 days ago | 0 ETH | ||||
21096384 | 56 days ago | Contract Creation | 0 ETH | |||
21096381 | 56 days ago | 0 ETH | ||||
21096381 | 56 days ago | Contract Creation | 0 ETH | |||
21096377 | 56 days ago | 0 ETH | ||||
21096377 | 56 days ago | Contract Creation | 0 ETH | |||
20995716 | 70 days ago | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
TokenVaultV2
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "./interfaces/ITokenVaultV2.sol"; import "./interfaces/ILockManager.sol"; import "./interfaces/IRevest.sol"; import "./interfaces/IOutputReceiver.sol"; import "./utils/RevestAccessControl.sol"; import "./RevestSmartWallet.sol"; import '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol'; import "@openzeppelin/contracts/proxy/Clones.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; /** * This vault knows nothing about ownership. Only what fnftIds correspond to what configs * and ensures that all FNFTs are backed by assets in the vault. */ contract TokenVaultV2 is ITokenVaultV2, Ownable, RevestAccessControl { using ERC165Checker for address; using SafeERC20 for IERC20; /// Address to use for EIP-1167 smart-wallet creation calls address public immutable TEMPLATE; /// Cutoff ID above which FNFTs are created from this contract uint public immutable FNFT_CUTOFF; /// Maps fnftIds to their respective configs mapping(uint => IRevest.FNFTConfig) private fnfts; /// Tracks migrations for updated staking contracts mapping(address => address) public migrations; /// Used for calculations uint private constant multiplierPrecision = 1 ether; /// The identifier for IOutputReceivers to return for use with ERC-165 bytes4 public constant OUTPUT_RECEIVER_INTERFACE_ID = type(IOutputReceiver).interfaceId; constructor( address provider, address[] memory oldOutputs, address[] memory newOutputs ) RevestAccessControl(provider) { RevestSmartWallet wallet = new RevestSmartWallet(); TEMPLATE = address(wallet); FNFT_CUTOFF = getFNFTHandler().getNextId() - 1; for(uint i = 0; i < oldOutputs.length; i++) { migrations[oldOutputs[i]] = newOutputs[i]; } } /** * @notice Maps an fnftConfig object to a given FNFT ID * @param fnftId the FNFT ID to map the config to * @param fnftConfig the config to map to the ID * @param quantity the quantity to create * @param from the user generating this call * @dev this can only ever be called from Revest.sol during the minting process */ function createFNFT(uint fnftId, IRevest.FNFTConfig memory fnftConfig, uint quantity, address from) external override onlyRevestController { mapFNFTToToken(fnftId, fnftConfig); if(fnftConfig.asset != address(0)) { emit DepositERC20(fnftConfig.asset, from, fnftId, fnftConfig.depositAmount * quantity, getFNFTAddress(fnftId)); } emit CreateFNFT(fnftId, from); } /** * @notice allows for the withdrawal of unlocked FNFTs * @param fnftId the FNFT ID to withdraw from * @param quantity the number of FNFTs within that series to withdraw * @param user the user requesting the withdrawal of funds * @dev should only ever be called from Revest.sol */ function withdrawToken( uint fnftId, uint quantity, address user ) external override onlyRevestController { // If the FNFT is an old one, this just assigns to zero-value IRevest.FNFTConfig memory fnft = fnfts[fnftId]; address asset = fnft.asset; address pipeTo = fnft.pipeToContract; uint amountToWithdraw; uint supplyBefore = getFNFTHandler().getSupply(fnftId) + quantity; if(fnftId <= FNFT_CUTOFF) { // Uses the old TokenVault // Withdraw and remap // Begin by getting the FNFT Config from the old TokenVault address oldVault = addressesProvider.getLegacyTokenVault(); fnft = ITokenVault(oldVault).getFNFT(fnftId); amountToWithdraw = quantity * fnft.depositAmount; // Update vars to reflect accurate state asset = fnft.asset; // Modify output receivers to forward underlying value to this contract if(fnft.pipeToContract != address(0)) { pipeTo = fnft.pipeToContract; // Store original output receiver destination fnft.pipeToContract = address(this); ITokenVault(oldVault).mapFNFTToToken(fnftId, fnft); // Handle any migrations needed from old to new staking contract if(migrations[pipeTo] != address(0)) { pipeTo = migrations[pipeTo]; } } // Call withdrawal method on old system ITokenVault(oldVault).withdrawToken(fnftId, quantity, user); // Very uncommon edge-case, no known system will use this, but need to cover regardless if(pipeTo != address(0) && supplyBefore - quantity != 0) { // If there are still instances, need to re-write to accurate OutputRec for future withdrawals fnft.pipeToContract = pipeTo; ITokenVault(oldVault).mapFNFTToToken(fnftId, fnft); } // If value has been routed here, forward onto destination, then handle callback if(pipeTo != address(0) && asset != address(0)) { // NB: The user has control of where these external calls go amountToWithdraw = IERC20(asset).balanceOf(address(this)); IERC20(asset).safeTransfer(pipeTo, amountToWithdraw); } } else { // Handle any migrations needed from old to new staking contract if(migrations[pipeTo] != address(0)) { pipeTo = migrations[pipeTo]; } // Deploy the smart wallet object if(asset != address(0)) { // Real tokens, deploy smart-wallet address smartWallAdd = Clones.cloneDeterministic(TEMPLATE, keccak256(abi.encode(fnftId))); RevestSmartWallet wallet = RevestSmartWallet(smartWallAdd); // NB: The user has control of where this external call goes amountToWithdraw = quantity * IERC20(asset).balanceOf(smartWallAdd) / supplyBefore; if(pipeTo == address(0)) { wallet.withdraw(amountToWithdraw, asset, user); } else { wallet.withdraw(amountToWithdraw, asset, pipeTo); } } } // Handle all callbacks from here, regardless of what system it was // NB: This makes an external call and could be used for reentrancy: // all important systems on IOutputReceiver implementations should be // marked as nonReentrant to ensure that exploitation is impossible // or properly follow checks-effects-interactions if(pipeTo != address(0) && pipeTo.supportsInterface(OUTPUT_RECEIVER_INTERFACE_ID)) { IOutputReceiver(pipeTo).receiveRevestOutput(fnftId, asset, payable(user), quantity); } // Perform clean-up if(supplyBefore - quantity == 0 && fnftId > FNFT_CUTOFF) { removeFNFT(fnftId); } emit RedeemFNFT(fnftId, user); if(asset != address(0) && amountToWithdraw > 0) { emit WithdrawERC20(asset, user, fnftId, amountToWithdraw, getFNFTAddress(fnftId)); } } /** * @notice this function maps an FNFT config to an FNFT ID * @param fnftId the FNFT ID to map to * @param fnftConfig the config to map to that ID * @dev this should only ever be called from Revest.sol */ function mapFNFTToToken( uint fnftId, IRevest.FNFTConfig memory fnftConfig ) public override onlyRevestController { // Gas optimizations fnfts[fnftId].asset = fnftConfig.asset; // We don't specify depositAmount or depositMul, neither are necessary anymore if(fnftConfig.split > 0) { fnfts[fnftId].split = fnftConfig.split; } if(fnftConfig.maturityExtension) { fnfts[fnftId].maturityExtension = fnftConfig.maturityExtension; } if(fnftConfig.pipeToContract != address(0)) { fnfts[fnftId].pipeToContract = fnftConfig.pipeToContract; } if(fnftConfig.isMulti) { fnfts[fnftId].isMulti = fnftConfig.isMulti; fnfts[fnftId].depositStopTime = fnftConfig.depositStopTime; } if(fnftConfig.nontransferrable){ fnfts[fnftId].nontransferrable = fnftConfig.nontransferrable; } } /** * @notice Emits an event when we have an additional deposit * @param user the user who is making the deposit * @param fnftId the ID of the FNFT being deposited * @param tokenAmount the amount of tokens being deposited * @dev this should only ever be called from Revest.sol */ function recordAdditionalDeposit( address user, uint fnftId, uint tokenAmount ) external override onlyRevestController { emit DepositERC20(fnfts[fnftId].asset, user, fnftId, tokenAmount, getFNFTAddress(fnftId)); } /// /// Utility functions /// /// Internal function to remove FNFT configs function removeFNFT(uint fnftId) private { delete fnfts[fnftId]; } /** * @notice Given an FNFT config, clones it and returns a deep copy * @param old an FNFT config to be cloned * @return a new FNFT config that is a deep copy of the passed-in parameter */ function cloneFNFTConfig(IRevest.FNFTConfig memory old) public pure override returns (IRevest.FNFTConfig memory) { return IRevest.FNFTConfig({ asset: old.asset, split: old.split, depositAmount:old.depositAmount, depositMul:old.depositMul, maturityExtension: old.maturityExtension, pipeToContract: old.pipeToContract, isMulti : old.isMulti, depositStopTime: old.depositStopTime, nontransferrable: old.nontransferrable }); } /// /// Getters /// /** * @notice gets the current face-value of an FNFT: if it has an OutputReceiver, will source data from there * @param fnftId the fnft to get the value of * @return the face-value of the FNFT – for native Revest vault storage, this is guaranteed to be accurate * @dev for FNFTs with OutputReceivers, this value is provided by the OutputReceiver and not gauranteed to be accurate */ function getFNFTCurrentValue(uint fnftId) external view override returns (uint) { if(fnftId <= FNFT_CUTOFF) { ITokenVault legacyVault = ITokenVault(addressesProvider.getLegacyTokenVault()); IRevest.FNFTConfig memory fnft = legacyVault.getFNFT(fnftId); if(fnft.pipeToContract != address(0) && fnft.pipeToContract.supportsInterface(OUTPUT_RECEIVER_INTERFACE_ID)) { address migration = migrations[fnft.pipeToContract]; if(migration != address(0) && migration.supportsInterface(OUTPUT_RECEIVER_INTERFACE_ID)) { // NB: The user has control of where this external view call goes return IOutputReceiver(migration).getValue((fnftId)); } else if(migration == address(0)) { // NB: The user has control of where this external view call goes return IOutputReceiver(fnft.pipeToContract).getValue((fnftId)); } } else { return legacyVault.getFNFTCurrentValue(fnftId); } } // NB: The user has control of where this external call goes if(fnfts[fnftId].pipeToContract.supportsInterface(OUTPUT_RECEIVER_INTERFACE_ID)) { return IOutputReceiver(fnfts[fnftId].pipeToContract).getValue((fnftId)); } uint currentAmount = 0; address asset = fnfts[fnftId].asset; if(asset != address(0)) { address smartWallet = getFNFTAddress(fnftId); uint supply = getFNFTHandler().getSupply(fnftId); // NB: The user has control of where this external call goes return IERC20(asset).balanceOf(smartWallet) / supply; } // Default fall-through return currentAmount; } /** * @notice Get the FNFT Config for a given FNFT ID * @param fnftId the FNFT ID to get the config for * @return the FNFT Config associated with the FNFT ID * @dev for TokenVaultV2 FNFTs, depositAmount will not be recorded */ function getFNFT(uint fnftId) public view override returns (IRevest.FNFTConfig memory) { if(fnftId <= FNFT_CUTOFF) { IRevest.FNFTConfig memory config = ITokenVault(addressesProvider.getLegacyTokenVault()).getFNFT(fnftId); return config; } else { return fnfts[fnftId]; } } /// Gets whether a given FNFT is nontransferrable function getNontransferable(uint fnftId) external view override returns (bool) { return getFNFT(fnftId).nontransferrable; } /// Gets the number of splits remaining for a given FNFT function getSplitsRemaining(uint fnftId) external view override returns (uint) { return getFNFT(fnftId).split; } /** * @notice Retrieves the smart-wallet address associated with a given FNFT ID * @param fnftId The FNFT Id to get the address for * @return smartWallet The address for the smart-wallet where funds for the given FNFT ID are stored */ function getFNFTAddress(uint fnftId) public view override returns (address smartWallet) { smartWallet = Clones.predictDeterministicAddress(TEMPLATE, keccak256(abi.encode(fnftId))); } /// /// Deprecated Functions /// /** * @dev Deprecated from TokenVaultV2 onwards */ function splitFNFT( uint fnftId, uint[] memory newFNFTIds, uint[] memory proportions, uint quantity ) external override onlyRevestController {} /** * @dev Deprecated from TokenVaultV2 onwards */ function depositToken( uint fnftId, uint transferAmount, uint quantity ) public override onlyRevestController {} /** * @dev Deprecated from TokenVaultV2 onwards */ function handleMultipleDeposits(uint, uint, uint) external override onlyRevestController {} }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "./ITokenVault.sol"; interface ITokenVaultV2 is ITokenVault { /// Emitted when an FNFT is created event CreateFNFT(uint indexed fnftId, address indexed from); /// Emitted when an FNFT is redeemed event RedeemFNFT(uint indexed fnftId, address indexed from); /// Emitted when an FNFT is created to denote what tokens have been deposited event DepositERC20(address indexed token, address indexed user, uint indexed fnftId, uint tokenAmount, address smartWallet); /// Emitted when an FNFT is withdraw to denote what tokens have been withdrawn event WithdrawERC20(address indexed token, address indexed user, uint indexed fnftId, uint tokenAmount, address smartWallet); function getFNFTAddress(uint fnftId) external view returns (address smartWallet); function recordAdditionalDeposit(address user, uint fnftId, uint tokenAmount) external; }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "./IRevest.sol"; interface ILockManager { function createLock(uint fnftId, IRevest.LockParam memory lock) external returns (uint); function getLock(uint lockId) external view returns (IRevest.Lock memory); function fnftIdToLockId(uint fnftId) external view returns (uint); function fnftIdToLock(uint fnftId) external view returns (IRevest.Lock memory); function pointFNFTToLock(uint fnftId, uint lockId) external; function lockTypes(uint tokenId) external view returns (IRevest.LockType); function unlockFNFT(uint fnftId, address sender) external returns (bool); function getLockMaturity(uint fnftId) external view returns (bool); }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; interface IRevest { event FNFTTimeLockMinted( address indexed asset, address indexed from, uint indexed fnftId, uint endTime, uint[] quantities, FNFTConfig fnftConfig ); event FNFTValueLockMinted( address indexed asset, address indexed from, uint indexed fnftId, address compareTo, address oracleDispatch, uint[] quantities, FNFTConfig fnftConfig ); event FNFTAddressLockMinted( address indexed asset, address indexed from, uint indexed fnftId, address trigger, uint[] quantities, FNFTConfig fnftConfig ); event FNFTWithdrawn( address indexed from, uint indexed fnftId, uint indexed quantity ); event FNFTSplit( address indexed from, uint[] indexed newFNFTId, uint[] indexed proportions, uint quantity ); event FNFTUnlocked( address indexed from, uint indexed fnftId ); event FNFTMaturityExtended( address indexed from, uint indexed fnftId, uint indexed newExtendedTime ); event FNFTAddionalDeposited( address indexed from, uint indexed newFNFTId, uint indexed quantity, uint amount ); struct FNFTConfig { address asset; // The token being stored address pipeToContract; // Indicates if FNFT will pipe to another contract uint depositAmount; // How many tokens uint depositMul; // Deposit multiplier uint split; // Number of splits remaining uint depositStopTime; // bool maturityExtension; // Maturity extensions remaining bool isMulti; // bool nontransferrable; // False by default (transferrable) // } // Refers to the global balance for an ERC20, encompassing possibly many FNFTs struct TokenTracker { uint lastBalance; uint lastMul; } enum LockType { DoesNotExist, TimeLock, ValueLock, AddressLock } struct LockParam { address addressLock; uint timeLockExpiry; LockType lockType; ValueLock valueLock; } struct Lock { address addressLock; LockType lockType; ValueLock valueLock; uint timeLockExpiry; uint creationTime; bool unlocked; } struct ValueLock { address asset; address compareTo; address oracle; uint unlockValue; bool unlockRisingEdge; } function mintTimeLock( uint endTime, address[] memory recipients, uint[] memory quantities, IRevest.FNFTConfig memory fnftConfig ) external payable returns (uint); function mintValueLock( address primaryAsset, address compareTo, uint unlockValue, bool unlockRisingEdge, address oracleDispatch, address[] memory recipients, uint[] memory quantities, IRevest.FNFTConfig memory fnftConfig ) external payable returns (uint); function mintAddressLock( address trigger, bytes memory arguments, address[] memory recipients, uint[] memory quantities, IRevest.FNFTConfig memory fnftConfig ) external payable returns (uint); function withdrawFNFT(uint tokenUID, uint quantity) external; function unlockFNFT(uint tokenUID) external; function splitFNFT( uint fnftId, uint[] memory proportions, uint quantity ) external returns (uint[] memory newFNFTIds); function depositAdditionalToFNFT( uint fnftId, uint amount, uint quantity ) external returns (uint); function extendFNFTMaturity( uint fnftId, uint endTime ) external returns (uint); function setFlatWeiFee(uint wethFee) external; function setERC20Fee(uint erc20) external; function getFlatWeiFee() external view returns (uint); function getERC20Fee() external view returns (uint); }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "./IRegistryProvider.sol"; import '@openzeppelin/contracts/utils/introspection/IERC165.sol'; /** * @title Provider interface for Revest FNFTs */ interface IOutputReceiver is IRegistryProvider, IERC165 { function receiveRevestOutput( uint fnftId, address asset, address payable owner, uint quantity ) external; function getCustomMetadata(uint fnftId) external view returns (string memory); function getValue(uint fnftId) external view returns (uint); function getAsset(uint fnftId) external view returns (address); function getOutputDisplayValues(uint fnftId) external view returns (bytes memory); }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IAddressRegistryV2.sol"; import "../interfaces/ILockManager.sol"; import "../interfaces/IRewardsHandler.sol"; import "../interfaces/ITokenVault.sol"; import "../interfaces/IRevestToken.sol"; import "../interfaces/IFNFTHandler.sol"; import "../lib/uniswap/IUniswapV2Factory.sol"; contract RevestAccessControl is Ownable { IAddressRegistryV2 internal addressesProvider; constructor(address provider) Ownable() { addressesProvider = IAddressRegistryV2(provider); } modifier onlyRevest() { require(_msgSender() != address(0), "E004"); require( _msgSender() == addressesProvider.getLockManager() || _msgSender() == addressesProvider.getRewardsHandler() || _msgSender() == addressesProvider.getTokenVault() || _msgSender() == addressesProvider.getRevest() || _msgSender() == addressesProvider.getRevestToken(), "E016" ); _; } modifier onlyRevestController() { require(_msgSender() != address(0), "E004"); require(_msgSender() == addressesProvider.getRevest(), "E017"); _; } modifier onlyTokenVault() { require(_msgSender() != address(0), "E004"); require(_msgSender() == addressesProvider.getTokenVault(), "E017"); _; } function setAddressRegistry(address registry) external onlyOwner { addressesProvider = IAddressRegistryV2(registry); } function getAdmin() internal view returns (address) { return addressesProvider.getAdmin(); } function getRevest() internal view returns (IRevest) { return IRevest(addressesProvider.getRevest()); } function getRevestToken() internal view returns (IRevestToken) { return IRevestToken(addressesProvider.getRevestToken()); } function getLockManager() internal view returns (ILockManager) { return ILockManager(addressesProvider.getLockManager()); } function getTokenVault() internal view returns (ITokenVault) { return ITokenVault(addressesProvider.getTokenVault()); } function getUniswapV2() internal view returns (IUniswapV2Factory) { return IUniswapV2Factory(addressesProvider.getDEX(0)); } function getFNFTHandler() internal view returns (IFNFTHandler) { return IFNFTHandler(addressesProvider.getRevestFNFT()); } function getRewardsHandler() internal view returns (IRewardsHandler) { return IRewardsHandler(addressesProvider.getRewardsHandler()); } }
// SPDX-License-Identifier: GNU-GPL v3.0 or later import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; pragma solidity ^0.8.0; /// @author RobAnon contract RevestSmartWallet { using SafeERC20 for IERC20; address private immutable MASTER; constructor() { MASTER = msg.sender; } modifier onlyMaster() { require(msg.sender == MASTER, 'E016'); _; } function withdraw(uint value, address token, address recipient) external onlyMaster { IERC20(token).safeTransfer(recipient, value); _cleanMemory(); } /// Credit to doublesharp for the brilliant gas-saving concept /// Self-destructing clone pattern function cleanMemory() external onlyMaster { _cleanMemory(); } function _cleanMemory() internal { selfdestruct(payable(MASTER)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface, */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return _supportsERC165Interface(account, type(IERC165).interfaceId) && !_supportsERC165Interface(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && _supportsERC165Interface(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in _interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!_supportsERC165Interface(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) { bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams); if (result.length < 32) return false; return success && abi.decode(result, (bool)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create(0, ptr, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) instance := create2(0, ptr, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { assembly { let ptr := mload(0x40) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(ptr, 0x14), shl(0x60, implementation)) mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000) mstore(add(ptr, 0x38), shl(0x60, deployer)) mstore(add(ptr, 0x4c), salt) mstore(add(ptr, 0x6c), keccak256(ptr, 0x37)) predicted := keccak256(add(ptr, 0x37), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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)); } } /** * @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.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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: balance query for the zero address"); 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 owner nor 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: transfer caller is not owner nor 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(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), 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); _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); _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(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * 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); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * 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(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); 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); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * 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); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "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 `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 _beforeTokenTransfer( 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: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "./IRevest.sol"; interface ITokenVault { function createFNFT( uint fnftId, IRevest.FNFTConfig memory fnftConfig, uint quantity, address from ) external; function withdrawToken( uint fnftId, uint quantity, address user ) external; function depositToken( uint fnftId, uint amount, uint quantity ) external; function cloneFNFTConfig(IRevest.FNFTConfig memory old) external returns (IRevest.FNFTConfig memory); function mapFNFTToToken( uint fnftId, IRevest.FNFTConfig memory fnftConfig ) external; function handleMultipleDeposits( uint fnftId, uint newFNFTId, uint amount ) external; function splitFNFT( uint fnftId, uint[] memory newFNFTIds, uint[] memory proportions, uint quantity ) external; function getFNFT(uint fnftId) external view returns (IRevest.FNFTConfig memory); function getFNFTCurrentValue(uint fnftId) external view returns (uint); function getNontransferable(uint fnftId) external view returns (bool); function getSplitsRemaining(uint fnftId) external view returns (uint); }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity ^0.8.0; import "../interfaces/IAddressRegistry.sol"; import "../interfaces/ITokenVault.sol"; import "../interfaces/ILockManager.sol"; interface IRegistryProvider { function setAddressRegistry(address revest) external; function getAddressRegistry() external view returns (address); }
// 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: GNU-GPL v3.0 or later pragma solidity >=0.8.0; /** * @title Provider interface for Revest FNFTs * @dev * */ interface IAddressRegistry { function initialize( address lock_manager_, address liquidity_, address revest_token_, address token_vault_, address revest_, address fnft_, address metadata_, address admin_, address rewards_ ) external; function getAdmin() external view returns (address); function setAdmin(address admin) external; function getLockManager() external view returns (address); function setLockManager(address manager) external; function getTokenVault() external view returns (address); function setTokenVault(address vault) external; function getRevestFNFT() external view returns (address); function setRevestFNFT(address fnft) external; function getMetadataHandler() external view returns (address); function setMetadataHandler(address metadata) external; function getRevest() external view returns (address); function setRevest(address revest) external; function getDEX(uint index) external view returns (address); function setDex(address dex) external; function getRevestToken() external view returns (address); function setRevestToken(address token) external; function getRewardsHandler() external view returns(address); function setRewardsHandler(address esc) external; function getAddress(bytes32 id) external view returns (address); function getLPs() external view returns (address); function setLPs(address liquidToken) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "./IAddressRegistry.sol"; /** * @title Provider interface for Revest FNFTs * @dev * */ interface IAddressRegistryV2 is IAddressRegistry { function initialize_with_legacy( address lock_manager_, address liquidity_, address revest_token_, address token_vault_, address legacy_vault_, address revest_, address fnft_, address metadata_, address admin_, address rewards_ ) external; function getLegacyTokenVault() external view returns (address legacy); function setLegacyTokenVault(address legacyVault) external; function breakGlass() external; function pauseToken() external; function unpauseToken() external; function modifyPauser(address pauser, bool grant) external; function modifyBreaker(address breaker, bool grant) external; }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; interface IRewardsHandler { struct UserBalance { uint allocPoint; // Allocation points uint lastMul; } function receiveFee(address token, uint amount) external; function updateLPShares(uint fnftId, uint newShares) external; function updateBasicShares(uint fnftId, uint newShares) external; function getAllocPoint(uint fnftId, address token, bool isBasic) external view returns (uint); function claimRewards(uint fnftId, address caller) external returns (uint); function setStakingContract(address stake) external; function getRewards(uint fnftId, address token) external view returns (uint); }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IRevestToken is IERC20 { }
// SPDX-License-Identifier: GNU-GPL v3.0 or later pragma solidity >=0.8.0; interface IFNFTHandler { function mint(address account, uint id, uint amount, bytes memory data) external; function mintBatchRec(address[] memory recipients, uint[] memory quantities, uint id, uint newSupply, bytes memory data) external; function mintBatch(address to, uint[] memory ids, uint[] memory amounts, bytes memory data) external; function setURI(string memory newuri) external; function burn(address account, uint id, uint amount) external; function burnBatch(address account, uint[] memory ids, uint[] memory amounts) external; function getBalance(address tokenHolder, uint id) external view returns (uint); function getSupply(uint fnftId) external view returns (uint); function getNextId() external view returns (uint); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// 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.5.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 functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 be 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/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 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; } }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 10000 }, "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":"provider","type":"address"},{"internalType":"address[]","name":"oldOutputs","type":"address[]"},{"internalType":"address[]","name":"newOutputs","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"}],"name":"CreateFNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"smartWallet","type":"address"}],"name":"DepositERC20","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":"uint256","name":"fnftId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"}],"name":"RedeemFNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"smartWallet","type":"address"}],"name":"WithdrawERC20","type":"event"},{"inputs":[],"name":"FNFT_CUTOFF","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OUTPUT_RECEIVER_INTERFACE_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TEMPLATE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"pipeToContract","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"depositMul","type":"uint256"},{"internalType":"uint256","name":"split","type":"uint256"},{"internalType":"uint256","name":"depositStopTime","type":"uint256"},{"internalType":"bool","name":"maturityExtension","type":"bool"},{"internalType":"bool","name":"isMulti","type":"bool"},{"internalType":"bool","name":"nontransferrable","type":"bool"}],"internalType":"struct IRevest.FNFTConfig","name":"old","type":"tuple"}],"name":"cloneFNFTConfig","outputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"pipeToContract","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"depositMul","type":"uint256"},{"internalType":"uint256","name":"split","type":"uint256"},{"internalType":"uint256","name":"depositStopTime","type":"uint256"},{"internalType":"bool","name":"maturityExtension","type":"bool"},{"internalType":"bool","name":"isMulti","type":"bool"},{"internalType":"bool","name":"nontransferrable","type":"bool"}],"internalType":"struct IRevest.FNFTConfig","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"pipeToContract","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"depositMul","type":"uint256"},{"internalType":"uint256","name":"split","type":"uint256"},{"internalType":"uint256","name":"depositStopTime","type":"uint256"},{"internalType":"bool","name":"maturityExtension","type":"bool"},{"internalType":"bool","name":"isMulti","type":"bool"},{"internalType":"bool","name":"nontransferrable","type":"bool"}],"internalType":"struct IRevest.FNFTConfig","name":"fnftConfig","type":"tuple"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"from","type":"address"}],"name":"createFNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"transferAmount","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getFNFT","outputs":[{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"pipeToContract","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"depositMul","type":"uint256"},{"internalType":"uint256","name":"split","type":"uint256"},{"internalType":"uint256","name":"depositStopTime","type":"uint256"},{"internalType":"bool","name":"maturityExtension","type":"bool"},{"internalType":"bool","name":"isMulti","type":"bool"},{"internalType":"bool","name":"nontransferrable","type":"bool"}],"internalType":"struct IRevest.FNFTConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getFNFTAddress","outputs":[{"internalType":"address","name":"smartWallet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getFNFTCurrentValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getNontransferable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getSplitsRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"handleMultipleDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"pipeToContract","type":"address"},{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"depositMul","type":"uint256"},{"internalType":"uint256","name":"split","type":"uint256"},{"internalType":"uint256","name":"depositStopTime","type":"uint256"},{"internalType":"bool","name":"maturityExtension","type":"bool"},{"internalType":"bool","name":"isMulti","type":"bool"},{"internalType":"bool","name":"nontransferrable","type":"bool"}],"internalType":"struct IRevest.FNFTConfig","name":"fnftConfig","type":"tuple"}],"name":"mapFNFTToToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"migrations","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recordAdditionalDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"}],"name":"setAddressRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256[]","name":"newFNFTIds","type":"uint256[]"},{"internalType":"uint256[]","name":"proportions","type":"uint256[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"splitFNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162003cb838038062003cb88339810160408190526200003491620003a1565b826200004033620001dd565b600180546001600160a01b0319166001600160a01b03929092169190911790556040516000906200007190620002b3565b604051809103906000f0801580156200008e573d6000803e3d6000fd5b506001600160a01b03811660805290506001620000aa6200022d565b6001600160a01b031663bc9683266040518163ffffffff1660e01b815260040160206040518083038186803b158015620000e357600080fd5b505afa158015620000f8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011e91906200041e565b6200012a91906200044e565b60a05260005b8351811015620001d2578281815181106200014f576200014f62000468565b60200260200101516003600086848151811062000170576200017062000468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508080620001c9906200047e565b91505062000130565b5050505050620004c1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60015460408051636acf14b760e11b815290516000926001600160a01b03169163d59e296e916004808301926020929190829003018186803b1580156200027357600080fd5b505afa15801562000288573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002ae91906200049c565b905090565b6106f980620035bf83390190565b80516001600160a01b0381168114620002d957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200030657600080fd5b815160206001600160401b0380831115620003255762000325620002de565b8260051b604051601f19603f830116810181811084821117156200034d576200034d620002de565b6040529384528581018301938381019250878511156200036c57600080fd5b83870191505b8482101562000396576200038682620002c1565b8352918301919083019062000372565b979650505050505050565b600080600060608486031215620003b757600080fd5b620003c284620002c1565b60208501519093506001600160401b0380821115620003e057600080fd5b620003ee87838801620002f4565b935060408601519150808211156200040557600080fd5b506200041486828701620002f4565b9150509250925092565b6000602082840312156200043157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101562000463576200046362000438565b500390565b634e487b7160e01b600052603260045260246000fd5b600060001982141562000495576200049562000438565b5060010190565b600060208284031215620004af57600080fd5b620004ba82620002c1565b9392505050565b60805160a0516130ae62000511600039600081816101810152818161053201528181611014015281816114450152611bdb0152600081816103c801528181610b3701526118d701526130ae6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c8063715018a6116100d8578063a3606b901161008c578063f5e574a511610066578063f5e574a514610437578063f636d9df1461045a578063fbe429211461046d57600080fd5b8063a3606b9014610304578063e71004f7146103fb578063f2fde38b1461042457600080fd5b806388305548116100bd578063883055481461036b5780638bfd9174146103c35780638da5cb5b146103ea57600080fd5b8063715018a6146103505780638717293d1461035857600080fd5b80633536cb6f1161012f5780633c8b3b62116101145780633c8b3b6214610317578063522f9b371461032a5780635d61210d1461033d57600080fd5b80633536cb6f146102d9578063375d59ba1461030457600080fd5b806314f487fa1161016057806314f487fa1461029e57806327c7812c146102b15780633398498d146102c657600080fd5b806307d6315e1461017c5780630bb007b8146101b6575b600080fd5b6101a37f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6102916101c4366004612b0b565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915260405180610120016040528083600001516001600160a01b0316815260200183602001516001600160a01b031681526020018360400151815260200183606001518152602001836080015181526020018360a0015181526020018360c00151151581526020018360e001511515815260200183610100015115158152509050919050565b6040516101ad9190612b9e565b6101a36102ac366004612bad565b610480565b6102c46102bf366004612bc6565b610495565b005b6101a36102d4366004612bad565b61052e565b6102ec6102e7366004612bad565b610b30565b6040516001600160a01b0390911681526020016101ad565b6102c4610312366004612be3565b610b84565b6102c4610325366004612c0f565b610cc0565b610291610338366004612bad565b610fc9565b6102c461034b366004612c3d565b6111ea565b6102c4611d49565b6102c4610366366004612c76565b611daf565b6103927fd1a3af5a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101ad565b6102ec7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03166102ec565b6102ec610409366004612bc6565b6003602052600090815260409020546001600160a01b031681565b6102c4610432366004612bc6565b611fb0565b61044a610445366004612bad565b612092565b60405190151581526020016101ad565b6102c4610468366004612cc2565b6120a8565b6102c461047b366004612da5565b61224d565b600061048b82610fc9565b6080015192915050565b6000546001600160a01b031633146104f45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60007f000000000000000000000000000000000000000000000000000000000000000082116108d757600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b1580156105b557600080fd5b505afa1580156105c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ed9190612e25565b6040517f522f9b37000000000000000000000000000000000000000000000000000000008152600481018590529091506000906001600160a01b0383169063522f9b37906024016101206040518083038186803b15801561064d57600080fd5b505afa158015610661573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106859190612e4d565b60208101519091506001600160a01b0316158015906106d7575060208101516106d7906001600160a01b03167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b1561083b576020808201516001600160a01b039081166000908152600390925260409091205416801580159061073b575061073b6001600160a01b0382167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b156107db576040517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018690526001600160a01b03821690630ff4c916906024015b60206040518083038186803b15801561079a57600080fd5b505afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190612ee7565b95945050505050565b6001600160a01b0381166108355760208201516040517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0390911690630ff4c91690602401610782565b506108d4565b6040517f3398498d000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03831690633398498d9060240160206040518083038186803b15801561089457600080fd5b505afa1580156108a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cc9190612ee7565b949350505050565b50505b60008281526002602052604090206001015461091c906001600160a01b03167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b156109cc57600082815260026020526040908190206001015490517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0390911690630ff4c9169060240160206040518083038186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c69190612ee7565b92915050565b6000828152600260205260408120546001600160a01b03168015610b295760006109f585610b30565b90506000610a016123a6565b6001600160a01b031663f77ee79d876040518263ffffffff1660e01b8152600401610a2e91815260200190565b60206040518083038186803b158015610a4657600080fd5b505afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190612ee7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015291925082918516906370a082319060240160206040518083038186803b158015610add57600080fd5b505afa158015610af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b159190612ee7565b610b1f9190612f2f565b9695505050505050565b5092915050565b60006109c67f000000000000000000000000000000000000000000000000000000000000000083604051602001610b6991815260200190565b60405160208183030381529060405280519060200120612441565b33610bd35760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2157600080fd5b505afa158015610c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c599190612e25565b6001600160a01b0316336001600160a01b031614610cbb5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b505050565b33610d0f5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612e25565b6001600160a01b0316336001600160a01b031614610df75760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b8051600083815260026020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909216919091179055608081015115610e5e5760808101516000838152600260205260409020600401555b8060c0015115610eac5760c0810151600083815260026020526040902060060180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790555b60208101516001600160a01b031615610f0d5760208181015160008481526002909252604090912060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039092169190911790555b8060e0015115610f6e5760e08101516000838152600260205260409020600681018054921515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff9093169290921790915560a08201516005909101555b80610100015115610fc5576101008101516000838152600260205260409020600601805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff9092169190911790555b5050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091527f0000000000000000000000000000000000000000000000000000000000000000821161115457600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612e25565b6001600160a01b031663522f9b37846040518263ffffffff1660e01b81526004016110fc91815260200190565b6101206040518083038186803b15801561111557600080fd5b505afa158015611129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114d9190612e4d565b9392505050565b5060009081526002602081815260409283902083516101208101855281546001600160a01b0390811682526001830154169281019290925291820154928101929092526003810154606083015260048101546080830152600581015460a08301526006015460ff808216151560c08401526101008083048216151560e0850152620100009092041615159082015290565b919050565b336112395760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b15801561128757600080fd5b505afa15801561129b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bf9190612e25565b6001600160a01b0316336001600160a01b0316146113215760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b600083815260026020818152604080842081516101208101835281546001600160a01b03908116808352600184015490911694820185905294820154928101929092526003810154606083015260048101546080830152600581015460a08301526006015460ff808216151560c08401526101008083048216151560e085015262010000909204161515908201529280866113ba6123a6565b6001600160a01b031663f77ee79d8a6040518263ffffffff1660e01b81526004016113e791815260200190565b60206040518083038186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114379190612ee7565b6114419190612f6a565b90507f0000000000000000000000000000000000000000000000000000000000000000881161188257600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b1580156114c857600080fd5b505afa1580156114dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115009190612e25565b6040517f522f9b37000000000000000000000000000000000000000000000000000000008152600481018b90529091506001600160a01b0382169063522f9b37906024016101206040518083038186803b15801561155d57600080fd5b505afa158015611571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115959190612e4d565b95508560400151886115a79190612f82565b865160208801519096509093506001600160a01b03161561168757602086018051309091526040517f3c8b3b620000000000000000000000000000000000000000000000000000000081529094506001600160a01b03821690633c8b3b6290611616908c908a90600401612fbf565b600060405180830381600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b505050506001600160a01b038481166000908152600360205260409020541615611687576001600160a01b03938416600090815260036020526040902054909316925b6040517f5d61210d000000000000000000000000000000000000000000000000000000008152600481018a9052602481018990526001600160a01b038881166044830152821690635d61210d90606401600060405180830381600087803b1580156116f157600080fd5b505af1158015611705573d6000803e3d6000fd5b505050506001600160a01b0384161580159061172957506117268883612fd4565b15155b156117b1576001600160a01b0380851660208801526040517f3c8b3b6200000000000000000000000000000000000000000000000000000000815290821690633c8b3b629061177e908c908a90600401612fbf565b600060405180830381600087803b15801561179857600080fd5b505af11580156117ac573d6000803e3d6000fd5b505050505b6001600160a01b038416158015906117d157506001600160a01b03851615155b1561187c576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038616906370a082319060240160206040518083038186803b15801561182e57600080fd5b505afa158015611842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118669190612ee7565b925061187c6001600160a01b03861685856124bd565b50611af1565b6001600160a01b0383811660009081526003602052604090205416156118c1576001600160a01b03928316600090815260036020526040902054909216915b6001600160a01b03841615611af15760006119247f00000000000000000000000000000000000000000000000000000000000000008a60405160200161190991815260200190565b6040516020818303038152906040528051906020012061253d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03808316600483015291925082918491908816906370a082319060240160206040518083038186803b15801561198657600080fd5b505afa15801561199a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119be9190612ee7565b6119c8908b612f82565b6119d29190612f2f565b93506001600160a01b038516611a6a576040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b038781166024830152898116604483015282169063b460af9490606401600060405180830381600087803b158015611a4d57600080fd5b505af1158015611a61573d6000803e3d6000fd5b50505050611aee565b6040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b038781166024830152868116604483015282169063b460af9490606401600060405180830381600087803b158015611ad557600080fd5b505af1158015611ae9573d6000803e3d6000fd5b505050505b50505b6001600160a01b03831615801590611b375750611b376001600160a01b0384167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b15611bc7576040517faca1c665000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b03858116602483015287811660448301526064820189905284169063aca1c66590608401600060405180830381600087803b158015611bae57600080fd5b505af1158015611bc2573d6000803e3d6000fd5b505050505b611bd18782612fd4565b158015611bfd57507f000000000000000000000000000000000000000000000000000000000000000088115b15611c8b576000888152600260208190526040822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559081018290556003810182905560048101829055600581019190915560060180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000001690555b6040516001600160a01b0387169089907f8142bc72e8f254c43eb4d4e01690e203a97742211d00cfaef8f23843c0f7baef90600090a36001600160a01b03841615801590611cd95750600082115b15611d3f5787866001600160a01b0316856001600160a01b03167fe2aed53c60ca1b4b11f08e22fe85134c82fb7a2165394b247bc98ab3ea3f619285611d1e8d610b30565b604080519283526001600160a01b0390911660208301520160405180910390a45b5050505050505050565b6000546001600160a01b03163314611da35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b611dad60006125f4565b565b33611dfe5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015611e4c57600080fd5b505afa158015611e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e849190612e25565b6001600160a01b0316336001600160a01b031614611ee65760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b611ef08484610cc0565b82516001600160a01b031615611f745783816001600160a01b031684600001516001600160a01b03167f122f95a022f1fb253b84039659a0fadbfb848c5cb38b40961b8de884732b62c5858760400151611f4a9190612f82565b611f5389610b30565b604080519283526001600160a01b0390911660208301520160405180910390a45b6040516001600160a01b0382169085907f512281c968b768e228fd73dc6932ab364adbcc6bcab206b3ef2b99be43b2e9a390600090a350505050565b6000546001600160a01b0316331461200a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b6001600160a01b0381166120865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104eb565b61208f816125f4565b50565b600061209d82610fc9565b610100015192915050565b336120f75760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b15801561214557600080fd5b505afa158015612159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217d9190612e25565b6001600160a01b0316336001600160a01b0316146121df5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b60008281526002602052604090205482906001600160a01b0380861691167f122f95a022f1fb253b84039659a0fadbfb848c5cb38b40961b8de884732b62c58461222885610b30565b604080519283526001600160a01b0390911660208301520160405180910390a4505050565b3361229c5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b1580156122ea57600080fd5b505afa1580156122fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123229190612e25565b6001600160a01b0316336001600160a01b0316146123845760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b50505050565b60006123958361265c565b801561114d575061114d83836126c0565b600154604080517fd59e296e00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163d59e296e916004808301926020929190829003018186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243c9190612e25565b905090565b600061114d8383306040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000008152606093841b60148201527f5af43d82803e903d91602b57fd5bf3ff000000000000000000000000000000006028820152921b6038830152604c8201526037808220606c830152605591012090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610cbb9084906127e5565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f59150506001600160a01b0381166109c65760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016104eb565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612688827f01ffc9a7000000000000000000000000000000000000000000000000000000006126c0565b80156109c657506126b9827fffffffff000000000000000000000000000000000000000000000000000000006126c0565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052905160009190829081906001600160a01b038716906175309061276d908690613017565b6000604051808303818686fa925050503d80600081146127a9576040519150601f19603f3d011682016040523d82523d6000602084013e6127ae565b606091505b50915091506020815110156127c957600093505050506109c6565b818015610b1f575080806020019051810190610b1f9190613033565b600061283a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128ca9092919063ffffffff16565b805190915015610cbb57808060200190518101906128589190613033565b610cbb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104eb565b60606108cc8484600085856001600160a01b0385163b61292c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104eb565b600080866001600160a01b031685876040516129489190613017565b60006040518083038185875af1925050503d8060008114612985576040519150601f19603f3d011682016040523d82523d6000602084013e61298a565b606091505b509150915061299a8282866129a5565b979650505050505050565b606083156129b457508161114d565b8251156129c45782518084602001fd5b8160405162461bcd60e51b81526004016104eb9190613050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715612a3157612a316129de565b60405290565b6001600160a01b038116811461208f57600080fd5b80356111e581612a37565b801515811461208f57600080fd5b80356111e581612a57565b60006101208284031215612a8357600080fd5b612a8b612a0d565b9050612a9682612a4c565b8152612aa460208301612a4c565b602082015260408201356040820152606082013560608201526080820135608082015260a082013560a0820152612add60c08301612a65565b60c0820152612aee60e08301612a65565b60e0820152610100612b01818401612a65565b9082015292915050565b60006101208284031215612b1e57600080fd5b61114d8383612a70565b6001600160a01b038082511683528060208301511660208401525060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c0810151151560c083015260e0810151612b8a60e084018215159052565b506101008181015180151584830152612384565b61012081016109c68284612b28565b600060208284031215612bbf57600080fd5b5035919050565b600060208284031215612bd857600080fd5b813561114d81612a37565b600080600060608486031215612bf857600080fd5b505081359360208301359350604090920135919050565b6000806101408385031215612c2357600080fd5b82359150612c348460208501612a70565b90509250929050565b600080600060608486031215612c5257600080fd5b83359250602084013591506040840135612c6b81612a37565b809150509250925092565b6000806000806101808587031215612c8d57600080fd5b84359350612c9e8660208701612a70565b92506101408501359150610160850135612cb781612a37565b939692955090935050565b600080600060608486031215612cd757600080fd5b8335612ce281612a37565b95602085013595506040909401359392505050565b600082601f830112612d0857600080fd5b8135602067ffffffffffffffff80831115612d2557612d256129de565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108482111715612d6857612d686129de565b604052938452858101830193838101925087851115612d8657600080fd5b83870191505b8482101561299a57813583529183019190830190612d8c565b60008060008060808587031215612dbb57600080fd5b84359350602085013567ffffffffffffffff80821115612dda57600080fd5b612de688838901612cf7565b94506040870135915080821115612dfc57600080fd5b50612e0987828801612cf7565b949793965093946060013593505050565b80516111e581612a37565b600060208284031215612e3757600080fd5b815161114d81612a37565b80516111e581612a57565b60006101208284031215612e6057600080fd5b612e68612a0d565b612e7183612e1a565b8152612e7f60208401612e1a565b602082015260408301516040820152606083015160608201526080830151608082015260a083015160a0820152612eb860c08401612e42565b60c0820152612ec960e08401612e42565b60e0820152610100612edc818501612e42565b908201529392505050565b600060208284031215612ef957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082612f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008219821115612f7d57612f7d612f00565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fba57612fba612f00565b500290565b828152610140810161114d6020830184612b28565b600082821015612fe657612fe6612f00565b500390565b60005b83811015613006578181015183820152602001612fee565b838111156123845750506000910152565b60008251613029818460208701612feb565b9190910192915050565b60006020828403121561304557600080fd5b815161114d81612a57565b602081526000825180602084015261306f816040850160208701612feb565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c6343000809000a60a060405234801561001057600080fd5b50336080526080516106bc61003d6000396000818160700152818161012401526101dd01526106bc6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80633ff5b85f1461003b578063b460af9414610045575b600080fd5b610043610058565b005b6100436100533660046105b4565b61010c565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f99060208082526004908201527f4530313600000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390fd5b61010a6101db565b565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f99060208082526004908201527f4530313600000000000000000000000000000000000000000000000000000000604082015260600190565b6101ce73ffffffffffffffffffffffffffffffffffffffff83168285610214565b6101d66101db565b505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16ff5b6040805173ffffffffffffffffffffffffffffffffffffffff848116602483015260448083018590528351808403909101815260649092018352602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526101d6928692916000916102df918516908490610389565b8051909150156101d657808060200190518101906102fd91906105f0565b6101d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016100f9565b606061039884846000856103a2565b90505b9392505050565b606082471015610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016100f9565b73ffffffffffffffffffffffffffffffffffffffff85163b6104b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100f9565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104db9190610642565b60006040518083038185875af1925050503d8060008114610518576040519150601f19603f3d011682016040523d82523d6000602084013e61051d565b606091505b509150915061052d828286610538565b979650505050505050565b6060831561054757508161039b565b8251156105575782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f9919061065e565b803573ffffffffffffffffffffffffffffffffffffffff811681146105af57600080fd5b919050565b6000806000606084860312156105c957600080fd5b833592506105d96020850161058b565b91506105e76040850161058b565b90509250925092565b60006020828403121561060257600080fd5b8151801515811461039b57600080fd5b60005b8381101561062d578181015183820152602001610615565b8381111561063c576000848401525b50505050565b60008251610654818460208701610612565b9190910192915050565b602081526000825180602084015261067d816040850160208701610612565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c6343000809000a000000000000000000000000d721a90dd7e010c8c5e022cc0100c55ac78e0fc4000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000bcbb435cf6f664caa5222c3ee01d1a377f12c428000000000000000000000000a002dc3e3c163732f4f5e6f941c87b61b5afca74000000000000000000000000fdc8fb38727650c76c47630f0941099f79870e2c000000000000000000000000000000000000000000000000000000000000000300000000000000000000000086169239aeeedefb9a571c952b809f2681c0e20900000000000000000000000086169239aeeedefb9a571c952b809f2681c0e209000000000000000000000000d76f585b6b94202430875ae748ff8c038dc64111
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101775760003560e01c8063715018a6116100d8578063a3606b901161008c578063f5e574a511610066578063f5e574a514610437578063f636d9df1461045a578063fbe429211461046d57600080fd5b8063a3606b9014610304578063e71004f7146103fb578063f2fde38b1461042457600080fd5b806388305548116100bd578063883055481461036b5780638bfd9174146103c35780638da5cb5b146103ea57600080fd5b8063715018a6146103505780638717293d1461035857600080fd5b80633536cb6f1161012f5780633c8b3b62116101145780633c8b3b6214610317578063522f9b371461032a5780635d61210d1461033d57600080fd5b80633536cb6f146102d9578063375d59ba1461030457600080fd5b806314f487fa1161016057806314f487fa1461029e57806327c7812c146102b15780633398498d146102c657600080fd5b806307d6315e1461017c5780630bb007b8146101b6575b600080fd5b6101a37f000000000000000000000000000000000000000000000000000000000000044181565b6040519081526020015b60405180910390f35b6102916101c4366004612b0b565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081019190915260405180610120016040528083600001516001600160a01b0316815260200183602001516001600160a01b031681526020018360400151815260200183606001518152602001836080015181526020018360a0015181526020018360c00151151581526020018360e001511515815260200183610100015115158152509050919050565b6040516101ad9190612b9e565b6101a36102ac366004612bad565b610480565b6102c46102bf366004612bc6565b610495565b005b6101a36102d4366004612bad565b61052e565b6102ec6102e7366004612bad565b610b30565b6040516001600160a01b0390911681526020016101ad565b6102c4610312366004612be3565b610b84565b6102c4610325366004612c0f565b610cc0565b610291610338366004612bad565b610fc9565b6102c461034b366004612c3d565b6111ea565b6102c4611d49565b6102c4610366366004612c76565b611daf565b6103927fd1a3af5a0000000000000000000000000000000000000000000000000000000081565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101ad565b6102ec7f000000000000000000000000f48aa3d22ee68e4adc612fd84ebd70ca4390d82e81565b6000546001600160a01b03166102ec565b6102ec610409366004612bc6565b6003602052600090815260409020546001600160a01b031681565b6102c4610432366004612bc6565b611fb0565b61044a610445366004612bad565b612092565b60405190151581526020016101ad565b6102c4610468366004612cc2565b6120a8565b6102c461047b366004612da5565b61224d565b600061048b82610fc9565b6080015192915050565b6000546001600160a01b031633146104f45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60007f000000000000000000000000000000000000000000000000000000000000044182116108d757600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b1580156105b557600080fd5b505afa1580156105c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ed9190612e25565b6040517f522f9b37000000000000000000000000000000000000000000000000000000008152600481018590529091506000906001600160a01b0383169063522f9b37906024016101206040518083038186803b15801561064d57600080fd5b505afa158015610661573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106859190612e4d565b60208101519091506001600160a01b0316158015906106d7575060208101516106d7906001600160a01b03167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b1561083b576020808201516001600160a01b039081166000908152600390925260409091205416801580159061073b575061073b6001600160a01b0382167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b156107db576040517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018690526001600160a01b03821690630ff4c916906024015b60206040518083038186803b15801561079a57600080fd5b505afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190612ee7565b95945050505050565b6001600160a01b0381166108355760208201516040517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0390911690630ff4c91690602401610782565b506108d4565b6040517f3398498d000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03831690633398498d9060240160206040518083038186803b15801561089457600080fd5b505afa1580156108a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108cc9190612ee7565b949350505050565b50505b60008281526002602052604090206001015461091c906001600160a01b03167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b156109cc57600082815260026020526040908190206001015490517f0ff4c916000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0390911690630ff4c9169060240160206040518083038186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c69190612ee7565b92915050565b6000828152600260205260408120546001600160a01b03168015610b295760006109f585610b30565b90506000610a016123a6565b6001600160a01b031663f77ee79d876040518263ffffffff1660e01b8152600401610a2e91815260200190565b60206040518083038186803b158015610a4657600080fd5b505afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190612ee7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015291925082918516906370a082319060240160206040518083038186803b158015610add57600080fd5b505afa158015610af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b159190612ee7565b610b1f9190612f2f565b9695505050505050565b5092915050565b60006109c67f000000000000000000000000f48aa3d22ee68e4adc612fd84ebd70ca4390d82e83604051602001610b6991815260200190565b60405160208183030381529060405280519060200120612441565b33610bd35760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2157600080fd5b505afa158015610c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c599190612e25565b6001600160a01b0316336001600160a01b031614610cbb5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b505050565b33610d0f5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190612e25565b6001600160a01b0316336001600160a01b031614610df75760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b8051600083815260026020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03909216919091179055608081015115610e5e5760808101516000838152600260205260409020600401555b8060c0015115610eac5760c0810151600083815260026020526040902060060180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790555b60208101516001600160a01b031615610f0d5760208181015160008481526002909252604090912060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b039092169190911790555b8060e0015115610f6e5760e08101516000838152600260205260409020600681018054921515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff9093169290921790915560a08201516005909101555b80610100015115610fc5576101008101516000838152600260205260409020600601805491151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff9092169190911790555b5050565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091527f0000000000000000000000000000000000000000000000000000000000000441821161115457600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b15801561109757600080fd5b505afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612e25565b6001600160a01b031663522f9b37846040518263ffffffff1660e01b81526004016110fc91815260200190565b6101206040518083038186803b15801561111557600080fd5b505afa158015611129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114d9190612e4d565b9392505050565b5060009081526002602081815260409283902083516101208101855281546001600160a01b0390811682526001830154169281019290925291820154928101929092526003810154606083015260048101546080830152600581015460a08301526006015460ff808216151560c08401526101008083048216151560e0850152620100009092041615159082015290565b919050565b336112395760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b15801561128757600080fd5b505afa15801561129b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bf9190612e25565b6001600160a01b0316336001600160a01b0316146113215760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b600083815260026020818152604080842081516101208101835281546001600160a01b03908116808352600184015490911694820185905294820154928101929092526003810154606083015260048101546080830152600581015460a08301526006015460ff808216151560c08401526101008083048216151560e085015262010000909204161515908201529280866113ba6123a6565b6001600160a01b031663f77ee79d8a6040518263ffffffff1660e01b81526004016113e791815260200190565b60206040518083038186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114379190612ee7565b6114419190612f6a565b90507f0000000000000000000000000000000000000000000000000000000000000441881161188257600154604080517f5782996300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b0316916357829963916004808301926020929190829003018186803b1580156114c857600080fd5b505afa1580156114dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115009190612e25565b6040517f522f9b37000000000000000000000000000000000000000000000000000000008152600481018b90529091506001600160a01b0382169063522f9b37906024016101206040518083038186803b15801561155d57600080fd5b505afa158015611571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115959190612e4d565b95508560400151886115a79190612f82565b865160208801519096509093506001600160a01b03161561168757602086018051309091526040517f3c8b3b620000000000000000000000000000000000000000000000000000000081529094506001600160a01b03821690633c8b3b6290611616908c908a90600401612fbf565b600060405180830381600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b505050506001600160a01b038481166000908152600360205260409020541615611687576001600160a01b03938416600090815260036020526040902054909316925b6040517f5d61210d000000000000000000000000000000000000000000000000000000008152600481018a9052602481018990526001600160a01b038881166044830152821690635d61210d90606401600060405180830381600087803b1580156116f157600080fd5b505af1158015611705573d6000803e3d6000fd5b505050506001600160a01b0384161580159061172957506117268883612fd4565b15155b156117b1576001600160a01b0380851660208801526040517f3c8b3b6200000000000000000000000000000000000000000000000000000000815290821690633c8b3b629061177e908c908a90600401612fbf565b600060405180830381600087803b15801561179857600080fd5b505af11580156117ac573d6000803e3d6000fd5b505050505b6001600160a01b038416158015906117d157506001600160a01b03851615155b1561187c576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038616906370a082319060240160206040518083038186803b15801561182e57600080fd5b505afa158015611842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118669190612ee7565b925061187c6001600160a01b03861685856124bd565b50611af1565b6001600160a01b0383811660009081526003602052604090205416156118c1576001600160a01b03928316600090815260036020526040902054909216915b6001600160a01b03841615611af15760006119247f000000000000000000000000f48aa3d22ee68e4adc612fd84ebd70ca4390d82e8a60405160200161190991815260200190565b6040516020818303038152906040528051906020012061253d565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b03808316600483015291925082918491908816906370a082319060240160206040518083038186803b15801561198657600080fd5b505afa15801561199a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119be9190612ee7565b6119c8908b612f82565b6119d29190612f2f565b93506001600160a01b038516611a6a576040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b038781166024830152898116604483015282169063b460af9490606401600060405180830381600087803b158015611a4d57600080fd5b505af1158015611a61573d6000803e3d6000fd5b50505050611aee565b6040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b038781166024830152868116604483015282169063b460af9490606401600060405180830381600087803b158015611ad557600080fd5b505af1158015611ae9573d6000803e3d6000fd5b505050505b50505b6001600160a01b03831615801590611b375750611b376001600160a01b0384167fd1a3af5a0000000000000000000000000000000000000000000000000000000061238a565b15611bc7576040517faca1c665000000000000000000000000000000000000000000000000000000008152600481018990526001600160a01b03858116602483015287811660448301526064820189905284169063aca1c66590608401600060405180830381600087803b158015611bae57600080fd5b505af1158015611bc2573d6000803e3d6000fd5b505050505b611bd18782612fd4565b158015611bfd57507f000000000000000000000000000000000000000000000000000000000000044188115b15611c8b576000888152600260208190526040822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116825560018201805490911690559081018290556003810182905560048101829055600581019190915560060180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000001690555b6040516001600160a01b0387169089907f8142bc72e8f254c43eb4d4e01690e203a97742211d00cfaef8f23843c0f7baef90600090a36001600160a01b03841615801590611cd95750600082115b15611d3f5787866001600160a01b0316856001600160a01b03167fe2aed53c60ca1b4b11f08e22fe85134c82fb7a2165394b247bc98ab3ea3f619285611d1e8d610b30565b604080519283526001600160a01b0390911660208301520160405180910390a45b5050505050505050565b6000546001600160a01b03163314611da35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b611dad60006125f4565b565b33611dfe5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b158015611e4c57600080fd5b505afa158015611e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e849190612e25565b6001600160a01b0316336001600160a01b031614611ee65760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b611ef08484610cc0565b82516001600160a01b031615611f745783816001600160a01b031684600001516001600160a01b03167f122f95a022f1fb253b84039659a0fadbfb848c5cb38b40961b8de884732b62c5858760400151611f4a9190612f82565b611f5389610b30565b604080519283526001600160a01b0390911660208301520160405180910390a45b6040516001600160a01b0382169085907f512281c968b768e228fd73dc6932ab364adbcc6bcab206b3ef2b99be43b2e9a390600090a350505050565b6000546001600160a01b0316331461200a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104eb565b6001600160a01b0381166120865760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104eb565b61208f816125f4565b50565b600061209d82610fc9565b610100015192915050565b336120f75760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b15801561214557600080fd5b505afa158015612159573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217d9190612e25565b6001600160a01b0316336001600160a01b0316146121df5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b60008281526002602052604090205482906001600160a01b0380861691167f122f95a022f1fb253b84039659a0fadbfb848c5cb38b40961b8de884732b62c58461222885610b30565b604080519283526001600160a01b0390911660208301520160405180910390a4505050565b3361229c5760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530303400000000000000000000000000000000000000000000000000000000604082015260600190565b600160009054906101000a90046001600160a01b03166001600160a01b031663f97e7d746040518163ffffffff1660e01b815260040160206040518083038186803b1580156122ea57600080fd5b505afa1580156122fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123229190612e25565b6001600160a01b0316336001600160a01b0316146123845760405162461bcd60e51b81526004016104eb9060208082526004908201527f4530313700000000000000000000000000000000000000000000000000000000604082015260600190565b50505050565b60006123958361265c565b801561114d575061114d83836126c0565b600154604080517fd59e296e00000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163d59e296e916004808301926020929190829003018186803b15801561240457600080fd5b505afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243c9190612e25565b905090565b600061114d8383306040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000008152606093841b60148201527f5af43d82803e903d91602b57fd5bf3ff000000000000000000000000000000006028820152921b6038830152604c8201526037808220606c830152605591012090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610cbb9084906127e5565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f59150506001600160a01b0381166109c65760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016104eb565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000612688827f01ffc9a7000000000000000000000000000000000000000000000000000000006126c0565b80156109c657506126b9827fffffffff000000000000000000000000000000000000000000000000000000006126c0565b1592915050565b604080517fffffffff00000000000000000000000000000000000000000000000000000000831660248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000179052905160009190829081906001600160a01b038716906175309061276d908690613017565b6000604051808303818686fa925050503d80600081146127a9576040519150601f19603f3d011682016040523d82523d6000602084013e6127ae565b606091505b50915091506020815110156127c957600093505050506109c6565b818015610b1f575080806020019051810190610b1f9190613033565b600061283a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128ca9092919063ffffffff16565b805190915015610cbb57808060200190518101906128589190613033565b610cbb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104eb565b60606108cc8484600085856001600160a01b0385163b61292c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104eb565b600080866001600160a01b031685876040516129489190613017565b60006040518083038185875af1925050503d8060008114612985576040519150601f19603f3d011682016040523d82523d6000602084013e61298a565b606091505b509150915061299a8282866129a5565b979650505050505050565b606083156129b457508161114d565b8251156129c45782518084602001fd5b8160405162461bcd60e51b81526004016104eb9190613050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715612a3157612a316129de565b60405290565b6001600160a01b038116811461208f57600080fd5b80356111e581612a37565b801515811461208f57600080fd5b80356111e581612a57565b60006101208284031215612a8357600080fd5b612a8b612a0d565b9050612a9682612a4c565b8152612aa460208301612a4c565b602082015260408201356040820152606082013560608201526080820135608082015260a082013560a0820152612add60c08301612a65565b60c0820152612aee60e08301612a65565b60e0820152610100612b01818401612a65565b9082015292915050565b60006101208284031215612b1e57600080fd5b61114d8383612a70565b6001600160a01b038082511683528060208301511660208401525060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c0810151151560c083015260e0810151612b8a60e084018215159052565b506101008181015180151584830152612384565b61012081016109c68284612b28565b600060208284031215612bbf57600080fd5b5035919050565b600060208284031215612bd857600080fd5b813561114d81612a37565b600080600060608486031215612bf857600080fd5b505081359360208301359350604090920135919050565b6000806101408385031215612c2357600080fd5b82359150612c348460208501612a70565b90509250929050565b600080600060608486031215612c5257600080fd5b83359250602084013591506040840135612c6b81612a37565b809150509250925092565b6000806000806101808587031215612c8d57600080fd5b84359350612c9e8660208701612a70565b92506101408501359150610160850135612cb781612a37565b939692955090935050565b600080600060608486031215612cd757600080fd5b8335612ce281612a37565b95602085013595506040909401359392505050565b600082601f830112612d0857600080fd5b8135602067ffffffffffffffff80831115612d2557612d256129de565b8260051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108482111715612d6857612d686129de565b604052938452858101830193838101925087851115612d8657600080fd5b83870191505b8482101561299a57813583529183019190830190612d8c565b60008060008060808587031215612dbb57600080fd5b84359350602085013567ffffffffffffffff80821115612dda57600080fd5b612de688838901612cf7565b94506040870135915080821115612dfc57600080fd5b50612e0987828801612cf7565b949793965093946060013593505050565b80516111e581612a37565b600060208284031215612e3757600080fd5b815161114d81612a37565b80516111e581612a57565b60006101208284031215612e6057600080fd5b612e68612a0d565b612e7183612e1a565b8152612e7f60208401612e1a565b602082015260408301516040820152606083015160608201526080830151608082015260a083015160a0820152612eb860c08401612e42565b60c0820152612ec960e08401612e42565b60e0820152610100612edc818501612e42565b908201529392505050565b600060208284031215612ef957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082612f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008219821115612f7d57612f7d612f00565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fba57612fba612f00565b500290565b828152610140810161114d6020830184612b28565b600082821015612fe657612fe6612f00565b500390565b60005b83811015613006578181015183820152602001612fee565b838111156123845750506000910152565b60008251613029818460208701612feb565b9190910192915050565b60006020828403121561304557600080fd5b815161114d81612a57565b602081526000825180602084015261306f816040850160208701612feb565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea164736f6c6343000809000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d721a90dd7e010c8c5e022cc0100c55ac78e0fc4000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000bcbb435cf6f664caa5222c3ee01d1a377f12c428000000000000000000000000a002dc3e3c163732f4f5e6f941c87b61b5afca74000000000000000000000000fdc8fb38727650c76c47630f0941099f79870e2c000000000000000000000000000000000000000000000000000000000000000300000000000000000000000086169239aeeedefb9a571c952b809f2681c0e20900000000000000000000000086169239aeeedefb9a571c952b809f2681c0e209000000000000000000000000d76f585b6b94202430875ae748ff8c038dc64111
-----Decoded View---------------
Arg [0] : provider (address): 0xD721A90dd7e010c8C5E022cc0100c55aC78E0FC4
Arg [1] : oldOutputs (address[]): 0xbCbB435cf6f664CAA5222c3Ee01d1A377F12C428,0xA002Dc3E3C163732F4F5e6F941C87b61B5Afca74,0xfDc8fb38727650c76c47630F0941099f79870E2c
Arg [2] : newOutputs (address[]): 0x86169239aeeEdefb9A571c952B809F2681c0e209,0x86169239aeeEdefb9A571c952B809F2681c0e209,0xD76F585b6B94202430875aE748fF8C038Dc64111
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 000000000000000000000000d721a90dd7e010c8c5e022cc0100c55ac78e0fc4
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [4] : 000000000000000000000000bcbb435cf6f664caa5222c3ee01d1a377f12c428
Arg [5] : 000000000000000000000000a002dc3e3c163732f4f5e6f941c87b61b5afca74
Arg [6] : 000000000000000000000000fdc8fb38727650c76c47630f0941099f79870e2c
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [8] : 00000000000000000000000086169239aeeedefb9a571c952b809f2681c0e209
Arg [9] : 00000000000000000000000086169239aeeedefb9a571c952b809f2681c0e209
Arg [10] : 000000000000000000000000d76f585b6b94202430875ae748ff8c038dc64111
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.