编译器
0.8.16+commit.07a7930e
文件 1 的 10:AddressUpgradeable.sol
pragma solidity ^0.8.1;
library AddressUpgradeable {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 10:ContextUpgradeable.sol
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
uint256[50] private __gap;
}
文件 3 的 10:FunctionRegistry.sol
pragma solidity ^0.8.16;
import {IFunctionRegistry} from "./interfaces/IFunctionRegistry.sol";
abstract contract FunctionRegistry is IFunctionRegistry {
mapping(bytes32 => address) public override verifiers;
mapping(bytes32 => address) public override verifierOwners;
function registerFunction(address _owner, address _verifier, bytes32 _salt)
external
override
returns (bytes32 functionId)
{
functionId = getFunctionId(_owner, _salt);
_register(functionId, _owner, _verifier);
emit FunctionRegistered(functionId, _verifier, _salt, _owner);
}
function deployAndRegisterFunction(address _owner, bytes memory _bytecode, bytes32 _salt)
external
override
returns (bytes32 functionId, address verifier)
{
functionId = getFunctionId(_owner, _salt);
verifier = _deploy(_bytecode, functionId);
_register(functionId, _owner, verifier);
emit FunctionRegistered(functionId, verifier, _salt, _owner);
}
function updateFunction(address _verifier, bytes32 _salt)
external
override
returns (bytes32 functionId)
{
functionId = getFunctionId(msg.sender, _salt);
_update(functionId, _verifier);
emit FunctionVerifierUpdated(functionId, _verifier);
}
function deployAndUpdateFunction(bytes memory _bytecode, bytes32 _salt)
external
override
returns (bytes32 functionId, address verifier)
{
functionId = getFunctionId(msg.sender, _salt);
verifier = _deploy(_bytecode, functionId);
_update(functionId, verifier);
emit FunctionVerifierUpdated(functionId, verifier);
}
function getFunctionId(address _owner, bytes32 _salt)
public
pure
override
returns (bytes32 functionId)
{
functionId = keccak256(abi.encode(_owner, _salt));
}
function _deploy(bytes memory _bytecode, bytes32 _salt)
internal
returns (address deployedAddr)
{
if (_bytecode.length == 0) revert EmptyBytecode();
assembly {
deployedAddr := create2(0, add(_bytecode, 32), mload(_bytecode), _salt)
}
if (deployedAddr == address(0)) revert FailedDeploy();
emit Deployed(keccak256(_bytecode), _salt, deployedAddr);
}
function _register(bytes32 functionId, address _owner, address _verifier) internal {
if (_verifier == address(0)) {
revert VerifierCannotBeZero();
}
if (address(verifiers[functionId]) != address(0)) {
revert FunctionAlreadyRegistered(functionId);
}
verifierOwners[functionId] = _owner;
verifiers[functionId] = _verifier;
}
function _update(bytes32 functionId, address _verifier) internal {
if (_verifier == address(0)) {
revert VerifierCannotBeZero();
}
if (msg.sender != verifierOwners[functionId]) {
revert NotFunctionOwner(msg.sender, verifierOwners[functionId]);
}
if (_verifier == verifiers[functionId]) {
revert VerifierAlreadyUpdated(functionId);
}
verifiers[functionId] = _verifier;
}
}
文件 4 的 10:IFeeVault.sol
pragma solidity ^0.8.16;
interface IFeeVaultEvents {
event Received(address indexed account, address indexed token, uint256 amount);
event Deducted(address indexed account, address indexed token, uint256 amount);
event Collected(address indexed to, address indexed token, uint256 amount);
}
interface IFeeVaultErrors {
error InvalidAccount(address account);
error InvalidToken(address token);
error InsufficentAllowance(address token, uint256 amount);
error InsufficientBalance(address token, uint256 amount);
error FailedToSendNative(uint256 amount);
error OnlyDeductor(address sender);
}
interface IFeeVault is IFeeVaultEvents, IFeeVaultErrors {
function balances(address token, address account) external view returns (uint256);
function depositNative(address account) external payable;
function deposit(address account, address token, uint256 amount) external;
}
文件 5 的 10:IFunctionRegistry.sol
pragma solidity >=0.5.0;
interface IFunctionRegistryEvents {
event FunctionRegistered(
bytes32 indexed functionId, address verifier, bytes32 salt, address owner
);
event FunctionVerifierUpdated(bytes32 indexed functionId, address verifier);
event Deployed(
bytes32 indexed bytecodeHash, bytes32 indexed salt, address indexed deployedAddress
);
}
interface IFunctionRegistryErrors {
error EmptyBytecode();
error FailedDeploy();
error VerifierCannotBeZero();
error VerifierAlreadyUpdated(bytes32 functionId);
error FunctionAlreadyRegistered(bytes32 functionId);
error NotFunctionOwner(address owner, address actualOwner);
}
interface IFunctionRegistry is IFunctionRegistryEvents, IFunctionRegistryErrors {
function verifiers(bytes32 functionId) external view returns (address verifier);
function verifierOwners(bytes32 functionId) external view returns (address owner);
function registerFunction(address owner, address verifier, bytes32 salt)
external
returns (bytes32 functionId);
function deployAndRegisterFunction(address owner, bytes memory bytecode, bytes32 salt)
external
returns (bytes32 functionId, address verifier);
function updateFunction(address verifier, bytes32 salt) external returns (bytes32 functionId);
function deployAndUpdateFunction(bytes memory bytecode, bytes32 salt)
external
returns (bytes32 functionId, address verifier);
function getFunctionId(address owner, bytes32 salt)
external
pure
returns (bytes32 functionId);
}
文件 6 的 10:IFunctionVerifier.sol
pragma solidity >=0.5.0;
interface IFunctionVerifier {
function verify(bytes32 inputHash, bytes32 outputHash, bytes memory proof)
external
returns (bool);
function verificationKeyHash() external view returns (bytes32);
}
文件 7 的 10:ISuccinctGateway.sol
pragma solidity >=0.8.0;
enum WhitelistStatus {
Default,
Custom,
Disabled
}
interface ISuccinctGatewayEvents {
event RequestCallback(
uint32 indexed nonce,
bytes32 indexed functionId,
bytes input,
bytes context,
address callbackAddress,
bytes4 callbackSelector,
uint32 callbackGasLimit,
uint256 feeAmount
);
event RequestCall(
bytes32 indexed functionId,
bytes input,
address entryAddress,
bytes entryCalldata,
uint32 entryGasLimit,
address sender,
uint256 feeAmount
);
event RequestFulfilled(
uint32 indexed nonce, bytes32 indexed functionId, bytes32 inputHash, bytes32 outputHash
);
event Call(bytes32 indexed functionId, bytes32 inputHash, bytes32 outputHash);
event SetFeeVault(address indexed oldFeeVault, address indexed newFeeVault);
event ProverUpdated(bytes32 indexed functionId, address indexed prover, bool added);
event WhitelistStatusUpdated(bytes32 indexed functionId, WhitelistStatus status);
}
interface ISuccinctGatewayErrors {
error InvalidRequest(uint32 nonce, bytes32 expectedRequestHash, bytes32 requestHash);
error CallbackFailed(bytes4 callbackSelector, bytes output, bytes context);
error InvalidCall(bytes32 functionId, bytes input);
error CallFailed(address callbackAddress, bytes callbackData);
error InvalidProof(address verifier, bytes32 inputHash, bytes32 outputHash, bytes proof);
error ReentrantFulfill();
error OnlyProver(bytes32 functionId, address sender);
error RecoverFailed();
}
interface ISuccinctGateway is ISuccinctGatewayEvents, ISuccinctGatewayErrors {
function requestCallback(
bytes32 functionId,
bytes memory input,
bytes memory context,
bytes4 callbackSelector,
uint32 callbackGasLimit
) external payable returns (bytes32);
function requestCall(
bytes32 functionId,
bytes memory input,
address entryAddress,
bytes memory entryData,
uint32 entryGasLimit
) external payable;
function verifiedCall(bytes32 functionId, bytes memory input)
external
view
returns (bytes memory);
function isCallback() external view returns (bool);
}
文件 8 的 10:Initializable.sol
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
abstract contract Initializable {
uint8 private _initialized;
bool private _initializing;
event Initialized(uint8 version);
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
文件 9 的 10:OwnableUpgradeable.sol
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
uint256[49] private __gap;
}
文件 10 的 10:SuccinctGateway.sol
pragma solidity ^0.8.16;
import {ISuccinctGateway, WhitelistStatus} from "./interfaces/ISuccinctGateway.sol";
import {IFunctionVerifier} from "./interfaces/IFunctionVerifier.sol";
import {FunctionRegistry} from "./FunctionRegistry.sol";
import {IFeeVault} from "./payments/interfaces/IFeeVault.sol";
import {Initializable} from "@openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol";
import {OwnableUpgradeable} from "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";
contract SuccinctGateway is
ISuccinctGateway,
FunctionRegistry,
Initializable,
OwnableUpgradeable
{
address public feeVault;
uint32 public nonce;
mapping(uint32 => bytes32) public requests;
bytes32 public verifiedFunctionId;
bytes32 public verifiedInputHash;
bytes public verifiedOutput;
bool public override isCallback;
mapping(bytes32 => WhitelistStatus) public whitelistStatus;
mapping(bytes32 => mapping(address => bool)) public allowedProvers;
modifier nonReentrant() {
if (
isCallback || verifiedFunctionId != bytes32(0) || verifiedInputHash != bytes32(0)
|| verifiedOutput.length != 0
) {
revert ReentrantFulfill();
}
_;
}
modifier onlyProver(bytes32 _functionId) {
if (
whitelistStatus[_functionId] == WhitelistStatus.Default
&& !allowedProvers[bytes32(0)][msg.sender]
) {
revert OnlyProver(_functionId, msg.sender);
} else if (
whitelistStatus[_functionId] == WhitelistStatus.Custom
&& !allowedProvers[_functionId][msg.sender]
) {
revert OnlyProver(_functionId, msg.sender);
}
_;
}
function initialize(address _owner, address _feeVault, address _defaultProver)
external
initializer
{
_transferOwnership(_owner);
feeVault = _feeVault;
allowedProvers[bytes32(0)][_defaultProver] = true;
}
function requestCallback(
bytes32 _functionId,
bytes memory _input,
bytes memory _context,
bytes4 _callbackSelector,
uint32 _callbackGasLimit
) external payable override returns (bytes32) {
bytes32 inputHash = sha256(_input);
bytes32 contextHash = keccak256(_context);
address callbackAddress = msg.sender;
bytes32 requestHash = _requestHash(
nonce,
_functionId,
inputHash,
contextHash,
callbackAddress,
_callbackSelector,
_callbackGasLimit
);
requests[nonce] = requestHash;
emit RequestCallback(
nonce,
_functionId,
_input,
_context,
callbackAddress,
_callbackSelector,
_callbackGasLimit,
msg.value
);
nonce++;
if (feeVault != address(0)) {
IFeeVault(feeVault).depositNative{value: msg.value}(callbackAddress);
}
return requestHash;
}
function requestCall(
bytes32 _functionId,
bytes memory _input,
address _entryAddress,
bytes memory _entryCalldata,
uint32 _entryGasLimit
) external payable override {
emit RequestCall(
_functionId,
_input,
_entryAddress,
_entryCalldata,
_entryGasLimit,
msg.sender,
msg.value
);
if (feeVault != address(0)) {
IFeeVault(feeVault).depositNative{value: msg.value}(msg.sender);
}
}
function verifiedCall(bytes32 _functionId, bytes memory _input)
external
view
override
returns (bytes memory)
{
bytes32 inputHash = sha256(_input);
if (verifiedFunctionId == _functionId && verifiedInputHash == inputHash) {
return verifiedOutput;
} else {
revert InvalidCall(_functionId, _input);
}
}
function fulfillCallback(
uint32 _nonce,
bytes32 _functionId,
bytes32 _inputHash,
address _callbackAddress,
bytes4 _callbackSelector,
uint32 _callbackGasLimit,
bytes memory _context,
bytes memory _output,
bytes memory _proof
) external nonReentrant onlyProver(_functionId) {
bytes32 contextHash = keccak256(_context);
bytes32 requestHash = _requestHash(
_nonce,
_functionId,
_inputHash,
contextHash,
_callbackAddress,
_callbackSelector,
_callbackGasLimit
);
if (requests[_nonce] != requestHash) {
revert InvalidRequest(_nonce, requests[_nonce], requestHash);
}
delete requests[_nonce];
bytes32 outputHash = sha256(_output);
_verify(_functionId, _inputHash, outputHash, _proof);
isCallback = true;
(bool status,) = _callbackAddress.call{gas: _callbackGasLimit}(
abi.encodeWithSelector(_callbackSelector, _output, _context)
);
isCallback = false;
if (!status) {
revert CallbackFailed(_callbackSelector, _output, _context);
}
emit RequestFulfilled(_nonce, _functionId, _inputHash, outputHash);
}
function fulfillCall(
bytes32 _functionId,
bytes memory _input,
bytes memory _output,
bytes memory _proof,
address _callbackAddress,
bytes memory _callbackData
) external nonReentrant onlyProver(_functionId) {
bytes32 inputHash = sha256(_input);
bytes32 outputHash = sha256(_output);
_verify(_functionId, inputHash, outputHash, _proof);
verifiedFunctionId = _functionId;
verifiedInputHash = inputHash;
verifiedOutput = _output;
(bool status,) = _callbackAddress.call(_callbackData);
if (!status) {
revert CallFailed(_callbackAddress, _callbackData);
}
delete verifiedFunctionId;
delete verifiedInputHash;
delete verifiedOutput;
emit Call(_functionId, inputHash, outputHash);
}
function setWhitelistStatus(bytes32 _functionId, WhitelistStatus _status) external {
if (msg.sender != verifierOwners[_functionId]) {
revert NotFunctionOwner(msg.sender, verifierOwners[_functionId]);
}
whitelistStatus[_functionId] = _status;
emit WhitelistStatusUpdated(_functionId, _status);
}
function addCustomProver(bytes32 _functionId, address _prover) external {
if (msg.sender != verifierOwners[_functionId]) {
revert NotFunctionOwner(msg.sender, verifierOwners[_functionId]);
}
allowedProvers[_functionId][_prover] = true;
emit ProverUpdated(_functionId, _prover, true);
}
function removeCustomProver(bytes32 _functionId, address _prover) external {
if (msg.sender != verifierOwners[_functionId]) {
revert NotFunctionOwner(msg.sender, verifierOwners[_functionId]);
}
delete allowedProvers[_functionId][_prover];
emit ProverUpdated(_functionId, _prover, false);
}
function addDefaultProver(address _prover) external onlyOwner {
allowedProvers[bytes32(0)][_prover] = true;
emit ProverUpdated(bytes32(0), _prover, true);
}
function removeDefaultProver(address _prover) external onlyOwner {
delete allowedProvers[bytes32(0)][_prover];
emit ProverUpdated(bytes32(0), _prover, false);
}
function setFeeVault(address _feeVault) external onlyOwner {
emit SetFeeVault(feeVault, _feeVault);
feeVault = _feeVault;
}
function recover(address _to, uint256 _amount) external onlyOwner {
(bool success,) = _to.call{value: _amount}("");
if (!success) {
revert RecoverFailed();
}
}
function _requestHash(
uint32 _nonce,
bytes32 _functionId,
bytes32 _inputHash,
bytes32 _contextHash,
address _callbackAddress,
bytes4 _callbackSelector,
uint32 _callbackGasLimit
) internal pure returns (bytes32) {
return keccak256(
abi.encodePacked(
_nonce,
_functionId,
_inputHash,
_contextHash,
_callbackAddress,
_callbackSelector,
_callbackGasLimit
)
);
}
function _verify(
bytes32 _functionId,
bytes32 _inputHash,
bytes32 _outputHash,
bytes memory _proof
) internal {
address verifier = verifiers[_functionId];
if (!IFunctionVerifier(verifier).verify(_inputHash, _outputHash, _proof)) {
revert InvalidProof(address(verifier), _inputHash, _outputHash, _proof);
}
}
}
{
"compilationTarget": {
"src/SuccinctGateway.sol": "SuccinctGateway"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 100000
},
"remappings": [
":@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":@openzeppelin/=lib/openzeppelin-contracts/",
":@safe/=lib/safe-contracts/contracts/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
":safe-contracts/=lib/safe-contracts/"
]
}
[{"inputs":[{"internalType":"address","name":"callbackAddress","type":"address"},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[{"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"internalType":"bytes","name":"output","type":"bytes"},{"internalType":"bytes","name":"context","type":"bytes"}],"name":"CallbackFailed","type":"error"},{"inputs":[],"name":"EmptyBytecode","type":"error"},{"inputs":[],"name":"FailedDeploy","type":"error"},{"inputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"}],"name":"FunctionAlreadyRegistered","type":"error"},{"inputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"},{"internalType":"bytes","name":"input","type":"bytes"}],"name":"InvalidCall","type":"error"},{"inputs":[{"internalType":"address","name":"verifier","type":"address"},{"internalType":"bytes32","name":"inputHash","type":"bytes32"},{"internalType":"bytes32","name":"outputHash","type":"bytes32"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"InvalidProof","type":"error"},{"inputs":[{"internalType":"uint32","name":"nonce","type":"uint32"},{"internalType":"bytes32","name":"expectedRequestHash","type":"bytes32"},{"internalType":"bytes32","name":"requestHash","type":"bytes32"}],"name":"InvalidRequest","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"actualOwner","type":"address"}],"name":"NotFunctionOwner","type":"error"},{"inputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"},{"internalType":"address","name":"sender","type":"address"}],"name":"OnlyProver","type":"error"},{"inputs":[],"name":"RecoverFailed","type":"error"},{"inputs":[],"name":"ReentrantFulfill","type":"error"},{"inputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"}],"name":"VerifierAlreadyUpdated","type":"error"},{"inputs":[],"name":"VerifierCannotBeZero","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"inputHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"outputHash","type":"bytes32"}],"name":"Call","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"bytecodeHash","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"salt","type":"bytes32"},{"indexed":true,"internalType":"address","name":"deployedAddress","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"verifier","type":"address"},{"indexed":false,"internalType":"bytes32","name":"salt","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"FunctionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"verifier","type":"address"}],"name":"FunctionVerifierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"prover","type":"address"},{"indexed":false,"internalType":"bool","name":"added","type":"bool"}],"name":"ProverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"input","type":"bytes"},{"indexed":false,"internalType":"address","name":"entryAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"entryCalldata","type":"bytes"},{"indexed":false,"internalType":"uint32","name":"entryGasLimit","type":"uint32"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"RequestCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"nonce","type":"uint32"},{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"input","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"context","type":"bytes"},{"indexed":false,"internalType":"address","name":"callbackAddress","type":"address"},{"indexed":false,"internalType":"bytes4","name":"callbackSelector","type":"bytes4"},{"indexed":false,"internalType":"uint32","name":"callbackGasLimit","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"RequestCallback","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"nonce","type":"uint32"},{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"inputHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"outputHash","type":"bytes32"}],"name":"RequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeeVault","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeVault","type":"address"}],"name":"SetFeeVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"functionId","type":"bytes32"},{"indexed":false,"internalType":"enum WhitelistStatus","name":"status","type":"uint8"}],"name":"WhitelistStatusUpdated","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"address","name":"_prover","type":"address"}],"name":"addCustomProver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prover","type":"address"}],"name":"addDefaultProver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"allowedProvers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"bytes","name":"_bytecode","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deployAndRegisterFunction","outputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"},{"internalType":"address","name":"verifier","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_bytecode","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deployAndUpdateFunction","outputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"},{"internalType":"address","name":"verifier","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"bytes","name":"_input","type":"bytes"},{"internalType":"bytes","name":"_output","type":"bytes"},{"internalType":"bytes","name":"_proof","type":"bytes"},{"internalType":"address","name":"_callbackAddress","type":"address"},{"internalType":"bytes","name":"_callbackData","type":"bytes"}],"name":"fulfillCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_nonce","type":"uint32"},{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"bytes32","name":"_inputHash","type":"bytes32"},{"internalType":"address","name":"_callbackAddress","type":"address"},{"internalType":"bytes4","name":"_callbackSelector","type":"bytes4"},{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"},{"internalType":"bytes","name":"_context","type":"bytes"},{"internalType":"bytes","name":"_output","type":"bytes"},{"internalType":"bytes","name":"_proof","type":"bytes"}],"name":"fulfillCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"getFunctionId","outputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_feeVault","type":"address"},{"internalType":"address","name":"_defaultProver","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isCallback","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_verifier","type":"address"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"registerFunction","outputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"address","name":"_prover","type":"address"}],"name":"removeCustomProver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prover","type":"address"}],"name":"removeDefaultProver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"bytes","name":"_input","type":"bytes"},{"internalType":"address","name":"_entryAddress","type":"address"},{"internalType":"bytes","name":"_entryCalldata","type":"bytes"},{"internalType":"uint32","name":"_entryGasLimit","type":"uint32"}],"name":"requestCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"bytes","name":"_input","type":"bytes"},{"internalType":"bytes","name":"_context","type":"bytes"},{"internalType":"bytes4","name":"_callbackSelector","type":"bytes4"},{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"}],"name":"requestCallback","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"requests","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_feeVault","type":"address"}],"name":"setFeeVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"enum WhitelistStatus","name":"_status","type":"uint8"}],"name":"setWhitelistStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_verifier","type":"address"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"updateFunction","outputs":[{"internalType":"bytes32","name":"functionId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_functionId","type":"bytes32"},{"internalType":"bytes","name":"_input","type":"bytes"}],"name":"verifiedCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifiedFunctionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifiedInputHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifiedOutput","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"verifierOwners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"verifiers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"whitelistStatus","outputs":[{"internalType":"enum WhitelistStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]