first post here. Can anyone help with fixing this argument issue. I must say that this is for a class project and this will never be put to use for monetary gain.
I am making a makeshift NFT marketplace through Streamlit. My contract is as follows:
contract Top10NFL is ERC721Full {
constructor() public ERC721Full("Top10NFLtoken", "TOP") {}
function mintToken(address NFT_Owner, string memory tokenURI, uint256 tokenIDinput) public payable returns (uint256) {
uint256 tokenID = tokenIDinput;
_mint(NFT_Owner, tokenID);
_setTokenURI(tokenID, tokenURI);
return tokenID;
}
}
This is the connection point to call the contract:
import os
import json
import streamlit as st
import pandas as pd
import numpy as np
from web3 import Web3
from pathlib import Path
from dotenv import load_dotenv
from streamlit_player import st_player
st.title("Play 10 - Philly Special - Eagles vs Patriots")
st_player("https://www.youtube.com/watch?v=y3Jqif1TUwQ")
if st.button("Buy Philly Special NFT"):
play_10_uri = "https://www.youtube.com/watch?v=y3Jqif1TUwQ"
tx_hash = contract.functions.mintToken(
address,
play_10_uri,
).transact({"from": address, "value": offer_price*1000000000000000000, "gas": 2000000})
receipt = w3.eth.waitForTransactionReceipt(tx_hash)
st.write("Transaction receipt mined:")
st.write(dict(receipt))
This worked just fine the other day and nothing was changed but now I am unable to get it work correctly. I believe that my if statement only has two arguments in it while the mint function calls for three. Reason for this current error.
ValidationError: Could not identify the intended function with name `mintToken`, positional argument(s) of type `(<class 'str'>, <class 'str'>)` and keyword argument(s) of type `{}`. Found 1 function(s) with the name `mintToken`: ['mintToken(address,string,uint256)'] Function invocation failed due to improper number of arguments.
Removing an argument from the contract will not let it compile. I am not sure what to add to the if statement if anything at all. Thank you.