https://github.com/adrianmcli/erc721-practice
A practice repo for working with ERC-721 tokens.
https://github.com/adrianmcli/erc721-practice
Last synced: about 1 year ago
JSON representation
A practice repo for working with ERC-721 tokens.
- Host: GitHub
- URL: https://github.com/adrianmcli/erc721-practice
- Owner: adrianmcli
- Created: 2018-07-01T20:18:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T05:45:22.000Z (almost 8 years ago)
- Last Synced: 2025-01-17T04:44:27.573Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# erc721-practice
A practice repo for working with ERC-721 tokens. There are two important things to look at: the smart contract and the tests.
## The smart contract
In `contracts/MyToken.sol`, notice that it's only doing a few things:
1. Inheriting from OpenZeppelin's `ERC721Token.sol`;
2. Implementing a constructor;
3. Implementing a simple minting method.
Almost everything else is delegated to OpenZeppelin's hard work.
## The tests
The tests go through a bunch of behaviours that we'd expect from an ERC-721 token. Study these well.
Note: I wrote a helper function called `expectRevert` to detect reverts, because I didn't want to include another library and this makes the tests relatively more readable.