* Add IERC721Metadata implementation into ERC721 * Add IERC721Enumerable into ERC721 * Update ERC721Pausable and ERC721Burnable * Delete ERC721Metadata, ERC721Enumerable and ERC721 (now ERC721) * Update mocks * Update tests * Update contracts/token/ERC721/ERC721.sol Co-Authored-By: Francisco Giordano <frangio.1@gmail.com> * Make ERC721Pausable and ERC721Burnable abstract Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
27 lines
808 B
JavaScript
27 lines
808 B
JavaScript
const { accounts, contract } = require('@openzeppelin/test-environment');
|
|
|
|
const { BN } = require('@openzeppelin/test-helpers');
|
|
|
|
const { expect } = require('chai');
|
|
|
|
const ERC721Holder = contract.fromArtifact('ERC721Holder');
|
|
const ERC721Mock = contract.fromArtifact('ERC721Mock');
|
|
|
|
describe('ERC721Holder', function () {
|
|
const [ owner ] = accounts;
|
|
|
|
const name = 'Non Fungible Token';
|
|
const symbol = 'NFT';
|
|
|
|
it('receives an ERC721 token', async function () {
|
|
const token = await ERC721Mock.new(name, symbol);
|
|
const tokenId = new BN(1);
|
|
await token.mint(owner, tokenId);
|
|
|
|
const receiver = await ERC721Holder.new();
|
|
await token.safeTransferFrom(owner, receiver.address, tokenId, { from: owner });
|
|
|
|
expect(await token.ownerOf(tokenId)).to.be.equal(receiver.address);
|
|
});
|
|
});
|