smartcontractkit / chainlink-brownie-contracts

A repository for automatically using the latest chainlink repo from the core chainlink repo.
303 stars 65 forks source link

Transaction reverts when creating a new collectible #12

Closed omer2307 closed 2 years ago

omer2307 commented 2 years ago

Creating a collectible transaction bumps me and error: Execution reverted during call: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, include allow_revert:True as a transaction parameter

file code:

from brownie import AdvancedC, accounts, config
from scripts.helpful import get_breed
import time

STATIC_SEED = 123

def main():
dev = accounts.add(config["wallets"]["from_key"])
print(dev)
print(len(AdvancedC) - 1)
advanced_collectible = AdvancedC[len(AdvancedC) - 1]
print(AdvancedC)
print(advanced_collectible)
transaction = advanced_collectible.createCollectible(
STATIC_SEED, "None", {"from": dev, "gas_limit": 2800000}
)
transaction.wait(1)
requestID = transaction.events["requestedCollectible"]["requestID"]
token_id = advanced_collectible.requestIDToTokenID(requestID)
time.sleep(55)
breed = get_breed(advanced_collectible.tokenIDToBreed(token_id))
print("Dog breed of tokenID {} is {}".format(token_id, breed))`

the function of create collectible:

function createCollectible(uint256 userProvidedSeed, string memory tokenURI) public returns (bytes32) { bytes32 requestID = requestRandomness(keyHash, fee, userProvidedSeed); requestIDToSender[requestID] = msg.sender; requestIDToTokenURI[requestID] = tokenURI; emit requestedCollectible(requestID); }
PatrickAlphaC commented 2 years ago

Could you please make this on the appropriate repo? I think you're just using some outdated code. Are you looking for this?

https://github.com/PatrickAlphaC/nft-mix