How to pass from argument to constructor function in solidity that can be received as msg.sender . This is my constructor code
constructor(uint256 _initialSupply)public{
totalSupply = _initialSupply;
balanceOf[msg.sender] = _initialSupply;
}
My client side code
initContract: function() {
$.getJSON('ErcToken.json', function(json, textStatus) {
App.contracts.ErcToken = TruffleContract(json);
App.contracts.ErcToken.setProvider(App.web3Provider);
return App.rendor();
});
},
rendor: function(){
web3.eth.getCoinbase(function(err,account){
if(err === null){
App.account = account;
$("#").text(account);
}
});
App.contracts.ErcToken.deployed().then(function(instance){
return instance.balanceOf(App.account);
}).then(function(balance){
$("#").text(balance.toNumber());
});
return App.bindEvents();
}
Here i'm always receiving balance as 0