Contract method에 send할때 나오는 오류

우선 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

value를 보내지 않아도 되는 function에 send로 access할때는 문제없이 되네요…ㅠㅠ 뭐가 문젤까요

value를 보내는 function만 잘되지 않는데 제가 call한 방법이 틀린건가요 도와주세요!!

안녕하세요

해당 트랜잭션의 오류를 내용이 Rhythmic Monkey Club: sale is not active 이렇게 나오는데

mainMint의 require 조건이 안맞는것같은데 확인 부탁드립니다.

1개의 좋아요

scope내에서 트잭 오류를 확인할 수 있었군요. 감사합니다. 컨트랙을 매번 새로 만들어서 쓰다보니 옛날 컨트랙을 사용해서 sale 조건이 안맞게 설정되어있었습니다…감사합니다…ㅎㅎ