diff --git a/x/wasm/keeper/keeper.go b/x/wasm/keeper/keeper.go index 9d20d0cd37..fadd59ff64 100644 --- a/x/wasm/keeper/keeper.go +++ b/x/wasm/keeper/keeper.go @@ -990,6 +990,14 @@ func (k Keeper) setAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAd info.InstantiateConfig = newConfig k.storeCodeInfo(ctx, codeID, *info) + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeSetAccessConfig, + sdk.NewAttribute(types.AttributeKeyCodeID, strconv.FormatUint(codeID, 10)), + sdk.NewAttribute(types.AttributeKeyCodePermission, newConfig.Permission.String()), + sdk.NewAttribute(types.AttributeKeyAuthorizedAddresses, strings.Join(newConfig.Addresses, ", ")), + )) + return nil } diff --git a/x/wasm/types/events.go b/x/wasm/types/events.go index 6becc4d01b..58d9e88900 100644 --- a/x/wasm/types/events.go +++ b/x/wasm/types/events.go @@ -17,16 +17,19 @@ const ( EventTypeGovContractResult = "gov_contract_result" EventTypeUpdateContractAdmin = "update_contract_admin" EventTypeClearContractAdmin = "clear_contract_admin" + EventTypeSetAccessConfig = "set_access_config" ) // event attributes returned from contract execution const ( AttributeReservedPrefix = "_" - AttributeKeyContractAddr = "_contract_address" - AttributeKeyCodeID = "code_id" - AttributeKeyChecksum = "code_checksum" - AttributeKeyResultDataHex = "result" - AttributeKeyRequiredCapability = "required_capability" - AttributeKeyAdmin = "admin" + AttributeKeyContractAddr = "_contract_address" + AttributeKeyCodeID = "code_id" + AttributeKeyChecksum = "code_checksum" + AttributeKeyCodePermission = "code_permission" + AttributeKeyAuthorizedAddresses = "auth_addresses" + AttributeKeyResultDataHex = "result" + AttributeKeyRequiredCapability = "required_capability" + AttributeKeyAdmin = "admin" )