1

How to tranfer ether to 100 address easy? Im try ing wallet contract and multisend ETH with myetherwallet.com but not working.Ether tran to Wallet contract but not send to other address.

Other method tranfer ether to multi address easy to beginer?

1 Answer 1

2

This contract will do what you need.

This implies that when deploying it you should send the ether, that is why the constructor is payable. You can also just deploy it and then send the ether to the contract. See that that the address used to deploy the contract is also the owner. Only the owner will be able to execute the function to send the transactions, also the withdraw function can be executed only by the owner.

pragma solidity 0.4.24;

contract mySender{

    address public owner;

    constructor() public payable{
        owner = msg.sender;        
    }

    function multyTx(address[100] addrs, uint[100] values) public {
        require(msg.sender==owner);
        for(uint256 i=0;i<addrs.length;i++){
            addrs[i].transfer(values[i]);
        }
    }

    // In case you change your mind, this will get your ether back to your account
    function withdraw() public {
        require(msg.sender == owner);
        owner.transfer(address(this).balance);
    }

    function () public payable{}   
}

hope this helps

1
  • if this solved your problem accept the answer so that people know this has been solved.
    – Jaime
    Commented Aug 10, 2018 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.