Multiple Transfers

When you want to move the assets from a two or more stealth address to another stealth address or you want unshield the asset (in other words withdraw from the arcane contract) you’d call the transferFromMultiple function:

/**
 * @notice Transfer from multiple stealth addresses
 * @dev Allows for a single transaction to transfer tokens from multiple stealth addresses.
 *
 * In a situation where a user has multiple stealth addresses with some token T and wants to
 * transfer a certain amount of T, but one stealth address does not have enough T to transfer,
 * the user can use this function to transfer the tokens from multiple stealth addresses.
 *
 * Emits a {Transfer} event indicating the transfer
 *
 * @param _token token to transfer
 * @param _senders an array of stealth addresses to transfer the token from
 * @param _amounts an array of amounts to transfer from each stealth address respectively
 * @param _totalAmount the total amount of tokens to transfer
 * @param _receiver the stealth address to transfer the token to
 * @param _signatures an array of signatures of the senders respectively
 * @param _transferData extra parameters for the transfer
 * @param _announcementData the transfer announcement data
 */
function transferFromMultiple(
    address _token,
    address[] calldata _senders,
    uint256[] calldata _amounts,
    uint256 _totalAmount,
    address payable _receiver,
    Signature[] calldata _signatures,
    TransferData calldata _transferData,
    AnnouncementData calldata _announcementData
) external;

You’d notice the _signatures paramater, this is a list of signature generated using the private keys of the _senders respectively.

Last updated