Documentation
¶
Overview ¶
Package precompile implements custom precompiles for the Nibiru EVM.
Precompiles are special, built-in contract interfaces that exist at predefined addresses and run custom logic outside of what is possible in standard Solidity contracts. This package extends the default Ethereum precompiles with Nibiru-specific functionality.
Key components:
- InitPrecompiles: Initializes and returns a map of precompiled contracts.
- PrecompileFunToken: Implements the FunToken precompile for ERC20-to-bank transfers.
The package also provides utility functions for working with precompiles, such as "ABIMethodByID" and "OnRunStart" for common precompile execution setup.
Index ¶
- Variables
- func DecomposeInput(abi *gethabi.ABI, input []byte) (method *gethabi.Method, args []interface{}, err error)
- func InitPrecompiles(k keepers.PublicKeepers) (precompiles map[gethcommon.Address]vm.PrecompiledContract)
- func PrecompileFunToken(keepers keepers.PublicKeepers) vm.PrecompiledContract
- type FunTokenMethod
Constants ¶
This section is empty.
Variables ¶
var PrecompileAddr_FunToken = gethcommon.HexToAddress("0x0000000000000000000000000000000000000800")
Precompile address for "FunToken.sol", the contract that enables transfers of ERC20 tokens to "nibi" addresses as bank coins using the ERC20's `FunToken` mapping.
Functions ¶
func DecomposeInput ¶
func InitPrecompiles ¶
func InitPrecompiles( k keepers.PublicKeepers, ) (precompiles map[gethcommon.Address]vm.PrecompiledContract)
InitPrecompiles initializes and returns a map of precompiled contracts for the EVM. It combines default Ethereum precompiles with custom Nibiru precompiles.
Parameters:
- k: A keepers.PublicKeepers instance providing access to various blockchain state.
Returns:
- A map of Ethereum addresses to PrecompiledContract implementations.
func PrecompileFunToken ¶
func PrecompileFunToken(keepers keepers.PublicKeepers) vm.PrecompiledContract
Types ¶
type FunTokenMethod ¶
type FunTokenMethod string
const (
FunTokenMethod_BankSend FunTokenMethod = "bankSend"
)