IMasterAccountController
Interface for the MasterAccountController contract, which manages personal accounts and executes XRPL instructions on Flare.
It uses the Diamond pattern to compose all functionality into a single deployed contract.
Sourced from IMasterAccountController.sol and its facets on GitHub.
Personal Accounts
getPersonalAccount
Returns the PersonalAccount contract address for a given XRPL owner.
A PersonalAccount is deployed only once the first instruction has been sent from its owner XRPL address.
If the account has not yet been deployed, it returns the precomputed deterministic address.
function getPersonalAccount(
string calldata _xrplOwner
)
external view
returns (address);
Parameters:
_xrplOwner: The XRPL address of the owner.
Returns:
- The
PersonalAccountcontract address, or the computed address if not yet deployed.
Instructions
executeInstruction
Executes an XRPL instruction for a given XRPL address using a Flare Data Connector payment proof.
function executeInstruction(
IPayment.Proof calldata _proof,
string calldata _xrplAddress
)
external payable;
Parameters:
_proof: Proof of the XRPL payment transaction that comes from the Flare Data Connector._xrplAddress: The XRPL address that sent the payment.
reserveCollateral
Reserves collateral for a minting operation. Called by the executor service after receiving a collateral reservation instruction from an XRPL payment.
function reserveCollateral(
string calldata _xrplAddress,
bytes32 _paymentReference,
bytes32 _transactionId
)
external payable
returns (uint256 _collateralReservationId);
Parameters:
_xrplAddress: The XRPL address requesting the collateral reservation._paymentReference: The payment reference from the XRPL transaction memo._transactionId: The unique XRPL transaction ID for tracking.
Returns:
_collateralReservationId: The ID of the collateral reservation.
executeDepositAfterMinting
Executes a vault deposit after minting is complete for a given collateral reservation.
function executeDepositAfterMinting(
uint256 _collateralReservationId,
IPayment.Proof calldata _proof,
string calldata _xrplAddress
)
external;
Parameters:
_collateralReservationId: The ID of the collateral reservation returned byreserveCollateral._proof: Proof of the XRPL payment transaction._xrplAddress: The XRPL address requesting execution.
isTransactionIdUsed
Returns true if the given XRPL transaction ID has already been executed.
function isTransactionIdUsed(
bytes32 _transactionId
)
external view
returns (bool);
getTransactionIdForCollateralReservation
Returns the XRPL transaction ID associated with a collateral reservation.
function getTransactionIdForCollateralReservation(
uint256 _collateralReservationId
)
external view
returns (bytes32 _transactionId);
Instruction Fees
getDefaultInstructionFee
Returns the default fee applied to instructions without a specific per-instruction fee configured. Denominated in the underlying asset's smallest unit (i.e., XRP drops).
function getDefaultInstructionFee()
external view
returns (uint256);
getInstructionFee
Returns the fee for a specific instruction ID (first byte on an encoded instruction).
function getInstructionFee(
uint256 _instructionId
)
external view
returns (uint256);
Parameters:
_instructionId: The ID of the instruction.
Agent Vaults
getAgentVaults
Returns the list of registered FAssets agent vault IDs and their corresponding addresses.
function getAgentVaults()
external view
returns (uint256[] memory _agentVaultIds, address[] memory _agentVaultAddresses);
Returns:
_agentVaultIds: The list of registered agent vault IDs._agentVaultAddresses: The list of registered agent vault addresses.
Vaults
getVaults
Returns the list of registered vaults as arrays of their IDs, addresses, and types (Firelight or Upshift).
function getVaults()
external view
returns (
uint256[] memory _vaultIds,
address[] memory _vaultAddresses,
uint8[] memory _vaultTypes
);
Returns:
_vaultIds: The list of registered vault IDs._vaultAddresses: The list of vault addresses._vaultTypes: The list of vault types (1= Firelight,2= Upshift).
Executor
getExecutorInfo
Returns the executor address and fee.
The executor is the service that calls reserveCollateral and executeDepositAfterMinting on behalf of users.
function getExecutorInfo()
external view
returns (address payable _executor, uint256 _executorFee);
Returns:
_executor: The executor address._executorFee: The executor fee in wei.
XRPL Provider Wallets
getXrplProviderWallets
Returns a list of XRPL operator wallet addresses to which users send payment transactions.
function getXrplProviderWallets()
external view
returns (string[] memory);
Payment Proofs
getSourceId
Returns the source ID used to identify the XRPL chain for payment proof verification.
function getSourceId()
external view
returns (bytes32);
getPaymentProofValidityDurationSeconds
Returns the maximum age (in seconds) of an XRPL payment proof for it to be accepted.
function getPaymentProofValidityDurationSeconds()
external view
returns (uint256);
Events
Instructions
CollateralReserved
Emitted when collateral is reserved for minting.
event CollateralReserved(
address indexed personalAccount,
bytes32 indexed transactionId,
bytes32 indexed paymentReference,
string xrplOwner,
uint256 collateralReservationId,
address agentVault,
uint256 lots,
address executor,
uint256 executorFee
);
InstructionExecuted
Emitted when an instruction is executed.
event InstructionExecuted(
address indexed personalAccount,
bytes32 indexed transactionId,
bytes32 indexed paymentReference,
string xrplOwner,
uint256 instructionId
);
FXrpRedeemed
Emitted when an FXRP redemption is performed.
event FXrpRedeemed(
address indexed personalAccount,
uint256 lots,
uint256 amount,
address executor,
uint256 executorFee
);
FXrpTransferred
Emitted when FXRP is transferred from a personal account.
event FXrpTransferred(
address indexed personalAccount,
address to,
uint256 amount
);
Approved
Emitted when a token approval is made for a vault.
event Approved(
address indexed personalAccount,
address fxrp,
address vault,
uint256 amount
);
Deposited
Emitted when a deposit is made to a vault.
event Deposited(
address indexed personalAccount,
address indexed vault,
uint256 amount,
uint256 shares
);
Redeemed
Emitted when a redemption is made from a vault.
event Redeemed(
address indexed personalAccount,
address indexed vault,
uint256 shares,
uint256 amount
);
WithdrawalClaimed
Emitted when a withdrawal claim is completed.
event WithdrawalClaimed(
address indexed personalAccount,
address indexed vault,
uint256 period,
uint256 amount
);
RedeemRequested
Emitted when a redeem request is made from a vault.
event RedeemRequested(
address indexed personalAccount,
address indexed vault,
uint256 shares,
uint256 claimableEpoch,
uint256 year,
uint256 month,
uint256 day
);
Claimed
Emitted when a claim is made for a specific date.
event Claimed(
address indexed personalAccount,
address indexed vault,
uint256 year,
uint256 month,
uint256 day,
uint256 shares,
uint256 amount
);