I hava a problem. I need to initialize the person having the address of the purse in the Javascript, then pass it to the function Solidity, but I get an error about wrong format.
My JavaScript function
$scope.myToken = accounts[0];
$scope.initProviders = function(providersAddresses,providersAmount){
alert(providersAddresses);
contract.init(providersAddresses,providersAmount,$scope.myToken).call();
};
And call this function
<md-button ng-click="initProviders('0x199fdf564df1d18056ed46724582502fd3ce580a',1)">INIT</md-button>
And Solidity code
function init(address[] provAddrs, uint provCount,address mainAcc)
{
clientAddr = mainAcc;
for(uint i = 0;i<provCount;i++)
{
providers[i].profit = 0;
providers[i].addr = provAddrs[0];
provCount++;
}
}
But after that I have error invalid address