IPersonalAccount
Interface for the PersonalAccount contract — Flare account abstraction for an XRPL address, controller entirely by that address.
Sourced from IPersonalAccount.sol on GitHub.
View Functions
xrplOwner
Returns the XRPL owner address associated with this personal account.
function xrplOwner() external view returns (string memory);
If a contract at a given Flare address returns an XRPL account when the xrplOwner() function is called, then it is a smart account.
Use this to detect whether an arbitrary Flare address is a smart account.
controllerAddress
Returns the MasterAccountController address that manages this personal account.
function controllerAddress() external view returns (address);
implementation
Returns the implementation contract address for this personal account (used by the beacon proxy pattern).
function implementation() external view returns (address);
State-Changing Functions
executeUserOp
Executes a series of arbitrary calls from this personal account as a single user operation.
Each call is made with the personal account as msg.sender, allowing the account to interact with any contract on Flare.
The function is payable so the account can forward FLR alongside the calls.
function executeUserOp(
Call[] calldata _calls
)
external payable;
Parameters:
_calls: Array ofCallstructs describing each call to execute.
Reverts with CallFailed(index, returnData) if any call in the array fails, where index identifies the failing call and returnData is the raw revert data returned by the target.
Structs
Call
Describes a single call dispatched by executeUserOp.
struct Call {
address target;
uint256 value;
bytes data;
}
Fields:
target: The target contract address to call.value: The amount of FLR (in wei) to send with the call.data: The ABI-encoded calldata to pass to the target.
Errors
CallFailed
Thrown by executeUserOp when one of the underlying calls reverts.
error CallFailed(uint256 index, bytes returnData);
Parameters:
index: The index of the failing call within the_callsarray.returnData: The raw return data from the failed call.
InsufficientFundsForCollateralReservation
Thrown when the value sent with a collateral reservation is not enough to cover both the collateral reservation fee and the executor fee.
error InsufficientFundsForCollateralReservation(
uint256 collateralReservationFee,
uint256 executorFee
);
Parameters:
collateralReservationFee: The required collateral reservation fee.executorFee: The required executor fee.
InsufficientFundsForRedeem
Thrown when the value sent with a redeem operation is not enough to cover the executor fee.
error InsufficientFundsForRedeem(uint256 executorFee);
Parameters:
executorFee: The required executor fee.
OnlyController
Thrown when a function restricted to the MasterAccountController is called by any other address.
error OnlyController();
AlreadyInitialized
Thrown when the personal account initializer is called more than once.
error AlreadyInitialized();
InvalidControllerAddress
Thrown when the controller address provided at initialization is the zero address or otherwise invalid.
error InvalidControllerAddress();
InvalidXrplOwner
Thrown when the XRPL owner string provided at initialization is empty or otherwise invalid.
error InvalidXrplOwner();
AgentNotAvailable
Thrown when the FAssets agent selected for a minting or redemption operation is not available.
error AgentNotAvailable();
ApprovalFailed
Thrown when an ERC-20 approval issued by the personal account (for example, when granting a vault permission to spend FXRP) returns false or reverts.
error ApprovalFailed();
Events
CollateralReserved
Emitted when collateral is reserved for minting FXRP.
event CollateralReserved(
address agentVault,
uint256 lots,
address executor,
uint256 executorFee,
uint256 collateralReservationId
);
Parameters:
agentVault: The agent vault address.lots: The number of lots that will be minted.executor: The executor address.executorFee: The fee paid to the executor.collateralReservationId: The ID of the collateral reservation.
This event does not include the necessary information to complete the minting process.
When performing minting, the CollateralReserved event emitted by the IAssetManager contract should be observed instead.
FXrpTransferred
Emitted when a transfer of FXRP is made from the personal account.
event FXrpTransferred(
address to,
uint256 amount
);
Parameters:
to: The recipient address.amount: The amount of FXRP transferred.
FXrpRedeemed
Emitted when a FXRP redemption is performed.
event FXrpRedeemed(
uint256 lots,
uint256 amount,
address executor,
uint256 executorFee
);
Parameters:
lots: The number of lots redeemed.amount: The amount redeemed.executor: The executor address.executorFee: The fee paid to the executor.
Approved
Emitted when a token approval is made for a vault.
event Approved(
address fxrp,
address vault,
uint256 amount
);
Parameters:
fxrp: The FXRP token address.vault: The vault address.amount: The approved amount.
Deposited
Emitted when a deposit is made to a vault.
event Deposited(
address indexed vault,
uint256 amount,
uint256 shares
);
Parameters:
vault: The vault address.amount: The amount deposited.shares: The number of shares received.
Redeemed
Emitted when a redeem is made from a vault.
event Redeemed(
address indexed vault,
uint256 amount,
uint256 shares
);
Parameters:
vault: The vault address.amount: The amount redeemed.shares: The number of shares burned.
WithdrawalClaimed
Emitted when a withdrawal claim is made from a vault.
event WithdrawalClaimed(
address indexed vault,
uint256 period,
uint256 amount
);
Parameters:
vault: The vault address.period: The period for which the claim is made.amount: The amount claimed.
RedeemRequested
Emitted when a redeem request is made from a vault.
event RedeemRequested(
address indexed vault,
uint256 shares,
uint256 claimableEpoch,
uint256 year,
uint256 month,
uint256 day
);
Parameters:
vault: The vault address.shares: The number of shares to redeem.claimableEpoch: The epoch when the claim becomes available.year: The year of the claimable date.month: The month of the claimable date.day: The day of the claimable date.
Claimed
Emitted when a claim is made for a specific date.
event Claimed(
address indexed vault,
uint256 year,
uint256 month,
uint256 day,
uint256 shares,
uint256 amount
);
Parameters:
vault: The vault address.year: The year of the claim.month: The month of the claim.day: The day of the claim.shares: The number of shares claimed.amount: The amount claimed.
SwapExecuted
Emitted when a token swap is executed.
event SwapExecuted(
address indexed tokenIn,
address indexed tokenOut,
uint256 amountIn,
uint256 amountOut
);
Parameters:
tokenIn: The input token address.tokenOut: The output token address.amountIn: The amount of input tokens.amountOut: The amount of output tokens received.