Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreafspeziale/pokemon-erc721
🐯 Basic example of ERC721 and mint function using Truffle exec
https://github.com/andreafspeziale/pokemon-erc721
Last synced: 4 days ago
JSON representation
🐯 Basic example of ERC721 and mint function using Truffle exec
- Host: GitHub
- URL: https://github.com/andreafspeziale/pokemon-erc721
- Owner: andreafspeziale
- Created: 2018-08-03T12:26:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T22:15:06.000Z (almost 2 years ago)
- Last Synced: 2024-04-29T23:18:12.892Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 203 KB
- Stars: 3
- Watchers: 3
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pokemon ERC-721
> ERC-721 is the Ethereum standard for non-fungible tokens.## Full working sample
This project is composed by two components:
- **Truffle project**
- **App** - [repository](https://github.com/andreafspeziale/pokemon-ERC721-app)The *Truffle project* contains the smart contracts and all the tools for the contracts deployment and testing.
The *App project* contains a simple server to retrive the `Pokemon tokenURI` information and a HTML page to display and transfer the tokens and so the related Pokemons.
To quickly run the whole project
- clone this repository
- `$ npm i`
- `$ cd config && cp config.js.sample config.js`
- use the following as `config.js`:
```
module.exports = {
pokemon: {
min: 1,
max: 151,
extraMax: 201,
uriUrl: 'http://localhost:3000/api/pokemons',
},
networks: {
parity: {
receiver: 'SOMETHING',
},
},
}
```
- `$ npm run ganache` | Save the private keys of the displayed accounts, you will need to import it into `Metamask`
- `$ npm run migrate:development`At this point leaving all up and running move to the [*Pokemon App* README](https://github.com/andreafspeziale/pokemon-ERC721-app) and follow the instructions.
## System used
> System used during the development of the project
- node v10.9.0
- npm 6.2.0## Install
> Install project dependenciesCommand: *`$ npm i`*
## Available networks
> Truffle newtowks
- `development`
- `parity` (usage needs to be granted)## Run local Ethereum node
> As it's configured the following script spawn a local Ethereum Network with the following params:
> - port: 7545
> - networkId: 47
> - blockTime: 1 secCommand: *`$ npm run ganache`*
## Truffle migration
> Deploy and mint each unique token to the specified network> NOTE: for the contracts deployment will be used the `eth.accounts[0]` on both network (it needs to be unlock and funded)
> NOTE: at *`t0`* all the tokens will be minted towards `eth.accounts[1]` in the `development network`
> NOTE: at *`t0`* all the tokens will be minted towards `config specified account` in the `parity network`
Command: *`$ npm run migrate:NETWORK_NAME`*
## Run the tests
> Truffle smart contract testsCommand: *`$ npm run test:NETWORK_NAME`*
## Mint Pokemon on demand
> NOTE: will mint towards `eth.accounts[1]` in the `development network`> NOTE: will mint towards `config specified account` in the `parity network`
Command: *`$ npm run mint:NETWORK_NAME`*
## Config
The **config folder** contains a config file where you can specified for the parity network the receiver address of the minted tokens.In addition you can specify the range of avaiable pokemons you want to mint.
Keep in mind that the related App project supports only the first 151 pokemon.