Agnes
Agnes

Reputation: 33

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?

Upvotes: 1

Views: 1346

Answers (2)

emilrueh
emilrueh

Reputation: 11

As I encountered the same issue I have tried around and realized that when deploying to a live net a default gas price setting seems to be set meaning only ganache needs the above described variables and imports etc.

It actually seems to be working better when setting these variables ONLY for development nets and the "gas_price": gas_strategy in the contract deployment dictionary seems unnecessary for both.

I have used an "if on dev" check to set gas_price(gas_strategy) see below:

from brownie.network import gas_price
from brownie.network.gas.strategies import LinearScalingStrategy

gas_strategy = LinearScalingStrategy("60 gwei", "70 gwei", 1.1)

if network.show_active() == "development":
    gas_price(gas_strategy)

(Solidity version 0.6.6 and this was just trial and error so no official fix)

Upvotes: 0

OAlchemista
OAlchemista

Reputation: 46

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

Upvotes: 3

Related Questions