0

I'm having trouble locating any documentation on which characters are allowed in Ethereum event names. For example, can I put cyrillic characters in them? Can I put emojis? What is allowed and disallowed in an Ethereum event name?

I'm asking in general terms, not just Solidity.

1

2 Answers 2

1

An identifier in solidity has to start with a letter, a dollar-sign or an underscore and may additionally contain numbers after the first symbol.

from https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityLexer.Identifier

0

ya, but u need to write unicode before string. e.g.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

contract aakash4dev{
  string a=unicode"Hello 😃 sɪˈrɪlɪk";
  function get() public view returns(string memory){
    return a;
  }
}

writing string a="Hello 😃" will give error, as normal string stored in solidity do not support unicode emojis.

read more: https://docs.soliditylang.org/en/v0.8.11/types.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.