testnet
GitHub

StaticPrecompiles.WithOkrwPrecompile

(s StaticPrecompiles) WithOkrwPrecompile(bankKeeper, okrwKeeper, accountKeeper) StaticPrecompiles

This method adds the OKRW 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 OKRW precompile will be added.
bankKeeper cmn.BankKeeper The x/bank module keeper, used for handling OKRW token transfers and balance queries.
okrwKeeper okrwkeeper.Keeper The x/okrw module keeper, used to access minting logic, permissions, and module-specific parameters.
accountKeeper okrwtypes.AccountKeeper The x/auth module keeper, used for account existence checks and other account-related operations.

Returns

Type: StaticPrecompiles

Returns the modified StaticPrecompiles map, now containing the OKRW 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 OKRW 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.WithOkrwPrecompile(bankKeeper, okrwKeeper, accountKeeper)

// The OKRW precompile is now in the customSet map
ESC
Type to search