不明白为什么持有者拿到代币后余额还是0
I don't understand why the holder balance is still 0 after he gets tokens
我一直在 Ropsten 上玩这个合约:
https://pastebin.com/XPVxPNFv
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
正如您在回答中所述,此处您将金额添加到调用或 "sent" 交易的地址,在这种情况下这是不正确的。
balances[msg.sender] += _amount;
您应该增加将接收令牌的地址的数量。
balances[addresses[i]] += _amount;
此致,
我一直在 Ropsten 上玩这个合约: https://pastebin.com/XPVxPNFv
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
正如您在回答中所述,此处您将金额添加到调用或 "sent" 交易的地址,在这种情况下这是不正确的。
balances[msg.sender] += _amount;
您应该增加将接收令牌的地址的数量。
balances[addresses[i]] += _amount;
此致,