-
카테고리
-
세부 분야
블록체인
-
해결 여부
미해결
not a program account 에러
20.06.28 04:53 작성 조회수 278
0
not a program account 에러는 어떤 상황에서 생기는 오류인가요...!
에러메세지와 error.js 화면 적어놓겠습니다.
해결법에 대해서도 조언 가능하시다면 부탁드립니다.
<에러메세지>
errors.js:74 Uncaught (in promise) Error: Returned error: not a program account (e.g., an account having code and storage)
at Object.ErrorResponse (errors.js:74)
at eval (index.js:155)
at XMLHttpRequest.request.onreadystatechange (index.js:112)
at XMLHttpRequestEventTarget.dispatchEvent (xml-http-request-event-target.js:34)
at XMLHttpRequest._setReadyState (xml-http-request.js:208)
at XMLHttpRequest._onHttpResponseEnd (xml-http-request.js:318)
at exports.IncomingMessage.eval (xml-http-request.js:289)
at exports.IncomingMessage.emit (events.js:157)
at endReadableNT (_stream_readable.js:1010)
at afterTickTwo (index.js:28)
<errors.js>
onst constants = __webpack_require__(/*! ./constants */ "./node_modules/caver-js/packages/caver-core-helpers/src/constants.js")
const hasErrorMessage = result => !!result && !!result.error && !!result.error.message
const txErrorTable = {
'0x2': 'VM error occurs while running smart contract',
'0x3': 'max call depth exceeded',
'0x4': 'contract address collision',
'0x5': 'contract creation code storage out of gas',
'0x6': 'evm: max code size exceeded',
'0x7': 'out of gas',
'0x8': 'evm: write protection',
'0x9': 'evm: execution reverted',
'0xa': 'reached the opcode count limit',
'0xb': 'account already exists',
'0xc': 'not a program account (e.g., an account having code and storage)',
'0xd': 'Human-readable address is not supported now',
'0xe': 'fee ratio is out of range [1, 99]',
'0xf': 'AccountKeyFail is not updatable',
'0x10': 'different account key type',
'0x11': 'AccountKeyNil cannot be initialized to an account',
'0x12': 'public key is not on curve',
'0x13': 'key weight is zero',
'0x14': 'key is not serializable',
'0x15': 'duplicated key',
'0x16': 'weighted sum overflow',
'0x17': 'unsatisfiable threshold. Weighted sum of keys is less than the threshold.',
'0x18': 'length is zero',
'0x19': 'length too long',
'0x1a': 'nested role-based key',
'0x1b': 'a legacy transaction must be with a legacy account key',
'0x1c': 'deprecated feature',
'0x1d': 'not supported',
'0x1e': 'smart contract code format is invalid',
}
module.exports = {
InvalidConnection: host => new Error(`CONNECTION ERROR: Couldn't connect to node ${host}.`),
ConnectionTimeout: ms => new Error(`CONNECTION TIMEOUT: timeout of ${ms}ms achived`),
InvalidProvider: () => new Error('Provider not set or invalid'),
InvalidNumberOfParams: (got, expected, method) =>
new Error(`
Invalid number of parameters for "${method}". Got ${got} expected ${expected}!
`),
ErrorResponse: result => {
const message = hasErrorMessage(result) ? result.error.message : JSON.stringify(result)
return new Error(`Returned error: ${message}`)
},
InvalidResponse: result => {
if (result === null) return new Error('Invalid response: null')
const message = hasErrorMessage(result) ? result.error.message : `Invalid JSON RPC response: ${JSON.stringify(result)}`
return new Error(message)
},
needNameCallPropertyToCreateMethod: new Error('When creating a method you need to provide at least the "name" and "call" property.'),
blockHashNull: new Error('blockHash null'),
contractCouldntBeStored: new Error("The contract code couldn't be stored, please check your gas limit."),
receiptDidntContainContractAddress: new Error("The transaction receipt didn't contain a contract address."),
transactionReverted: receiptJSON => new Error(`Transaction has been reverted by the EVM:\n${receiptJSON}`),
transactionRanOutOfGas: receiptJSON => new Error(`Transaction ran out of gas. Please provide more gas:\n${receiptJSON}`),
invalidGasPrice: () => new Error(`Invalid gas price. Please provide valid gas price: ${constants.VALID_GAS_PRICE}`),
invalidGasLimit: () => new Error('Invalid gas limit. Please provide valid gas.'),
invalidData: () => new Error('Invalid data. Please provide valid hex-strict data.'),
notAllowedZeroGas: () => new Error("gas can't be 0. Please provide more gas."),
txErrorTable,
}
답변을 작성해보세요.
답변 0