Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0.000547603141051617 ETH
Eth Value
$1.83 (@ $3,340.83/ETH)More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BaseWallet
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-02-04 */ pragma solidity ^0.4.24; /** * @title Module * @dev Interface for a module. * A module MUST implement the addModule() method to ensure that a wallet with at least one module * can never end up in a "frozen" state. * @author Julien Niset - <[email protected]> */ interface Module { /** * @dev Inits a module for a wallet by e.g. setting some wallet specific parameters in storage. * @param _wallet The wallet. */ function init(BaseWallet _wallet) external; /** * @dev Adds a module to a wallet. * @param _wallet The target wallet. * @param _module The modules to authorise. */ function addModule(BaseWallet _wallet, Module _module) external; /** * @dev Utility method to recover any ERC20 token that was sent to the * module by mistake. * @param _token The token to recover. */ function recoverToken(address _token) external; } /** * @title BaseWallet * @dev Simple modular wallet that authorises modules to call its invoke() method. * Based on https://gist.github.com/Arachnid/a619d31f6d32757a4328a428286da186 by * @author Julien Niset - <[email protected]> */ contract BaseWallet { // The implementation of the proxy address public implementation; // The owner address public owner; // The authorised modules mapping (address => bool) public authorised; // The enabled static calls mapping (bytes4 => address) public enabled; // The number of modules uint public modules; event AuthorisedModule(address indexed module, bool value); event EnabledStaticCall(address indexed module, bytes4 indexed method); event Invoked(address indexed module, address indexed target, uint indexed value, bytes data); event Received(uint indexed value, address indexed sender, bytes data); event OwnerChanged(address owner); /** * @dev Throws if the sender is not an authorised module. */ modifier moduleOnly { require(authorised[msg.sender], "BW: msg.sender not an authorized module"); _; } /** * @dev Inits the wallet by setting the owner and authorising a list of modules. * @param _owner The owner. * @param _modules The modules to authorise. */ function init(address _owner, address[] _modules) external { require(owner == address(0) && modules == 0, "BW: wallet already initialised"); require(_modules.length > 0, "BW: construction requires at least 1 module"); owner = _owner; modules = _modules.length; for(uint256 i = 0; i < _modules.length; i++) { require(authorised[_modules[i]] == false, "BW: module is already added"); authorised[_modules[i]] = true; Module(_modules[i]).init(this); emit AuthorisedModule(_modules[i], true); } } /** * @dev Enables/Disables a module. * @param _module The target module. * @param _value Set to true to authorise the module. */ function authoriseModule(address _module, bool _value) external moduleOnly { if (authorised[_module] != _value) { if(_value == true) { modules += 1; authorised[_module] = true; Module(_module).init(this); } else { modules -= 1; require(modules > 0, "BW: wallet must have at least one module"); delete authorised[_module]; } emit AuthorisedModule(_module, _value); } } /** * @dev Enables a static method by specifying the target module to which the call * must be delegated. * @param _module The target module. * @param _method The static method signature. */ function enableStaticCall(address _module, bytes4 _method) external moduleOnly { require(authorised[_module], "BW: must be an authorised module for static call"); enabled[_method] = _module; emit EnabledStaticCall(_module, _method); } /** * @dev Sets a new owner for the wallet. * @param _newOwner The new owner. */ function setOwner(address _newOwner) external moduleOnly { require(_newOwner != address(0), "BW: address cannot be null"); owner = _newOwner; emit OwnerChanged(_newOwner); } /** * @dev Performs a generic transaction. * @param _target The address for the transaction. * @param _value The value of the transaction. * @param _data The data of the transaction. */ function invoke(address _target, uint _value, bytes _data) external moduleOnly { // solium-disable-next-line security/no-call-value require(_target.call.value(_value)(_data), "BW: call to target failed"); emit Invoked(msg.sender, _target, _value, _data); } /** * @dev This method makes it possible for the wallet to comply to interfaces expecting the wallet to * implement specific static methods. It delegates the static call to a target contract if the data corresponds * to an enabled method, or logs the call otherwise. */ function() public payable { if(msg.data.length > 0) { address module = enabled[msg.sig]; if(module == address(0)) { emit Received(msg.value, msg.sender, msg.data); } else { require(authorised[module], "BW: must be an authorised module for static call"); // solium-disable-next-line security/no-inline-assembly assembly { calldatacopy(0, 0, calldatasize()) let result := staticcall(gas, module, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) switch result case 0 {revert(0, returndatasize())} default {return (0, returndatasize())} } } } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_module","type":"address"},{"name":"_method","type":"bytes4"}],"name":"enableStaticCall","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_module","type":"address"},{"name":"_value","type":"bool"}],"name":"authoriseModule","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"},{"name":"_modules","type":"address[]"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes4"}],"name":"enabled","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_target","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"invoke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"authorised","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"modules","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"module","type":"address"},{"indexed":false,"name":"value","type":"bool"}],"name":"AuthorisedModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"module","type":"address"},{"indexed":true,"name":"method","type":"bytes4"}],"name":"EnabledStaticCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"module","type":"address"},{"indexed":true,"name":"target","type":"address"},{"indexed":true,"name":"value","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"}],"name":"Invoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"value","type":"uint256"},{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"data","type":"bytes"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"}],"name":"OwnerChanged","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b50610e93806100206000396000f3006080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af4035811461021557806313da30b2146102385780631f17732d1461027e5780633c5a3cea146102a45780635c60da1b146102d15780635f54892b146103025780638da5cb5b1461033c5780638f6f033214610351578063d6eb1bbf14610382578063f7e80e98146103b7575b6000368110156102125750600080357fffffffff0000000000000000000000000000000000000000000000000000000016815260036020526040902054600160a060020a03168015156101515733600160a060020a0316347f606834f57405380c4fb88d1f4850326ad3885f014bab3b568dfbf7a041eef7386000366040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a3610212565b600160a060020a03811660009081526002602052604090205460ff1615156101ee5760408051600080516020610e48833981519152815260206004820152603060248201527f42573a206d75737420626520616e20617574686f7269736564206d6f64756c6560448201527f20666f72207374617469632063616c6c00000000000000000000000000000000606482015290519081900360840190fd5b3660008037600080366000845afa3d6000803e80801561020d573d6000f35b3d6000fd5b50005b34801561022157600080fd5b50610236600160a060020a03600435166103de565b005b34801561024457600080fd5b50610236600160a060020a03600435167fffffffff0000000000000000000000000000000000000000000000000000000060243516610538565b34801561028a57600080fd5b50610236600160a060020a036004351660243515156106ef565b3480156102b057600080fd5b5061023660048035600160a060020a0316906024803590810191013561094a565b3480156102dd57600080fd5b506102e6610c68565b60408051600160a060020a039092168252519081900360200190f35b34801561030e57600080fd5b506102e67fffffffff0000000000000000000000000000000000000000000000000000000060043516610c77565b34801561034857600080fd5b506102e6610c92565b34801561035d57600080fd5b5061023660048035600160a060020a0316906024803591604435918201910135610ca1565b34801561038e57600080fd5b506103a3600160a060020a0360043516610e2c565b604080519115158252519081900360200190f35b3480156103c357600080fd5b506103cc610e41565b60408051918252519081900360200190f35b3360009081526002602052604090205460ff1615156104725760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03811615156104d75760408051600080516020610e48833981519152815260206004820152601a60248201527f42573a20616464726573732063616e6e6f74206265206e756c6c000000000000604482015290519081900360640190fd5b60018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a150565b3360009081526002602052604090205460ff1615156105cc5760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821660009081526002602052604090205460ff1615156106695760408051600080516020610e48833981519152815260206004820152603060248201527f42573a206d75737420626520616e20617574686f7269736564206d6f64756c6560448201527f20666f72207374617469632063616c6c00000000000000000000000000000000606482015290519081900360840190fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716908117909155905190917fd04b9de96b5ba21173fd97c509db394c9e07a59ffb10c26da7f6ce38a8102fcb91a35050565b3360009081526002602052604090205460ff1615156107835760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821660009081526002602052604090205460ff161515811515146109465760018115151415610855576004805460019081018255600160a060020a038416600081815260026020526040808220805460ff191690941790935582517f19ab453c0000000000000000000000000000000000000000000000000000000081523094810194909452915190926319ab453c92602480830193919282900301818387803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b50505050610904565b6004805460001901908190556000106108e35760408051600080516020610e48833981519152815260206004820152602860248201527f42573a2077616c6c6574206d7573742068617665206174206c65617374206f6e60448201527f65206d6f64756c65000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600260205260409020805460ff191690555b6040805182151581529051600160a060020a038416917f8da3ff870ae294081392139550e167f1f31f277f22015ee22fbffdbd7758f4e1919081900360200190a25b5050565b600154600090600160a060020a03161580156109665750600454155b15156109c15760408051600080516020610e48833981519152815260206004820152601e60248201527f42573a2077616c6c657420616c726561647920696e697469616c697365640000604482015290519081900360640190fd5b60008211610a445760408051600080516020610e48833981519152815260206004820152602b60248201527f42573a20636f6e737472756374696f6e207265717569726573206174206c656160448201527f73742031206d6f64756c65000000000000000000000000000000000000000000606482015290519081900360840190fd5b506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038516179055600481905560005b81811015610c625760026000848484818110610a8d57fe5b60209081029290920135600160a060020a03168352508101919091526040016000205460ff1615610b0d5760408051600080516020610e48833981519152815260206004820152601b60248201527f42573a206d6f64756c6520697320616c72656164792061646465640000000000604482015290519081900360640190fd5b600160026000858585818110610b1f57fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff1916911515919091179055828282818110610b5c57fe5b90506020020135600160a060020a0316600160a060020a03166319ab453c306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b158015610bdf57600080fd5b505af1158015610bf3573d6000803e3d6000fd5b505050508282828181101515610c0557fe5b90506020020135600160a060020a0316600160a060020a03167f8da3ff870ae294081392139550e167f1f31f277f22015ee22fbffdbd7758f4e16001604051808215151515815260200191505060405180910390a2600101610a75565b50505050565b600054600160a060020a031681565b600360205260009081526040902054600160a060020a031681565b600154600160a060020a031681565b3360009081526002602052604090205460ff161515610d355760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b83600160a060020a03168383836040518083838082843782019150509250505060006040518083038185875af1925050501515610dc15760408051600080516020610e48833981519152815260206004820152601960248201527f42573a2063616c6c20746f20746172676574206661696c656400000000000000604482015290519081900360640190fd5b8284600160a060020a031633600160a060020a03167f7d2476ab50663f025cff0be85655bcf355f62768615c0c478f3cd5293f80736585856040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a450505050565b60026020526000908152604090205460ff1681565b60045481560008c379a000000000000000000000000000000000000000000000000000000000a165627a7a7230582023fd6f6498fe791685e6aeb193f0c205b223d2c60e6e392363cd75161a0c95130029
Deployed Bytecode
0x6080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af4035811461021557806313da30b2146102385780631f17732d1461027e5780633c5a3cea146102a45780635c60da1b146102d15780635f54892b146103025780638da5cb5b1461033c5780638f6f033214610351578063d6eb1bbf14610382578063f7e80e98146103b7575b6000368110156102125750600080357fffffffff0000000000000000000000000000000000000000000000000000000016815260036020526040902054600160a060020a03168015156101515733600160a060020a0316347f606834f57405380c4fb88d1f4850326ad3885f014bab3b568dfbf7a041eef7386000366040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a3610212565b600160a060020a03811660009081526002602052604090205460ff1615156101ee5760408051600080516020610e48833981519152815260206004820152603060248201527f42573a206d75737420626520616e20617574686f7269736564206d6f64756c6560448201527f20666f72207374617469632063616c6c00000000000000000000000000000000606482015290519081900360840190fd5b3660008037600080366000845afa3d6000803e80801561020d573d6000f35b3d6000fd5b50005b34801561022157600080fd5b50610236600160a060020a03600435166103de565b005b34801561024457600080fd5b50610236600160a060020a03600435167fffffffff0000000000000000000000000000000000000000000000000000000060243516610538565b34801561028a57600080fd5b50610236600160a060020a036004351660243515156106ef565b3480156102b057600080fd5b5061023660048035600160a060020a0316906024803590810191013561094a565b3480156102dd57600080fd5b506102e6610c68565b60408051600160a060020a039092168252519081900360200190f35b34801561030e57600080fd5b506102e67fffffffff0000000000000000000000000000000000000000000000000000000060043516610c77565b34801561034857600080fd5b506102e6610c92565b34801561035d57600080fd5b5061023660048035600160a060020a0316906024803591604435918201910135610ca1565b34801561038e57600080fd5b506103a3600160a060020a0360043516610e2c565b604080519115158252519081900360200190f35b3480156103c357600080fd5b506103cc610e41565b60408051918252519081900360200190f35b3360009081526002602052604090205460ff1615156104725760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03811615156104d75760408051600080516020610e48833981519152815260206004820152601a60248201527f42573a20616464726573732063616e6e6f74206265206e756c6c000000000000604482015290519081900360640190fd5b60018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a150565b3360009081526002602052604090205460ff1615156105cc5760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821660009081526002602052604090205460ff1615156106695760408051600080516020610e48833981519152815260206004820152603060248201527f42573a206d75737420626520616e20617574686f7269736564206d6f64756c6560448201527f20666f72207374617469632063616c6c00000000000000000000000000000000606482015290519081900360840190fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116600081815260036020526040808220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716908117909155905190917fd04b9de96b5ba21173fd97c509db394c9e07a59ffb10c26da7f6ce38a8102fcb91a35050565b3360009081526002602052604090205460ff1615156107835760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821660009081526002602052604090205460ff161515811515146109465760018115151415610855576004805460019081018255600160a060020a038416600081815260026020526040808220805460ff191690941790935582517f19ab453c0000000000000000000000000000000000000000000000000000000081523094810194909452915190926319ab453c92602480830193919282900301818387803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b50505050610904565b6004805460001901908190556000106108e35760408051600080516020610e48833981519152815260206004820152602860248201527f42573a2077616c6c6574206d7573742068617665206174206c65617374206f6e60448201527f65206d6f64756c65000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600260205260409020805460ff191690555b6040805182151581529051600160a060020a038416917f8da3ff870ae294081392139550e167f1f31f277f22015ee22fbffdbd7758f4e1919081900360200190a25b5050565b600154600090600160a060020a03161580156109665750600454155b15156109c15760408051600080516020610e48833981519152815260206004820152601e60248201527f42573a2077616c6c657420616c726561647920696e697469616c697365640000604482015290519081900360640190fd5b60008211610a445760408051600080516020610e48833981519152815260206004820152602b60248201527f42573a20636f6e737472756374696f6e207265717569726573206174206c656160448201527f73742031206d6f64756c65000000000000000000000000000000000000000000606482015290519081900360840190fd5b506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038516179055600481905560005b81811015610c625760026000848484818110610a8d57fe5b60209081029290920135600160a060020a03168352508101919091526040016000205460ff1615610b0d5760408051600080516020610e48833981519152815260206004820152601b60248201527f42573a206d6f64756c6520697320616c72656164792061646465640000000000604482015290519081900360640190fd5b600160026000858585818110610b1f57fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff1916911515919091179055828282818110610b5c57fe5b90506020020135600160a060020a0316600160a060020a03166319ab453c306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b158015610bdf57600080fd5b505af1158015610bf3573d6000803e3d6000fd5b505050508282828181101515610c0557fe5b90506020020135600160a060020a0316600160a060020a03167f8da3ff870ae294081392139550e167f1f31f277f22015ee22fbffdbd7758f4e16001604051808215151515815260200191505060405180910390a2600101610a75565b50505050565b600054600160a060020a031681565b600360205260009081526040902054600160a060020a031681565b600154600160a060020a031681565b3360009081526002602052604090205460ff161515610d355760408051600080516020610e48833981519152815260206004820152602760248201527f42573a206d73672e73656e646572206e6f7420616e20617574686f72697a656460448201527f206d6f64756c6500000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b83600160a060020a03168383836040518083838082843782019150509250505060006040518083038185875af1925050501515610dc15760408051600080516020610e48833981519152815260206004820152601960248201527f42573a2063616c6c20746f20746172676574206661696c656400000000000000604482015290519081900360640190fd5b8284600160a060020a031633600160a060020a03167f7d2476ab50663f025cff0be85655bcf355f62768615c0c478f3cd5293f80736585856040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a450505050565b60026020526000908152604090205460ff1681565b60045481560008c379a000000000000000000000000000000000000000000000000000000000a165627a7a7230582023fd6f6498fe791685e6aeb193f0c205b223d2c60e6e392363cd75161a0c95130029
Swarm Source
bzzr://23fd6f6498fe791685e6aeb193f0c205b223d2c60e6e392363cd75161a0c9513
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,340.83 | 0.0005476 | $1.83 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.