I made the following contract:
pragma solidity ^0.4.17;
contract Checking {
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 checking.js with the following commands
var Checking = artifacts.require("./Checking.sol");
module.exports = function (deployer) {
var ss;
Checking.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 .....