Hi,
I am having an issue when calling a function to interact with a contract and im quite stumped about what is going on. And any ideas would be greatly appreciated. Im able to login no problem to moralis.
errors.js:28 Uncaught (in promise) Error: Returned error: unknown account
at Object.ErrorResponse (errors.js:28)
at index.js:302
at XMLHttpRequest.i.onreadystatechange (index.js:98)
This is in my index.html
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/moralis.js"></script>
<script type="text/javascript"src="abi.js"></script>
This is in my main.js
// connect to Moralis server
Moralis.initialize("fQ5bhUdiCiWmI9OyDffHKypokEpG56V5z7cHGAYK");
Moralis.serverURL = "https://oolhmy6ryxge.bigmoralis.com:2053/server";
let contractAddress = "0x9645633E13579a9ed3F973b0C146551FEa8A92Ae"
const NODE_URL = "https://speedy-nodes-nyc.moralis.io/91a948142eb4408b51cf3875/polygon/mumbai/archive"
And I have a button that calls a function.
async function upload(){
let contract = new web3.eth.Contract(contractAbi,contractAddress)
contract.methods.createNewSpecies(“svgsentfromBrowser”,3,“browserszs”,false).send({from: ethereum.selectedAddress, value:1000000000000000}).on(‘transactionHash’, function(hash){
}).on(‘receipt’, function(receipt){
console.log(receipt)
})}
Thanks again!