Skip to content
Verified contractPartial

MultiTransfer

Address0x5baaa5d1f5fd6f9136d470b6508b05bcded61589
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.5.17

 

Same code

Only this contract

 

Details

Compiler
solc 0.5.17+commit.d19bba13
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
10,202,703
Creation transaction
0x11f7a5cfa8…dc6438e725

MultiTransfer.sol

pragma solidity ^0.5.5;

interface IMakerPriceFeed {
  function read() external view returns (bytes32);
}

contract MultiTransfer {
    address owner;
    address oracle;
    
    constructor (address _oracle) public {
        owner = msg.sender;
        oracle = _oracle;
    }
    
    function changeOracleAddress(
        address _oracle
    )
    public
    {
        require(msg.sender == owner);
        oracle = _oracle;
        
    }
    
    function multiTransferETH(
        address[] memory to,
        uint256[] memory amounts
    )
    public
    payable
    {
        require(to.length == amounts.length);
        uint256 total = msg.value;
        for(uint256 i = 0; i < to.length; i++) {
            require(total >= amounts[i]);
            address(uint160(to[i])).transfer(amounts[i]);
            total -= amounts[i];
        }
        msg.sender.transfer(total);
    }
    
    function multiTransferUSD(
        address[] memory to,
        uint256[] memory amounts
    )
    public
    payable
    {
        require(to.length == amounts.length);
        uint256 total = msg.value;
        uint256 price = 10**36 / uint256(IMakerPriceFeed(oracle).read());
        uint256 toSent;
        
        for(uint256 i = 0; i < to.length; i++) {
            toSent = amounts[i] * price;
            require(total >= toSent);
            address(uint160(to[i])).transfer(toSent);
            total -= toSent;
        }
        msg.sender.transfer(total);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 0,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.