-
Notifications
You must be signed in to change notification settings - Fork 409
Open
Description
in the advanced collectible, it works fine till deploying and funding with link but throws when createCollectible
this is how the solidity looks
function createCollectible()
public returns (bytes32){
bytes32 requestId = requestRandomness(keyhash, fee);
requestIdToSender[requestId] = msg.sender;
emit requestedCollectible(requestId, msg.sender);
}
function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override {
Breed breed = Breed(randomNumber%3);
uint256 newTokenId = tokenCounter;
tokenIdToBreed[newTokenId] = breed;
emit BreedAssigned(newTokenId, breed);
address owner = requestIdToSender[requestId];
_safeMint(owner, newTokenId);
// _setTokenURI(newTokenId, tokenURI);
tokenCounter = tokenCounter + 1;
}
function setTokenURI(uint256 tokenId, string memory _tokenURI) public {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not owner or approved");
_setTokenURI(tokenId, _tokenURI);
}
and this is how the python looks
def deploy_and_create():
account = get_account()
advanced_collectible = AdvancedCollectible.deploy(
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)
)
fund_with_link(advanced_collectible.address)
tx = advanced_collectible.createCollectible({"from":account})
tx.wait(1)
print("created ")
Metadata
Metadata
Assignees
Labels
No labels