Skip to content

IFluidWalletFactory ​

WALLET_PROXY ​

solidity
function WALLET_PROXY() external view returns (address)

InstaFlashReceiverInterface ​

executeOperation ​

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

FluidWalletVariables ​

VERSION ​

solidity
string VERSION

ETH_ADDRESS ​

solidity
address ETH_ADDRESS

X32 ​

solidity
uint256 X32

VAULT_FACTORY ​

solidity
address VAULT_FACTORY

FLUID_WALLET_FACTORY ​

solidity
address FLUID_WALLET_FACTORY

owner ​

solidity
address owner

owner address of this wallet. It is initialized while deploying the wallet for the user.

_transientAllowHash ​

solidity
bytes32 _transientAllowHash

transient allow hash used to signal allowing certain entry into methods such as executeOperation etc.

_resetTransientStorage ​

solidity
function _resetTransientStorage() internal

FluidWalletErrorsAndEvents ​

FluidWallet__NotAllowed ​

solidity
error FluidWallet__NotAllowed()

FluidWallet__ToHexDigit ​

solidity
error FluidWallet__ToHexDigit()

FluidWallet__Unauthorized ​

solidity
error FluidWallet__Unauthorized()

Executed ​

solidity
event Executed(address owner, uint256 tokenId)

ExecutedCast ​

solidity
event ExecutedCast(address owner)

Action ​

solidity
struct Action {
  address target;
  bytes data;
  uint256 value;
  uint8 operation;
}

FluidWalletImplementation ​

constructor ​

solidity
constructor(address vaultFactory_, address fluidWalletFactory_) public

onERC721Received ​

solidity
function onERC721Received(address operator_, address from_, uint256 tokenId_, bytes data_) external returns (bytes4)

_ERC721 callback used Fluid Vault Factory and executes actions encoded in data_ Caller should be Fluid Wallet Factory._

Parameters ​

NameTypeDescription
operator_addressoperator_ caller to transfer the the given token ID
from_addressfrom_ previous owner of the given token ID
tokenId_uint256tokenId_ id of the ERC721
data_bytesdata bytes containing the abi.encoded() actions that are executed like in Action[] & owner

cast ​

solidity
function cast(struct FluidWalletErrorsAndEvents.Action[] actions_) public

executeOperation ​

solidity
function executeOperation(address[], uint256[], uint256[], address initiator_, bytes data_) external returns (bool)

Parameters ​

NameTypeDescription
address[]
uint256[]
uint256[]
initiator_addressflashloan initiator -> must be this contract
data_bytesdata bytes containing the abi.encoded() actions that are executed like in CastParams.actions

_calculateStorageSlotUintMapping ​

solidity
function _calculateStorageSlotUintMapping(uint256 slot_, uint256 key_) internal pure returns (bytes32)

Calculating the slot ID for Liquidity contract for single mapping

VaultConstants ​

solidity
struct VaultConstants {
  address supplyToken0;
  address supplyToken1;
  address borrowToken0;
  address borrowToken1;
}

_sweepTokens ​

solidity
function _sweepTokens(address owner_, uint256 tokenId_) internal

_getVaultConstants ​

solidity
function _getVaultConstants(address vault_) internal view returns (struct FluidWalletImplementation.VaultConstants constants_)

_flushTokens ​

solidity
function _flushTokens(address token_, address owner_) internal

_validateOwner ​

solidity
function _validateOwner(address owner_) internal view

validate owner by recomputing fluid address.

_executeActions ​

solidity
function _executeActions(struct FluidWalletErrorsAndEvents.Action[] actions_) internal

_executes actions_ with respective target, calldata, operation etc._

_handleActionFailure ​

solidity
function _handleActionFailure(uint256 i_, bytes result_) internal pure

_handles failure of an action execution depending on error cause, decoding and reverting with result_ as reason string._

REVERT_REASON_MAX_LENGTH ​

solidity
uint256 REVERT_REASON_MAX_LENGTH

_getRevertReasonFromReturnedData ​

solidity
function _getRevertReasonFromReturnedData(bytes returnedData_) internal pure returns (string reason_)

Get the revert reason from the returnedData (supports Panic, Error & Custom Errors). Based on https://github.com/superfluid-finance/protocol-monorepo/blob/dev/packages/ethereum-contracts/contracts/libs/CallUtils.sol This is needed in order to provide some human-readable revert message from a call.

Parameters ​

NameTypeDescription
returnedData_bytesrevert data of the call

Return Values ​

NameTypeDescription
reason_stringrevert reason

_toHexDigit ​

solidity
function _toHexDigit(uint8 d) internal pure returns (bytes1)

used to convert bytes4 selector to string