web/src/abi.ts25 lines · 1630 bytes
| 1 | // The parts of the contract ABIs the war room reads. Written from the contracts' interface; test/airlock-selftest.ts |
| 2 | // compares every event topic and function selector here with the forge artifacts in out/ (FOUNDRY_PROFILE=eth). |
| 3 | import { parseAbi } from 'viem' |
| 4 | |
| 5 | /** src/AirlockAdmin.sol: events the airlock is drawn from, and the views the page calls */ |
| 6 | export const ADMIN_ABI = parseAbi([ |
| 7 | 'event Proposed(uint256 indexed id, uint8 indexed kind, address indexed target, uint256 value, bytes data, bytes32 codehash, uint64 readyBlock)', |
| 8 | 'event Vetoed(uint256 indexed id, address indexed guardian, bytes32 ruleHash, uint256 vetoCount)', |
| 9 | 'event Cleared(uint256 indexed id, address indexed clearer, bytes32 evidenceHash)', |
| 10 | 'event Executed(uint256 indexed id, address executor)', |
| 11 | 'event ReasonAttached(uint256 indexed id, address guardian, bytes32 reportHash)', |
| 12 | 'struct Proposal { uint8 kind; uint8 status; address proposer; address target; uint256 value; bytes32 codehash; bytes32 dataHash; uint64 proposedBlock; uint64 readyBlock; uint256 vetoCount; }', |
| 13 | 'function getProposal(uint256 id) view returns (Proposal)', |
| 14 | 'function clearanceOf(uint256 id) view returns (bytes32)', |
| 15 | 'function nextId() view returns (uint256)', |
| 16 | 'function delayBlocks() view returns (uint64)', |
| 17 | ]) |
| 18 | |
| 19 | /** src/cre/AirlockReceiver.sol: one Verdict per accepted Chainlink CRE report (action 0 = Veto, 1 = Clear) */ |
| 20 | export const RECEIVER_ABI = parseAbi([ |
| 21 | 'event Verdict(uint256 indexed proposalId, uint8 indexed action, bytes32 ruleHash, bytes32 evidenceHash, bytes32 workflowId)', |
| 22 | ]) |
| 23 | |
| 24 | export const ACTION_VETO = 0 |
| 25 | export const ACTION_CLEAR = 1 |