Documentation ¶
Index ¶
- func BytesToBigInt(data []byte) *big.Int
- func CoinIsZRC20(denom string) bool
- func CreateZRC20CoinSet(zrc20address common.Address, amount *big.Int) (sdk.Coins, error)
- func GetCosmosAddress(bankKeeper bank.Keeper, addr common.Address) (sdk.AccAddress, error)
- func GetEVMCallerAddress(evm *vm.EVM, contract *vm.Contract) (common.Address, error)
- func ZRC20ToCosmosDenom(ZRC20Address common.Address) string
- type BaseContract
- type ContractCaller
- type ErrDisabledMethod
- type ErrInsufficientBalance
- type ErrInvalidAddr
- type ErrInvalidAmount
- type ErrInvalidArgument
- type ErrInvalidCoin
- type ErrInvalidMethod
- type ErrInvalidNumberOfArgs
- type ErrInvalidToken
- type ErrUnexpected
- type ErrWriteMethod
- type ExtStateDB
- type Registrable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToBigInt ¶
func CoinIsZRC20 ¶
CoinIsZRC20 checks if a given coin is a ZRC20 coin based on its denomination.
func CreateZRC20CoinSet ¶
func GetCosmosAddress ¶
GetCosmosAddress returns the counterpart cosmos address of the given ethereum address. It checks if the address is empty or blocked by the bank keeper.
func GetEVMCallerAddress ¶
GetEVMCallerAddress returns the caller address. Usually the caller is the contract.CallerAddress, which is the address of the contract that called the precompiled contract. If contract.CallerAddress != evm.Origin is true, it means the call was made through a contract, on which case there is a need to set the caller to the evm.Origin.
func ZRC20ToCosmosDenom ¶
ZRC20ToCosmosDenom returns the cosmos coin address for a given ZRC20 address. This is converted to "zrc20/{ZRC20Address}".
Types ¶
type BaseContract ¶
type BaseContract interface { Registrable ContractCaller }
func NewBaseContract ¶
func NewBaseContract(address common.Address) BaseContract
type ContractCaller ¶
type ErrDisabledMethod ¶
type ErrDisabledMethod struct {
Method string
}
func (ErrDisabledMethod) Error ¶
func (e ErrDisabledMethod) Error() string
type ErrInsufficientBalance ¶
func (ErrInsufficientBalance) Error ¶
func (e ErrInsufficientBalance) Error() string
type ErrInvalidAddr ¶
func (ErrInvalidAddr) Error ¶
func (e ErrInvalidAddr) Error() string
type ErrInvalidAmount ¶
type ErrInvalidAmount struct {
Got string
}
func (ErrInvalidAmount) Error ¶
func (e ErrInvalidAmount) Error() string
type ErrInvalidArgument ¶
type ErrInvalidArgument struct {
Got any
}
func (ErrInvalidArgument) Error ¶
func (e ErrInvalidArgument) Error() string
type ErrInvalidCoin ¶
func (ErrInvalidCoin) Error ¶
func (e ErrInvalidCoin) Error() string
type ErrInvalidMethod ¶
type ErrInvalidMethod struct {
Method string
}
func (ErrInvalidMethod) Error ¶
func (e ErrInvalidMethod) Error() string
type ErrInvalidNumberOfArgs ¶
type ErrInvalidNumberOfArgs struct {
Got, Expect int
}
func (ErrInvalidNumberOfArgs) Error ¶
func (e ErrInvalidNumberOfArgs) Error() string
type ErrInvalidToken ¶
func (ErrInvalidToken) Error ¶
func (e ErrInvalidToken) Error() string
type ErrUnexpected ¶
func (ErrUnexpected) Error ¶
func (e ErrUnexpected) Error() string
type ErrWriteMethod ¶
type ErrWriteMethod struct {
Method string
}
func (ErrWriteMethod) Error ¶
func (e ErrWriteMethod) Error() string
type ExtStateDB ¶
type ExtStateDB interface { vm.StateDB ExecuteNativeAction( contract common.Address, converter statedb.EventConverter, action func(ctx sdk.Context) error, ) error CacheContext() sdk.Context }
ExtStateDB defines extra methods of statedb to support stateful precompiled contracts. It's used to persist changes into the store.