Create & collect trading cards. It's just a prototype - you can create as many trading cards as you like and you'll get rewarded the full card price (which is calculated automatically) when someone purchases it in the shop. Card artworks are stored on IPFS.
In a real application, not everyone would be allowed to create cards (or there would be a more complicated governance/voting process behind it) and cards would probably be sold in Booster Packs and not directly.
Schema: package (tested with version)
- node.js (10.7.0)
- npm (6.2.0)
- truffle (4.1.13)
- ganache-cli (6.1.8)
- solidity (0.4.24)
- metamask (4.9.3)
- Install packages:
npm i
- Start your private Blockchain:
ganache-cli
- Copy one of the private keys that ganache gives you and import the account in Metamask
- Make sure you are on the right local network in Metamask:
http://127.0.0.1:8545
- Compile contracts:
truffle compile --reset
(maybe it works without --reset, but it's the safer option) - Migrate contracts:
truffle migrate --reset
- Start development server:
npm run dev
- Visit:
http.//localhost:3000
- Run tests:
truffle test
- Don't use the beta version of Metamask. This project has been developed with Metamask 4.9.3 in mind.
- Reset your account in Metamask. Sometimes not doing this can cause problems (Settings -> Reset Account)
- If a transaction fails, try to re-send it with a higher Gas Limit (eg. 60'000)
- How common attacks are addressed
- Which design patterns are used
- Where are the contracts deployed on Rinkeby
Enjoy! ❤️