def deploy_mocks(decimals=18, initial_value=2000): """ Use this script if you want to deploy mocks to a testnet """ # Set a default gas price priority_fee("1 gwei") print(f"The active network is {network.show_active()}") print("Deploying Mocks...") account = get_account() print("Deploying Mock Link Token...") link_token = LinkToken.deploy({"from": account}) print("Deploying Mock Price Feed...") mock_price_feed = MockV3Aggregator.deploy(decimals, initial_value, {"from": account}) print(f"Deployed to {mock_price_feed.address}") print("Deploying Mock VRFCoordinator...") mock_vrf_coordinator = VRFCoordinatorMock.deploy( link_token.address, { "from": account, "gas_price": chain.base_fee }) print(f"Deployed to {mock_vrf_coordinator.address}") print("Deploying Mock Oracle...") mock_oracle = MockOracle.deploy(link_token.address, {"from": account}) print(f"Deployed to {mock_oracle.address}") print("Mocks Deployed!")
def get_eth_usd_price_feed_address(): if network.show_active() == "development": mock_price_feed = MockV3Aggregator.deploy(18, 2000, {"from": accounts[0]}) return mock_price_feed.address if network.show_active() in config["networks"]: return config["networks"][network.show_active()]["eth_usd_price_feed"] else: pytest.skip("Invalid network specified ") return
def get_eth_usd_price_feed_address(): if network.show_active() == 'development': mock_price_feed = MockV3Aggregator.deploy(18, 2000, {'from': accounts[0]}) return mock_price_feed.address if network.show_active() in config['networks']: return config['networks'][network.show_active()]['eth_usd_price_feed'] else: pytest.skip('Invalid network specified ') return
def deploy_mocks(decimals=DECIMALS, initial_value=INITIAL_VALUE): """ Use this script if you want to deploy mocks to a testnet """ print(f"The active network is {network.show_active()}") print("Deploying Mocks...") account = get_account() print("Deploying Mock Link Token...") link_token = LinkToken.deploy({"from": account}) print("Deploying Mock Price Feed...") mock_price_feed = MockV3Aggregator.deploy(decimals, initial_value, {"from": account}) print(f"Deployed to {mock_price_feed.address}") print("Deploying Mock VRFCoordinator...") mock_vrf_coordinator = VRFCoordinatorMock.deploy(link_token.address, {"from": account}) print(f"Deployed to {mock_vrf_coordinator.address}") print("Deploying Mock Oracle...") mock_oracle = MockOracle.deploy(link_token.address, {"from": account}) print(f"Deployed to {mock_oracle.address}") print("Mocks Deployed!")
def deploy_mocks(decimals=DECIMALS, initial_value=INITIAL_VALUE): account = get_account() MockV3Aggregator.deploy(decimals, initial_value, {"from": account}) link_token = LinkToken.deploy({"from": account}) VRFCoordinatorMock.deploy(link_token.address, {"from": account}) print("Deployed!")