python-3.xganachebrownie

Awaiting transaction in the mempool


I am trying to follow Curve tutorial on Brownie. After installing Ganache and Brownie successfully I have tried to use the token template from https://github.com/brownie-mix by typing brownie bake token in the command line (while being in the project's folder). The structure of the token project got re-created in my directory. After typing brownie console I get response that brownie environment is ready. Then I try to deply token contract with Token.deploy("Test Token", "TST", 18, 1e21, {'from': accounts[0]}) and this command resulted with mesaage "Awaiting transaction in the mempool"- This message has been hanging on for over 30 minutes I am wondering how should I de-bug it? What can cause the situation where the token does not get deployed correctly?


Solution

  • maybe I can help you. Let's go. Your problem is with gas_price, in a recent eth version the gas is always necessary.

    I resolved my problem with this way...

    from brownie import accounts, config, SimpleStorage
    from brownie.network import gas_price
    from brownie.network.gas.strategies import LinearScalingStrategy
    
    gas_strategy = LinearScalingStrategy("60 gwei", "70 gwei", 1.1)
    
    gas_price(gas_strategy)
    
    def deploy_simple_storage():
        account = accounts[0]
        simple_storage = SimpleStorage.deploy({
            "from": account,
            "gas_price": gas_strategy
            })
    
        # Transact
        # Call
        print(simple_storage)
    
    
    def main():
        deploy_simple_storage()
    

    I don't know if need all this for your problem, but I needed. try import gas_price and call it after "from": account.

    If someone have a better solution, tell me pls.

    fonts: https://eth-brownie.readthedocs.io/en/stable/config.html https://github.com/batprem/pynft