우선 call을 통해서 컨트랙 method를 부르는데 문제 없음을 확인했습니다.
헌데 아래처럼 method를 send하면 오류가 납니다.
contract.methods.mainMint( amount ).send({from: window.klaytn.selectedAddress, gas: 3000000, value: price}, function(error, result) {
console.log(result);
});
send에서 value를 패스하는 방법이 잘못된 것일까요? 오류는 아래와 같습니다.
Uncaught (in promise) Error: evm: execution reverted
{
“blockHash”: “0x7f5ce61d2fb83420594406562b6267a152308186fcf2116ea47f035089c90622”,
“blockNumber”: 84989036,
“contractAddress”: null,
“from”: “0x15b5185cf69bf9940a1ffd008be2c0b6816a8c8a”,
“gas”: “0x2dc6c0”,
“gasPrice”: “0xae9f7bcc00”,
“gasUsed”: 30074,
“input”: “0xf578d9df0000000000000000000000000000000000000000000000000000000000000001”,
“logsBloom”: “0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000”,
“nonce”: “0xe”,
“senderTxHash”: “0x34c473bee4f4b2126aea82af15d22df690907955cea8f0eae6d4e8bcc1993f5f”,
“signatures”: [
{
“V”: “0x7f5”,
“R”: “0x235a846879c05e62565cc3d75ea0c7d6347318152caa898e8d2f67ba1fdfacf8”,
“S”: “0x6b6fb5b97232eca4dc2da57c3ec54d7418997b47f98412b94640060c58c29784”
}
],
“status”: false,
“to”: “0xc85524614a52b46d2a4755272568f82e14285b16”,
“transactionHash”: “0x34c473bee4f4b2126aea82af15d22df690907955cea8f0eae6d4e8bcc1993f5f”,
“transactionIndex”: 0,
“txError”: “0x9”,
“type”: “TxTypeLegacyTransaction”,
“typeInt”: 0,
“value”: “0xde0b6b3a7640000”,
“events”: {}
}
at checkForNormalTx (index.js:764:1)
at index.js:640:1