文件 1 的 27: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 的 27: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;
}
}
文件 3 的 27: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));
}
}
文件 4 的 27:IAddressLock.sol
pragma solidity >=0.8.0;
import "./IRegistryProvider.sol";
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
interface IAddressLock is IRegistryProvider, IERC165{
function createLock(uint fnftId, uint lockId, bytes memory arguments) external;
function updateLock(uint fnftId, uint lockId, bytes memory arguments) external;
function isUnlockable(uint fnftId, uint lockId) external view returns (bool);
function getDisplayValues(uint fnftId, uint lockId) external view returns (bytes memory);
function getMetadata() external view returns (string memory);
function needsUpdate() external view returns (bool);
}
文件 5 的 27: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;
}
文件 6 的 27: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;
}
文件 7 的 27:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 8 的 27: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);
}
文件 9 的 27: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);
}
文件 10 的 27: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);
}
文件 11 的 27: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);
}
文件 12 的 27:IOutputReceiverV2.sol
pragma solidity >=0.8.0;
import "./IOutputReceiver.sol";
import "./IRevest.sol";
import '@openzeppelin/contracts/utils/introspection/IERC165.sol';
interface IOutputReceiverV2 is IOutputReceiver {
function receiveSecondaryCallback(
uint fnftId,
address payable owner,
uint quantity,
IRevest.FNFTConfig memory config,
bytes memory args
) external payable;
function triggerOutputReceiverUpdate(
uint fnftId,
bytes memory args
) external;
function handleFNFTRemaps(uint fnftId, uint[] memory newFNFTIds, address caller, bool cleanup) external;
}
文件 13 的 27:IOutputReceiverV3.sol
pragma solidity >=0.8.0;
import "./IOutputReceiverV2.sol";
interface IOutputReceiverV3 is IOutputReceiverV2 {
event DepositERC20OutputReceiver(address indexed mintTo, address indexed token, uint amountTokens, uint indexed fnftId, bytes extraData);
event DepositERC721OutputReceiver(address indexed mintTo, address indexed token, uint[] tokenIds, uint indexed fnftId, bytes extraData);
event DepositERC1155OutputReceiver(address indexed mintTo, address indexed token, uint tokenId, uint amountTokens, uint indexed fnftId, bytes extraData);
event WithdrawERC20OutputReceiver(address indexed caller, address indexed token, uint amountTokens, uint indexed fnftId, bytes extraData);
event WithdrawERC721OutputReceiver(address indexed caller, address indexed token, uint[] tokenIds, uint indexed fnftId, bytes extraData);
event WithdrawERC1155OutputReceiver(address indexed caller, address indexed token, uint tokenId, uint amountTokens, uint indexed fnftId, bytes extraData);
function handleTimelockExtensions(uint fnftId, uint expiration, address caller) external;
function handleAdditionalDeposit(uint fnftId, uint amountToDeposit, uint quantity, address caller) external;
function handleSplitOperation(uint fnftId, uint[] memory proportions, uint quantity, address caller) external;
}
文件 14 的 27: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);
}
文件 15 的 27: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);
}
文件 16 的 27:IRevestToken.sol
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IRevestToken is IERC20 {
}
文件 17 的 27: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);
}
文件 18 的 27: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);
}
文件 19 的 27: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;
}
文件 20 的 27: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;
}
文件 21 的 27:IWETH.sol
pragma solidity ^0.8.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
文件 22 的 27: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);
}
}
文件 23 的 27:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 24 的 27:Revest.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import '@openzeppelin/contracts/utils/introspection/ERC165Checker.sol';
import "./interfaces/IRevest.sol";
import "./interfaces/IAddressRegistry.sol";
import "./interfaces/ILockManager.sol";
import "./interfaces/ITokenVaultV2.sol";
import "./interfaces/IRewardsHandler.sol";
import "./interfaces/IOutputReceiver.sol";
import "./interfaces/IOutputReceiverV2.sol";
import "./interfaces/IOutputReceiverV3.sol";
import "./interfaces/IAddressLock.sol";
import "./utils/RevestAccessControl.sol";
import "./utils/RevestReentrancyGuard.sol";
import "./lib/IWETH.sol";
contract RevestA4 is IRevest, RevestAccessControl, RevestReentrancyGuard {
using SafeERC20 for IERC20;
using ERC165Checker for address;
bytes4 public constant ADDRESS_LOCK_INTERFACE_ID = type(IAddressLock).interfaceId;
bytes4 public constant OUTPUT_RECEIVER_INTERFACE_V2_ID = type(IOutputReceiverV2).interfaceId;
bytes4 public constant OUTPUT_RECEIVER_INTERFACE_V3_ID = type(IOutputReceiverV3).interfaceId;
address immutable WETH;
uint public erc20Fee;
uint private constant erc20multiplierPrecision = 1000;
uint public flatWeiFee;
uint private constant MAX_INT = 2**256 - 1;
mapping(address => bool) private approved;
mapping(address => bool) public whitelisted;
constructor(
address provider,
address weth
) RevestAccessControl(provider) {
WETH = weth;
}
function mintTimeLock(
uint endTime,
address[] memory recipients,
uint[] memory quantities,
IRevest.FNFTConfig memory fnftConfig
) external payable override nonReentrant returns (uint) {
uint fnftId = getFNFTHandler().getNextId();
{
IRevest.LockParam memory timeLock;
timeLock.lockType = IRevest.LockType.TimeLock;
timeLock.timeLockExpiry = endTime;
getLockManager().createLock(fnftId, timeLock);
}
doMint(recipients, quantities, fnftId, fnftConfig, msg.value);
emit FNFTTimeLockMinted(fnftConfig.asset, _msgSender(), fnftId, endTime, quantities, fnftConfig);
return fnftId;
}
function mintValueLock(
address primaryAsset,
address compareTo,
uint unlockValue,
bool unlockRisingEdge,
address oracleDispatch,
address[] memory recipients,
uint[] memory quantities,
IRevest.FNFTConfig memory fnftConfig
) external payable override nonReentrant returns (uint) {
uint fnftId = getFNFTHandler().getNextId();
{
IRevest.LockParam memory valueLock;
valueLock.lockType = IRevest.LockType.ValueLock;
valueLock.valueLock.unlockRisingEdge = unlockRisingEdge;
valueLock.valueLock.unlockValue = unlockValue;
valueLock.valueLock.asset = primaryAsset;
valueLock.valueLock.compareTo = compareTo;
valueLock.valueLock.oracle = oracleDispatch;
getLockManager().createLock(fnftId, valueLock);
}
doMint(recipients, quantities, fnftId, fnftConfig, msg.value);
emit FNFTValueLockMinted(fnftConfig.asset, _msgSender(), fnftId, compareTo, oracleDispatch, quantities, fnftConfig);
return fnftId;
}
function mintAddressLock(
address trigger,
bytes memory arguments,
address[] memory recipients,
uint[] memory quantities,
IRevest.FNFTConfig memory fnftConfig
) external payable override nonReentrant returns (uint) {
uint fnftId = getFNFTHandler().getNextId();
{
IRevest.LockParam memory addressLock;
addressLock.addressLock = trigger;
addressLock.lockType = IRevest.LockType.AddressLock;
uint lockId = getLockManager().createLock(fnftId, addressLock);
if(trigger.supportsInterface(ADDRESS_LOCK_INTERFACE_ID)) {
IAddressLock(trigger).createLock(fnftId, lockId, arguments);
}
}
doMint(recipients, quantities, fnftId, fnftConfig, msg.value);
emit FNFTAddressLockMinted(fnftConfig.asset, _msgSender(), fnftId, trigger, quantities, fnftConfig);
return fnftId;
}
function withdrawFNFT(uint fnftId, uint quantity) external override nonReentrant {
_withdrawFNFT(fnftId, quantity);
}
function unlockFNFT(uint fnftId) external override nonReentrant {
IRevest.LockType lock = getLockManager().lockTypes(fnftId);
require(lock == IRevest.LockType.AddressLock || lock == IRevest.LockType.ValueLock, "E008");
require(getLockManager().unlockFNFT(fnftId, _msgSender()), "E056");
emit FNFTUnlocked(_msgSender(), fnftId);
}
function splitFNFT(
uint fnftId,
uint[] memory proportions,
uint quantity
) external override nonReentrant returns (uint[] memory) {
revert("TMP_BRK");
}
function extendFNFTMaturity(
uint fnftId,
uint endTime
) external override nonReentrant returns (uint) {
IFNFTHandler fnftHandler = getFNFTHandler();
uint supply = fnftHandler.getSupply(fnftId);
uint balance = fnftHandler.getBalance(_msgSender(), fnftId);
require(endTime > block.timestamp, 'E002');
require(fnftId < fnftHandler.getNextId(), "E007");
require(balance == supply , "E022");
IRevest.FNFTConfig memory config = getTokenVault().getFNFT(fnftId);
ILockManager manager = getLockManager();
require(config.maturityExtension &&
manager.lockTypes(fnftId) == IRevest.LockType.TimeLock, "E029");
require(manager.fnftIdToLock(fnftId).timeLockExpiry < endTime, "E030");
IRevest.LockParam memory lock;
lock.lockType = IRevest.LockType.TimeLock;
lock.timeLockExpiry = endTime;
manager.createLock(fnftId, lock);
if(config.pipeToContract != address(0) && config.pipeToContract.supportsInterface(OUTPUT_RECEIVER_INTERFACE_V3_ID)) {
IOutputReceiverV3(config.pipeToContract).handleTimelockExtensions(fnftId, endTime, _msgSender());
}
emit FNFTMaturityExtended(_msgSender(), fnftId, endTime);
return fnftId;
}
function depositAdditionalToFNFT(
uint fnftId,
uint amount,
uint quantity
) external override nonReentrant returns (uint) {
address vault = addressesProvider.getTokenVault();
IRevest.FNFTConfig memory fnft = ITokenVault(vault).getFNFT(fnftId);
address handler = addressesProvider.getRevestFNFT();
require(fnftId < IFNFTHandler(handler).getNextId(), "E007");
require(fnft.isMulti, "E034");
require(fnft.depositStopTime > block.timestamp || fnft.depositStopTime == 0, "E035");
require(quantity > 0, "E070");
require(fnft.depositMul == 0 || fnft.asset == address(0), 'E084');
uint supply = IFNFTHandler(handler).getSupply(fnftId);
uint deposit = quantity * amount;
require(quantity == supply, 'E083');
if(!whitelisted[_msgSender()]) {
uint totalERC20Fee = erc20Fee * deposit / erc20multiplierPrecision;
if(totalERC20Fee > 0) {
IERC20(fnft.asset).safeTransferFrom(_msgSender(), addressesProvider.getAdmin(), totalERC20Fee);
}
}
if(fnft.asset != address(0)){
address smartWallet = ITokenVaultV2(vault).getFNFTAddress(fnftId);
IERC20(fnft.asset).safeTransferFrom(_msgSender(), smartWallet, deposit);
ITokenVaultV2(vault).recordAdditionalDeposit(_msgSender(), fnftId, deposit);
}
if(fnft.pipeToContract != address(0) && fnft.pipeToContract.supportsInterface(OUTPUT_RECEIVER_INTERFACE_V3_ID)) {
IOutputReceiverV3(fnft.pipeToContract).handleAdditionalDeposit(fnftId, amount, quantity, _msgSender());
}
emit FNFTAddionalDeposited(_msgSender(), fnftId, quantity, amount);
return 0;
}
function _withdrawFNFT(uint fnftId, uint quantity) private {
address fnftHandler = addressesProvider.getRevestFNFT();
require(quantity > 0, "E003");
IFNFTHandler(fnftHandler).burn(_msgSender(), fnftId, quantity);
require(getLockManager().unlockFNFT(fnftId, _msgSender()), 'E082');
address vault = addressesProvider.getTokenVault();
ITokenVault(vault).withdrawToken(fnftId, quantity, _msgSender());
emit FNFTWithdrawn(_msgSender(), fnftId, quantity);
}
function doMint(
address[] memory recipients,
uint[] memory quantities,
uint fnftId,
IRevest.FNFTConfig memory fnftConfig,
uint weiValue
) internal {
bool isSingular;
uint totalQuantity = quantities[0];
{
uint rec = recipients.length;
uint quant = quantities.length;
require(rec == quant, "recipients and quantities arrays must match");
isSingular = rec == 1;
if(!isSingular) {
for(uint i = 1; i < quant; i++) {
totalQuantity += quantities[i];
}
}
require(totalQuantity > 0, "E003");
}
address vault = addressesProvider.getTokenVault();
if(weiValue > 0) {
IWETH(WETH).deposit{value: weiValue}();
}
if(!whitelisted[_msgSender()]) {
if(flatWeiFee > 0) {
require(weiValue >= flatWeiFee, "E005");
address reward = addressesProvider.getRewardsHandler();
if(!approved[reward]) {
IERC20(WETH).approve(reward, MAX_INT);
approved[reward] = true;
}
IRewardsHandler(reward).receiveFee(WETH, flatWeiFee);
}
if(fnftConfig.depositAmount > 0) {
uint totalERC20Fee = erc20Fee * totalQuantity * fnftConfig.depositAmount / erc20multiplierPrecision;
if(totalERC20Fee > 0) {
IERC20(fnftConfig.asset).safeTransferFrom(_msgSender(), addressesProvider.getAdmin(), totalERC20Fee);
}
}
weiValue -= flatWeiFee;
}
if(weiValue > 0) {
require(fnftConfig.asset == WETH, "E053");
require(weiValue >= fnftConfig.depositAmount, "E015");
}
ITokenVault(vault).createFNFT(fnftId, fnftConfig, totalQuantity, _msgSender());
if(fnftConfig.asset != address(0)){
address smartWallet = ITokenVaultV2(vault).getFNFTAddress(fnftId);
IERC20(fnftConfig.asset).safeTransferFrom(_msgSender(), smartWallet, totalQuantity * fnftConfig.depositAmount);
}
if(!isSingular) {
getFNFTHandler().mintBatchRec(recipients, quantities, fnftId, totalQuantity, '');
} else {
getFNFTHandler().mint(recipients[0], fnftId, quantities[0], '');
}
}
function setFlatWeiFee(uint wethFee) external override onlyOwner {
flatWeiFee = wethFee;
}
function setERC20Fee(uint erc20) external override onlyOwner {
erc20Fee = erc20;
}
function getFlatWeiFee() external view override returns (uint) {
return flatWeiFee;
}
function getERC20Fee() external view override returns (uint) {
return erc20Fee;
}
function getAddressesProvider() external view returns (IAddressRegistry) {
return addressesProvider;
}
function modifyWhitelist(address contra, bool listed) external onlyOwner {
whitelisted[contra] = listed;
}
}
文件 25 的 27: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 的 27:RevestReentrancyGuard.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract RevestReentrancyGuard is ReentrancyGuard {
uint private constant MAX_INT = 0xFFFFFFFFFFFFFFFF;
uint private currentId = MAX_INT;
modifier revestNonReentrant(uint fnftId) {
require(fnftId != currentId, "E052");
currentId = fnftId;
_;
currentId = MAX_INT;
}
}
文件 27 的 27: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");
}
}
}
{
"compilationTarget": {
"contracts/Revest.sol": "RevestA4"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 10000
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"newFNFTId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FNFTAddionalDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":false,"internalType":"address","name":"trigger","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"quantities","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"}],"indexed":false,"internalType":"struct IRevest.FNFTConfig","name":"fnftConfig","type":"tuple"}],"name":"FNFTAddressLockMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newExtendedTime","type":"uint256"}],"name":"FNFTMaturityExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256[]","name":"newFNFTId","type":"uint256[]"},{"indexed":true,"internalType":"uint256[]","name":"proportions","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"FNFTSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"quantities","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"}],"indexed":false,"internalType":"struct IRevest.FNFTConfig","name":"fnftConfig","type":"tuple"}],"name":"FNFTTimeLockMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"FNFTUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":false,"internalType":"address","name":"compareTo","type":"address"},{"indexed":false,"internalType":"address","name":"oracleDispatch","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"quantities","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"}],"indexed":false,"internalType":"struct IRevest.FNFTConfig","name":"fnftConfig","type":"tuple"}],"name":"FNFTValueLockMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"fnftId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"FNFTWithdrawn","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"},{"inputs":[],"name":"ADDRESS_LOCK_INTERFACE_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OUTPUT_RECEIVER_INTERFACE_V2_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OUTPUT_RECEIVER_INTERFACE_V3_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"depositAdditionalToFNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc20Fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"extendFNFTMaturity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flatWeiFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAddressesProvider","outputs":[{"internalType":"contract IAddressRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getERC20Fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFlatWeiFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"trigger","type":"address"},{"internalType":"bytes","name":"arguments","type":"bytes"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"quantities","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":"mintAddressLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"quantities","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":"mintTimeLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"primaryAsset","type":"address"},{"internalType":"address","name":"compareTo","type":"address"},{"internalType":"uint256","name":"unlockValue","type":"uint256"},{"internalType":"bool","name":"unlockRisingEdge","type":"bool"},{"internalType":"address","name":"oracleDispatch","type":"address"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"quantities","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":"mintValueLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"contra","type":"address"},{"internalType":"bool","name":"listed","type":"bool"}],"name":"modifyWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"erc20","type":"uint256"}],"name":"setERC20Fee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"wethFee","type":"uint256"}],"name":"setFlatWeiFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256[]","name":"proportions","type":"uint256[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"splitFNFT","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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"}],"name":"unlockFNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"withdrawFNFT","outputs":[],"stateMutability":"nonpayable","type":"function"}]