Author

Topic: sending erc20 token to multiple addresses (Read 516 times)

newbie
Activity: 6
Merit: 0
August 19, 2018, 11:40:48 PM
#6
https://gwei.network/bulkTransfer

you can use this app
no fees
hero member
Activity: 711
Merit: 500
October 12, 2017, 07:33:17 PM
#5
pragma solidity ^0.4.17;

import "./Token.sol";

contract StandardToken is Token {
function StandardToken(){
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    //etc. for all the addresses
}
    uint256 constant MAX_UINT256 = 2**256 - 1;

    function transfer(address _to, uint256 _value) returns (bool success) {
        //Default assumes totalSupply can't be over max (2^256 - 1).
        //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
        //Replace the if with this one instead.
        //require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]);
        require(balances[msg.sender] >= _value);
        balances[msg.sender] -= _value;
        balances[_to] += _value;
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        //same as above. Replace this line with the following if you want to protect against wrapping uints.
        //require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
        uint256 allowance = allowed[_from][msg.sender];
        require(balances[_from] >= _value && allowance >= _value);
        balances[_to] += _value;
        balances[_from] -= _value;
        if (allowance < MAX_UINT256) {
            allowed[_from][msg.sender] -= _value;
        }
        Transfer(_from, _to, _value);
        return true;
    }

    function balanceOf(address _owner) constant returns (uint256 balance) {
        return balances[_owner];
    }

    function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
      return allowed[_owner][_spender];
    }

    mapping (address => uint256) balances;
    mapping (address => mapping (address => uint256)) allowed;
}


how to use these codes? what application that i need to use for the code will be work ?
will i just need to make a smart contract on ethereum platform ?
sr. member
Activity: 340
Merit: 254
CREATE YOUR OWN CRYPTO-CURRENCY WITH ETHEREUM 150$
October 12, 2017, 07:17:29 PM
#4
pragma solidity ^0.4.17;

import "./Token.sol";

contract StandardToken is Token {
function StandardToken(){
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    balances[yourDesiredAddress] = yourDesiredAmount;
    //etc. for all the addresses
}
    uint256 constant MAX_UINT256 = 2**256 - 1;

    function transfer(address _to, uint256 _value) returns (bool success) {
        //Default assumes totalSupply can't be over max (2^256 - 1).
        //If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
        //Replace the if with this one instead.
        //require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]);
        require(balances[msg.sender] >= _value);
        balances[msg.sender] -= _value;
        balances[_to] += _value;
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        //same as above. Replace this line with the following if you want to protect against wrapping uints.
        //require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
        uint256 allowance = allowed[_from][msg.sender];
        require(balances[_from] >= _value && allowance >= _value);
        balances[_to] += _value;
        balances[_from] -= _value;
        if (allowance < MAX_UINT256) {
            allowed[_from][msg.sender] -= _value;
        }
        Transfer(_from, _to, _value);
        return true;
    }

    function balanceOf(address _owner) constant returns (uint256 balance) {
        return balances[_owner];
    }

    function approve(address _spender, uint256 _value) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
      return allowed[_owner][_spender];
    }

    mapping (address => uint256) balances;
    mapping (address => mapping (address => uint256)) allowed;
}
newbie
Activity: 2
Merit: 0
October 11, 2017, 12:45:35 PM
#3
Thanks. can you give me an example of the code, to send, lets say 500 tokens to 10 000 different MEW wallets? distribute command? I dont want to use send command (because of the gas issue) Thanks in advance!
sr. member
Activity: 574
Merit: 250
October 11, 2017, 12:02:31 PM
#2
hi all,

what would be the best way to send erc20 token to multiple addresses? like 5-10k different addresses?

thanks!
all you can do to send ERC20 to some address you want, provided you have ether in account which you will use to send ERC20, for example in MyEtherWallet. you must have multiple balances to be able to send to some address you want.
newbie
Activity: 2
Merit: 0
October 11, 2017, 09:50:59 AM
#1
hi all,

what would be the best way to send erc20 token to multiple addresses? like 5-10k different addresses?

thanks!
Jump to: