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:
| Position | Type | Description |
|---|---|---|
token | address | ERC20 token or native token sentinel. |
creator | address | Depositor and cancellation recipient. |
recipient | address | Claim recipient. |
expiryBlocks | uint256 | Blocks after initialization before cancellation is allowed. |
commitmentHash | bytes32 | SHA-256 hash required for claim. |
State
| Variable | Type | Description |
|---|---|---|
s_depositedAt | uint256 | Block number recorded during initialize(). |
s_settled | bool | Set after claim or cancellation. |
External functions
| Function | Description |
|---|---|
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
Events
| Event | Description |
|---|---|
Claimed(address,bytes32) | Emitted when recipient claims with a valid preimage. |
Refunded(address,bytes32) | Emitted when creator cancels after expiry. |
Errors
| Error | Meaning |
|---|---|
EscrowVault__InvalidCommitment | Preimage does not match commitment hash. |
EscrowVault__EscrowNotExpired | Cancel attempted before expiry. |
EscrowVault__NativeTransferFailed | Native token transfer failed. |
EscrowVault__EscrowAlreadySettled | Vault was already claimed or cancelled. |