简体   繁体   中英

Should I use NEAR Events Standard in my contract?

I've got a smart contract that isn't specifically using the NEP-171 or NEP-141 (NFT and FT) standards. I've implemented very limited parts of the standards which allows me to mint an NFT and view it in the wallet but the core, approvals, and royalties aspect of the NFT standard are not implemented.

I wanted to use the events standard so I could use an indexer to pickup any of my specific events but wasn't sure what to do about the standard field:

EVENT_JSON:{
    "standard": "nepXXX",
    "version": "1.0.0",
    "event": "xyz_is_triggered"
}

I'm not using any specific standard and I was wondering what someone would do if they had a contract that had nothing to do with NFTs or FTs and how they would go about using the events standard.

We definitely want to empower user-defined standards and was something we took into consideration when creating the events standard. If, for example, you had your own standard that your contracts were following - say a charitable giving standard called fayyr1 , you could put that in the standard field and it could look something like:

EVENT_JSON:{
    "standard": "fayyr1",
    "version": "1.0.0",
    "event": "donation"
}

If you weren't using your own defined standard, you could put whatever you like in the standard field except nep141/nep171. Those events won't be picked up by any standard-complaint tooling and you are good to go. This could be N/A , for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM