From 9f1427e331f5895487f633c0347d1b05fa2bb111 Mon Sep 17 00:00:00 2001 From: rubyisrust Date: Tue, 18 Mar 2025 14:42:59 +0800 Subject: [PATCH] Update ERC-7401: Fix some typos Signed-off-by: rubyisrust --- assets/erc-7401/contracts/NestableToken.sol | 6 +++--- assets/erc-7401/test/nestable.ts | 22 ++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/assets/erc-7401/contracts/NestableToken.sol b/assets/erc-7401/contracts/NestableToken.sol index 89c0e569f44..5993a19cfac 100644 --- a/assets/erc-7401/contracts/NestableToken.sol +++ b/assets/erc-7401/contracts/NestableToken.sol @@ -630,7 +630,7 @@ contract NestableToken is Context, IERC165, IERC721, IERC7401 { // At this point we know pendingRecursiveBurns must be at least 1 pendingRecursiveBurns = maxChildrenBurns - totalChildBurns; } - // We substract one to the next level to count for the token being burned, then add it again on returns + // We subtract one to the next level to count for the token being burned, then add it again on returns // This is to allow the behavior of 0 recursive burns meaning only the current token is deleted. totalChildBurns += IERC7401(children[i].contractAddress).burn( @@ -1226,7 +1226,7 @@ contract NestableToken is Context, IERC165, IERC721, IERC7401 { * ] * @param parentId ID of the parent token for which the pending child token is being retrieved * @param index Index of the child token in the parent token's pending child tokens array - * @return struct A Child struct containting data about the specified child + * @return struct A Child struct containing data about the specified child */ function pendingChildOf( uint256 parentId, @@ -1391,7 +1391,7 @@ contract NestableToken is Context, IERC165, IERC721, IERC7401 { * ] * @dev To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. * @param parentId ID of the token that has accepted a pending child token - * @param childIndex Index of the child token that was accpeted in the given parent token's pending children array + * @param childIndex Index of the child token that was accepted in the given parent token's pending children array * @param childAddress Address of the collection smart contract of the child token that was expected to be located * at the specified index of the given parent token's pending children array * @param childId ID of the child token that was expected to be located at the specified index of the given parent diff --git a/assets/erc-7401/test/nestable.ts b/assets/erc-7401/test/nestable.ts index 7009e60891a..eaf71b862ad 100644 --- a/assets/erc-7401/test/nestable.ts +++ b/assets/erc-7401/test/nestable.ts @@ -161,7 +161,7 @@ describe('NestableToken', function () { const childId1 = 99; await child.nestMint(parent.address, childId1, parentId); - // owner is the same adress + // owner is the same address expect(await parent.ownerOf(parentId)).to.equal(tokenOwner.address); expect(await child.ownerOf(childId1)).to.equal(tokenOwner.address); @@ -1048,7 +1048,7 @@ describe('NestableToken', function () { await child.mint(firstOwner.address, childId1); }); - it('cannot nest tranfer from non immediate owner (owner of parent)', async function () { + it('cannot nest transfer from non immediate owner (owner of parent)', async function () { const otherParentId = 2; await parent.mint(firstOwner.address, otherParentId); // We send it to the parent first @@ -1059,14 +1059,14 @@ describe('NestableToken', function () { ).to.be.revertedWithCustomError(child, 'NotApprovedOrDirectOwner'); }); - it('cannot nest tranfer to same NFT', async function () { + it('cannot nest transfer to same NFT', async function () { // We can no longer nest transfer it, even if we are the root owner: await expect( child.connect(firstOwner).nestTransfer(child.address, childId1, childId1), ).to.be.revertedWithCustomError(child, 'NestableTransferToSelf'); }); - it('cannot nest tranfer a descendant same NFT', async function () { + it('cannot nest transfer a descendant same NFT', async function () { // We can no longer nest transfer it, even if we are the root owner: await child.connect(firstOwner).nestTransfer(parent.address, childId1, parentId); const grandChildId = 999; @@ -1082,7 +1082,7 @@ describe('NestableToken', function () { ).to.be.revertedWithCustomError(child, 'NestableTransferToDescendant'); }); - it('cannot nest tranfer if ancestors tree is too deep', async function () { + it('cannot nest transfer if ancestors tree is too deep', async function () { let lastId = childId1; for (let i = 101; i <= 200; i++) { await child.nestMint(child.address, i, lastId); @@ -1095,27 +1095,27 @@ describe('NestableToken', function () { ).to.be.revertedWithCustomError(child, 'NestableTooDeep'); }); - it('cannot nest tranfer if not owner', async function () { + it('cannot nest transfer if not owner', async function () { const notOwner = addrs[3]; await expect( child.connect(notOwner).nestTransfer(parent.address, childId1, parentId), ).to.be.revertedWithCustomError(child, 'NotApprovedOrDirectOwner'); }); - it('cannot nest tranfer to address 0', async function () { + it('cannot nest transfer to address 0', async function () { await expect( child.connect(firstOwner).nestTransfer(ADDRESS_ZERO, childId1, parentId), ).to.be.revertedWithCustomError(child, 'ERC721TransferToTheZeroAddress'); }); - it('cannot nest tranfer to a non contract', async function () { + it('cannot nest transfer to a non contract', async function () { const newOwner = addrs[2]; await expect( child.connect(firstOwner).nestTransfer(newOwner.address, childId1, parentId), ).to.be.revertedWithCustomError(child, 'IsNotContract'); }); - it('cannot nest tranfer to contract if it does implement IERC7401', async function () { + it('cannot nest transfer to contract if it does implement IERC7401', async function () { const ERC721 = await ethers.getContractFactory('ERC721Mock'); const nonNestable = await ERC721.deploy('Non receiver', 'NR'); await nonNestable.deployed(); @@ -1124,13 +1124,13 @@ describe('NestableToken', function () { ).to.be.revertedWithCustomError(child, 'NestableTransferToNonNestableImplementer'); }); - it('can nest tranfer to IERC7401 contract', async function () { + it('can nest transfer to IERC7401 contract', async function () { await child.connect(firstOwner).nestTransfer(parent.address, childId1, parentId); expect(await child.ownerOf(childId1)).to.eql(firstOwner.address); expect(await child.directOwnerOf(childId1)).to.eql([parent.address, bn(parentId), true]); }); - it('cannot nest tranfer to non existing parent token', async function () { + it('cannot nest transfer to non existing parent token', async function () { const notExistingParentId = 9999; await expect( child.connect(firstOwner).nestTransfer(parent.address, childId1, notExistingParentId),