From 82cafd6a68e066dec107a0aa22420c1d9401f8aa Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 5 Mar 2019 11:31:49 -0800 Subject: [PATCH] Added remaining erc1155 revert reasons to `types` package --- packages/types/CHANGELOG.json | 2 +- packages/types/src/index.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/types/CHANGELOG.json b/packages/types/CHANGELOG.json index 65fe752365..eabb5fa8ac 100644 --- a/packages/types/CHANGELOG.json +++ b/packages/types/CHANGELOG.json @@ -3,7 +3,7 @@ "version": "2.1.2", "changes": [ { - "note": "Added `Uint256Underflow`, `TransferRejected`, and `InsufficientAllowance` revert reasons", + "note": "Added ERC1155 revert reasons", "pr": 1657 } ] diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 55d36a0f93..546cb3ddc5 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -246,7 +246,6 @@ export enum RevertReason { InvalidMsgValue = 'INVALID_MSG_VALUE', InsufficientEthRemaining = 'INSUFFICIENT_ETH_REMAINING', Uint256Overflow = 'UINT256_OVERFLOW', - Uint256Underflow = 'UINT256_UNDERFLOW', Erc721ZeroToAddress = 'ERC721_ZERO_TO_ADDRESS', Erc721OwnerMismatch = 'ERC721_OWNER_MISMATCH', Erc721InvalidSpender = 'ERC721_INVALID_SPENDER', @@ -260,8 +259,6 @@ export enum RevertReason { TxFullyConfirmed = 'TX_FULLY_CONFIRMED', TxNotFullyConfirmed = 'TX_NOT_FULLY_CONFIRMED', TimeLockIncomplete = 'TIME_LOCK_INCOMPLETE', - TransferRejected = 'TRANSFER_REJECTED', - InsufficientAllowance = 'INSUFFICIENT_ALLOWANCE', // DutchAuction AuctionInvalidAmount = 'INVALID_AMOUNT', AuctionExpired = 'AUCTION_EXPIRED', @@ -276,6 +273,18 @@ export enum RevertReason { ToLessThanLengthRequired = 'TO_LESS_THAN_LENGTH_REQUIRED', InvalidApprovalSignature = 'INVALID_APPROVAL_SIGNATURE', ApprovalExpired = 'APPROVAL_EXPIRED', + // ERC1155 + AmountEqualToOneRequired = 'AMOUNT_EQUAL_TO_ONE_REQUIRED', + BadReceiverReturnValue = 'BAD_RECEIVER_RETURN_VALUE', + CannotTransferToAddressZero = 'CANNOT_TRANSFER_TO_ADDRESS_ZERO', + InsufficientAllowance = 'INSUFFICIENT_ALLOWANCE', + NFTNotOwnedByFromAddress = 'NFT_NOT_OWNED_BY_FROM_ADDRESS', + OwnersAndIdsMustHaveSameLength = 'OWNERS_AND_IDS_MUST_HAVE_SAME_LENGTH', + TokenAndValuesLengthMismatch = 'TOKEN_AND_VALUES_LENGTH_MISMATCH', + TriedToMintFungibleForNonFungibleToken = 'TRIED_TO_MINT_FUNGIBLE_FOR_NON_FUNGIBLE_TOKEN', + TriedToMintNonFungibleForFungibleToken = 'TRIED_TO_MINT_NON_FUNGIBLE_FOR_FUNGIBLE_TOKEN', + TransferRejected = 'TRANSFER_REJECTED', + Uint256Underflow = 'UINT256_UNDERFLOW', } export enum StatusCodes {