@matterlabs/hardhat-zksync-verify
Version:
Hardhat plugin to verify smart contracts for the ZKsync network
36 lines • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZksyncEtherscanResponse = void 0;
class ZksyncEtherscanResponse {
constructor(response) {
this.status = parseInt(response.status, 10);
this.message = response.result;
}
errorExists() {
return !this.isSuccess() || !this.isPending();
}
getError() {
return this.errorExists() ? this.message : undefined;
}
isPending() {
return this.message === 'Pending in queue';
}
isFailure() {
return this.message.startsWith('Fail - Unable to verify');
}
isSuccess() {
return this.message === 'Pass - Verified';
}
isBytecodeMissingInNetworkError() {
return this.message.startsWith('Unable to locate ContractCode at');
}
isAlreadyVerified() {
return (this.message.startsWith('Contract source code already verified') ||
this.message.startsWith('Already Verified'));
}
isOk() {
return this.status === 1;
}
}
exports.ZksyncEtherscanResponse = ZksyncEtherscanResponse;
//# sourceMappingURL=verification-status-response.js.map