Skip to content

Commit 01fb24d

Browse files
readme improvements
1 parent 8517c78 commit 01fb24d

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

Diff for: README.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
1-
# Sample Metadata API for Non-Fungible Tokens (NFTs)
1+
# Sample Metadata API for Non-Fungible Tokens (NFTs) <!-- omit in toc -->
22

3-
Use this repo to make an API for serving metadata about your tokens ([ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) or [ERC-1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md)) to marketplaces like [OpenSea](https://opensea.io) and other third parties. Metadata for each token can include an **image**, **animation**, **attributes**, **scalar properties**, **boost properties**, and more!
3+
Use this repo to make an API for serving metadata about your tokens ([ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) or [ERC-1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md)) to marketplaces like [OpenSea](https://opensea.io) and other third parties.
4+
5+
Metadata for each token can include an image, animation, attributes, scalar properties, boost properties, and more!
46

57
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
68

7-
## Requirements
8-
You need node.js (8.11.* or later) and npm installed. If you want to do a Heroku deployment, download and install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and run `heroku login` locally.
9+
- [Getting Started](#getting-started)
10+
- [Requirements](#requirements)
11+
- [Minting Tokens](#minting-tokens)
12+
- [Selling Tokens](#selling-tokens)
13+
- [Selling in Bulk](#selling-in-bulk)
14+
- [Troubleshooting](#troubleshooting)
15+
16+
## Getting Started
917

10-
## Instructions
18+
### Requirements
19+
You need node.js (8.11.* or later) and npm installed. If you want to do a Heroku deployment, download and install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) and run `heroku login` locally.
1120

1221
1. Click the **Deploy to Heroku** button above to instantly get it up and running somewhere. You can pick the URL! For this example, let's say that it's `your-metadata-api.herokuapp.com`.
1322
2. Run `heroku git:clone -a your-metadata-api`, and `cd` into your new directory.
1423
3. Run `npm install`.
1524
4. Save the Heroku URL you picked into `src/constants.js` as the `HOST` variable (e.g. `https://your-metadata-api.herokuapp.com`). This is the root URL for the tokens on your contract.
1625
5. Deploy to Heroku by committing your changes and using `git push heroku master`.
1726
6. Visit your token's metadata at https://your-metadata-api.herokuapp.com/api/token/1 (for token 1).
18-
7. Call [_setTokenURI](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/1fd993bc01890bf6bd974aaf3d709bdf0a79b9bf/contracts/token/ERC721/ERC721Metadata.sol#L68) on your NFT's contract using the URL pattern above, either directly if you exposed that method for the contract `owner`, or by minting new tokens using [mintWithTokenURI](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721MetadataMintable.sol#L19).
1927

20-
If you're confused by the last step, here's a [tutorial on setting up a mintable NFT contract](https://docs.opensea.io/docs). Alternatively, you can have your buyers mint the tokens for you (and pay the gas to do that) at purchase-time, using the [OpenSea crowdsale tutorial](https://docs.opensea.io/docs/opensea-initial-item-sale-tutorial).
28+
## Minting Tokens
29+
30+
Here's a [tutorial on setting up a mintable NFT contract](https://docs.opensea.io/docs). Alternatively, you can have your buyers mint the tokens for you (and pay the gas to do that) at purchase-time, using the [OpenSea Crowdsale Tutorial](https://docs.opensea.io/docs/opensea-initial-item-sale-tutorial).
31+
32+
Now that you a contract and a token URI for each of your tokens, there's a nice [mint.js script](https://github.com/ProjectOpenSea/opensea-creatures/blob/master/scripts/mint.js) that you can run locally to mint them on a testnet like Rinkeby and on mainnet Ethereum.
33+
34+
If you want more control over the minting process, call [_setTokenURI](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/1fd993bc01890bf6bd974aaf3d709bdf0a79b9bf/contracts/token/ERC721/ERC721Metadata.sol#L68) on your NFT's contract using the URL pattern above, either directly if you exposed that method for the contract `owner`, or by minting new tokens using [mintWithTokenURI](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721MetadataMintable.sol#L19).
35+
36+
## Selling Tokens
37+
38+
If you're signed into MetaMask as the owner of your contract, you can click the "SELL" button on any asset to sell it immediately on OpenSea, using Dutch (declining price), English (to the highest bidder), and fixed-price auctions.
39+
40+
### Selling in Bulk
41+
42+
You can also use the OpenSea.js SDK to create sell orders. You can [create sell orders in bulk](https://github.com/ProjectOpenSea/opensea-js#running-crowdsales) if you followed the [Crowdsale Tutorial](https://docs.opensea.io/docs/opensea-initial-item-sale-tutorial) above.
2143

2244
## Troubleshooting
2345

0 commit comments

Comments
 (0)