Skip to content

ValueError: VM Exception while processing transaction: revert: #1498

Answered by praxis-dev
praxis-dev asked this question in Q&A
Discussion options

You must be logged in to vote
helpful_scripts.py

from brownie import network, config, accounts, MockV3Aggregator
from web3 import Web3

LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"]

DECIMALS = 8
STARTING_PRICE = 200000000000


def get_account():
    if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
        return accounts[0]
    else:
        return accounts.add(config["wallets"]["from_key"])


def deploy_mocks():
    print(f"The active network is {network.show_active()}")
    print("Deploying Mocks...")
    if len(MockV3Aggregator) <= 0:
        MockV3Aggregator.deploy(DECIMALS, STARTING_PRICE, {"from": get_account()})
    print("Mocks Deployed")

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@praxis-dev
Comment options

@cromewar
Comment options

@praxis-dev
Comment options

Answer selected by praxis-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants