How do I dynamically call an event with a name? For example, my contract has a few events and based on some conditions I would like to call one of them. I don't want to use a switch or an if statement but would like to specify the name of the event and call it with data
I tried the following simple example but it didn't work.
event StoredValue(
string data);
function callEvent(string eventName, data) {
this.call(bytes4(sha3("StoredValue(data)")));
}
I want to pass a name and arguments into a function which will be used to call the event