Exemple #1
0
 public void Initialize(string symbol, string tokenName, ulong totalSupply, uint decimals)
 {
     Api.Assert(!_initialized.GetValue(), "Already initialized.");
     // Api.Assert(Api.GetContractOwner().Equals(Api.GetTransaction().From), "Only owner can initialize the contract state.");
     _symbol.SetValue(symbol);
     _tokenName.SetValue(tokenName);
     _totalSupply.SetValue(totalSupply);
     _decimals.SetValue(decimals);
     _balances[Api.GetTransaction().From] = totalSupply;
     _initialized.SetValue(true);
 }