# `Ethers.Contracts.UniversalSigValidator`
[🔗](https://github.com/ExWeb3/elixir_ethers/blob/v0.8.0/lib/ethers/contracts/universal_sig_validator.ex#L1)

[ERC-6492](https://eips.ethereum.org/EIPS/eip-6492) universal signature validator
(the `ValidateSigOffchain` helper contract).

This contract is never deployed. Its creation code is executed *deploylessly* via
`eth_call` (an `eth_call` with no `to` address runs the given data as init code and
returns whatever the constructor returns). The constructor
`(address _signer, bytes32 _hash, bytes _signature)` validates the signature —
handling ERC-6492 wrapped signatures for counterfactual (not-yet-deployed) wallets,
ERC-1271 smart-contract wallets, and plain `ecrecover` EOA signatures — and returns
a single byte: `0x01` for valid, `0x00` for invalid.

Used by `Ethers.Signature` — you normally don't need to use this module directly.

## Bytecode provenance

The creation bytecode is the `erc6492SignatureValidatorByteCode` constant from
[viem](https://github.com/wevm/viem/blob/main/src/constants/contracts.ts), which is
the compiled `ValidateSigOffchain` helper from the ERC-6492 reference implementation
(Ambire's [signature-validator](https://github.com/AmbireTech/signature-validator)).

# `creation_code`

```elixir
@spec creation_code() :: &lt;&lt;_::13472&gt;&gt;
```

Returns the creation (init) bytecode of the validator contract.

# `encode_validation_call`

```elixir
@spec encode_validation_call(&lt;&lt;_::160&gt;&gt;, &lt;&lt;_::256&gt;&gt;, binary()) :: &lt;&lt;_::64, _::_*8&gt;&gt;
```

Encodes a deployless validation call for the given signer, hash and signature.

Returns the binary to be used as the `data` of an `eth_call` with no `to` address:
the creation code followed by the ABI-encoded
`(address _signer, bytes32 _hash, bytes _signature)` constructor arguments.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
