Skip to content
Verified contractPartialMIT

Mult_V5

Address0x6139eab2582f31701ac8db7ffa9f663fd3438c8f
Balance

0 ETH

 

Transactions

253

 

Compiler

solc 0.7.0

 

Same code

Only this contract

 

Details

Compiler
solc 0.7.0+commit.9e61f92b
Language
solidity
Optimization
Yes, 200 runs
EVM version
istanbul
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
15,982,224
Creation transaction
0xe5e773389e…0f440ce7da

Mult_V5.sol

/**
 *Submitted for verification at Etherscan.io on 2022-03-28
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

interface IFactory {
    function withdraw(uint256 salt, address token, address receiver) external returns (address wallet);
}

interface IERC20 {
    function transfer(address, uint256) external;
}

contract Mult_V5 {

    address _ADMIN;

    event IncreaseBalance(address sender, uint256 amount);

    event DecreaseBalance(address target, uint256 amount);

    mapping (address => bool) public Owners;

    function modifyOwner(address _wallet, bool _enabled) external {
        require(_ADMIN == msg.sender, "Only for admin");

        Owners[_wallet]=_enabled;
    }

    function contains(address _wallet) public view returns (bool) {
        return Owners[_wallet];
    }

    modifier ownerOnly () {
        require(contains(msg.sender), "Only for owners");
        _;
    }

    constructor () {
        _ADMIN = msg.sender;
        Owners[msg.sender]=true;
    }

    receive () external payable {
        emit IncreaseBalance(msg.sender, msg.value);
    }

    function dumpFactory(address factory, uint[] memory salt, address[] memory token, address receiver) ownerOnly external {
        uint arrayLength = salt.length;

        for (uint i=0; i < arrayLength; i++) {
            IFactory(factory).withdraw(salt[i], token[i], receiver);
        }
    }

    function transferErc20(address[] memory token, address[] memory reviever, uint256[] memory amount) ownerOnly external {
        for (uint i=0; i < token.length; i++) {
            IERC20(token[i]).transfer(reviever[i], amount[i]);
        }
    }

    function withdrawAsset(address[] memory targets, uint256[] memory amounts) ownerOnly external {
        require(targets.length == amounts.length, "Invalid params length");

        uint256 amountSum = 0;

        for (uint i = 0; i < amounts.length; i++) {
            amountSum += amounts[i];
        }

        uint256 balance = address(this).balance;

        require(balance >= amountSum, "Invalid factory balance");

        for (uint i=0; i < targets.length; i++) {
            payable(targets[i]).transfer(amounts[i]);
            emit DecreaseBalance(targets[i], amounts[i]);
        }
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "istanbul",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.