Deploying and testing
Deploying and testing the marketplace contract
The marketplace contract can be deployed without any parameters, as it's token-agnostic:
To create a sale, the list_for_sale
entrypoint is called as follows (replace with the correct values):
Note that the price argument is expressed in mutez, one million-th of a tez. Hence, 1_000_000 utez equals 1 ęŠ.
Now let's switch the account and buy the NFT (this will fail):
Why did it fail? Remember, the marketplace contract is not allowed to transfer Alice's tokens. She need to first add the marketplace as an approved operator for her tokens. This can be done once for all her tokens with the following call:
Now, try to buy again, it should work!
Last updated