文件 1 的 28:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
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);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 28:Clones.sol
pragma solidity ^0.8.0;
library Clones {
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");
}
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");
}
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)
}
}
function predictDeterministicAddress(address implementation, bytes32 salt)
internal
view
returns (address predicted)
{
return predictDeterministicAddress(implementation, salt, address(this));
}
}
文件 3 的 28:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 28: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";
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
mapping(uint256 => mapping(address => uint256)) private _balances;
mapping(address => mapping(address => bool)) private _operatorApprovals;
string private _uri;
constructor(string memory uri_) {
_setURI(uri_);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
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];
}
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;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
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);
}
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);
}
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);
}
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);
}
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
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);
}
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);
}
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);
}
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);
}
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);
}
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;
}
}
文件 5 的 28:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 6 的 28:ERC165Checker.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
library ERC165Checker {
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
function supportsERC165(address account) internal view returns (bool) {
return
_supportsERC165Interface(account, type(IERC165).interfaceId) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
}
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
if (supportsERC165(account)) {
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
if (!supportsERC165(account)) {
return false;
}
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
return true;
}
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));
}
}
文件 7 的 28:IAddressRegistry.sol
pragma solidity >=0.8.0;
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;
}
文件 8 的 28:IAddressRegistryV2.sol
pragma solidity >=0.8.0;
import "./IAddressRegistry.sol";
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;
}
文件 9 的 28:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 10 的 28:IERC1155MetadataURI.sol
pragma solidity ^0.8.0;
import "../IERC1155.sol";
interface IERC1155MetadataURI is IERC1155 {
function uri(uint256 id) external view returns (string memory);
}
文件 11 的 28:IERC1155Receiver.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155Receiver is IERC165 {
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 28:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 13 的 28:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 14 的 28:IFNFTHandler.sol
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);
}
文件 15 的 28:ILockManager.sol
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);
}
文件 16 的 28:IOutputReceiver.sol
pragma solidity >=0.8.0;
import "./IRegistryProvider.sol";
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
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);
}
文件 17 的 28:IRegistryProvider.sol
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);
}
文件 18 的 28:IRevest.sol
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;
address pipeToContract;
uint depositAmount;
uint depositMul;
uint split;
uint depositStopTime;
bool maturityExtension;
bool isMulti;
bool nontransferrable;
}
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);
}
文件 19 的 28:IRevestToken.sol
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IRevestToken is IERC20 {
}
文件 20 的 28:IRewardsHandler.sol
pragma solidity >=0.8.0;
interface IRewardsHandler {
struct UserBalance {
uint allocPoint;
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);
}
文件 21 的 28:ITokenVault.sol
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);
}
文件 22 的 28:ITokenVaultV2.sol
pragma solidity >=0.8.0;
import "./ITokenVault.sol";
interface ITokenVaultV2 is ITokenVault {
event CreateFNFT(uint indexed fnftId, address indexed from);
event RedeemFNFT(uint indexed fnftId, address indexed from);
event DepositERC20(address indexed token, address indexed user, uint indexed fnftId, uint tokenAmount, address smartWallet);
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;
}
文件 23 的 28:IUniswapV2Factory.sol
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;
}
文件 24 的 28:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 25 的 28:RevestAccessControl.sol
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());
}
}
文件 26 的 28:RevestSmartWallet.sol
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
pragma solidity ^0.8.0;
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();
}
function cleanMemory() external onlyMaster {
_cleanMemory();
}
function _cleanMemory() internal {
selfdestruct(payable(MASTER));
}
}
文件 27 的 28:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
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));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 28 的 28:TokenVaultV2.sol
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";
contract TokenVaultV2 is ITokenVaultV2, Ownable, RevestAccessControl {
using ERC165Checker for address;
using SafeERC20 for IERC20;
address public immutable TEMPLATE;
uint public immutable FNFT_CUTOFF;
mapping(uint => IRevest.FNFTConfig) private fnfts;
mapping(address => address) public migrations;
uint private constant multiplierPrecision = 1 ether;
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];
}
}
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);
}
function withdrawToken(
uint fnftId,
uint quantity,
address user
) external override onlyRevestController {
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) {
address oldVault = addressesProvider.getLegacyTokenVault();
fnft = ITokenVault(oldVault).getFNFT(fnftId);
amountToWithdraw = quantity * fnft.depositAmount;
asset = fnft.asset;
if(fnft.pipeToContract != address(0)) {
pipeTo = fnft.pipeToContract;
fnft.pipeToContract = address(this);
ITokenVault(oldVault).mapFNFTToToken(fnftId, fnft);
if(migrations[pipeTo] != address(0)) {
pipeTo = migrations[pipeTo];
}
}
ITokenVault(oldVault).withdrawToken(fnftId, quantity, user);
if(pipeTo != address(0) && supplyBefore - quantity != 0) {
fnft.pipeToContract = pipeTo;
ITokenVault(oldVault).mapFNFTToToken(fnftId, fnft);
}
if(pipeTo != address(0) && asset != address(0)) {
amountToWithdraw = IERC20(asset).balanceOf(address(this));
IERC20(asset).safeTransfer(pipeTo, amountToWithdraw);
}
} else {
if(migrations[pipeTo] != address(0)) {
pipeTo = migrations[pipeTo];
}
if(asset != address(0)) {
address smartWallAdd = Clones.cloneDeterministic(TEMPLATE, keccak256(abi.encode(fnftId)));
RevestSmartWallet wallet = RevestSmartWallet(smartWallAdd);
amountToWithdraw = quantity * IERC20(asset).balanceOf(smartWallAdd) / supplyBefore;
if(pipeTo == address(0)) {
wallet.withdraw(amountToWithdraw, asset, user);
} else {
wallet.withdraw(amountToWithdraw, asset, pipeTo);
}
}
}
if(pipeTo != address(0) && pipeTo.supportsInterface(OUTPUT_RECEIVER_INTERFACE_ID)) {
IOutputReceiver(pipeTo).receiveRevestOutput(fnftId, asset, payable(user), quantity);
}
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));
}
}
function mapFNFTToToken(
uint fnftId,
IRevest.FNFTConfig memory fnftConfig
) public override onlyRevestController {
fnfts[fnftId].asset = fnftConfig.asset;
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;
}
}
function recordAdditionalDeposit(
address user,
uint fnftId,
uint tokenAmount
) external override onlyRevestController {
emit DepositERC20(fnfts[fnftId].asset, user, fnftId, tokenAmount, getFNFTAddress(fnftId));
}
function removeFNFT(uint fnftId) private {
delete fnfts[fnftId];
}
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
});
}
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)) {
return IOutputReceiver(migration).getValue((fnftId));
} else if(migration == address(0)) {
return IOutputReceiver(fnft.pipeToContract).getValue((fnftId));
}
} else {
return legacyVault.getFNFTCurrentValue(fnftId);
}
}
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);
return IERC20(asset).balanceOf(smartWallet) / supply;
}
return currentAmount;
}
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];
}
}
function getNontransferable(uint fnftId) external view override returns (bool) {
return getFNFT(fnftId).nontransferrable;
}
function getSplitsRemaining(uint fnftId) external view override returns (uint) {
return getFNFT(fnftId).split;
}
function getFNFTAddress(uint fnftId) public view override returns (address smartWallet) {
smartWallet = Clones.predictDeterministicAddress(TEMPLATE, keccak256(abi.encode(fnftId)));
}
function splitFNFT(
uint fnftId,
uint[] memory newFNFTIds,
uint[] memory proportions,
uint quantity
) external override onlyRevestController {}
function depositToken(
uint fnftId,
uint transferAmount,
uint quantity
) public override onlyRevestController {}
function handleMultipleDeposits(uint, uint, uint) external override onlyRevestController {}
}
{
"compilationTarget": {
"contracts/TokenVaultV2.sol": "TokenVaultV2"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 10000
},
"remappings": []
}
[{"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"}]