aere-contracts/contracts/mocks/ERC8004V2Mocks.sol
Aere Network 1b50878368
Some checks failed
contracts-ci / Install (lockfile) → compile → full test suite (push) Failing after 16m0s
contracts-ci / Ethereum interop (EIP-2537 BLS, prague hardfork) (push) Failing after 27s
contracts-ci / PQC known-answer tests (NIST vectors) (push) Failing after 16m53s
contracts-ci / Coverage (scoped, with artifacts) (push) Has been cancelled
ERC-8004 V2 registries transcribed from the current draft (identity ERC-721+metadata+agentWallet, reputation, validation), 17 unit tests, local conformance deployment script; fixtures provenance; the MPC verifier moves to contracts/mpc (the publish gate refuses any 'confidential' path by structure)
2026-09-02 17:52:51 +03:00

19 lines
946 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
/// @dev Test-only ERC-1271 wallet: a contract wallet whose approvals are ECDSA signatures of `owner`.
/// Used to prove that AereIdentityRegistry8004V2.setAgentWallet accepts contract wallets (ERC-1271)
/// and not only EOAs (EIP-712), as the ERC-8004 draft requires.
contract Mock1271Wallet is IERC1271 {
address public immutable owner;
constructor(address owner_) { owner = owner_; }
function isValidSignature(bytes32 hash, bytes memory signature) external view override returns (bytes4) {
(address rec, ECDSA.RecoverError err) = ECDSA.tryRecover(hash, signature);
if (err == ECDSA.RecoverError.NoError && rec == owner) return IERC1271.isValidSignature.selector;
return bytes4(0);
}
}