'Smartcontract/Lottery : Errors during execution of running scripts
While running the deploy_lottery.py I am getting the following error: The transactions executes until def start_lottery(). Once it reaches the def enter_lottery the programs stops execution with the following error: 1."sender doesn't have enough funds to send tx." I am running the script in local development chain with a "id" account.
Solution 1:[1]
Can you share your code please? mine looks like this and it works
python
def startLotter():
account = get_account()
lottery = Lottery[-1]
starting_tx = lottery.startLottery({"from": account})
starting_tx.wait(1)
print("The lottery has started!!")
solidity
function startLottery() public onlyOwner
{
require(lottery_state == LOTTERY_STATE.CLOSED, "lottery already open");
lottery_state = LOTTERY_STATE.OPEN;
}
the function only has to change the state of the lottery but that does require a transaction so you should have the funds.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 0xVinx |
