PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 28, 2022

[FIXED] When generating contract metadata with `sp.init_metadata` do you include or exclude on-chain views in the `views` array in the metadata?

 July 28, 2022     blockchain, metadata, smartcontracts     No comments   

Issue

When I perform self.init_metadata("metadata", some_metadata) on contract metadata inside SmartPy, should the list of views inside the TZIP-16 (https://tzip.tezosagora.org/proposal/tzip-16/) metadata only contain off-chain views, or must on-chain views also be included in this information?


Solution

Internally, the compiler interprets on-chain views the same way as off-chain views when it comes to metadata (not included in the contract code).

If the off-chain view has the same logic as the on-chain view, you can remove the off-chain entirely and just use the on-chain view.



Answered By - Figario
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing