Skip to content

Commit 45aa83a

Browse files
authored
Merge pull request #272 from MoMannn/readme
Readme updates
2 parents 6a15483 + 5a695c2 commit 45aa83a

File tree

5 files changed

+32
-46
lines changed

5 files changed

+32
-46
lines changed

BUG_BOUNTY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ How to win:
7979

8080
- Be descriptive and detailed when describing your issue
8181
- Fix it — recommend a way to solve the problem
82-
- Include a [Specron test](https://specron.github.io/framework/) case that we can reproduce
82+
- Include a [Hardhat test](https://hardhat.org/) case that we can reproduce
8383

8484
Rules for bounty sponsor:
8585

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
# ERC-721 Token — Reference Implementation
44

5-
This is the complete reference implementation of the [ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) non-fungible token standard for the Ethereum and Wanchain blockchains. This is an open-source project, complete with [Specron](https://specron.github.io/framework/) testing.
5+
This is the complete reference implementation of the [ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) non-fungible token standard for the Ethereum and Wanchain blockchains. This is an open-source project, complete with [Hardhat](https://hardhat.org/) testing.
66

77
The purpose of this implementation is to provide a good starting point for anyone who wants to use and develop non-fungible tokens on the Ethereum and Wanchain blockchains. Instead of re-implementing the ERC-721 yourself you can use this code which has gone through multiple audits and we hope it will be extensively used by the community in the future.
8+
Note that this implementation is more restrictive then the ERC-721 standard since it does not support `payable` function calls out of the box. You are however free to add this yourself.
89

910
If you are looking for a more feature-rich and advanced ERC721 implementation, then check out the [0xcert Framework](https://github.com/0xcert/framework).
1011

src/contracts/tokens/erc721.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ interface ERC721
4848
* function checks if `_to` is a smart contract (code size > 0). If so, it calls
4949
* `onERC721Received` on `_to` and throws if the return value is not
5050
* `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`.
51-
* @dev Transfers the ownership of an NFT from one address to another address.
51+
* @dev Transfers the ownership of an NFT from one address to another address. This function can
52+
* be changed to payable.
5253
* @param _from The current owner of the NFT.
5354
* @param _to The new owner.
5455
* @param _tokenId The NFT to transfer.
@@ -65,7 +66,8 @@ interface ERC721
6566
/**
6667
* @notice This works identically to the other function with an extra data parameter, except this
6768
* function just sets data to ""
68-
* @dev Transfers the ownership of an NFT from one address to another address.
69+
* @dev Transfers the ownership of an NFT from one address to another address. This function can
70+
* be changed to payable.
6971
* @param _from The current owner of the NFT.
7072
* @param _to The new owner.
7173
* @param _tokenId The NFT to transfer.
@@ -82,7 +84,7 @@ interface ERC721
8284
* they may be permanently lost.
8385
* @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved
8486
* address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero
85-
* address. Throws if `_tokenId` is not a valid NFT.
87+
* address. Throws if `_tokenId` is not a valid NFT. This function can be changed to payable.
8688
* @param _from The current owner of the NFT.
8789
* @param _to The new owner.
8890
* @param _tokenId The NFT to transfer.
@@ -98,7 +100,7 @@ interface ERC721
98100
* @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is
99101
* the current NFT owner, or an authorized operator of the current owner.
100102
* @param _approved The new approved NFT controller.
101-
* @dev Set or reaffirm the approved address for an NFT.
103+
* @dev Set or reaffirm the approved address for an NFT. This function can be changed to payable.
102104
* @param _tokenId The NFT to approve.
103105
*/
104106
function approve(

src/tests/utils/address-utils.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const { expect } = require('chai');
2+
3+
describe('address utils', function() {
4+
let addressUtils, owner;
5+
6+
beforeEach(async () => {
7+
const addressUtilsContract = await ethers.getContractFactory('AddressUtilsMock');
8+
addressUtils = await addressUtilsContract.deploy();
9+
[ owner ] = await ethers.getSigners();
10+
await addressUtils.deployed();
11+
});
12+
13+
it('correctly checks account', async function() {
14+
expect(await addressUtils.isContract(owner.address)).to.equal(false);
15+
});
16+
17+
it('correctly checks smart contract', async function() {
18+
const contract = await ethers.getContractFactory('NFTokenTestMock');
19+
const nfToken = await contract.deploy();
20+
await nfToken.deployed();
21+
expect(await addressUtils.isContract(nfToken.address)).to.equal(true);
22+
});
23+
});

src/tests/utils/address-utils.test.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)