Replies: 2 comments 3 replies
-
I would like to suggest embracing naming conventions for the smart contract functions to enable better interoperability between the contracts written in different languages. Our NEPs already defined interfaces in snake_case and I suggest we stick to it. At the same time, I would like to suggest that we don't break the programming language conventions, so the code does not look alien in the relevant ecosystem. In order to achieve that, I believe SDKs can handle auto-renaming and even allow people to provide custom aliases, e.g.: @call('nft_mint')
nftMint({ token_id, metadata, receiver_id, perpetual_royalties }) {
...
} |
Beta Was this translation helpful? Give feedback.
-
Short-term summary: We will continue to leave this thread open, and direct feedback here before we make a decision around converting case at compile-time |
Beta Was this translation helpful? Give feedback.
-
It came to our (Pagoda DevRel) attention that naming conventions for functions differ between JS (camelCase) and Rust (snake_case). This inconsistency will lead to extra work for existing dApps that listen to events on-chain searching for function names, such as
ft_transfer
, to add search for camelCase function names.This is not really the best solution, as new languages will probably also have SDKs for NEAR in the future, and they all come with their own casing convention for function names.
We'd propose adding a standard for naming convention of smart contract functions and have SDKs preferably support this auto-conversion (#136).
What do you guys think?
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions