This agent uses ContractInspector alerts and it automatically detects for interfaces adherences and contract type.
It detects contracts:
- If it is an Ownable contract
- If it is an Ownable2Step contract
- If it is an AccessControl contract
- If it is an AccessControlEnumerable contract
- If it is an PaymentSplitter contract
- If it is an VestingWallet contract
- If it is an Governor contract
- If it is an TimelockController contract
- If it is an GovernorCompatibilityBravo contract
- If it is an GovernorCountingSimple contract
- If it is an GovernorPreventLateQuorum contract
- If it is an GovernorSettings contract
- If it is an GovernorTimelock contract
- If it is an GovernorTimelockCompound contract
- If it is an GovernorVotesQuorumFraction contract
- If it is an ERC2771Context contract
- If it is an MinimalForwarder contract
- If it has upgradebility contract by exposing
upgradeToandupgradeToAndCallfunctions. This can be either a proxy (eitherERC1967or not) or an UUPS implementation contract. - If it is an UUPSUpgradeable implementation logic contract
- If it is an ERC1967Upgrade contract
- If it is an UpgradeableBeacon contract
- If it is a TransparentUpgradeableProxy contract
- If it is a ProxyAdmin contract
- If it is a Initializable contract
- If it is a Pausable contract
- If it is a PullPayment contract
- If it is a ERC1155 contract
- If it is a ERC1155Burnable contract
- If it is a ERC1155Pausable contract
- If it is a ERC1155Supply contract
- If it is a ERC20 contract
- If it is a ERC20Burnable contract
- If it is a ERC20Capped contract
- If it is a ERC20FlashMint contract
- If it is a ERC20Pausable contract
- If it is a ERC20Permit contract
- If it is a ERC20Snapshot contract
- If it is a ERC20Votes contract
- If it is a ERC20VotesComp contract
- If it is a ERC20Wrapper contract
- If it is a ERC4626 contract
- If it is a TokenTimelock contract
- If it is a ERC721 contract
- If it is a ERC721Burnable contract
- If it is a ERC721Consecutive contract
- If it is a ERC721Enumerable contract
- If it is a ERC721Pausable contract
- If it is a ERC721Royalty contract
- If it is a ERC721Votes contract
- If it is a Escrow contract
- If it is a ConditionalEscrow contract
- If it is a RefundEscrow contract
It detects interfaces:
- If it adheres to IAccessControl interface
- If it adheres to IAccessControlEnumerable interface
- If it adheres to IGovernor interface
- If it adheres to IGovernorCompatibilityBravo interface
- If it adheres to IGovernorTimelock interface
- If it adheres to IVotes
- If it adheres to IERC1155 interface
- If it adheres to IERC1155MetadataURI interface
- If it adheres to IERC1155Receiver interface
- If it adheres to IERC1363 interface
- If it adheres to IERC1363Receiver interface
- If it adheres to IERC1363Spender interface
- If it adheres to IERC165 interface
- If it adheres to IERC1820Implementer interface
- If it adheres to IERC1820Registry interface
- If it adheres to IERC20 interface
- If it adheres to IERC20Metadata interface
- If it adheres to IERC2309 interface
- If it adheres to IERC2612 interface
- If it adheres to IERC2981 interface
- If it adheres to IERC3156FlashBorrower interface
- If it adheres to IERC3156FlashLender interface
- If it adheres to IERC4626 interface
- If it adheres to IERC721 interface
- If it adheres to IERC721Enumerable interface
- If it adheres to IERC721Metadata interface
- If it adheres to IERC721Receiver interface
- If it adheres to IERC777 interface
- If it adheres to IERC777Recipient interface
- If it adheres to IERC777Sender interface
- If it adheres to IERC1822Proxiable interface
- If it adheres to IBeacon interface
- If it adheres to IAmb interface
- If it adheres to IArbSys interface
- If it adheres to IBridge interface
- If it adheres to IDelayedMessageProvider interface
- If it adheres to IInbox interface
- If it adheres to IOutbox interface
- If it adheres to ICompoundTimelock interface
- If it adheres to ICrossDomainMessenger interface
- If it adheres to IFxMessageProcessor interface
- Create a new
isItXXXfunction insrc/inspectors.tsfile whereXXXis the name of the interface you want to support. - In this new function add the function and events names of the interface definition into the
functionsInInterfaceandeventsInInterface. Be sure to remove parameters name andindexes/memory/calldatakeywords or any other keyword that is not used to calculate the signatures of those functions and events. - Add
isItXXXto the imports of theagent.tsfile. - Call the
isItXXXfunction inside theanalyzeInterfaceand take the call results. - Use the call results to push a new object into the
observationResultsarray. Look at other examples to know how to fill the pushing object. Be sure to do this beforeobservationResultsis returned.
- Test block:
npm run block 15128926
{
"name": `Interface detected`,
"description": `Contract {contractAddress} adheres to some interfaces`
"alertId": `ID`,
"protocol": "ethereum",
"severity": "Info",
"type": "Info",
"metadata": {
"types": // A list of supported interfaces
"contractAddress": , // the contract address
"overallConfidence": , // confidence level, many function signatures can correspond to different actual functions
"extras": "{}" // extra fields
}
}