Documentation
¶
Index ¶
- Constants
- func GetKiiAddressByEvmAddress(ctx sdk.Context, evmAddress common.Address) (sdk.AccAddress, error)
- func NewMsgTransfer(ctx sdk.Context, method *abi.Method, sender common.Address, args []interface{}) (*types.MsgTransfer, error)
- func ValidateArgsLength(args []interface{}, length int) error
- type Precompile
- func (p *Precompile) EmitEventTransfer(ctx sdk.Context, stateDB vm.StateDB, caller common.Address, ...) (err error)
- func (p Precompile) GetAdjustedTimestamp(ctx sdk.Context, clientID string, height clienttypes.Height) (uint64, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) LogTransfer(ctx sdk.Context, method *abi.Method, msg *types.MsgTransfer)
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (p Precompile) NewMsgTransferDefaultTimeout(ctx sdk.Context, method *abi.Method, sender common.Address, args []interface{}) (*types.MsgTransfer, error)
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- func (p Precompile) Transfer(ctx sdk.Context, method *abi.Method, stateDB vm.StateDB, args []interface{}, ...) ([]byte, error)
- func (p Precompile) TransferWithDefaultTimeout(ctx sdk.Context, method *abi.Method, stateDB vm.StateDB, args []interface{}, ...) ([]byte, error)
- type TransferEvent
- type ValidatedArgs
Constants ¶
const ( TransferMethod = "transfer" TransferWithDefaultTimeoutMethod = "transferWithDefaultTimeout" )
const ( DefaultBlockIncrement = 100 DefaultTimeIncrement = 10 * time.Minute )
Default increment values
const (
// EventTypeTransfer define the event when a transfer is done via contract
EventTypeTransfer = "Transfer"
)
const (
IBCPrecompileAddress = "0x0000000000000000000000000000000000001002"
)
Variables ¶
This section is empty.
Functions ¶
func GetKiiAddressByEvmAddress ¶
GetKiiAddressByEvmAddress transforms evm address into a kii address
func NewMsgTransfer ¶
func NewMsgTransfer( ctx sdk.Context, method *abi.Method, sender common.Address, args []interface{}, ) (*types.MsgTransfer, error)
NewMsgTransfer creates a new Transfer message
func ValidateArgsLength ¶
ValidateArgsLength checks if the length of the args is as expected
Types ¶
type Precompile ¶
type Precompile struct {
cmn.Precompile
// contains filtered or unexported fields
}
Precompile defines the struct for the ibc precompile
func NewPrecompile ¶
func NewPrecompile( transferKeeper ibctransferkeeper.Keeper, clientKeeper clientkeeper.Keeper, connectionKeeper connectionkeeper.Keeper, channelKeeper channelkeeper.Keeper, ) (*Precompile, error)
NewPrecompile defines creates a new instance of ibc precompile
func (*Precompile) EmitEventTransfer ¶
func (p *Precompile) EmitEventTransfer( ctx sdk.Context, stateDB vm.StateDB, caller common.Address, receiver, denom, port, channel string, amount *big.Int, height clienttypes.Height, timeoutTimestamp uint64, memo string, ) (err error)
EmitEventTransfer emits the Transfer event
func (Precompile) GetAdjustedTimestamp ¶
func (p Precompile) GetAdjustedTimestamp(ctx sdk.Context, clientID string, height clienttypes.Height) (uint64, error)
GetAdjustedTimestamp creates default timestamp from height and unix
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
IsTransaction checks if the method is a transaction
func (Precompile) LogTransfer ¶ added in v5.2.0
func (p Precompile) LogTransfer(ctx sdk.Context, method *abi.Method, msg *types.MsgTransfer)
LogTransfer logs a given transfer in the debug stream msg received here already passed basic validation
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns the logger for the precompile
func (Precompile) NewMsgTransferDefaultTimeout ¶
func (p Precompile) NewMsgTransferDefaultTimeout( ctx sdk.Context, method *abi.Method, sender common.Address, args []interface{}, ) (*types.MsgTransfer, error)
NewMsgTransferDefaultTimeout builds a new transfer message while collecting timeout information
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas returns the gas required for the precompile This is the same implementation as the one from the EVM module pre-compiles
type TransferEvent ¶
type TransferEvent struct {
Caller common.Address
Denom common.Hash
Receiver common.Hash
Port string
Channel string
Amount *big.Int
RevisionNumber uint64
RevisionHeight uint64
TimeoutTimestamp uint64
Memo string
}
TransferEvent represents the solidity event that is logged
type ValidatedArgs ¶
type ValidatedArgs struct {
// contains filtered or unexported fields
}
ValidatedArgs stores common args that have been validated