error: {code: 6414, message: 'evm: execution reverted'}
안녕하세요. 웹에서 Klip REST API(App2App)를 사용해 nft민팅사이트를 만들고 있는 학생입니다.
executeContract 실행 시 트랜잭션이 생성되지 않는 문제에 대해 조언을 얻고자 글을 올립니다.
truffle로 cypress에 배포한 컨트랙트의 함수를 호출했는데 다음과 같은 오류가 발생했습니다.
1. 에러 메시지(res.data.result.data) :
- error: {code: 6414, message: 'evm: execution reverted'}
- expiration_time: 1692995296
- request_key: "8bde7072-90fd-488d-bd70-3a9309d8303d"
- status: "prepared"
관련해 작성한 코드는 다음과 같습니다.
2. 코드
```
const to = CONTRACTADDRESS;
const value = "1";
const abi = (생략)
const params = `[\"${myAccount}\",\"${tokenId}\"]`;
const bappName = (생략)
axios
bapp: {
name: bappName,
},
chain: "klaytn",
type: "execute_contract",
transaction: {
from: from, //삭제해도 같은 결과가 도출됩니다.
to: to, //SCA 주소
abi: abi,
value: value,
params: params,
},
}).then((res) => {
const requestKey = res.data.request_key;
QRCode.toDataURL(`https://klipwallet.com/?target=/a2a?request_key=${requestKey}`).then(
(url) => {
console.log(url);
let timer = setInterval(() => {
axios.get(
)
axios.get(
).then((res) => {
console.log(`[EXECUTECONTRACT Result]${JSON.stringify(res.data.result)}`);
});
},5000);
}
});
```
App2App - Klip Docs (klipwallet.com)에 따르면, 트랜잭션이 생성되지 않은 것 같습니다.
인자에서 from을 제외해도 같은 결과가 나오며, 현재 지갑엔 2klay가 있는 상태입니다.
CA가 올바른지 확인한 상태입니다.
스마트컨트랙트상의 문제인지, 호출의 문제인지 감이 잘 잡히지 않습니다.
항상 협조에 감사드립니다.
0
-
안녕하세요,
Klip A2A은 고객의 가스비 손실을 방지하는 차원에서 트랜잭션 실행 시, estimateGas 과정에서 revert가 날 것이 예상되면 해당 에러 메세지를 보여주고 트랜잭션을 수행하지 않습니다.
컨트랙트를 디버깅해보시는 것을 권장 드립니다.
감사합니다.
0
댓글을 남기려면 로그인하세요.
댓글
댓글 1개