|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.26; |
| 3 | + |
| 4 | +import {AccountERC7702WithModulesMock} from "../patched/mocks/account/AccountMock.sol"; |
| 5 | +import {EIP712} from "../patched/utils/cryptography/EIP712.sol"; |
| 6 | +import {EnumerableSet} from "../patched/utils/structs/EnumerableSet.sol"; |
| 7 | + |
| 8 | +contract AccountHarness is AccountERC7702WithModulesMock { |
| 9 | + using EnumerableSet for EnumerableSet.AddressSet; |
| 10 | + |
| 11 | + constructor(string memory name, string memory version) EIP712(name, version) {} |
| 12 | + |
| 13 | + function getFallbackHandler(bytes4 selector) external view returns (address) { |
| 14 | + return _fallbackHandler(selector); |
| 15 | + } |
| 16 | + |
| 17 | + function getDataSelector(bytes memory data) external pure returns (bytes4) { |
| 18 | + return bytes4(data); |
| 19 | + } |
| 20 | + |
| 21 | + function _validatorContains(address module) external view returns (bool) { |
| 22 | + return _validators.contains(module); |
| 23 | + } |
| 24 | + |
| 25 | + function _validatorLength() external view returns (uint256) { |
| 26 | + return _validators.length(); |
| 27 | + } |
| 28 | + |
| 29 | + function _validatorAt(uint256 index) external view returns (address) { |
| 30 | + return _validators.at(index); |
| 31 | + } |
| 32 | + |
| 33 | + function _validatorAtFull(uint256 index) external view returns (bytes32) { |
| 34 | + return _validators._inner._values[index]; |
| 35 | + } |
| 36 | + |
| 37 | + function _validatorPositionOf(address module) external view returns (uint256) { |
| 38 | + return _validators._inner._positions[bytes32(uint256(uint160(module)))]; |
| 39 | + } |
| 40 | + |
| 41 | + function _executorContains(address module) external view returns (bool) { |
| 42 | + return _executors.contains(module); |
| 43 | + } |
| 44 | + |
| 45 | + function _executorLength() external view returns (uint256) { |
| 46 | + return _executors.length(); |
| 47 | + } |
| 48 | + |
| 49 | + function _executorAt(uint256 index) external view returns (address) { |
| 50 | + return _executors.at(index); |
| 51 | + } |
| 52 | + |
| 53 | + function _executorAtFull(uint256 index) external view returns (bytes32) { |
| 54 | + return _executors._inner._values[index]; |
| 55 | + } |
| 56 | + |
| 57 | + function _executorPositionOf(address module) external view returns (uint256) { |
| 58 | + return _executors._inner._positions[bytes32(uint256(uint160(module)))]; |
| 59 | + } |
| 60 | +} |
0 commit comments