Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL_ERROR: insufficient funds #35

Closed
pyDraco9 opened this issue Jun 11, 2023 · 1 comment
Closed

INTERNAL_ERROR: insufficient funds #35

pyDraco9 opened this issue Jun 11, 2023 · 1 comment

Comments

@pyDraco9
Copy link

Maybe someone can help me troubleshoot why?
account balance should be fine: 0.00311887674881946
try sending 0.001

def deposit(private_key, amount):
    try:
        account: LocalAccount = Account.from_key(private_key)
        zk_web3 = ZkSyncBuilder.build("https://testnet.era.zksync.dev")
        eth_web3 = Web3(Web3.HTTPProvider("https://rpc.ankr.com/eth_goerli")
        print(eth_web3.eth.block_number)
        eth_provider = EthereumProvider(zk_web3, eth_web3, account)
        print("Executing deposit transaction on L1 network")
        l1_tx_receipt = eth_provider.deposit(
            token=Token.create_eth(),
            amount=eth_web3.to_wei(amount, "ether"),
            gas_price=eth_web3.eth.gas_price
        )
        # Check if deposit transaction was successful
        if not l1_tx_receipt["status"]:
            raise RuntimeError("Layer 1 error")

        return l1_tx_receipt["transactionHash"].hex()

    except Exception as e:
        print(f"deposit error: {e}")
        return
    return

And logging debug

2023-06-11 10:08:35,072 - DEBUG - Making request. Method: zks_getMainContract
2023-06-11 10:08:35,073 - DEBUG - make_request: zks_getMainContract, params : ()
2023-06-11 10:08:35,073 - DEBUG - Making request HTTP. URI: https://testnet.era.zksync.dev, Method: zks_getMainContract
2023-06-11 10:08:35,074 - DEBUG - Session cached: https://testnet.era.zksync.dev, <requests.sessions.Session object at 0x000001C3D6592B80>
2023-06-11 10:08:35,075 - DEBUG - Starting new HTTPS connection (1): testnet.era.zksync.dev:443
2023-06-11 10:08:36,013 - DEBUG - https://testnet.era.zksync.dev:443 "POST / HTTP/1.1" 200 None
2023-06-11 10:08:36,013 - DEBUG - Getting response HTTP. URI: https://testnet.era.zksync.dev, Method: zks_getMainContract, Response: {'jsonrpc': '2.0', 'result': '0x1908e2bf4a88f91e4ef0dc72f02b8ea36bea2319', 'id': 0}
2023-06-11 10:08:36,024 - DEBUG - Making request. Method: eth_chainId
2023-06-11 10:08:36,025 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId
2023-06-11 10:08:36,358 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:36,359 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId, Response: {'jsonrpc': '2.0', 'id': 1, 'result': '0x5'}
2023-06-11 10:08:36,360 - DEBUG - Making request. Method: zks_getBridgeContracts
2023-06-11 10:08:36,360 - DEBUG - make_request: zks_getBridgeContracts, params : ()
2023-06-11 10:08:36,361 - DEBUG - Making request HTTP. URI: https://testnet.era.zksync.dev, Method: zks_getBridgeContracts
2023-06-11 10:08:36,638 - DEBUG - https://testnet.era.zksync.dev:443 "POST / HTTP/1.1" 200 None
2023-06-11 10:08:36,638 - DEBUG - Getting response HTTP. URI: https://testnet.era.zksync.dev, Method: zks_getBridgeContracts, Response: {'jsonrpc': '2.0', 'result': {'l1Erc20DefaultBridge': '0x927ddfcc55164a59e0f33918d13a2d559bc10ce7', 'l2Erc20DefaultBridge': '0x00ff932a6d70e2b8f1eb4919e1e09c1923e7e57b'}, 'id': 1}
Executing deposit transaction on L1 network
2023-06-11 10:08:36,644 - DEBUG - Making request. Method: eth_gasPrice
2023-06-11 10:08:36,644 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_gasPrice
2023-06-11 10:08:36,936 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 42
2023-06-11 10:08:36,937 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_gasPrice, Response: {'jsonrpc': '2.0', 'id': 2, 'result': '0x119b'}
2023-06-11 10:08:36,938 - DEBUG - Making request. Method: eth_getTransactionCount
2023-06-11 10:08:36,938 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount
2023-06-11 10:08:37,289 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:37,290 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount, Response: {'jsonrpc': '2.0', 'id': 3, 'result': '0x1'}
2023-06-11 10:08:37,291 - DEBUG - Making request. Method: eth_call
2023-06-11 10:08:37,292 - DEBUG - Making request. Method: eth_chainId
2023-06-11 10:08:37,292 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId
2023-06-11 10:08:37,537 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:37,537 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId, Response: {'jsonrpc': '2.0', 'id': 4, 'result': '0x5'}
2023-06-11 10:08:37,538 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_call
2023-06-11 10:08:37,834 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 None
2023-06-11 10:08:37,834 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_call, Response: {'jsonrpc': '2.0', 'id': 5, 'result': '0x0000000000000000000000000000000000000000000000000011c37937e08000'}
2023-06-11 10:08:37,835 - DEBUG - Making request. Method: eth_getTransactionCount
2023-06-11 10:08:37,836 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount
2023-06-11 10:08:38,104 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:38,104 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount, Response: {'jsonrpc': '2.0', 'id': 6, 'result': '0x1'}
2023-06-11 10:08:38,106 - DEBUG - Making request. Method: eth_call
2023-06-11 10:08:38,106 - DEBUG - Making request. Method: eth_chainId
2023-06-11 10:08:38,106 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId
2023-06-11 10:08:38,394 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:38,395 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId, Response: {'jsonrpc': '2.0', 'id': 7, 'result': '0x5'}
2023-06-11 10:08:38,397 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_call
2023-06-11 10:08:38,683 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 None
2023-06-11 10:08:38,683 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_call, Response: {'jsonrpc': '2.0', 'id': 8, 'result': '0x0000000000000000000000000000000000000000000000000011c37937e08000'}
2023-06-11 10:08:38,684 - DEBUG - Making request. Method: eth_getTransactionCount
2023-06-11 10:08:38,686 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount
2023-06-11 10:08:38,975 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 39
2023-06-11 10:08:38,976 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_getTransactionCount, Response: {'jsonrpc': '2.0', 'id': 9, 'result': '0x1'}
2023-06-11 10:08:38,978 - DEBUG - Making request. Method: eth_chainId
2023-06-11 10:08:38,978 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId
2023-06-11 10:08:39,313 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 40
2023-06-11 10:08:39,314 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_chainId, Response: {'jsonrpc': '2.0', 'id': 10, 'result': '0x5'}
2023-06-11 10:08:39,322 - DEBUG - Making request. Method: eth_sendRawTransaction
2023-06-11 10:08:39,322 - DEBUG - Making request HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_sendRawTransaction
2023-06-11 10:08:39,816 - DEBUG - https://rpc.ankr.com:443 "POST /eth_goerli HTTP/1.1" 200 None
2023-06-11 10:08:39,817 - DEBUG - Getting response HTTP. URI: https://rpc.ankr.com/eth_goerli, Method: eth_sendRawTransaction, Response: {'jsonrpc': '2.0', 'id': 11, 'error': {'code': -32000, 'message': 'INTERNAL_ERROR: insufficient funds'}}
@danijelTxFusion
Copy link
Contributor

The account balance cannot cover the transaction fee on the Goerli network. Based on my experience, your balance is too low and cannot even cover the transaction fee at regular traffic levels. You would need more funds to execute the deposit workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants