Can we add view endpoints to existing FA1.2 and FA2 contracts?

It’s currently pretty painful to, e.g., get the token balance of an account from inside a contract - you’ve got to use a callback (complexity = bad) and trust the token contract doesn’t do anything malicious. This would be solved with the new view endpoints, but the FA1.2 and FA2 standards existed before views existed.

So, can we add some protocol magic that lets us call these endpoints as if they were views? A hacky solution would be to enumerate the known FA contracts (the TzKT API has a list) and mutate them to add the view endpoints (this would need a protocol amendment). But, I’m sure y’all can come up with something more elegant.


You’ll probably get more engagement in the Tezos Stack exchange.

There is an ongoing discussion about a FA3 standard. If that happens?? I hope views will be supported there. But no idea FA2.1 / FA3 - It's time