You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
733 B
25 lines
733 B
5 years ago
|
const { BN } = require('@openzeppelin/test-helpers');
|
||
6 years ago
|
|
||
6 years ago
|
const { expect } = require('chai');
|
||
|
|
||
4 years ago
|
const ERC721Holder = artifacts.require('ERC721Holder');
|
||
|
const ERC721Mock = artifacts.require('ERC721Mock');
|
||
5 years ago
|
|
||
4 years ago
|
contract('ERC721Holder', function (accounts) {
|
||
5 years ago
|
const [ owner ] = accounts;
|
||
6 years ago
|
|
||
5 years ago
|
const name = 'Non Fungible Token';
|
||
|
const symbol = 'NFT';
|
||
|
|
||
6 years ago
|
it('receives an ERC721 token', async function () {
|
||
5 years ago
|
const token = await ERC721Mock.new(name, symbol);
|
||
6 years ago
|
const tokenId = new BN(1);
|
||
5 years ago
|
await token.mint(owner, tokenId);
|
||
6 years ago
|
|
||
|
const receiver = await ERC721Holder.new();
|
||
5 years ago
|
await token.safeTransferFrom(owner, receiver.address, tokenId, { from: owner });
|
||
6 years ago
|
|
||
6 years ago
|
expect(await token.ownerOf(tokenId)).to.be.equal(receiver.address);
|
||
6 years ago
|
});
|
||
|
});
|