function TriggerContract() { var account = getAccounts(); var test = web3.eth.defaultAccount;
console.log(account);
var q = document.getElementById("Quantity").value;
var u = toHex(document.getElementById("Unit").value);
var m = toHex(document.getElementById("Material").value);
var x = contractAddress.countMaterials(function(err, result) {
if (err) {
console.log(err)
} else {
console.log("Hey")
}
});
console.log(x);
contractAddress.setMaterial((test,q, u, m) => {
if (err) {
console.log(err)
} else {
console.log("YES")
}
});
Reset();
}
I get a "Uncaught Error: Invalid number of arguments to Solidity function" on the following line and have no idea why. The number of arguments should be correct. Any suggestions would be greatly appreciated.
contractAddress.setMaterial((test,q, u, m)
function setMaterial(address _address, uint64 _weight, bytes16 _material, bytes16 _unit) public{
materials[_address] = Material(_address, _weight, _unit, _material);
materialAccounts.push(_address) -1;
emit materialAdded(_materialID);
}