Hot answers tagged

5 votes
Accepted

FA2 from/to serialization

In the FA2.0 standard the sender and receiver is send as Bytes (vs. send as string for FA1.2). Both token standards say that sender and receiver are Michelson addresses. Michelson addresses have two ...
4 votes
Accepted

How to store and load custom FA2 NFT metadata?

Your code above has some issues that I will describe below. Also, you are confusing off-chain metadata with on-chain metadata, tzip16 and tzip21 allow those structures because they were designed to be ...
3 votes
Accepted

How to get the owner of an FA2 token on chain

The specification does not enforce an implementation for this. You can only verify if a given address owns the token by calling balance_of callback view. In the case of an NFT, balance 1 would mean ...
3 votes

FA2 view not working correctly

The feature on-chain views was added with the Hangzou protocol. But the TZIP for FA2 standard was defined before Tezos had on-chain views. So in the current state the FA2 Token standard does not ...
  • 151
3 votes
Accepted

How to retrive parameters from a Michelson function?

I don't know Dart, Flutter, or this library so my help will be limited. From looking at your code you have 2 sets of Michelson that is decided based on whether its FA1 or 2 final parameters = token....
2 votes
Accepted

How to monitor RPC block responses for token transfers?

An example of a token I may want to track is tzBTC, which does call transfer internally - and it does show up in the RPC response. That is the answer, isn't that? :) So, you need to iterate over ...
  • 2,427
2 votes
Accepted

Clarifications on FA2 operator

Is it possible to have more than 1 operator per tokenID? Operators are stored in a big-map, there can be as many entries in it as there needs to be. For example here is the contents of the operators ...
2 votes
Accepted

How do I call the FA2 balance_of endpoint through Truffle?

As far as I know, you cannot check if the entrypoint returns the balance with JavaScript, because the entrypoint doesn't return a value but emits a transaction. I didn't try it for a FA2 token ...
2 votes
Accepted

I can't import my nft into my temple wallet

The entrypoint balance_of does not respect the specification. Your contract has: (Does not match the specification) (pair %balance_of (contract %callback (list (pair ...
2 votes

Pattern by which you can determine that this is a FA2 contract, and not FA1.2

You can distinguish between FA1.2 and FA2 by checking contract entrypoint semantics. For example: FA1.2 contract must implement approve entrypoint and FA2 must implement update_operators entrypoint. ...
  • 122
2 votes
Accepted

Is operator support required for standard NFTs?

Setting an Operator allows another wallet / contract address to transfer or make use of the asset that was given to it. This is how all dApps work. If you want to sell something on objkt.com, you have ...
2 votes

Call FA2 transfer from another smart-contract with archertype

I just typed const transaction as a transfer_param type and used the name of the field you defined. Also, %transfer takes a list of transfer_param as input, so [transaction] instead of just ...
  • 46
2 votes

How to retrive parameters from a Michelson function?

In addition to @simon-mcloughlin's answer, if you don't know how to build Michelson parameters you can use a helper endpoint in TzKT API: https://api.tzkt.io/#operation/...
  • 2,427
2 votes

FA2 view not working correctly

I would guess Temple doesn't recognize the metadata as they don't seem valid. You can get more information about formatting the token metadata here => https://gitlab.com/tezos/tzip/-/blob/master/...
1 vote

How to change the storage to transfer of an NFT?

One more thing, the storage update { s with price = _price; } is misplaced. You should take it out of the make_transfer lambda, which doesn't return a storage. I've reproduced your code and ...
1 vote

How to change the storage to transfer of an NFT?

Change the commas in let { _price, amount, to_, token_id } = p in to semicolons. It is difficult to tell which line is line 421 that generates the error, but I think this is it.
1 vote
Accepted

Is there a "standard" way to load off-chain metadata for all tokens from a single off-chain data source in an FA2 contract?

Yes, there is no standard way to do that. However, there is a "URI-pattern" approach, which is non-standard, but I believe it will be, eventually. The idea is to place the string %...
  • 2,427
1 vote

Do FA2 entrypoints need to be at the top level in order to comply with the spec?

You don't need to know the position of an entrypoint to call it. For this reason, the position does not matter much so it is not imposed by the standard.
1 vote

Best way to duplicate/sync private database with FA2 contract transactions & balances

tzkt.io offers a websocket based listener that can be used for the scenario mentioned by you. Alternatively, you can run a cron job that checks for changes in the contract storage (tzkt's API can be ...
1 vote

Calling contract entrypoint having complex parameters

First of all, there is an error in your Javascript, you cannot name the array indices and assign them a value, instead of [from_ = sender ...], just write [sender ...]. Then, the argument for the ...

Only top scored, non community-wiki answers of a minimum length are eligible