Rename ERC1155InsufficientApprovalForAll to ERC1155MissingApprovalForAll (#4381)

This commit is contained in:
Ernesto García
2023-06-26 06:20:01 -06:00
committed by GitHub
parent cb4bf950df
commit 8cab922347
5 changed files with 9 additions and 9 deletions

View File

@ -138,7 +138,7 @@ interface IERC1155Errors {
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155InsufficientApprovalForAll(address operator, address owner);
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.

View File

@ -116,7 +116,7 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) public virtual {
if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) {
revert ERC1155InsufficientApprovalForAll(_msgSender(), from);
revert ERC1155MissingApprovalForAll(_msgSender(), from);
}
_safeTransferFrom(from, to, id, amount, data);
}
@ -132,7 +132,7 @@ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IER
bytes memory data
) public virtual {
if (from != _msgSender() && !isApprovedForAll(from, _msgSender())) {
revert ERC1155InsufficientApprovalForAll(_msgSender(), from);
revert ERC1155MissingApprovalForAll(_msgSender(), from);
}
_safeBatchTransferFrom(from, to, ids, amounts, data);
}

View File

@ -14,7 +14,7 @@ import "../ERC1155.sol";
abstract contract ERC1155Burnable is ERC1155 {
function burn(address account, uint256 id, uint256 value) public virtual {
if (account != _msgSender() && !isApprovedForAll(account, _msgSender())) {
revert ERC1155InsufficientApprovalForAll(_msgSender(), account);
revert ERC1155MissingApprovalForAll(_msgSender(), account);
}
_burn(account, id, value);
@ -22,7 +22,7 @@ abstract contract ERC1155Burnable is ERC1155 {
function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {
if (account != _msgSender() && !isApprovedForAll(account, _msgSender())) {
revert ERC1155InsufficientApprovalForAll(_msgSender(), account);
revert ERC1155MissingApprovalForAll(_msgSender(), account);
}
_burnBatch(account, ids, values);