Events related to tokens

Hello support,

I have some inquiries regarding event logging for NFTs. I noticed that there are predefined event types such as Mint, Burn, Transfer, etc. I was wondering if it’s possible to add additional event types, and if so, what is the process for doing so? Furthermore, I’m curious about the ability for anyone to log events on tokens. If this isn’t allowed, could you please clarify the rules and requirements for logging events on a specific token?

Thank you for your assistance

The events you listed are the ones defined in a CIS2 standard.

Your token contract may emit arbitrary other events as long as they don’t clash with the CIS2 events.

For example this contract eth-ccd-bridge/lib.rs at main · Concordium/eth-ccd-bridge · GitHub is a CIS2 contract that has additional events GrantRoleEvent and RevokeRoleEvent.

Does that answer your question?

Good example code for the events outside the standard. Thanks.

Last thing: let’s say someone creates another contract (different or copy of our) and starts to log events using a token created in our contract. Is that allowed/possible?

They can log events, but it will be clear they are coming from the other contract (different address is logging them) so that is going to be clear.

They cannot log events in your name.

Thank you for the information. To clarify, when creating a list of events for a token, it is advisable to include only events that are relevant to the contract that originally created the token. While it is hopefully uncommon for individuals to log events for other tokens - it could potentially confuse the owner of the token

You should only include events from the contract that has the token. Otherwise you will have potentially incorrect view.

Technically each logged event has a token ID. The full token address is contract address + token id so when processing an event you should categorize them by token address.

Then there should be no confusion.

Great. Thanks, for the additional details.