Policy Validator
Contract
contract PolicyValidator {
/// @notice Verify that `proof` is a valid approval signature for `action`
/// according to Brain's policy engine and configured constraints.
/// @param action Canonical encoding of the proposed action.
/// @param proof Signed approval from the Brain policy engine.
/// @return True if the proof is valid for the action; false otherwise.
function validate(
bytes calldata action,
bytes calldata proof
)
external
returns (bool)
{
// 1. Decode the action hash from `action`
// 2. Recover the signer address from `proof`
// 3. Verify signer matches the authorised Brain policy engine address
// 4. Verify the action hash in the proof matches `action`
// 5. Verify the proof has not expired and the nonce is unused
}
}What the Proof Contains
Field
Description
Integration with ERC-4337
Last updated
