Skip to main content

OffChainSignatureValidator

The OffChainSignatureValidator is the default signature validator for off-chain signature validation calls for all parties. The contract approves all plaintext messages signed by party members above the signing threshold for the given party. By default the threshold is 0 meaning any member of the party can sign messages. Once the threshold is set, the current voting power of the signer is used to calculate if they are above the threshold.

Note: this contract will always reject EIP-712 signatures.

Code

OffChainSignatureValidator.sol

Functions

isValidSignature

function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4)

This function takes the hash of the signed data as well as a signature. The signature must exactly match the following schema to ensure the validator is able to reconstruct the signed data properly. Attain the ECDSA signature (via ETH_SIGN or ETH_PERSONAL_SIGN with many clients). abi.encodePacked(r,s,v,message)=signature where message is the plaintext signed data.

setSigningThresholdBps

function setSigningThresholdBps(uint96 thresholdBps) external

This function sets the signing threshold for the caller —- as such, it must be called by the Party in an ArbitraryCallsProposal.