Skip to content

VaultT1Migrator ​

Git Source

Inherits: Owned

State Variables ​

X32 ​

solidity
uint256 internal constant X32 = 0xffffffff;

ETH_ADDRESS ​

solidity
address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

VAULT_T1_FACTORY_OLD ​

solidity
IFluidVaultFactory public immutable VAULT_T1_FACTORY_OLD;

VAULT_T1_FACTORY_NEW ​

solidity
IFluidVaultFactory public immutable VAULT_T1_FACTORY_NEW;

FLA ​

solidity
InstaFlashInterface public immutable FLA;

WETH ​

solidity
IWETH9 public immutable WETH;

flashloanConfig ​

solidity
mapping(address => FlashloanConfig) public flashloanConfig;

Functions ​

constructor ​

solidity
constructor(address owner_, address fla_, address weth_, address oldFactory_, address newFactory_) Owned(owner_);

setFlashloanConfig ​

solidity
function setFlashloanConfig(address token_, uint256 route_, uint256 amount_) public onlyOwner;

spell ​

solidity
function spell(address[] memory targets_, bytes[] memory calldatas_) public onlyOwner;

withdraw ​

solidity
function withdraw(address to_, address[] memory tokens_, uint256[] memory amounts_) public onlyOwner;

onERC721Received ​

solidity
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
    external
    returns (bytes4);

executeOperation ​

solidity
function executeOperation(
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata premiums,
    address initiator,
    bytes calldata _data
) external returns (bool);

vaultByNftId ​

solidity
function vaultByNftId(uint256 nftId_) public view returns (uint256 vaultId_, address vault_);

vaultConfig ​

solidity
function vaultConfig(address vault_) public view returns (address supply_, address borrow_);

calculateStorageSlotUintMapping ​

solidity
function calculateStorageSlotUintMapping(uint256 slot_, uint256 key_) public pure returns (bytes32);

getVaultAddress ​

solidity
function getVaultAddress(address vaultFactory_, uint256 vaultId_) public pure returns (address vault_);

receive ​

solidity
receive() external payable;

Events ​

Migrated ​

solidity
event Migrated(uint256 indexed vaultId, address indexed owner, uint256 indexed nft, uint256 collateral, uint256 debt);

Withdraw ​

solidity
event Withdraw(address indexed to, address indexed token, uint256 amount);

SetFlashloanConfig ​

solidity
event SetFlashloanConfig(address indexed token, uint256 indexed route, uint256 amount);

Errors ​

FluidVaultT1Migrator__InvalidOperation ​

solidity
error FluidVaultT1Migrator__InvalidOperation();

FluidVaultT1Migrator__NotAllowed ​

solidity
error FluidVaultT1Migrator__NotAllowed();

Structs ​

FlashloanConfig ​

solidity
struct FlashloanConfig {
    uint256 amount;
    uint256 route;
}

MigratorParams ​

solidity
struct MigratorParams {
    uint256 nftId;
    address owner;
    address supply;
    address borrow;
    uint256 vaultId;
    address vaultFrom;
    address vaultTo;
    uint256 supplyAmount;
    uint256 borrowAmount;
    int256 withdrawAmount;
    int256 paybackAmount;
    uint256 route;
}