In solidity a smart contract can define modifiers which can be called before the code of the function is run.
An example of such a contract would be as below:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Example {
modifier onlyOwner {
require(msg.sender == owner);
_;
}
//This function has the onlyOwner modifier
function setNewOwner(address newOwner) public onlyOwner {
owner = newOwner;
}
}
An example of a query which adds a filter to select functions which have modifiers is: