Documentation ¶
Index ¶
- type Hooks
- type Keeper
- func (k Keeper) CallEVM(ctx sdk.Context, abi abi.ABI, from, contract common.Address, commit bool, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallEVMWithData(ctx sdk.Context, from common.Address, contract *common.Address, data []byte, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) ConvertCoin(goCtx context.Context, msg *types.MsgConvertCoin) (*types.MsgConvertCoinResponse, error)
- func (k Keeper) ConvertERC20(goCtx context.Context, msg *types.MsgConvertERC20) (*types.MsgConvertERC20Response, error)
- func (k Keeper) CreateCoinMetadata(ctx sdk.Context, contract common.Address) (*banktypes.Metadata, error)
- func (k Keeper) DeleteERC20Map(ctx sdk.Context, erc20 common.Address)
- func (k Keeper) DeleteTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) DeployERC20Contract(ctx sdk.Context, coinMetadata banktypes.Metadata) (common.Address, error)
- func (k Keeper) GetAllTokenPairs(ctx sdk.Context) []types.TokenPair
- func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool)
- func (k Keeper) GetDenomMap(ctx sdk.Context, denom string) []byte
- func (k Keeper) GetERC20Map(ctx sdk.Context, erc20 common.Address) []byte
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetTokenPair(ctx sdk.Context, id []byte) (types.TokenPair, bool)
- func (k Keeper) GetTokenPairID(ctx sdk.Context, token string) []byte
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IsDenomRegistered(ctx sdk.Context, denom string) bool
- func (k Keeper) IsERC20Registered(ctx sdk.Context, erc20 common.Address) bool
- func (k Keeper) IsTokenPairRegistered(ctx sdk.Context, id []byte) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintingEnabled(ctx sdk.Context, sender, receiver sdk.AccAddress, token string) (types.TokenPair, error)
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement) exported.Acknowledgement
- func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) QueryERC20(ctx sdk.Context, contract common.Address) (types.ERC20Data, error)
- func (k Keeper) RegisterCoin(ctx sdk.Context, coinMetadata banktypes.Metadata) (*types.TokenPair, error)
- func (k Keeper) RegisterERC20(ctx sdk.Context, contract common.Address) (*types.TokenPair, error)
- func (k Keeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, ...) (uint64, error)
- func (k Keeper) SetDenomMap(ctx sdk.Context, denom string, id []byte)
- func (k Keeper) SetERC20Map(ctx sdk.Context, erc20 common.Address, id []byte)
- func (k *Keeper) SetIBCKeeper(ibcKeeper ibctransferkeeper.Keeper)
- func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) ToggleRelay(ctx sdk.Context, token string) (types.TokenPair, error)
- func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
- func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)
- func (k Keeper) TransferERC20(goCtx context.Context, msg *types.MsgTransferERC20) (*types.MsgTransferERC20Response, error)
- func (k Keeper) UpdateTokenPairERC20(ctx sdk.Context, erc20Addr, newERC20Addr common.Address) (types.TokenPair, error)
- func (k Keeper) WriteAcknowledgement(ctx sdk.Context, channelCap *capabilitytypes.Capability, ...) error
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for erc20 keeper
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of this module maintains collections of erc20.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, ps paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, ek types.EVMKeeper, ) *Keeper
NewKeeper creates new instances of the erc20 Keeper
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM( ctx sdk.Context, abi abi.ABI, from, contract common.Address, commit bool, method string, args ...interface{}, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVM performs a smart contract method call using given args
func (Keeper) CallEVMWithData ¶
func (k Keeper) CallEVMWithData( ctx sdk.Context, from common.Address, contract *common.Address, data []byte, commit bool, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVMWithData performs a smart contract method call using contract data
func (Keeper) ConvertCoin ¶
func (k Keeper) ConvertCoin( goCtx context.Context, msg *types.MsgConvertCoin, ) (*types.MsgConvertCoinResponse, error)
ConvertCoin converts Cosmos-native Coins into ERC20 tokens for both Cosmos-native and ERC20 TokenPair Owners
func (Keeper) ConvertERC20 ¶
func (k Keeper) ConvertERC20( goCtx context.Context, msg *types.MsgConvertERC20, ) (*types.MsgConvertERC20Response, error)
ConvertERC20 converts ERC20 tokens into Cosmos-native Coins for both Cosmos-native and ERC20 TokenPair Owners
func (Keeper) CreateCoinMetadata ¶
func (k Keeper) CreateCoinMetadata(ctx sdk.Context, contract common.Address) (*banktypes.Metadata, error)
CreateCoinMetadata generates the metadata to represent the ERC20 token on Uptick.
func (Keeper) DeleteERC20Map ¶
DeleteERC20Map deletes the token pair id for the given address
func (Keeper) DeleteTokenPair ¶
DeleteTokenPair removes a token pair.
func (Keeper) DeployERC20Contract ¶
func (k Keeper) DeployERC20Contract( ctx sdk.Context, coinMetadata banktypes.Metadata, ) (common.Address, error)
DeployERC20Contract creates and deploys an ERC20 contract on the EVM with the erc20 module account as owner.
func (Keeper) GetAllTokenPairs ¶
GetAllTokenPairs - get all registered token tokenPairs
func (Keeper) GetAppVersion ¶ added in v0.2.3
GetAppVersion returns the underlying application version.
func (Keeper) GetDenomMap ¶
GetDenomMap returns the token pair id for the given denomination
func (Keeper) GetERC20Map ¶
GetERC20Map returns the token pair id for the given address
func (Keeper) GetTokenPair ¶
GetTokenPair - get registered token pair from the identifier
func (Keeper) GetTokenPairID ¶
GetTokenPairID returns the pair id from either of the registered tokens.
func (Keeper) IsDenomRegistered ¶
IsDenomRegistered check if registered coin denom is registered
func (Keeper) IsERC20Registered ¶
IsERC20Registered check if registered ERC20 token is registered
func (Keeper) IsTokenPairRegistered ¶
IsTokenPairRegistered - check if registered token tokenPair is registered
func (Keeper) MintingEnabled ¶
func (k Keeper) MintingEnabled(ctx sdk.Context, sender, receiver sdk.AccAddress, token string) (types.TokenPair, error)
MintingEnabled checks that:
- the global parameter for intrarelaying is enabled
- minting is enabled for the given (erc20,coin) token pair
- recipient address is not on the blocked list
- bank module transfers are enabled for the Cosmos coin
func (Keeper) OnAcknowledgementPacket ¶ added in v0.2.0
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData, ack channeltypes.Acknowledgement) error
OnAcknowledgementPacket responds to the success or failure of a packet acknowledgement written on the receiving chain. If the acknowledgement was a success then nothing occurs. If the acknowledgement failed, then the sender is refunded their tokens using the refundPacketToken function.
func (Keeper) OnRecvPacket ¶ added in v0.2.0
func (k Keeper) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement, ) exported.Acknowledgement
OnRecvPacket will get the denom name from ibc ,generate by port/channel/denom
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params return hub contract param
func (Keeper) QueryERC20 ¶
QueryERC20 returns the data of a deployed ERC20 contract
func (Keeper) RegisterCoin ¶
func (k Keeper) RegisterCoin(ctx sdk.Context, coinMetadata banktypes.Metadata) (*types.TokenPair, error)
RegisterCoin deploys an erc20 contract and creates the token pair for the existing cosmos coin
func (Keeper) RegisterERC20 ¶
RegisterERC20 creates a cosmos coin and registers the token pair between the coin and the ERC20
func (Keeper) SendPacket ¶ added in v0.2.0
func (k Keeper) SendPacket( ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte, ) (uint64, error)
func (Keeper) SetDenomMap ¶
SetDenomMap sets the token pair id for the denomination
func (Keeper) SetERC20Map ¶
SetERC20Map sets the token pair id for the given address
func (*Keeper) SetIBCKeeper ¶ added in v0.2.16
func (k *Keeper) SetIBCKeeper(ibcKeeper ibctransferkeeper.Keeper)
SetIBCKeeper sets the ICS4 wrapper to the keeper. It panics if already set
func (*Keeper) SetICS4Wrapper ¶ added in v0.2.0
func (k *Keeper) SetICS4Wrapper(ics4Wrapper porttypes.ICS4Wrapper)
SetICS4Wrapper sets the ICS4 wrapper to the keeper. It panics if already set
func (Keeper) SetTokenPair ¶
SetTokenPair stores a token pair
func (Keeper) ToggleRelay ¶
ToggleRelay toggles relaying for a given token pair
func (Keeper) TokenPair ¶
func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
TokenPair returns a given registered token pair
func (Keeper) TokenPairs ¶
func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)
TokenPairs return registered pairs
func (Keeper) TransferERC20 ¶ added in v0.2.16
func (k Keeper) TransferERC20( goCtx context.Context, msg *types.MsgTransferERC20, ) ( *types.MsgTransferERC20Response, error, )
TransferERC20 converts ERC20 tokens into native Cosmos nft for both Cosmos-native and ERC20 TokenPair Owners and transfer through IBC
func (Keeper) UpdateTokenPairERC20 ¶
func (k Keeper) UpdateTokenPairERC20(ctx sdk.Context, erc20Addr, newERC20Addr common.Address) (types.TokenPair, error)
UpdateTokenPairERC20 updates the ERC20 token address for the registered token pair
func (Keeper) WriteAcknowledgement ¶ added in v0.2.0
func (k Keeper) WriteAcknowledgement(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error