Verified contractPartial
Multiplexer
Address0xcc4c3ea411eee853250dbe30a3adddb5e7776484
- Balance
0 ETH
- Transactions
32
- Compiler
solc 0.4.23
- Same code
1 more contract
Details
- Compiler
- solc 0.4.23+commit.124ca40d
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 12,158,543
- Creation transaction
- 0x2a1175ef45…d6751b0237
Multiplexer.sol
/**
*Submitted for verification at Etherscan.io on 2021-03-29
*/
pragma solidity ^0.4.23;
contract ERC20 {
function transferFrom( address from, address to, uint value) returns (bool ok);
}
contract Multiplexer {
function sendEth(address[] _to, uint256[] _value) payable returns (bool _success) {
// input validation
assert(_to.length == _value.length);
assert(_to.length <= 255);
// count values for refunding sender
uint256 beforeValue = msg.value;
uint256 afterValue = 0;
// loop through to addresses and send value
for (uint8 i = 0; i < _to.length; i++) {
afterValue = afterValue + _value[i];
assert(_to[i].send(_value[i]));
}
// send back remaining value to sender
uint256 remainingValue = beforeValue - afterValue;
if (remainingValue > 0) {
assert(msg.sender.send(remainingValue));
}
return true;
}
function sendErc20(address _tokenAddress, address[] _to, uint256[] _value) returns (bool _success) {
// input validation
assert(_to.length == _value.length);
assert(_to.length <= 255);
// use the erc20 abi
ERC20 token = ERC20(_tokenAddress);
// loop through to addresses and send value
for (uint8 i = 0; i < _to.length; i++) {
assert(token.transferFrom(msg.sender, _to[i], _value[i]) == true);
}
return true;
}
}Compiler settingsShow
{
"optimizer": {
"runs": 0,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.