balpy icon indicating copy to clipboard operation
balpy copied to clipboard

Fails to run on Kovan, Goerli, Mainnet

Open LinuxIsCool opened this issue 3 years ago • 5 comments

Kovan is deprecated and no longer supported by infura.

I tried running the following:

python3 samples/poolCreation/poolCreationSample.py samples/poolCreation/sampleLBPool.json

on both mainnet and goerli. I get the following error:

Missing contracts on mainnet: [ChildChainStreamer, ChildChainLiquidityGaugeFactory]

==============================================================

==============================================================
================ Step 1: Check Token Balances ================
==============================================================

Traceback (most recent call last):
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/web3/contract.py", line 1507, in call_contract_function
    output_data = web3.codec.decode_abi(output_types, return_data)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/codec.py", line 181, in decode_abi
    return decoder(stream)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_utils/functional.py", line 45, in inner
    return callback(fn(*args, **kwargs))
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/decoding.py", line 173, in decode
    yield decoder(stream)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/decoding.py", line 127, in __call__
    return self.decode(stream)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/decoding.py", line 198, in decode
    raw_data = self.read_data_from_stream(stream)
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/eth_abi/decoding.py", line 305, in read_data_from_stream
    raise InsufficientDataBytes(
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ygg/Workspace/Forks/balpy/samples/poolCreation/poolCreationSample.py", line 112, in <module>
    main();
  File "/home/ygg/Workspace/Forks/balpy/samples/poolCreation/poolCreationSample.py", line 39, in main
    if not bal.erc20HasSufficientBalances(tokens, initialBalances):
  File "/home/ygg/Workspace/Forks/balpy/balpy/balpy.py", line 618, in erc20HasSufficientBalances
    currentHasSufficientBalance = self.erc20HasSufficientBalance(token, amount);
  File "/home/ygg/Workspace/Forks/balpy/balpy/balpy.py", line 595, in erc20HasSufficientBalance
    balance = self.erc20GetBalanceStandard(tokenAddress);
  File "/home/ygg/Workspace/Forks/balpy/balpy/balpy.py", line 564, in erc20GetBalanceStandard
    decimals = self.erc20GetDecimals(tokenAddress);
  File "/home/ygg/Workspace/Forks/balpy/balpy/balpy.py", line 557, in erc20GetDecimals
    decimals = token.functions.decimals().call();
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/web3/contract.py", line 954, in call
    return call_contract_function(
  File "/home/ygg/.cache/pypoetry/virtualenvs/balpy-yyw1STJO-py3.10/lib/python3.10/site-packages/web3/contract.py", line 1528, in call_contract_function
    raise BadFunctionCallOutput(msg) from e
web3.exceptions.BadFunctionCallOutput: Could not transact with/call contract function, is contract deployed correctly and chain synced?

LinuxIsCool avatar Nov 20 '22 03:11 LinuxIsCool

A number of samples still pointing to kovan is a known issue, just haven't had the time to address it

What exactly are you passing as your sampleLBPool.json to get these errors?

gerrrg avatar Nov 21 '22 14:11 gerrrg

This:

https://github.com/balancer-labs/balpy/blob/22d0c65749beb664b4afd572e7d4ffa334de7157/samples/poolCreation/sampleLBPool.json

I see that you edited that file in the following commit. Maybe I should pull and try again.

LinuxIsCool avatar Nov 22 '22 21:11 LinuxIsCool

What's the solution for moving beyond Kovan? Point everything to Goerli? Would that work?

LinuxIsCool avatar Nov 22 '22 21:11 LinuxIsCool

you said you were trying to launch a pool on Goerli, but that's a kovan sample file. What file were you using to deploy a pool on Goerli?

The solution for moving beyond Kovan is to move everything to Goerli, yeah.

gerrrg avatar Nov 22 '22 21:11 gerrrg

Yes sorry, I made one change to that file which was changing the network to Goerli.

Thanks for clarifying the Goerli migration. An easy contribution to the repo.

LinuxIsCool avatar Nov 23 '22 20:11 LinuxIsCool