I have written my first sample contract. It compiled successfully but when I am trying to run this, it is giving me an error as:
Send transaction failed: Invalid address. if you use injected provider, please check it is properly unlocked.
Code is as follows:
pragma solidity ^0.4.22;
contract Myfirstcontract
{
string private name;
uint private age;
function setName (string newName)
{
name = newName;
}
function getName () returns (string)
{
return name;
}
function setAge (uint newAge)
{
age = newAge;
}
function getAge () returns (uint)
{
return age;
}
}
Please suggest.