2
votes
Accepted
What are the differences between the chain view decorators in SmartPy?
@sp.utils.view: An old helper that simplifies the creation of an entrypoint that callback a contract with a value. Do not use it except if you know what you are doing.
@sp.onchain_view: an on-chain ...
- 622
1
vote
Accepted
When generating contract metadata with `sp.init_metadata` do you include or exclude on-chain views in the `views` array in the metadata?
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-...
- 3,768
1
vote
Accepted
Can off-chain views call on-chain views?
Yes, you can call on-chain views from off-chain views. off-chain views use run_code RPC endpoint, which runs some instructions against a given context provided by you, similar to calling an entrypoint....
- 3,768
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
off-chain-views × 4on-chain-views × 3
smartpy × 2
metadata × 2
node × 1
smart-contracts × 1
contract × 1
tzip16 × 1
views × 1