Hi, I am using the web3.js library to deploy a smart contract giving it some parameters and setting also the eth value that would be sent in the smartcontract.
Using a 0.4v Solidity version smart contract it works just fine. But when using a smartcontract of version 0.5 of solidity it gives me the following error:
" Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"
The main difference between both versions is that in the 0.4v, the input arguments are inside a function and in the 0.5v they are inside the constructor. Apart from this I can not seem to find any differences between both versions.
Below i attach JS code I am using from web3.js library. I am changing the ABI and bytecode when changing smart contracts. Apart from that, everything remains the same. Checking on Internet I have been recommended to increase by a lot the gas fee which I have done (paying almost 1 tBNB) but the error remains there. I know that the smartcontract works perfectly as I have been able to deploy it using Remix, but i do not know why it is not working with web3js.
This is the smartcontract I am using: https://testnet.bscscan.com/address/0x9124673dd5665a8db86513bbbd430a4886924089#code
Can someone please tell me what may be happening? Thank you, I have been stuck with this error for some weeks.
var standardtokenContract = new web3.eth.Contract(abi);
standardtokenContract.deploy({
data: '0x' + bytecode,
arguments: [$tokenName, $tokenSymbol, $decimalUnits, $initialSupply,address]
}).send({
from: addressU,
value:ethers.utils.parseEther("0.005")
// gas: "1000000",
//gasPrice: '30000000000'
)]