안녕하세요
ipfs.add를 통해서 cid 값을 받아 왔는데, cid 값을 block에 기록을 하고자 합니다.
cid값은 잘 받아오고, signTransaction으로 rawTransaction 값도 잘 받아 옵니다 .하지만, sendTransaction을 보내면 Error: evm: execution reverted 에러가 발생합니다.
혹시 제가 잘못진행 한 것일까요??
const buffer = Buffer.from("hello wrold");
const response = await caver.ipfs.add(buffer.buffer);
const hex = caver.ipfs.toHex(response);
console.log("send file CID :", response);
let senderRawTransaction = "";
try {
//@ts-ignore
const { rawTransaction } = await caver.klay.accounts.signTransaction(
{
type: "FEE_DELEGATED_SMART_CONTRACT_EXECUTION",
from: klaytn.selectedAddress,
to: "0x92c73e30b4dd72db7aaaae9efd82f8140349ce2d",
data: hex,
gas: "500000",
},
privateKey
);
senderRawTransaction = rawTransaction;
console.log(senderRawTransaction);
} catch (error) {
console.log(">>>>>>>>>>", error);
}
try {
if (senderRawTransaction) {
const result = await caver.klay.sendTransaction({
senderRawTransaction: senderRawTransaction,
feePayer: feePayer.address,
});
console.log("!!!!!!!", result);
}
} catch (error) {
console.log("@@@###", error);
}
error
Error: evm: execution reverted
{
"blockHash": "0xb5921a82fa69327549b216df1c4abc346506c70b6f4bf1566adbc40ab4ee4667",
"blockNumber": 85938670,
"contractAddress": null,
"feePayer": "0x5fabbb43b9d1615ae08c412f8cc5e40197d274db",
"feePayerSignatures": [
{
"V": "0x7f5",
"R": "0xb4b6a870aabfb8a8828f1a6bffa60588f4412bac328ac8baea3dea0c59215d2c",
"S": "0x4a275512d04ff161b2e8b49c8f05de71a092bb224b58133a6b7e84ae15f4b8f6"
}
],
"from": "0x1421dddfa9305c5e68b52357a0b8f95baabe6592",
"gas": "0x7a120",
"gasPrice": "0xae9f7bcc00",
"gasUsed": 34613,
"input": "0x1220ca85c3ae715df72fb538e1c34daa56172690b2b44b6d6c44759990e545ab47e4",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0xa5",
"senderTxHash": "0xeaf8250b9dd5bf436a3f8671d9ce5de61356d81b352bc42abc2a4e29caca9202",
"signatures": [
{
"V": "0x7f6",
"R": "0xf01fbf9dc7d562e5cb78543bfb805e814fbc5f467d26d8e778ace40df404d1f4",
"S": "0x685ba8b58a58656f8dd6e5db3bfec146714ca70b8639b2c365bd76a6b3fb43c2"
}
],
"status": false,
"to": "0x92c73e30b4dd72db7aaaae9efd82f8140349ce2d",
"transactionHash": "0x089f02c1f2ea9036382d1310cec40c95edd09e4bc65e816707bdd777d2faa2e6",
"transactionIndex": 2,
"txError": "0x9",
"type": "TxTypeFeeDelegatedSmartContractExecution",
"typeInt": 49,
"value": "0x0"
}
at checkForNormalTx (index.js:771:1)
at index.js:648:1