Please join the Ethereum Python Dev discord, which has a #brownie channel! https://discord.gg/FwuxuvGSjz
from
field specifying the address to deploy from
here's my deploy_lottery script
from scripts.helpful_script import (
LOCAL_BLOCKCHAIN_ENVIRONMENT,
get_account,
get_contract,
fund_with_link,
)
from brownie import Lottery, accounts, network, config
import time
import os
def deploy_lottery():
account = get_account()
lottery = Lottery.deploy(
get_contract("eth_usd_price_feed").address,
get_contract("vrf_Coordinator").address,
get_contract("link_token").address,
config["networks"][network.show_active()]["fee"],
config["networks"][network.show_active()]["keyhash"],
{"from": account},
publish_source=config["networks"][network.show_active()].get("verify", False),
)
print("Deployed lottery!")
return lottery
def start_lottery():
account = get_account()
lottery = Lottery[-1]
starting_tx = lottery.startLottery({"from": account})
starting_tx.wait(1)
print("The lottery is started!")
def enter_lottery():
account = get_account()
lottery = Lottery[-1]
value = lottery.getEntranceFee() + 100000000
tx = lottery.enter({"from": account, "value": value})
tx.wait(1)
print("You entered the lottery!")
def end_lottery():
account = get_account()
lottery = Lottery[-1]
# fund the contract
# then end the lottery
tx = fund_with_link(lottery.address)
tx.wait(1)
ending_transaction = lottery.endLottery({"from": account})
ending_transaction.wait(1)
time.sleep(180)
print(f"{lottery.recentWinner()} is the new winner!")
def main():
deploy_lottery()
start_lottery()
enter_lottery()
end_lottery()
Hey guys.. im having an issue with my FTMSCAN_TOKEN.
An API token is required to verify contract source code. Visit https://ftmscan.com/ to obtain a token, and then store it as the environment variable $FTMSCAN_TOKEN
i have already put
? export FTMSCAN_TOKEN=xxxxxxxx
which i got from https://ftmscan.com/myapikey
Is there anyway to verify that my key has been added correctly?
HI guys !
I'm unable to import accounts from brownie via the command(from brownie import accounts).
I've already installed Brownie in the required way, but still, I'm unable to import accounts from brownie via the code(from brownie import accounts). It is correct till (from brownie..), but then not showing accounts option when I write import accounts
Hello! So I have a bit of an issue. I am writing a contract and I need to input a data structure signed according to EIP-712. I've spent a lot of time on this, but I figured out that whenever I call the function using the brownie Contract container , the hash that I obtain is wrong and the signature I get is not valid. However, when I deploy the contract in the forked chain, and I use web3.contract to call it, the hash and signature are right, any idea what might be causing this ?
Anyone able to help me with this?
FAILED tests/hyp.py - IndexError: list index out of range
error on the imported accounts input in given