-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrorSig.py
80 lines (78 loc) · 2.7 KB
/
errorSig.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from web3 import Web3
errors = [
"OnlyAdminCanCall()",
"CannotBeAdminLess()",
"CannotBeZero()",
"CannotBeSlashed()",
"InsufficientStakeToLock()",
"EnclaveKeyNotVerified()",
"ExceedsAcceptableRange()",
"InvalidContractAddress()",
"CannotUseMatchingEngineRole()",
"InvalidEnclaveSignature(address)",
"IncorrectImageId()",
"AttestationTimeout()",
"InvalidECIESACL()",
"BlacklistedImage(bytes32)",
"AlreadyABlacklistedImage(bytes32)",
"MustBeAnEnclave(bytes32)",
"FailedWhitelistingImages(bytes32)",
"FailedAddingToFamily(bytes32,bytes32)",
"InferredImageIdIsDifferent()",
"ImageAlreadyInFamily(bytes32,bytes32)",
"GeneratorAlreadyExists()",
"InvalidGenerator()",
"CannotLeaveWithActiveMarket()",
"AssignOnlyToIdleGenerators()",
"InsufficientGeneratorComputeAvailable()",
"OnlyWorkingGenerators()",
"InvalidEnclaveKey()",
"OnlyValidGeneratorsCanRequestExit()",
"InvalidGeneratorStatePerMarket()",
"UnstakeRequestNotInPlace()",
"ReduceComputeRequestNotInPlace()",
"MaxParallelRequestsPerMarketExceeded()",
"KeyAlreadyExists(address)",
"ReductionRequestNotValid()",
"PublicMarketsDontNeedKey()",
"CannotModifyImagesForPublicMarkets()",
"InvalidMarket()",
"AlreadyJoinedMarket()",
"CannotBeMoreThanDeclaredCompute()",
"CannotLeaveMarketWithActiveRequest()",
"MarketAlreadyExists()",
"InactiveMarket()",
"OnlyMarketCreator()",
"CannotRemoveDefaultImageFromMarket(uint256,bytes32)",
"CannotAssignExpiredTasks()",
"InvalidInputs()",
"ArityMismatch()",
"OnlyMatchingEngineCanAssign()",
"RequestAlreadyInPlace()",
"CannotSlashUsingValidInputs(uint256)",
"ShouldBeInCreateState()",
"ProofPriceMismatch(uint256)",
"ProofTimeMismatch(uint256)",
"OnlyExpiredAsksCanBeCancelled(uint256)",
"OnlyAssignedAsksCanBeProved(uint256)",
"InvalidProof(uint256)",
"ShouldBeInCrossedDeadlineState(uint256)",
"ShouldBeInAssignedState(uint256)",
"OnlyGeneratorCanDiscardRequest(uint256)",
"InvalidEnclaveSignature()",
"AttestationAutherKeyNotVerified()",
"AttestationAutherImageNotWhitelisted()",
"AttestationAutherImageNotInFamily()",
"AttestationAutherAttestationTooOld()",
"AttestationAutherMismatchedLengths",
"InferredImageIdIsDifferent()",
"ECDSAInvalidSignature()",
"ECDSAInvalidSignatureLength(uint256)",
"ECDSAInvalidSignatureS(bytes32)",
"AttestationVerifierAttestationTooOld()"
]
# Calculate the hash for each error signature and get the first 4 bytes
for error in errors:
error_hash = Web3.keccak(text=error).hex()
error_selector = error_hash[:10]
print(f"{error}: {error_selector}")