You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transaction sent: 0xe97361a7db515a30e3feac79b1e14d6e16abd3132949b17a82fbb83cd87bc619
Gas price: 0.0 gwei Gas limit: 12000000 Nonce: 7
Lottery.endLottery confirmed (reverted) Block: 8 Gas used: 11813033 (98.44%)
File "brownie/_cli/run.py", line 49, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/deploy_lottery.py", line 55, in main
end_lottery()
File "./scripts/deploy_lottery.py", line 45, in end_lottery
ending_tx = lottery.endLottery({"from": account})
File "brownie/network/contract.py", line 1693, in __call__
return self.transact(*args)
File "brownie/network/contract.py", line 1566, in transact
return tx["from"].transfer(
File "brownie/network/account.py", line 680, in transfer
receipt._raise_if_reverted(exc)
File "brownie/network/transaction.py", line 420, in _raise_if_reverted
raise exc._with_attr(
VirtualMachineError: revert
Trace step -1, program counter 2469:
File "/Users/dibakar/.brownie/packages/smartcontractkit/[email protected]/contracts/src/v0.6/VRFConsumerBase.sol", line 161, in VRFConsumerBase.requestRandomness:
function requestRandomness(bytes32 _keyHash, uint256 _fee)
internal returns (bytes32 requestId)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
// This is the seed passed to VRFCoordinator. The oracle will mix this with
// the hash of the block containing this request to obtain the seed/input
// which is finally passed to the VRF cryptographic machinery.
Terminating local RPC client..
end_lottery() deploy script -
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_tx = lottery.endLottery({"from": account})
ending_tx.wait(1)
time.sleep(180)
print(f"{lottery.recentWinner()} is the new winner!")
endLottery() Smart Contract -
function endLottery() public onlyOwner {
lottery_state = LOTTERY_STATE.CALCULATING_WINNER;
bytes32 requestId = requestRandomness(keyhash, fee);
emit RequestedRandomness(requestId);
}
The text was updated successfully, but these errors were encountered:
Error -
end_lottery()
deploy script -endLottery()
Smart Contract -The text was updated successfully, but these errors were encountered: