This commit is contained in:
dexorder
2024-10-17 02:42:28 -04:00
commit 25def69c66
878 changed files with 112489 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
const { ethers } = require('hardhat');
const { expect } = require('chai');
const name = 'Non Fungible Token';
const symbol = 'NFT';
const tokenId = 1n;
describe('ERC721Holder', function () {
it('receives an ERC721 token', async function () {
const [owner] = await ethers.getSigners();
const token = await ethers.deployContract('$ERC721', [name, symbol]);
await token.$_mint(owner, tokenId);
const receiver = await ethers.deployContract('$ERC721Holder');
await token.connect(owner).safeTransferFrom(owner, receiver, tokenId);
expect(await token.ownerOf(tokenId)).to.equal(receiver);
});
});