JoinColony / colonyDiscord

🤖 Beep boop. I'm a Colony Discord bot.
GNU General Public License v3.0
2 stars 2 forks source link

Map list of events #3

Closed chmanie closed 2 years ago

chmanie commented 2 years ago

To make it easier to configure events, we would like to maintain a list of contract events that the bot supports and map them to the actual event names. This is especially interesting for overloaded (or old versions of) events which might be confusing for some people as they contain additional information that is irrelevant in this context (parameter types). Also the amount of events that are available might be overwhelming at first, especially because some are not relevant at this point in time.

My suggestion is to maintain a list of common and relevant events and map them to the original contract events like so:

const MAP = {
  DomainAdded: 'DomainAdded(address,uint256)',
  ColonyUpgraded: 'ColonyUpgraded(uint256,uint256)',
  // ...
};

We could also add a translatable text string to the map that interpolates the values but that might be another issue altogether.

All available events can be seen here:

Note: events on the ColonyNetwork have to be filtered on the colonyNetwork's address. Same goes for the extension contracts (OneTxPayment, etc.) which also have own addresses.