whitehat0917 / ConnectSmartContract

This is nodejs source to connect smart contract by web3
0 stars 3 forks source link

Always returns 'insufficient funds for gas * price + value' #1

Closed Miojo closed 3 years ago

Miojo commented 3 years ago

When settlingAuction it always returns { code: -32000, message: 'insufficient funds for gas * price + value' }

Constants used: const roninUrl = 'https://api.roninchain.com/rpc'; const WETH = '0xc99a6a985ed2cac1ef41640596c5a5f9f4e19ef5'; const axieAddress = '0x32950db2a7164ae833121501c797d79e7b79d74c'; const contractAddress = '0x213073989821f738a7ba3520c3d31a1f9ad31bbd';

Everything reads correctly. I have enough WETH on ronin, but web3.eth.getBalance(walletAddress).then( result => console.log("Balance:",result)) shows 0

kmahl commented 3 years ago

Hi Joao, how are you? Could you solve this problem? I have it too

Miojo commented 3 years ago

yes. I didn't know at the time, but it is against Axies terms of service buying and selling via code. They implemented some barriers to avoid it and this is one of them.

lucasfontesgaspareto commented 3 years ago

the same here, but i see other people buy like a robot... so i dont know if they are truly make something to barrier

kmahl commented 3 years ago

Yes, what I have noticed is that they buy and give away the axie before they ban it. I was never able to execute the purchase and abandoned the project

lucasfontesgaspareto commented 3 years ago

i hate lunacian, i have solded by mistake my axie, instead of 0.1 eth it was 0.01...

@kmahl i will try this no metter what, did you have some progress in the buy process?

YahyaOukharta commented 3 years ago

web3.eth.getBalance(walletAddress) returns the balance in ETH, or in RON in ronin chain. to get the balance in WETH you'll have to interact with the WETH contract.