This commit is contained in:
VolodymyrBg 2025-03-27 14:15:51 +08:00 committed by GitHub
commit 33d8832d99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -134,7 +134,12 @@ func (k *Keeper) GetOrDeployCosmosCoinERC20Contract(
// register the contract to the module store
err = k.SetDeployedCosmosCoinContract(ctx, tokenInfo.CosmosDenom, contractAddress)
// TODO: emit event that contract was deployed
// Emit event that contract was deployed
ctx.EventManager().EmitEvent(sdk.NewEvent(
types.EventTypeDeployedCosmosCoinContract,
sdk.NewAttribute(types.AttributeKeyCosmosDenom, tokenInfo.CosmosDenom),
sdk.NewAttribute(types.AttributeKeyContractAddress, contractAddress.String()),
))
return contractAddress, err
}

View File

@ -10,6 +10,7 @@ const (
EventTypeConvertCosmosCoinToERC20 = "convert_cosmos_coin_to_erc20"
EventTypeConvertCosmosCoinFromERC20 = "convert_cosmos_coin_from_erc20"
EventTypeDeployedCosmosCoinContract = "deployed_cosmos_coin_contract"
// Event Attributes - Common
AttributeKeyReceiver = "receiver"
@ -18,4 +19,8 @@ const (
// Event Attributes - Conversions
AttributeKeyInitiator = "initiator"
AttributeKeyERC20Address = "erc20_address"
// Event Attributes - Contract Deployment
AttributeKeyCosmosDenom = "cosmos_denom"
AttributeKeyContractAddress = "contract_address"
)