Documentation
¶
Index ¶
- Variables
- func AbiArgumentsForPayload() abi.Arguments
- func NewEVMHooks(k Keeper) evmtypes.EvmHooks
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type EVMHooks
- type Keeper
- func (k Keeper) AddPendingInbound(ctx context.Context, inbound types.Inbound) error
- func (k Keeper) AllPendingInbounds(goCtx context.Context, req *types.QueryAllPendingInboundsRequest) (*types.QueryAllPendingInboundsResponse, error)
- func (k Keeper) AttachOutboundsToExistingUniversalTx(ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, ...) error
- func (k Keeper) AttachRescueOutboundFromReceipt(ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, pcTx types.PCTx) error
- func (k Keeper) BuildOutboundsFromReceipt(ctx context.Context, utxId string, receipt *evmtypes.MsgEthereumTxResponse) ([]*types.OutboundTx, error)
- func (k Keeper) BuildPcUniversalTxKey(ctx context.Context, pc types.PCTx) (string, error)
- func (k Keeper) CalculateGasCost(baseFee sdkmath.LegacyDec, maxFeePerGas *big.Int, ...) (*big.Int, error)
- func (k Keeper) CallExecuteUniversalTx(ctx sdk.Context, recipientAddr common.Address, sourceChain string, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallFactoryGetOriginForUEA(ctx sdk.Context, from, factoryAddr, ueaAddr common.Address) (*types.UniversalAccountId, bool, error)
- func (k Keeper) CallFactoryToDeployUEA(ctx sdk.Context, from, factoryAddr common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallFactoryToGetUEAAddressForOrigin(ctx sdk.Context, from, factoryAddr common.Address, ...) (common.Address, bool, error)
- func (k Keeper) CallPRC20Deposit(ctx sdk.Context, prc20Address, to common.Address, amount *big.Int) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallPRC20DepositAutoSwap(ctx sdk.Context, prc20Address, to common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallUEADomainSeparator(ctx sdk.Context, from, ueaAddr common.Address) ([32]byte, error)
- func (k Keeper) CallUEAExecutePayload(ctx sdk.Context, from, ueaAddr common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallUEAMigrateUEA(ctx sdk.Context, from, ueaAddr common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallUniversalCoreRefundUnusedGas(ctx sdk.Context, gasToken common.Address, amount *big.Int, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallUniversalCoreSetChainMeta(ctx sdk.Context, chainNamespace string, price *big.Int, chainHeight *big.Int) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallUniversalCoreSetGasPrice(ctx sdk.Context, chainID string, price *big.Int) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CreateUniversalTx(ctx context.Context, key string, utx types.UniversalTx) error
- func (k Keeper) CreateUniversalTxFromPCTx(ctx context.Context, pcTx types.PCTx) (*types.UniversalTx, error)
- func (k Keeper) CreateUniversalTxFromReceiptIfOutbound(ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, pcTx types.PCTx) error
- func (k Keeper) DeductAndBurnFees(ctx context.Context, from sdk.AccAddress, gasCost *big.Int) error
- func (k Keeper) DeployUEA(ctx context.Context, evmFrom common.Address, ...) ([]byte, error)
- func (k Keeper) DeployUEAV2(ctx context.Context, evmFrom common.Address, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) ExecuteInbound(ctx context.Context, utx types.UniversalTx) error
- func (k Keeper) ExecuteInboundFunds(ctx context.Context, utx types.UniversalTx) error
- func (k Keeper) ExecuteInboundFundsAndPayload(ctx context.Context, utx types.UniversalTx) error
- func (k Keeper) ExecuteInboundGas(ctx context.Context, inbound types.Inbound) error
- func (k Keeper) ExecuteInboundGasAndPayload(ctx context.Context, utx types.UniversalTx) error
- func (k Keeper) ExecutePayload(ctx context.Context, evmFrom common.Address, ...) error
- func (k Keeper) ExecutePayloadV2(ctx context.Context, evmFrom common.Address, ueaAddr common.Address, ...) (*vmtypes.MsgEthereumTxResponse, error)
- func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState
- func (k Keeper) FinalizeOutbound(ctx context.Context, utxId string, outbound types.OutboundTx) error
- func (k Keeper) GetChainMeta(ctx context.Context, chainID string) (types.ChainMeta, bool, error)
- func (k Keeper) GetDefaultFeeTierForToken(ctx sdk.Context, prc20Address common.Address) (*big.Int, error)
- func (k Keeper) GetGasPrice(ctx context.Context, chainID string) (types.GasPrice, bool, error)
- func (k Keeper) GetModuleAccountNonce(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetPayloadHashEVM(ctx sdk.Context, from, ueaAddr common.Address, ...) (common.Hash, error)
- func (k Keeper) GetSwapQuote(ctx sdk.Context, quoterAddr, prc20Address, wpcAddress common.Address, ...) (*big.Int, error)
- func (k *Keeper) GetUeModuleAddress(ctx context.Context) (common.Address, string)
- func (k Keeper) GetUniversalCoreQuoterAddress(ctx sdk.Context) (common.Address, error)
- func (k Keeper) GetUniversalCoreWPCAddress(ctx sdk.Context) (common.Address, error)
- func (k Keeper) GetUniversalTx(ctx context.Context, key string) (types.UniversalTx, bool, error)
- func (k Keeper) HasUniversalTx(ctx context.Context, key string) (bool, error)
- func (k Keeper) IncrementModuleAccountNonce(ctx sdk.Context) (uint64, error)
- func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error
- func (k Keeper) IsPendingInbound(ctx context.Context, inbound types.Inbound) (bool, error)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) MigrateGasPricesToChainMeta(ctx context.Context) error
- func (k Keeper) MigrateUEA(ctx context.Context, evmFrom common.Address, ...) error
- func (k Keeper) MintPCTokensDirectly(ctx sdk.Context, recipient sdk.AccAddress, amount sdkmath.Int) error
- func (k Keeper) RemovePendingInbound(ctx context.Context, inbound types.Inbound) error
- func (k Keeper) SchemaBuilder() *collections.SchemaBuilder
- func (k Keeper) SetChainMeta(ctx context.Context, chainID string, chainMeta types.ChainMeta) error
- func (k Keeper) SetGasPrice(ctx context.Context, chainID string, gasPrice types.GasPrice) error
- func (k Keeper) SetModuleAccountNonce(ctx sdk.Context, nonce uint64) error
- func (k Keeper) StoreVerifiedPayloadHash(ctx sdk.Context, utx types.UniversalTx, ueaAddr common.Address, ...) error
- func (k Keeper) UpdateOutbound(ctx context.Context, utxId string, outbound types.OutboundTx) error
- func (k Keeper) UpdateParams(ctx context.Context, params types.Params) error
- func (k Keeper) UpdateUniversalTx(ctx context.Context, key string, updateFn func(*types.UniversalTx) error) error
- func (k Keeper) VoteChainMeta(ctx context.Context, universalValidator sdk.ValAddress, observedChainId string, ...) error
- func (k Keeper) VoteGasPrice(ctx context.Context, universalValidator sdk.ValAddress, observedChainId string, ...) error
- func (k Keeper) VoteInbound(ctx context.Context, universalValidator sdk.ValAddress, inbound types.Inbound) error
- func (k Keeper) VoteOnInboundBallot(ctx context.Context, universalValidator sdk.ValAddress, inbound types.Inbound) (isFinalized bool, isNew bool, err error)
- func (k Keeper) VoteOnOutboundBallot(ctx context.Context, universalValidator sdk.ValAddress, utxId string, ...) (isFinalized bool, isNew bool, err error)
- func (k Keeper) VoteOutbound(ctx context.Context, universalValidator sdk.ValAddress, utxId string, ...) error
- type Querier
- func (k Querier) AllChainMetas(goCtx context.Context, req *types.QueryAllChainMetasRequest) (*types.QueryAllChainMetasResponse, error)
- func (k Querier) AllGasPrices(goCtx context.Context, req *types.QueryAllGasPricesRequest) (*types.QueryAllGasPricesResponse, error)
- func (k Querier) AllUniversalTx(goCtx context.Context, req *types.QueryAllUniversalTxRequest) (*types.QueryAllUniversalTxResponse, error)
- func (k Querier) ChainMeta(goCtx context.Context, req *types.QueryChainMetaRequest) (*types.QueryChainMetaResponse, error)
- func (k Querier) GasPrice(goCtx context.Context, req *types.QueryGasPriceRequest) (*types.QueryGasPriceResponse, error)
- func (k Querier) GetUniversalTx(goCtx context.Context, req *types.QueryGetUniversalTxRequest) (*types.QueryGetUniversalTxResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- type QuerierV2
Constants ¶
This section is empty.
Variables ¶
var UNIVERSAL_PAYLOAD_TYPEHASH = common.HexToHash("0x1d8b43e5066bd20bfdacf7b8f4790c0309403b18434e3699ce3c5e57502ed8c4")
Functions ¶
func AbiArgumentsForPayload ¶
AbiArgumentsForPayload returns the abi.Arguments for encoding a UniversalPayload struct
func NewEVMHooks ¶ added in v0.0.13
NewEVMHooks creates a new instance of EVMHooks.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the module MsgServer interface
Types ¶
type EVMHooks ¶ added in v0.0.13
type EVMHooks struct {
// contains filtered or unexported fields
}
EVMHooks implements the EVM post-processing hooks. This hook will be invoked after every EVM transaction execution and is responsible for detecting outbound events and creating UniversalTx if needed.
func (EVMHooks) PostTxProcessing ¶ added in v0.0.13
func (h EVMHooks) PostTxProcessing( ctx sdk.Context, sender common.Address, msg core.Message, receipt *ethtypes.Receipt, ) error
PostTxProcessing is called by the EVM module after transaction execution. It inspects the receipt and creates UniversalTx + Outbound only if UniversalTxWithdraw event is detected.
type Keeper ¶
type Keeper struct {
Params collections.Item[types.Params]
// Inbound trackers
PendingInbounds collections.KeySet[string]
// UniversalTx collection
UniversalTx collections.Map[string, types.UniversalTx]
// Module account manual nonce
ModuleAccountNonce collections.Item[uint64]
// GasPrices collection stores aggregated gas price data for each chain
GasPrices collections.Map[string, types.GasPrice]
// ChainMetas collection stores aggregated chain metadata (gas price + block height) for each chain
ChainMetas collections.Map[string, types.ChainMeta]
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, logger log.Logger, authority string, evmKeeper types.EVMKeeper, feemarketKeeper types.FeeMarketKeeper, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, uregistryKeeper types.UregistryKeeper, utxverifierKeeper types.UtxverifierKeeper, uvalidatorKeeper types.UValidatorKeeper, ) Keeper
NewKeeper creates a new Keeper instance
func (Keeper) AddPendingInbound ¶
AddPendingInbound adds an inbound synthetic to the pending set if not already present
func (Keeper) AllPendingInbounds ¶
func (k Keeper) AllPendingInbounds(goCtx context.Context, req *types.QueryAllPendingInboundsRequest) (*types.QueryAllPendingInboundsResponse, error)
AllPendingInbounds implements types.QueryServer.
func (Keeper) AttachOutboundsToExistingUniversalTx ¶ added in v0.0.13
func (k Keeper) AttachOutboundsToExistingUniversalTx( ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, utx types.UniversalTx, ) error
AttachOutboundsToExistingUniversalTx Used when UniversalTx already exists (e.g. inbound execution) It attaches outbounds extracted from receipt to the existing utx.
func (Keeper) AttachRescueOutboundFromReceipt ¶ added in v0.0.19
func (k Keeper) AttachRescueOutboundFromReceipt( ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, pcTx types.PCTx, ) error
AttachRescueOutboundFromReceipt scans the receipt for RescueFundsOnSourceChain events emitted by UniversalGatewayPC and, for each one found, attaches a RESCUE_FUNDS outbound to the original UTX referenced by the event's universalTxId.
Unlike normal outbounds (which create a new UTX), rescue outbounds are appended to the already-existing UTX whose funds are stuck on the source chain.
func (Keeper) BuildOutboundsFromReceipt ¶ added in v0.0.13
func (k Keeper) BuildOutboundsFromReceipt( ctx context.Context, utxId string, receipt *evmtypes.MsgEthereumTxResponse, ) ([]*types.OutboundTx, error)
func (Keeper) BuildPcUniversalTxKey ¶ added in v0.0.13
func (Keeper) CalculateGasCost ¶
func (k Keeper) CalculateGasCost( baseFee sdkmath.LegacyDec, maxFeePerGas *big.Int, maxPriorityFeePerGas *big.Int, gasUsed uint64, ) (*big.Int, error)
CalculateGasCost calculates the gas cost based on EIP-1559 fee mechanism: 1. Effective Gas Price = min(maxFeePerGas, baseFee + maxPriorityFeePerGas) 2. Total Fee = gasUsed × Effective Gas Price Parameters: - baseFee: current network base fee - maxFeePerGas: maximum total fee user is willing to pay - maxPriorityFeePerGas: maximum tip to validator - gasUsed: amount of gas consumed
func (Keeper) CallExecuteUniversalTx ¶ added in v0.0.19
func (k Keeper) CallExecuteUniversalTx( ctx sdk.Context, recipientAddr common.Address, sourceChain string, ceaAddress []byte, payload []byte, amount *big.Int, prc20AssetAddr common.Address, txId [32]byte, ) (*evmtypes.MsgEthereumTxResponse, error)
CallExecuteUniversalTx calls executeUniversalTx on a smart-contract recipient. This is used for isCEA inbounds whose recipient is a deployed contract (not a UEA).
func (Keeper) CallFactoryGetOriginForUEA ¶ added in v0.0.16
func (k Keeper) CallFactoryGetOriginForUEA( ctx sdk.Context, from, factoryAddr, ueaAddr common.Address, ) (*types.UniversalAccountId, bool, error)
CallFactoryGetOriginForUEA checks if a given address is a UEA Returns the UniversalAccountId and a boolean indicating if the address is a UEA
func (Keeper) CallFactoryToDeployUEA ¶
func (k Keeper) CallFactoryToDeployUEA( ctx sdk.Context, from, factoryAddr common.Address, universalAccount *types.UniversalAccountId, ) (*evmtypes.MsgEthereumTxResponse, error)
CallFactoryToDeployUEA deploys a new UEA using factory contract Returns deployment response or error if deployment fails
func (Keeper) CallFactoryToGetUEAAddressForOrigin ¶
func (k Keeper) CallFactoryToGetUEAAddressForOrigin( ctx sdk.Context, from, factoryAddr common.Address, universalAccount *types.UniversalAccountId, ) (common.Address, bool, error)
CallFactoryToGetUEAAddressForOrigin calls FactoryV1.getUEAForOrigin(...)
func (Keeper) CallPRC20Deposit ¶
func (k Keeper) CallPRC20Deposit( ctx sdk.Context, prc20Address, to common.Address, amount *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error)
Calls Handler Contract to deposit prc20 tokens
func (Keeper) CallPRC20DepositAutoSwap ¶
func (k Keeper) CallPRC20DepositAutoSwap( ctx sdk.Context, prc20Address, to common.Address, amount, fee, minPCOut *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error)
Calls Handler Contract to deposit prc20 tokens with auto-swap. fee and minPCOut must be pre-computed by the caller (see GetDefaultFeeTierForToken / GetSwapQuote).
func (Keeper) CallUEADomainSeparator ¶
func (k Keeper) CallUEADomainSeparator( ctx sdk.Context, from, ueaAddr common.Address, ) ([32]byte, error)
CallUEADomainSeparator fetches the domainSeparator from the UEA contract
func (Keeper) CallUEAExecutePayload ¶
func (k Keeper) CallUEAExecutePayload( ctx sdk.Context, from, ueaAddr common.Address, universal_payload *types.UniversalPayload, verificationData []byte, ) (*evmtypes.MsgEthereumTxResponse, error)
CallUEAExecutePayload executes a universal payload through UEA
func (Keeper) CallUEAMigrateUEA ¶
func (k Keeper) CallUEAMigrateUEA( ctx sdk.Context, from, ueaAddr common.Address, migration_payload *types.MigrationPayload, signature []byte, ) (*evmtypes.MsgEthereumTxResponse, error)
CallUEAMigrateUEA migrates UEA through existing UEA
func (Keeper) CallUniversalCoreRefundUnusedGas ¶ added in v0.0.19
func (k Keeper) CallUniversalCoreRefundUnusedGas( ctx sdk.Context, gasToken common.Address, amount *big.Int, recipient common.Address, withSwap bool, fee *big.Int, minPCOut *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error)
CallUniversalCoreRefundUnusedGas calls refundUnusedGas on UniversalCore to return excess gas fee to the recipient. withSwap=true swaps the gas token back to PC; withSwap=false deposits PRC20 directly.
func (Keeper) CallUniversalCoreSetChainMeta ¶ added in v0.0.19
func (k Keeper) CallUniversalCoreSetChainMeta( ctx sdk.Context, chainNamespace string, price *big.Int, chainHeight *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error)
Calls UniversalCore Contract to set chain metadata (gas price + chain height). The contract uses block.timestamp for the observed-at value.
func (Keeper) CallUniversalCoreSetGasPrice ¶
func (k Keeper) CallUniversalCoreSetGasPrice( ctx sdk.Context, chainID string, price *big.Int, ) (*evmtypes.MsgEthereumTxResponse, error)
Calls UniversalCore Contract to set gas price
func (Keeper) CreateUniversalTx ¶
CreateUniversalTx stores a new UniversalTx
func (Keeper) CreateUniversalTxFromPCTx ¶ added in v0.0.13
func (Keeper) CreateUniversalTxFromReceiptIfOutbound ¶ added in v0.0.13
func (k Keeper) CreateUniversalTxFromReceiptIfOutbound( ctx sdk.Context, receipt *evmtypes.MsgEthereumTxResponse, pcTx types.PCTx, ) error
CreateUniversalTxFromReceiptIfOutbound Creates a UniversalTx ONLY if outbound events exist in the receipt. Safe to call from ExecutePayload, EVM hooks
func (Keeper) DeductAndBurnFees ¶
DeductAndBurnFees deducts gas fees from the user's smart account and burns them. The process happens in two steps: 1. Transfer coins from user account to module account 2. Burn coins from module account Returns error if either transfer or burn fails
func (Keeper) DeployUEA ¶
func (k Keeper) DeployUEA(ctx context.Context, evmFrom common.Address, universalAccountId *types.UniversalAccountId) ([]byte, error)
updateParams is for updating params collections of the module
func (Keeper) DeployUEAV2 ¶
func (k Keeper) DeployUEAV2(ctx context.Context, evmFrom common.Address, universalAccountId *types.UniversalAccountId) (*evmtypes.MsgEthereumTxResponse, error)
updateParams is for updating params collections of the module
func (Keeper) ExecuteInbound ¶
func (Keeper) ExecuteInboundFunds ¶
func (Keeper) ExecuteInboundFundsAndPayload ¶
func (Keeper) ExecuteInboundGas ¶
func (Keeper) ExecuteInboundGasAndPayload ¶
func (Keeper) ExecutePayload ¶
func (k Keeper) ExecutePayload(ctx context.Context, evmFrom common.Address, universalAccountId *types.UniversalAccountId, universalPayload *types.UniversalPayload, verificationData string) error
updateParams is for updating params collections of the module
func (Keeper) ExecutePayloadV2 ¶
func (k Keeper) ExecutePayloadV2(ctx context.Context, evmFrom common.Address, ueaAddr common.Address, universalPayload *types.UniversalPayload, verificationData string) (*vmtypes.MsgEthereumTxResponse, error)
ExecutePayloadV2 executes a universal payload through a UEA. The caller is responsible for resolving and validating ueaAddr before calling this function.
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState
ExportGenesis exports the module's state to a genesis state.
func (Keeper) FinalizeOutbound ¶ added in v0.0.13
func (Keeper) GetChainMeta ¶ added in v0.0.19
func (Keeper) GetDefaultFeeTierForToken ¶ added in v0.0.19
func (k Keeper) GetDefaultFeeTierForToken(ctx sdk.Context, prc20Address common.Address) (*big.Int, error)
GetDefaultFeeTierForToken reads defaultFeeTier[prc20] from UniversalCore.
func (Keeper) GetGasPrice ¶
func (Keeper) GetModuleAccountNonce ¶
GetModuleAccountNonce returns the current module account nonce. If not set yet, it safely defaults to 0.
func (Keeper) GetPayloadHashEVM ¶
func (k Keeper) GetPayloadHashEVM( ctx sdk.Context, from, ueaAddr common.Address, payload types.AbiUniversalPayload, ) (common.Hash, error)
GetPayloadHashEVM computes the EIP-712 style payload hash using the UEA contract's domainSeparator
func (Keeper) GetSwapQuote ¶ added in v0.0.19
func (k Keeper) GetSwapQuote( ctx sdk.Context, quoterAddr, prc20Address, wpcAddress common.Address, fee, amount *big.Int, ) (*big.Int, error)
GetSwapQuote calls QuoterV2.quoteExactInputSingle (commit=false) to get the expected output amount for swapping prc20 → wpc.
func (*Keeper) GetUeModuleAddress ¶
func (Keeper) GetUniversalCoreQuoterAddress ¶ added in v0.0.19
GetUniversalCoreQuoterAddress reads the uniswapV3Quoter address stored in UniversalCore.
func (Keeper) GetUniversalCoreWPCAddress ¶ added in v0.0.19
GetUniversalCoreWPCAddress reads the WPC (wrapped PC) address stored in UniversalCore.
func (Keeper) GetUniversalTx ¶
GetUniversalTx retrieves a UniversalTx by key, returns (value, found, error). UniversalStatus is always populated on-the-fly from the actual component states so it is never stale regardless of what was written to storage.
func (Keeper) HasUniversalTx ¶
HasUniversalTx checks if a UniversalTx exists
func (Keeper) IncrementModuleAccountNonce ¶
IncrementModuleAccountNonce increases the nonce by 1 and stores it back.
func (*Keeper) InitGenesis ¶
InitGenesis initializes the module's state from a genesis state.
func (Keeper) IsPendingInbound ¶
IsPendingInbound checks if an inbound synthetic is pending
func (Keeper) MigrateGasPricesToChainMeta ¶ added in v0.0.19
MigrateGasPricesToChainMeta seeds ChainMetas from existing GasPrices entries. Called once during the chain-meta upgrade. Existing gas price data (prices, block_nums, median_index) is carried over; StoredAts defaults to zero (treated as stale until validators re-vote).
func (Keeper) MigrateUEA ¶
func (k Keeper) MigrateUEA(ctx context.Context, evmFrom common.Address, universalAccountId *types.UniversalAccountId, migrationPayload *types.MigrationPayload, signature string) error
updateParams is for updating params collections of the module
func (Keeper) MintPCTokensDirectly ¶
func (k Keeper) MintPCTokensDirectly(ctx sdk.Context, recipient sdk.AccAddress, amount sdkmath.Int) error
TODO: temporary don't use in any fn
func (Keeper) RemovePendingInbound ¶
RemovePendingInbound removes an inbound synthetic from the pending set
func (Keeper) SchemaBuilder ¶
func (k Keeper) SchemaBuilder() *collections.SchemaBuilder
func (Keeper) SetChainMeta ¶ added in v0.0.19
func (Keeper) SetGasPrice ¶
func (Keeper) SetModuleAccountNonce ¶
SetModuleAccountNonce allows explicitly setting the nonce (optional, for migration or testing).
func (Keeper) StoreVerifiedPayloadHash ¶
func (k Keeper) StoreVerifiedPayloadHash( ctx sdk.Context, utx types.UniversalTx, ueaAddr common.Address, ueModuleAccAddress common.Address, sender string, chain string, ) error
StoreVerifiedPayloadHash stores one payload hash for a given inbound tx. sender is the address to record as the verified sender (UEA owner for CEA, inbound sender otherwise). chain is the CAIP-2 chain identifier to store under (UEA origin chain for CEA, inbound source chain otherwise).
func (Keeper) UpdateOutbound ¶ added in v0.0.13
func (Keeper) UpdateParams ¶
updateParams is for updating params collections of the module
func (Keeper) UpdateUniversalTx ¶
func (k Keeper) UpdateUniversalTx( ctx context.Context, key string, updateFn func(*types.UniversalTx) error, ) error
UpdateUniversalTx updates an existing UniversalTx in the store. It fetches the UniversalTx, applies the update function, and saves it back.
func (Keeper) VoteChainMeta ¶ added in v0.0.19
func (k Keeper) VoteChainMeta(ctx context.Context, universalValidator sdk.ValAddress, observedChainId string, price, blockNumber uint64) error
VoteChainMeta processes a universal validator's vote on chain metadata (gas price + chain height).
Rules:
- If blockNumber <= entry.LastAppliedChainHeight the tx is rejected — the validator must re-vote with a newer block height.
- Each vote is stamped with the current block time (storedAt) when it is recorded.
- When computing medians, only votes whose storedAt is within the last chainMetaVoteStalenessSeconds seconds are considered.
- Price median and chain-height median are computed independently (upper median = len/2).
- After a successful EVM call, LastAppliedChainHeight is updated.
func (Keeper) VoteGasPrice ¶
func (Keeper) VoteInbound ¶
func (k Keeper) VoteInbound(ctx context.Context, universalValidator sdk.ValAddress, inbound types.Inbound) error
voteInbound is for uvalidators for voting on synthetic asset inbound bridging
func (Keeper) VoteOnInboundBallot ¶
func (Keeper) VoteOnOutboundBallot ¶ added in v0.0.13
func (Keeper) VoteOutbound ¶ added in v0.0.13
func (k Keeper) VoteOutbound( ctx context.Context, universalValidator sdk.ValAddress, utxId string, outboundId string, observedTx types.OutboundObservation, ) error
VoteOutbound is for uvalidators for voting on observed outbound tx on external chain
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) AllChainMetas ¶ added in v0.0.19
func (k Querier) AllChainMetas(goCtx context.Context, req *types.QueryAllChainMetasRequest) (*types.QueryAllChainMetasResponse, error)
AllChainMetas implements types.QueryServer. Returns paginated chain meta entries for all registered chains.
func (Querier) AllGasPrices ¶
func (k Querier) AllGasPrices(goCtx context.Context, req *types.QueryAllGasPricesRequest) (*types.QueryAllGasPricesResponse, error)
AllGasPrices implements types.QueryServer. Sources data from ChainMetas (the new unified store) to maintain backward compatibility. Falls back to the legacy GasPrices store for entries not yet migrated.
func (Querier) AllUniversalTx ¶
func (k Querier) AllUniversalTx(goCtx context.Context, req *types.QueryAllUniversalTxRequest) (*types.QueryAllUniversalTxResponse, error)
AllUniversalTx implements types.QueryServer.
func (Querier) ChainMeta ¶ added in v0.0.19
func (k Querier) ChainMeta(goCtx context.Context, req *types.QueryChainMetaRequest) (*types.QueryChainMetaResponse, error)
ChainMeta implements types.QueryServer. Returns the aggregated chain metadata (gas price + chain height) for a specific chain.
func (Querier) GasPrice ¶
func (k Querier) GasPrice(goCtx context.Context, req *types.QueryGasPriceRequest) (*types.QueryGasPriceResponse, error)
GasPrice implements types.QueryServer. Sources data from ChainMetas (the new unified store) to maintain backward compatibility.
func (Querier) GetUniversalTx ¶
func (k Querier) GetUniversalTx(goCtx context.Context, req *types.QueryGetUniversalTxRequest) (*types.QueryGetUniversalTxResponse, error)
GetUniversalTx implements types.QueryServer.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
type QuerierV2 ¶ added in v0.0.16
type QuerierV2 struct {
Keeper
}
QuerierV2 implements the uexecutor.v2 QueryServer, returning native types.
func NewQuerierV2 ¶ added in v0.0.16
func (QuerierV2) GetUniversalTx ¶ added in v0.0.16
func (k QuerierV2) GetUniversalTx(goCtx context.Context, req *typesv2.QueryGetUniversalTxRequest) (*typesv2.QueryGetUniversalTxResponse, error)
GetUniversalTx implements typesv2.QueryServer. Returns the native UniversalTx type (not legacy) for the given ID.
Source Files
¶
- chain_meta.go
- create_outbound.go
- deploy_uea.go
- evm.go
- evm_hooks.go
- execute_inbound.go
- execute_inbound_funds.go
- execute_inbound_funds_and_payload.go
- execute_inbound_gas.go
- execute_inbound_gas_and_payload.go
- execute_payload.go
- fees.go
- gas_price.go
- genesis.go
- handler.go
- inbound.go
- keeper.go
- msg_deploy_uea.go
- msg_execute_payload.go
- msg_migrate_uea.go
- msg_server.go
- msg_update_params.go
- msg_vote_inbound.go
- msg_vote_outbound.go
- outbound.go
- payload.go
- query_server.go
- query_server_v2.go
- universal_tx.go
- voting.go