-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import 'dotenv/config'; | ||
|
||
const abi = [ | ||
'error Unauthorized()', | ||
|
||
'error BadgeNotAllowed(address badge)', | ||
'error BadgeNotFound(address badge)', | ||
'error ExpirationDisabled()', | ||
'error MissingPayload()', | ||
'error ResolverPaymentsDisabled()', | ||
'error RevocationDisabled()', | ||
'error SingletonBadge()', | ||
'error UnknownSchema()', | ||
|
||
'error AttestationBadgeMismatch(bytes32 uid)', | ||
'error AttestationExpired(bytes32 uid)', | ||
'error AttestationNotFound(bytes32 uid)', | ||
'error AttestationOwnerMismatch(bytes32 uid)', | ||
'error AttestationRevoked(bytes32 uid)', | ||
'error AttestationSchemaMismatch(bytes32 uid)', | ||
|
||
'error BadgeCountReached()', | ||
'error LengthMismatch()', | ||
'error TokenNotOwnedByUser(address token, uint256 tokenId)', | ||
|
||
'error CallerIsNotUserProfile()', | ||
'error DuplicatedUsername()', | ||
'error ExpiredSignature()', | ||
'error ImplementationNotContract()', | ||
'error InvalidReferrer()', | ||
'error InvalidSignature()', | ||
'error InvalidUsername()', | ||
'error MsgValueMismatchWithMintFee()', | ||
'error ProfileAlreadyMinted()', | ||
]; | ||
|
||
async function main() { | ||
const errData = '0x8baa579f'; | ||
const contract = new ethers.Interface(abi); | ||
const decodedError = contract.parseError(errData); | ||
console.log('error:', decodedError.name); | ||
} | ||
|
||
main(); |