0

On BSC Testnet I have deployed a token contract https://testnet.bscscan.com/address/0xE5bB5e6Cf65dBE0062d1EBa9e36e64F89e3f0638

And also a TokenSale contract https://testnet.bscscan.com/address/0xe6A01F088fE30e613D8449D6DA04196C90D5F255

Then I created a temporary DAPP with a swap function connected to my Tokesale contract. Here it is: http://kurt.bestcoinx.com/

The problem is that when I try to swap I get an error for example this transaction:

https://testnet.bscscan.com/tx/0x85b079d4351b16f8733e5b03dd97e7a8a4dfdddaa8037f3ce0c6a2ea9f4f16f7

with the error Warning! Error encountered during contract execution: out of gas

  1. I have BNB in my Owner wallet
  2. I have sent a sufficient amount of my token to the Token sale contract.
  3. I have tried sending BNB to my Tokensale contract and it failed too.

I don't know what to do to get this to start working and I will appreciate it if anyone can check these issues out for me.

Thanks

1
  • token and tokenSale links are the same
    – v1bio
    Commented Feb 5, 2022 at 13:04

1 Answer 1

0

Your WFT token's transfer method uses 65,994 gas for a transfer. The buyWithBNB method from the TokenSale contract uses it and not only it. The gas limit which you set is 50,000, that's why it's running out of gas. Try to set higher gas limit for buyWithBNB transaction.

4
  • Thank you V1bio. I have increased the gas limit to TokenSale from the Dapp as you can see from another instance of my TokenSale. See tx has below: testnet.bscscan.com/tx/…. Transaction still failed with the same result. Commented Feb 5, 2022 at 14:51
  • @UgochukwuOzoamaka how much gas the transaction uses at your local testnet?
    – v1bio
    Commented Feb 5, 2022 at 15:31
  • How do I figure that out? I am deploying using remix. Please guide me a little bit more. Thanks Commented Feb 6, 2022 at 16:08
  • @UgochukwuOzoamaka after you deploy your contract, execute the function buyWithBNB. There should be transaction report, check the execution cost.
    – v1bio
    Commented Feb 6, 2022 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.