Improve grammar in transfer error messages (#3542)

pull/3429/head
Aleksei Magusev 3 years ago committed by GitHub
parent d1b1e17d23
commit fbf235661e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      contracts/token/ERC1155/ERC1155.sol
  2. 4
      contracts/token/ERC1155/extensions/ERC1155Burnable.sol
  3. 6
      contracts/token/ERC721/ERC721.sol
  4. 2
      contracts/token/ERC721/extensions/ERC721Burnable.sol
  5. 2
      contracts/utils/introspection/IERC1820Registry.sol
  6. 4
      test/token/ERC1155/ERC1155.behavior.js
  7. 4
      test/token/ERC1155/extensions/ERC1155Burnable.test.js
  8. 6
      test/token/ERC721/ERC721.behavior.js

@ -123,7 +123,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
"ERC1155: caller is not token owner or approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
@ -140,7 +140,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
"ERC1155: caller is not token owner or approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}

@ -19,7 +19,7 @@ abstract contract ERC1155Burnable is ERC1155 {
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
"ERC1155: caller is not token owner or approved"
);
_burn(account, id, value);
@ -32,7 +32,7 @@ abstract contract ERC1155Burnable is ERC1155 {
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
"ERC1155: caller is not token owner or approved"
);
_burnBatch(account, ids, values);

@ -115,7 +115,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner nor approved for all"
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
@ -153,7 +153,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_transfer(from, to, tokenId);
}
@ -178,7 +178,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_safeTransfer(from, to, tokenId, data);
}

@ -20,7 +20,7 @@ abstract contract ERC721Burnable is Context, ERC721 {
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_burn(tokenId);
}
}

@ -107,7 +107,7 @@ interface IERC1820Registry {
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);
/**
* @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
* @notice Checks whether a contract implements an ERC165 interface or not without using or updating the cache.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.

@ -293,7 +293,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder,
this.token.safeTransferFrom(multiTokenHolder, recipient, firstTokenId, firstAmount, '0x', {
from: proxy,
}),
'ERC1155: caller is not token owner nor approved',
'ERC1155: caller is not token owner or approved',
);
});
});
@ -569,7 +569,7 @@ function shouldBehaveLikeERC1155 ([minter, firstTokenHolder, secondTokenHolder,
[firstAmount, secondAmount],
'0x', { from: proxy },
),
'ERC1155: caller is not token owner nor approved',
'ERC1155: caller is not token owner or approved',
);
});
});

@ -36,7 +36,7 @@ contract('ERC1155Burnable', function (accounts) {
it('unapproved accounts cannot burn the holder\'s tokens', async function () {
await expectRevert(
this.token.burn(holder, tokenIds[0], amounts[0].subn(1), { from: other }),
'ERC1155: caller is not token owner nor approved',
'ERC1155: caller is not token owner or approved',
);
});
});
@ -60,7 +60,7 @@ contract('ERC1155Burnable', function (accounts) {
it('unapproved accounts cannot burn the holder\'s tokens', async function () {
await expectRevert(
this.token.burnBatch(holder, tokenIds, [ amounts[0].subn(1), amounts[1].subn(2) ], { from: other }),
'ERC1155: caller is not token owner nor approved',
'ERC1155: caller is not token owner or approved',
);
});
});

@ -188,7 +188,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
it('reverts', async function () {
await expectRevert(
transferFunction.call(this, owner, other, tokenId, { from: other }),
'ERC721: caller is not token owner nor approved',
'ERC721: caller is not token owner or approved',
);
});
});
@ -505,7 +505,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
context('when the sender does not own the given token ID', function () {
it('reverts', async function () {
await expectRevert(this.token.approve(approved, tokenId, { from: other }),
'ERC721: approve caller is not token owner nor approved');
'ERC721: approve caller is not token owner or approved');
});
});
@ -513,7 +513,7 @@ function shouldBehaveLikeERC721 (errorPrefix, owner, newOwner, approved, another
it('reverts', async function () {
await this.token.approve(approved, tokenId, { from: owner });
await expectRevert(this.token.approve(anotherApproved, tokenId, { from: approved }),
'ERC721: approve caller is not token owner nor approved for all');
'ERC721: approve caller is not token owner or approved for all');
});
});

Loading…
Cancel
Save