ETH Price: $1,869.04 (-0.13%)

Transaction Decoder

Block:
4802578 at Dec-26-2017 08:45:23 PM +UTC
Transaction Fee:
0.000370206 ETH $0.69
Gas Used:
185,103 Gas / 2 Gwei

Emitted Events:

66 Controller.LogNewWallet( receiver=UserWallet )

Account State Difference:

  Address   Before After State Difference Code
(Nanopool)
9,963.093165546948726777 Eth9,963.093535752948726777 Eth0.000370206
0x6CaCE052...a27c4E21f
59.703814081608639735 Eth
Nonce: 753893
59.703443875608639735 Eth
Nonce: 753894
0.000370206
0xa3C1E324...F099B5770
(Bittrex: Controller)
0xedF03636...AFd04C325
0 Eth
Nonce: 0
0 Eth
Nonce: 1
From: 0 To: 11654996272318089466213786379972832768078933683424590536342048716347678955490368702388218933214870180234958601042064036059649932665597625733327200966621747160643894242575925700309289426932056881734667842284170279564009728976648828791901890948822810498967083755444181541269248440401765956933177616047112931638668617977841794017852457396518780757012064539104277530134091112215179941844590916375356621539138457530864548451749687487028597463581301901070635732005454866652687048781586928084716111164124871919122250009920667389902727253543541892062367632031122718139237883876535147718044963927023392432085662636996083665100197491296604018334199196063748454783288137614019080784211650194591932309972012697319784353274573137654982260858686632481945038448262332693604273476967660131987104781455308378547564755313184986663823973458307705639879249355227567290267218300287649455208407114931557441837012433840615351142709670234581383227143299182840870240181482479686900905848303765345046501472778300928508237731794174320377646096827809860197235255198736590210282723426047720670272666238273985917231313016259048317608469601009514091768646141633981683745495765378697457075874951088102392438296231908640418880838325401217822052457972948380073198076928728119840314151625726380542482097293290835181266480676211262770085234658574377

Execution Trace

Controller.CALL( )
  • UserWallet.60606040( )
    File 1 of 2: Controller
    pragma solidity ^0.4.10;
    
    // Copyright 2017 Bittrex
    
    contract AbstractSweeper {
        function sweep(address token, uint amount) returns (bool);
    
        function () { throw; }
    
        Controller controller;
    
        function AbstractSweeper(address _controller) {
            controller = Controller(_controller);
        }
    
        modifier canSweep() {
            if (msg.sender != controller.authorizedCaller() && msg.sender != controller.owner()) throw;
            if (controller.halted()) throw;
            _;
        }
    }
    
    contract Token {
        function balanceOf(address a) returns (uint) {
            (a);
            return 0;
        }
    
        function transfer(address a, uint val) returns (bool) {
            (a);
            (val);
            return false;
        }
    }
    
    contract DefaultSweeper is AbstractSweeper {
        function DefaultSweeper(address controller)
                 AbstractSweeper(controller) {}
    
        function sweep(address _token, uint _amount)
        canSweep
        returns (bool) {
            bool success = false;
            address destination = controller.destination();
    
            if (_token != address(0)) {
                Token token = Token(_token);
                uint amount = _amount;
                if (amount > token.balanceOf(this)) {
                    return false;
                }
    
                success = token.transfer(destination, amount);
            }
            else {
                uint amountInWei = _amount;
                if (amountInWei > this.balance) {
                    return false;
                }
    
                success = destination.send(amountInWei);
            }
    
            if (success) {
                controller.logSweep(this, destination, _token, _amount);
            }
            return success;
        }
    }
    
    contract UserWallet {
        AbstractSweeperList sweeperList;
        function UserWallet(address _sweeperlist) {
            sweeperList = AbstractSweeperList(_sweeperlist);
        }
    
        function () public payable { }
    
        function tokenFallback(address _from, uint _value, bytes _data) {
            (_from);
            (_value);
            (_data);
         }
    
        function sweep(address _token, uint _amount)
        returns (bool) {
            (_amount);
            return sweeperList.sweeperOf(_token).delegatecall(msg.data);
        }
    }
    
    contract AbstractSweeperList {
        function sweeperOf(address _token) returns (address);
    }
    
    contract Controller is AbstractSweeperList {
        address public owner;
        address public authorizedCaller;
    
        address public destination;
    
        bool public halted;
    
        event LogNewWallet(address receiver);
        event LogSweep(address indexed from, address indexed to, address indexed token, uint amount);
        
        modifier onlyOwner() {
            if (msg.sender != owner) throw; 
            _;
        }
    
        modifier onlyAuthorizedCaller() {
            if (msg.sender != authorizedCaller) throw; 
            _;
        }
    
        modifier onlyAdmins() {
            if (msg.sender != authorizedCaller && msg.sender != owner) throw; 
            _;
        }
    
        function Controller() 
        {
            owner = msg.sender;
            destination = msg.sender;
            authorizedCaller = msg.sender;
        }
    
        function changeAuthorizedCaller(address _newCaller) onlyOwner {
            authorizedCaller = _newCaller;
        }
    
        function changeDestination(address _dest) onlyOwner {
            destination = _dest;
        }
    
        function changeOwner(address _owner) onlyOwner {
            owner = _owner;
        }
    
        function makeWallet() onlyAdmins returns (address wallet)  {
            wallet = address(new UserWallet(this));
            LogNewWallet(wallet);
        }
    
        function halt() onlyAdmins {
            halted = true;
        }
    
        function start() onlyOwner {
            halted = false;
        }
    
        address public defaultSweeper = address(new DefaultSweeper(this));
        mapping (address => address) sweepers;
    
        function addSweeper(address _token, address _sweeper) onlyOwner {
            sweepers[_token] = _sweeper;
        }
    
        function sweeperOf(address _token) returns (address) {
            address sweeper = sweepers[_token];
            if (sweeper == 0) sweeper = defaultSweeper;
            return sweeper;
        }
    
        function logSweep(address from, address to, address token, uint amount) {
            LogSweep(from, to, token, amount);
        }
    }

    File 2 of 2: UserWallet
    pragma solidity ^0.4.10;
    
    // Copyright 2017 Bittrex
    
    contract AbstractSweeper {
        function sweep(address token, uint amount) returns (bool);
    
        function () { throw; }
    
        Controller controller;
    
        function AbstractSweeper(address _controller) {
            controller = Controller(_controller);
        }
    
        modifier canSweep() {
            if (msg.sender != controller.authorizedCaller() && msg.sender != controller.owner()) throw;
            if (controller.halted()) throw;
            _;
        }
    }
    
    contract Token {
        function balanceOf(address a) returns (uint) {
            (a);
            return 0;
        }
    
        function transfer(address a, uint val) returns (bool) {
            (a);
            (val);
            return false;
        }
    }
    
    contract DefaultSweeper is AbstractSweeper {
        function DefaultSweeper(address controller)
                 AbstractSweeper(controller) {}
    
        function sweep(address _token, uint _amount)
        canSweep
        returns (bool) {
            bool success = false;
            address destination = controller.destination();
    
            if (_token != address(0)) {
                Token token = Token(_token);
                uint amount = _amount;
                if (amount > token.balanceOf(this)) {
                    return false;
                }
    
                success = token.transfer(destination, amount);
            }
            else {
                uint amountInWei = _amount;
                if (amountInWei > this.balance) {
                    return false;
                }
    
                success = destination.send(amountInWei);
            }
    
            if (success) {
                controller.logSweep(this, destination, _token, _amount);
            }
            return success;
        }
    }
    
    contract UserWallet {
        AbstractSweeperList sweeperList;
        function UserWallet(address _sweeperlist) {
            sweeperList = AbstractSweeperList(_sweeperlist);
        }
    
        function () public payable { }
    
        function tokenFallback(address _from, uint _value, bytes _data) {
            (_from);
            (_value);
            (_data);
         }
    
        function sweep(address _token, uint _amount)
        returns (bool) {
            (_amount);
            return sweeperList.sweeperOf(_token).delegatecall(msg.data);
        }
    }
    
    contract AbstractSweeperList {
        function sweeperOf(address _token) returns (address);
    }
    
    contract Controller is AbstractSweeperList {
        address public owner;
        address public authorizedCaller;
    
        address public destination;
    
        bool public halted;
    
        event LogNewWallet(address receiver);
        event LogSweep(address indexed from, address indexed to, address indexed token, uint amount);
        
        modifier onlyOwner() {
            if (msg.sender != owner) throw; 
            _;
        }
    
        modifier onlyAuthorizedCaller() {
            if (msg.sender != authorizedCaller) throw; 
            _;
        }
    
        modifier onlyAdmins() {
            if (msg.sender != authorizedCaller && msg.sender != owner) throw; 
            _;
        }
    
        function Controller() 
        {
            owner = msg.sender;
            destination = msg.sender;
            authorizedCaller = msg.sender;
        }
    
        function changeAuthorizedCaller(address _newCaller) onlyOwner {
            authorizedCaller = _newCaller;
        }
    
        function changeDestination(address _dest) onlyOwner {
            destination = _dest;
        }
    
        function changeOwner(address _owner) onlyOwner {
            owner = _owner;
        }
    
        function makeWallet() onlyAdmins returns (address wallet)  {
            wallet = address(new UserWallet(this));
            LogNewWallet(wallet);
        }
    
        function halt() onlyAdmins {
            halted = true;
        }
    
        function start() onlyOwner {
            halted = false;
        }
    
        address public defaultSweeper = address(new DefaultSweeper(this));
        mapping (address => address) sweepers;
    
        function addSweeper(address _token, address _sweeper) onlyOwner {
            sweepers[_token] = _sweeper;
        }
    
        function sweeperOf(address _token) returns (address) {
            address sweeper = sweepers[_token];
            if (sweeper == 0) sweeper = defaultSweeper;
            return sweeper;
        }
    
        function logSweep(address from, address to, address token, uint amount) {
            LogSweep(from, to, token, amount);
        }
    }