As far as I can tell, the royalties are stored as metadata and then it's up to the marketplace to support that. Tezzard example:
0x05 means "this is a packed Michelson value". 0x01 means "this is a string". The remaining 4 bytes represent the length of the string.
A complete description of the binary format of Michelson values can be generated by the following command: tezos-codec describe alpha.script.expr binary schema.
On-chain views are synchronous so you’re mostly good (as good as with regular entry points but even simpler).
However, there are subtle scenarios that can go wrong depending on the assumptions that you make : you should not assume in general that balance is synchronized with state (it’s not) or that no operation is pending.
This is a complete assumption, but it would be possible to enforce royalties on the contract level: when the transfer entrypoint of an FA2 contract is called with an amount of tez for the cost of the NFT, the contract could retrieve the original owner of the NFT and sends him a percentage of the total cost.
For example, I buy an NFT that costs 10 XTZ, I send ...
Short answer is : too much.
10000 gas per call minimum
with a limit per transaction around 1000000.
EDIT: after precision by Raphael, the minimal cost is 1000 gas and not 10000 as it used to be the case. It means 100 iterations are sometimes ...
In case of errors, the FAILWITH instruction accepts almost any value (any value of a packable type to be precise) so it can be used directly to produce informative and structured errors.
Regarding feedback on successful calls, this is what events are about. There is currently no builtin support for events in Tezos but they are easy to simulate (as contract ...