StaticPrecompiles.WithPclPrecompile
(s StaticPrecompiles) WithPclPrecompile(bankKeeper, pclKeeper) StaticPrecompiles This method adds the PCL (Programmable Compliance Layer) precompile to a StaticPrecompiles map. It instantiates the precompile, injects its required keeper dependencies, and registers it at its designated on-chain address. This is part of the builder pattern used to construct the full precompile set.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
s | StaticPrecompiles | ✓ | The receiver; the precompile map to which the PCL precompile will be added. |
bankKeeper | cmn.BankKeeper | ✓ | The x/bank module keeper, used for certain compliance checks that may involve token transfers. |
pclKeeper | *pclkeeper.Keeper | ✓ | The x/pcl module keeper, used to access policy templates, contract policy registrations, and the simulation engine. |
Returns
Type:
StaticPrecompiles Returns the modified StaticPrecompiles map, now containing the PCL precompile, to allow for method chaining.
Examples
Chained invocation
This shows the intended usage within `DefaultStaticPrecompiles`, where methods are chained to build up the final set of Maroo-specific precompiles.
marooPrecompiles := StaticPrecompiles(precompiles).
WithOkrwPrecompile(bankKeeper, okrwKeeper, accountKeeper).
WithPclPrecompile(bankKeeper, pclKeeper) Manual construction
This example illustrates how a developer could manually add just the PCL precompile to a new, empty precompile map.
customSet := make(precompiletypes.StaticPrecompiles)
// Cast to Maroo's type to access the method
marooSet := types.StaticPrecompiles(customSet)
marooSet.WithPclPrecompile(bankKeeper, pclKeeper)
// The PCL precompile is now in the customSet map