Hey Devs I want to interact with this smart contract function
but i get this error Cannot read properties of undefined (reading âtoHexStringâ)
smart contract function
function createLock(
uint _expirationDuration,
address _tokenAddress,
uint _keyPrice,
uint _maxNumberOfKeys,
string calldata _lockName,
bytes12 _salt
) external returns(address);
here is my front-end function to interact with smart contract function
all parameters states
const [eventDuration, setEventDuration] = useState("") //for _expirationDuration
const [ticketQuantity, setTicketQuantiy] = useState("") // for _maxNumberOfKeys
const [ticketPrice, setTicketPrice] = useState("") // for _keyPrice
const [eventName, setEventName] = useState("") // for _lockName
const [salt, setSalt] = useState("abdul") // for _salt
const usdcContract = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" // for _tokenAddress
const contractExcuter = useWeb3ExecuteFunction()
// // create event function
async function createEventFunc() {
let options = {
contractAddress: unlockAddress,
functionName: "createLock",
abi: unlockABI,
//Parameters
params: {
_expirationDuration: eventDuration,
_tokenAddress: usdcContract,
_keyPrice: ticketPrice,
_maxNumberOfKeys: ticketQuantity,
_lockName: eventName,
_salt: "abdul"
},
}
await contractExcuter.fetch({
params: options,
onSuccess:() =>{
alert("you have succesful ran function")
},
onError: (errori) =>{
alert(errori.message)
}
})
console.log("clicked button")
}
what could be the source of the problem