ISP1VerifierGateway
VerifierRoute
A struct containing the address of a verifier and whether the verifier is frozen. A frozen verifier cannot be routed to.
struct VerifierRoute {
address verifier;
bool frozen;
}
ISP1VerifierGatewayEvents
RouteAdded
event RouteAdded(bytes4 selector, address verifier)
Emitted when a verifier route is added.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector that was added. |
| verifier | address | The address of the verifier contract. |
RouteFrozen
event RouteFrozen(bytes4 selector, address verifier)
Emitted when a verifier route is frozen.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector that was frozen. |
| verifier | address | The address of the verifier contract. |
ISP1VerifierGatewayErrors
RouteNotFound
error RouteNotFound(bytes4 selector)
Thrown when the verifier route is not found.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector that was specified. |
RouteIsFrozen
error RouteIsFrozen(bytes4 selector)
Thrown when the verifier route is found, but is frozen.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector that was specified. |
RouteAlreadyExists
error RouteAlreadyExists(address verifier)
Thrown when adding a verifier route and the selector already contains a route.
Parameters
| Name | Type | Description |
|---|---|---|
| verifier | address | The address of the verifier contract in the existing route. |
SelectorCannotBeZero
error SelectorCannotBeZero()
Thrown when adding a verifier route and the selector returned by the verifier is zero.
ISP1VerifierGateway
This contract is the interface for the SP1 Verifier Gateway.
routes
function routes(bytes4 selector) external view returns (address verifier, bool frozen)
Mapping of 4-byte verifier selectors to verifier routes.
Only one verifier route can be added for each selector.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector, which is both the first 4 bytes of the VERIFIER_HASH and the first 4 bytes of the proofs designed for that verifier. |
Return Values
| Name | Type | Description |
|---|---|---|
| verifier | address | The address of the verifier contract. |
| frozen | bool | Whether the verifier is frozen. |
addRoute
function addRoute(address verifier) external
Adds a verifier route. This enable proofs to be routed to this verifier.
Only callable by the owner. The owner is responsible for ensuring that the specified verifier is correct with a valid VERIFIER_HASH. Once a route to a verifier is added, it cannot be removed.
Parameters
| Name | Type | Description |
|---|---|---|
| verifier | address | The address of the verifier contract. This verifier MUST implement the ISP1VerifierWithHash interface. |
freezeRoute
function freezeRoute(bytes4 selector) external
Freezes a verifier route. This prevents proofs from being routed to this verifier.
Only callable by the owner. Once a route to a verifier is frozen, it cannot be unfrozen.
Parameters
| Name | Type | Description |
|---|---|---|
| selector | bytes4 | The verifier selector to freeze. |