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.
22 lines
674 B
22 lines
674 B
const { expect } = require('chai');
|
|
|
|
const ERC721Holder = artifacts.require('ERC721Holder');
|
|
const ERC721 = artifacts.require('$ERC721');
|
|
|
|
contract('ERC721Holder', function (accounts) {
|
|
const [owner] = accounts;
|
|
|
|
const name = 'Non Fungible Token';
|
|
const symbol = 'NFT';
|
|
const tokenId = web3.utils.toBN(1);
|
|
|
|
it('receives an ERC721 token', async function () {
|
|
const token = await ERC721.new(name, symbol);
|
|
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);
|
|
});
|
|
});
|
|
|