Wie erstelle ich ein Abonnement in VRFCoordinatorV2_Mocks von Brownie?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie erstelle ich ein Abonnement in VRFCoordinatorV2_Mocks von Brownie?

by Guest » 11 Jan 2025, 11:58

Ich versuche, eine subscriptionId des VRFCoordinatorV2_5Mokcs zu erstellen, um einen Lernvertrag zu implementieren, der aus einer Lotterie besteht.
Die Dokumentation schlägt vor: Rufen Sie die Funktion createSubscription (die VRFCoordinatorV2_5Mock erbt) auf, um ein neues Abonnement zu erstellen. also habe ich in meinen Code geschrieben:

Code: Select all

def end_lottery():
account = get_account()
lottery = Lottery[-1]
subId = VRFCoordinatorV2_5Mock.createSubscription({"from": account})

was die folgende Fehlermeldung generiert:

Code: Select all

  File "./scripts/deploy.py", line 56, in end_lottery
subId = VRFCoordinatorV2_5Mock.createSubscription({"from": account})
AttributeError: 'ContractContainer' object has no attribute 'createSubscription'
Terminating local RPC client...

Ich möchte VRFCoordinatorV2_5Mocks lokal ausführen, daher muss ich ein Abonnement erstellen und es für die Zwecke meines Vertrags verwenden. Darüber hinaus muss ich das Abonnement entweder über einen Token-Link oder über ETH finanzieren oder beides. Ich hoffe, Sie können mir helfen.

Top