我一直在玩Ropsten这个合同: CTE
function distribution(address[] addresses, uint256 _amount) onlyOwner public {
uint256 _remainingAmount = _MaxDistribPublicSupply - _CurrentDistribPublicSupply;
require(addresses.length <= 255);
require(_amount <= _remainingAmount);
_amount = _amount * 1e18;
for (uint i = 0; i < addresses.length; i++) {
require(_amount <= _remainingAmount);
_CurrentDistribPublicSupply += _amount;
balances[msg.sender] += _amount;
_totalSupply += _amount;
Transfer(this, addresses[i], _amount);
}
我不明白为什么持有人余额在他获得代币后仍为0。
答案 0 :(得分:1)
正如您在答案中所述,此处您正在将金额添加到已拨打的地址或“发送”#34;交易,在这种情况下这是不正确的。
余额[msg.sender] + = _amount;
您应该增加接收令牌的地址数量。
余额[地址[i]] + = _amount;
此致