It said that the address is invalid and here is my code
first I try with checksum the {from: address} here and if I put check some it will not remember address anymore so if I not put checksum in artW then it also said invalid argument.
export const mint = async(_data:string, _artistN:string, _artistW:string, _chain:string) => {
const abi = await token_abi.art_abi;
const web3 = await Moralis.Web3.enable();
const contract = new web3.eth.Contract(abi, CONTRACT_ADDRESS);
let user = Moralis.User.current();
console.log("UISER: ", user);
let account = getAddress();
try {const artW=web3.utils.toChecksumAddress(_artistW);
console.log(artW);
const res = await contract.methods.createArt(_artistN, artW, _data)
.send({from: account})
console.log("done: ",res.event.Paint);
} catch (error) {
console.log('====Contract createArt =============');
console.log(error);
console.log('====================================');
}
}
export const getAddress = async () => {
let user = Moralis.User.current();
if (user == null){
getlogin();
}
try {
// const account = user.get('ethAddress');
const address = await Moralis.User.currentAsync().then(function(user) {
return user.get("ethAddress")
});
return address;
} catch (error) {
//TODO: ADD ERROR
}
}