I have been working with solidity and contracts for a while, but a question came to my mind.
var code = fs.readFileSync(solidityFile).toString(); // Compile the contract code var compiledCode = solc.compile(code); // Generate the ABI abi = JSON.parse(compiledCode.contracts[':SupplyChainContract'].interface); contractInstance = new web3.eth.Contract(abi, contractAddress);
This generates a contract instance and you use this instance to call functions of contract and send transactions.
But, why do we need to do this?
Why cannot we just use the contract address and ask it to execute a function with given parameters? Is it to prevent spam? To force accountUnlock?
Edit: Is it to save state on the node before the state after transaction if validated (or not)? Forget that, does not seem to make sense.