IPrivacy.transferWithAuthorization
transferWithAuthorization(
PrivacyTransferRequest request,
PrivacyActionAuthorization authorization
) external returns (bool success) Executes a shielded transfer on behalf of authorization.effectiveSender, verified by a signed authorization payload (EOA, EIP-7702, or ERC-1271). The wrapped PrivacyTransferRequest carries a mandatory expiresAtUnix deadline; a separate authorization.deadline bounds the authorization itself. Both expiry checks reject with plain string reverts (IPrivacy declares no typed custom errors).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
request | PrivacyTransferRequest | ✓ | The shielded transfer request. expiresAtUnix is required and must be strictly greater than the current block time. |
authorization | PrivacyActionAuthorization | ✓ | The signed authorization identifying effectiveSender, executor, nonce, deadline, authorizationKind, and signature. Consumed once — the nonce is burned on success. |
Returns
Type:
bool Returns true on success. Failures revert with a plain string reason.
Errors
| Code | Name | Description |
|---|---|---|
expiresAtUnix is required | expiresAtUnix is required | String revert. request.expiresAtUnix was zero. |
transfer payload has expired | transfer payload has expired | String revert. The current block time was at or past request.expiresAtUnix. |
privacy authorization expired | privacy authorization expired | String revert. The current block time was at or past authorization.deadline. |
privacy authorization nonce already used | privacy authorization nonce already used | String revert. The authorization nonce was already consumed by a prior call. |
Examples
Executor-submitted transfer with a bounded expiry
Set request.expiresAtUnix tighter than authorization.deadline when the transfer becomes stale sooner than the signer's willingness-to-sign window.
const nowSec = Math.floor(Date.now() / 1000);
const request = {
// ... other privacy fields ...
expiresAtUnix: BigInt(nowSec + 300), // request payload expires in 5 min
};
const authorization = {
// TODO: replace with the real effective sender before production.
effectiveSender: "0x8f3aC2b1D9e74C05a6B18Fe27dC4913E5A0f7b62",
// TODO: replace with the real executor (submitter) address before production.
executor: "0x2c7F09b81A6D3fF1e5A0D4c6Bc2A8f7E19dC3a4B",
nonce: currentNonce,
deadline: BigInt(nowSec + 600), // authorization valid for 10 min
authorizationKind: 0, // EOA / EIP-7702 / ERC-1271 per policy
signature: "0x...",
};
await executorWallet.writeContract({
address: "0x100000000000000000000000000000000000000b",
abi: privacyAbi,
functionName: "transferWithAuthorization",
args: [request, authorization],
});