MetaMask struggles

Job ID: 36933771

Budget: €8 – €30 EUR

hi
we are a non-profit supporting other charities on crypto-donations

we use MetaMask so donors can start their transactions but now we have to do some fixes:

*) contract = new web3.eth.Contract(minABI, tokenContractAddress, { from: walletAddress, gas: 100000 });
I don't like the need to add the gas-parameter but otherwise MetaMask shows a warning and gas is to high
is there a better way that using the static 10000?

today I added Arbitrum, BNB SmartChain, Polygon and Optimism Network
*) switching networks works almost fine - but sometimes I get the error 'wallet_switchEthereumChain' already pending for origin...

*) on Arbitrum I always get a out-of-gas message when I try to connect to a contract
I think other ABI's are needed for different networks?

*) and I usually use
sendWei = window.web3.utils.toWei(donateAmount.toString(), "ether");
but on USDT the amount is wrong so I check the token-decimals and use
sendWei = donateAmount * (10 ** decimals);
seems like it's similar on USDC but i couldn't solve it
Related categories: JavaScript Blockchain Web3.js