async function transferTokensToContract(contractAddress, amount) {
web3 = new Web3(web3.currentProvider); // Assuming you're in a browser context
const contract = new web3.eth.Contract(contractAbi, contractAddress);
try {
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const senderAddress = accounts[0];
//const convertedValue = Number(convertToWBNB(amount));
const gasLimit = 20000000; // You can adjust this value based on your needs
// Call the burn function on the contract with the sender's address and amount
await contract.methods.burn(amount).send({ from: senderAddress, gas: gasLimit });
console.log(`${amount} tokens burned to address ${senderAddress}`);
} catch (error) {
console.error("Error transferring tokens:", error);
}
}