EscrowVault is the standard minimal proxy clone deployed by EscrowFactory. Its immutable arguments are stored in clone bytecode and decoded with fetchCloneArgs(). Source: evm/src/EscrowVault.sol

Immutable parameters

getEscrowParameters() returns:
PositionTypeDescription
tokenaddressERC20 token or native token sentinel.
creatoraddressDepositor and cancellation recipient.
recipientaddressClaim recipient.
expiryBlocksuint256Blocks after initialization before cancellation is allowed.
commitmentHashbytes32SHA-256 hash required for claim.

State

VariableTypeDescription
s_depositedAtuint256Block number recorded during initialize().
s_settledboolSet after claim or cancellation.

External functions

FunctionDescription
initialize()Called once by the factory after clone deployment. Records s_depositedAt.
claim(bytes32)Transfers all vault funds to recipient if the preimage hashes to commitmentHash.
refund()Solidity entrypoint used to cancel after expiry and return funds to creator.
getEscrowParameters()Reads immutable clone arguments.

Claim rule

sha256(abi.encodePacked(_commitment)) == commitmentHash

Events

EventDescription
Claimed(address,bytes32)Emitted when recipient claims with a valid preimage.
Refunded(address,bytes32)Emitted when creator cancels after expiry.

Errors

ErrorMeaning
EscrowVault__InvalidCommitmentPreimage does not match commitment hash.
EscrowVault__EscrowNotExpiredCancel attempted before expiry.
EscrowVault__NativeTransferFailedNative token transfer failed.
EscrowVault__EscrowAlreadySettledVault was already claimed or cancelled.