I'm unable to send transaction to my smart contract when I send some value in it

      // const pv = caver.wallet.keyring.createFromPrivateKey(newKey)
      // const newKeyring = caver.wallet.keyring.create(provider.address, newKey)
      // const keyAccount = newKeyring.toAccount()
      const wallets = caver.klay.accounts.wallet.add({
        address: address,
        privateKey: newKey
    });
      // const balance = await cont2.methods.getBalance().call()
      const ac = caver.klay.accounts.wallet[0];
 
      
      async function createTx(tx) {
        const account = caver.klay.accounts.wallet[0];
        tx.from = account.address;
        console.log(account.address);
        const signed = await account.signTransaction(tx);
        console.log(signed);
        return signed.rawTransaction;
      }
      const input = await cont2.methods.buyEggs("0x76588D3E8D2C721c16fec204551bdA54cfBF5146").encodeABI()
      const tx = await createTx({
        type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',
        to: '0xD18d6b621F5AB8aD07d579992Ace2FcCE5e859ef',
        //gasPrice: '999999999999999',
        value: toWei(`${bakeBNB}`),
        data: input,
        gas: 900000
    });
      const resp = await caver.klay.sendTransaction({
        senderRawTransaction: tx.toString(),
        feePayer: ac.address,
    });

    console.log({resp});
     ```
1 Like

저도 같은 μ¦μƒμž…λ‹ˆλ‹€. μ–΄λ–»κ²Œ ν•΄κ²° ν•΄μ•Όν•˜λ‚˜μš”?

Could you provide more detailed information to explain the issue especially, the output error message.

1 Like