I made following contract using visual studio code
pragma solidity ^0.4.17;
contract IDSCheck {
mapping( string => string ) PersonHash;
function AddHash(string name, string hash) {
PersonHash[name] = hash;
}
function GetHash (string name) public returns (string) {
return PersonHash[name];
}
}
Now I want to call this function from truffle using exec command.
I wrote a js file named idscheck.js with the following commands
var IDSCheck = artifacts.require("./IDSCheck.sol");
module.exports = function (deployer) {
var ss;
IDSCheck.deployed().then(function(deployed){ ss=deployed; });
ss.GetHash.call("sal");
}
I get an output error saying
Type Error: cannot read property 'GetHash' of undefined at .....
I am trying to do this is in truffle console. Primary target is to create a script that runs through a batch file using truffle console to get output of the GetHash function of the above contract.