Replies: 3 comments 9 replies
-
Values for req.body.address and req.body.isVerified are 0x549cd48a4169dE45F56Ff7CB141D6ea8bc900192 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Same error here using websocket provider Code: const buyToken = async(account, tokenContract, gasLimit, gasPrice) => {
const buyAmount = 0.1
const slippage = 0
let amountOutMin = 0;
const amountIn = ethers.utils.parseUnits(buyAmount.toString(), 'ether');
if (parseInt(slippage) !== 0) {
const amounts = await router(account).getAmountsOut(amountIn, [BNB_CONTRACT, tokenContract]);
amountOutMin = amounts[1].sub(amounts[1].div(100).mul(`${slippage}`));
}
const tx = await router(account).swapExactETHForTokensSupportingFeeOnTransferTokens(
amountOutMin,
[BNB_CONTRACT, tokenContract],
account.address,
(Date.now() + 1000 * 60 * 10),
{
'value': amountIn,
'gasLimit': gasLimit,
'gasPrice': gasPrice,
}
);
const receipt = await tx.wait();
if (receipt && receipt.blockNumber && receipt.status === 1) { // 0 - failed, 1 - success
console.log(`Transaction https://bscscan.com/tx/${receipt.transactionHash} mined, status success`);
} else if (receipt && receipt.blockNumber && receipt.status === 0) {
console.log(`Transaction https://bscscan.com/tx/${receipt.transactionHash} mined, status failed`);
} else {
console.log(`Transaction https://bscscan.com/tx/${receipt.transactionHash} not mined`);
}
} ABI : {
"inputs": [
{
"internalType": "uint256",
"name": "amountOutMin",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "swapExactETHForTokensSupportingFeeOnTransferTokens",
"outputs": [
],
"stateMutability": "payable",
"type": "function"
} output :
Version: Ethers 5.6.4 |
Beta Was this translation helpful? Give feedback.
1 reply
-
@ricmoo any hint about what could be happening to my example? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
5.6.4
Search Terms
invalid BigNumbe
Describe the Problem
When I call a contract with a Celo JRPC it fails saying invalid BigNumber and looks it complains about having an undefined value for gasLimit
I have tried with the BSC and it works, I have tried to add gasLimit as an override but it gives the same error
Code Snippet
Contract ABI
Errors
Environment
node.js (older than v12)
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions