Examples
High-level integration patterns
Before Any Integration
Configure Your Policy: Before integrating Predicate, you must deploy a policy or use an existing one. The policy ID
must be stored in the ServiceManager
contract.
Access the Network: The Predicate labs entity maintains a free service (middleware) which has been optimized for broadcasting tasks and aggregating signatures from the Operator Network.
Bridge Integration
This sample bridge contract inherits the Predicate Client, a library which provides necessary functions to enforce the corresponding policy.
One such function is authorizeTransactions
, which verifies that the signatures nested in the authorization parameters
belong to registered Predicate Operators.
Before users submit a transaction to the above contract, the interface must fetch signatures from the Predicate Network.
Each Operator in the Predicate Network enforces and signs the transaction referencing the latest policy set by the
application owner (see the Predicate ServiceManager
contract).
To fetch these signatures, the front end makes an API call to the Predicate Middleware, which returns the signatures alongside the transaction. The following is an example of how this is done.