ETH Price: $3,948.93 (+1.34%)

Contract

0xF657BB6bc979bf34d49e38AfBA34D5FD2A45B0Ca
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
112818892020-11-18 12:17:411488 days ago1605701861
0xF657BB6b...D2A45B0Ca
0.011 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LockStorage

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 999 runs

Other Settings:
default evmVersion, GNU GPLv3 license

Contract Source Code (Solidity Multiple files format)

File 1 of 6: LockStorage.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity ^0.6.12;
import "./BaseWallet.sol";
import "./Storage.sol";
import "./ILockStorage.sol";

/**
 * @title LockStorage
 * @dev Contract storing the state of wallets related to guardians and lock.
 * The contract only defines basic setters and getters with no logic. Only modules authorised
 * for a wallet can modify its state.
 * @author Julien Niset - <[email protected]>
 * @author Olivier Van Den Biggelaar - <[email protected]>
 */
contract LockStorage is ILockStorage, Storage {

    struct LockStorageConfig {
        // the lock's release timestamp
        uint256 lock;
        // the module that set the last lock
        address locker;
    }
    
    // wallet specific storage
    mapping (address => LockStorageConfig) internal configs;

    // *************** External Functions ********************* //

    /**
     * @dev Lets an authorised module set the lock for a wallet.
     * @param _wallet The target wallet.
     * @param _locker The feature doing the lock.
     * @param _releaseAfter The epoch time at which the lock should automatically release.
     */
    function setLock(address _wallet, address _locker, uint256 _releaseAfter) external override onlyModule(_wallet) {
        configs[_wallet].lock = _releaseAfter;
        if (_releaseAfter != 0 && _locker != configs[_wallet].locker) {
            configs[_wallet].locker = _locker;
        }
    }

    /**
     * @dev Checks if the lock is set for a wallet.
     * @param _wallet The target wallet.
     * @return true if the lock is set for the wallet.
     */
    function isLocked(address _wallet) external view override returns (bool) {
        return configs[_wallet].lock > now;
    }

    /**
     * @dev Gets the time at which the lock of a wallet will release.
     * @param _wallet The target wallet.
     * @return the time at which the lock of a wallet will release, or zero if there is no lock set.
     */
    function getLock(address _wallet) external view override returns (uint256) {
        return configs[_wallet].lock;
    }

    /**
     * @dev Gets the address of the last module that modified the lock for a wallet.
     * @param _wallet The target wallet.
     * @return the address of the last module that modified the lock for a wallet.
     */
    function getLocker(address _wallet) external view override returns (address) {
        return configs[_wallet].locker;
    }
}

File 2 of 6: BaseWallet.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.6.12;

import "./IModule.sol";
import "./IWallet.sol";

/**
 * @title BaseWallet
 * @notice Simple modular wallet that authorises modules to call its invoke() method.
 * @author Julien Niset - <[email protected]>
 */
contract BaseWallet is IWallet {

    // The implementation of the proxy
    address public implementation;
    // The owner
    address public override owner;
    // The authorised modules
    mapping (address => bool) public override authorised;
    // The enabled static calls
    mapping (bytes4 => address) public override enabled;
    // The number of modules
    uint public override 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);

    /**
     * @notice Throws if the sender is not an authorised module.
     */
    modifier moduleOnly {
        require(authorised[msg.sender], "BW: msg.sender not an authorized module");
        _;
    }

    /**
     * @notice 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[] calldata _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;
            IModule(_modules[i]).init(address(this));
            emit AuthorisedModule(_modules[i], true);
        }
        if (address(this).balance > 0) {
            emit Received(address(this).balance, address(0), "");
        }
    }

    /**
     * @inheritdoc IWallet
     */
    function authoriseModule(address _module, bool _value) external override moduleOnly {
        if (authorised[_module] != _value) {
            emit AuthorisedModule(_module, _value);
            if (_value == true) {
                modules += 1;
                authorised[_module] = true;
                IModule(_module).init(address(this));
            } else {
                modules -= 1;
                require(modules > 0, "BW: wallet must have at least one module");
                delete authorised[_module];
            }
        }
    }

    /**
    * @inheritdoc IWallet
    */
    function enableStaticCall(address _module, bytes4 _method) external override moduleOnly {
        require(authorised[_module], "BW: must be an authorised module for static call");
        enabled[_method] = _module;
        emit EnabledStaticCall(_module, _method);
    }

    /**
     * @inheritdoc IWallet
     */
    function setOwner(address _newOwner) external override moduleOnly {
        require(_newOwner != address(0), "BW: address cannot be null");
        owner = _newOwner;
        emit OwnerChanged(_newOwner);
    }

    /**
     * @notice 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 calldata _data) external moduleOnly returns (bytes memory _result) {
        bool success;
        (success, _result) = _target.call{value: _value}(_data);
        if (!success) {
            // solhint-disable-next-line no-inline-assembly
            assembly {
                returndatacopy(0, 0, returndatasize())
                revert(0, returndatasize())
            }
        }
        emit Invoked(msg.sender, _target, _value, _data);
    }

    /**
     * @notice This method delegates the static call to a target contract if the data corresponds
     * to an enabled module, or logs the call otherwise.
     */
    fallback() external payable {
        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");

            // solhint-disable-next-line 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())}
            }
        }
    }

    receive() external payable {
    }
}

File 3 of 6: ILockStorage.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.4 <0.7.0;

interface ILockStorage {
    function isLocked(address _wallet) external view returns (bool);

    function getLock(address _wallet) external view returns (uint256);

    function getLocker(address _wallet) external view returns (address);

    function setLock(address _wallet, address _locker, uint256 _releaseAfter) external;
}

File 4 of 6: IModule.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.4 <0.7.0;

/**
 * @title IModule
 * @notice 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 IModule {
    /**
     * @notice Inits a module for a wallet by e.g. setting some wallet specific parameters in storage.
     * @param _wallet The wallet.
     */
    function init(address _wallet) external;

    /**	
     * @notice Adds a module to a wallet. Cannot execute when wallet is locked (or under recovery)	
     * @param _wallet The target wallet.	
     * @param _module The modules to authorise.	
     */	
    function addModule(address _wallet, address _module) external;
}

File 5 of 6: IWallet.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.4 <0.7.0;

/**
 * @title IWallet
 * @notice Interface for the BaseWallet
 */
interface IWallet {
    /**
     * @notice Returns the wallet owner.
     * @return The wallet owner address.
     */
    function owner() external view returns (address);

    /**
     * @notice Returns the number of authorised modules.
     * @return The number of authorised modules.
     */
    function modules() external view returns (uint);

    /**
     * @notice Sets a new owner for the wallet.
     * @param _newOwner The new owner.
     */
    function setOwner(address _newOwner) external;

    /**
     * @notice Checks if a module is authorised on the wallet.
     * @param _module The module address to check.
     * @return `true` if the module is authorised, otherwise `false`.
     */
    function authorised(address _module) external view returns (bool);

    /**
     * @notice Returns the module responsible for a static call redirection.
     * @param _sig The signature of the static call.
     * @return the module doing the redirection
     */
    function enabled(bytes4 _sig) external view returns (address);

    /**
     * @notice 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;

    /**
    * @notice 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;
}

File 6 of 6: Storage.sol
// Copyright (C) 2018  Argent Labs Ltd. <https://argent.xyz>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

// SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.5.4 <0.7.0;

import "./IWallet.sol";

/**
 * @title Storage
 * @notice Base contract for the storage of a wallet.
 * @author Julien Niset - <[email protected]>
 */
contract Storage {

    /**
     * @notice Throws if the caller is not an authorised module.
     */
    modifier onlyModule(address _wallet) {
        require(IWallet(_wallet).authorised(msg.sender), "TS: must be an authorized module to call this method");
        _;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"getLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"getLocker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"address","name":"_locker","type":"address"},{"internalType":"uint256","name":"_releaseAfter","type":"uint256"}],"name":"setLock","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061036e806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80634a4fbeec146100515780636b221d141461008b5780636b9db4e6146100c3578063919884bf146100fb575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b031661013d565b604080519115158252519081900360200190f35b6100c1600480360360608110156100a157600080fd5b506001600160a01b0381358116916020810135909116906040013561015a565b005b6100e9600480360360208110156100d957600080fd5b50356001600160a01b03166102c8565b60408051918252519081900360200190f35b6101216004803603602081101561011157600080fd5b50356001600160a01b03166102e3565b604080516001600160a01b039092168252519081900360200190f35b6001600160a01b0316600090815260208190526040902054421090565b82806001600160a01b031663d6eb1bbf336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156101a857600080fd5b505afa1580156101bc573d6000803e3d6000fd5b505050506040513d60208110156101d257600080fd5b5051610229576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806103056034913960400191505060405180910390fd5b6001600160a01b0384166000908152602081905260409020829055811580159061027357506001600160a01b03808516600090815260208190526040902060010154848216911614155b156102c2576001600160a01b03848116600090815260208190526040902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169185169190911790555b50505050565b6001600160a01b031660009081526020819052604090205490565b6001600160a01b03908116600090815260208190526040902060010154169056fe54533a206d75737420626520616e20617574686f72697a6564206d6f64756c6520746f2063616c6c2074686973206d6574686f64a264697066735822122098ee3789a403446af1c8bf2ca8365c780712400a1a4e50c1c393d0f14effcea564736f6c634300060c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80634a4fbeec146100515780636b221d141461008b5780636b9db4e6146100c3578063919884bf146100fb575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b031661013d565b604080519115158252519081900360200190f35b6100c1600480360360608110156100a157600080fd5b506001600160a01b0381358116916020810135909116906040013561015a565b005b6100e9600480360360208110156100d957600080fd5b50356001600160a01b03166102c8565b60408051918252519081900360200190f35b6101216004803603602081101561011157600080fd5b50356001600160a01b03166102e3565b604080516001600160a01b039092168252519081900360200190f35b6001600160a01b0316600090815260208190526040902054421090565b82806001600160a01b031663d6eb1bbf336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156101a857600080fd5b505afa1580156101bc573d6000803e3d6000fd5b505050506040513d60208110156101d257600080fd5b5051610229576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806103056034913960400191505060405180910390fd5b6001600160a01b0384166000908152602081905260409020829055811580159061027357506001600160a01b03808516600090815260208190526040902060010154848216911614155b156102c2576001600160a01b03848116600090815260208190526040902060010180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169185169190911790555b50505050565b6001600160a01b031660009081526020819052604090205490565b6001600160a01b03908116600090815260208190526040902060010154169056fe54533a206d75737420626520616e20617574686f72697a6564206d6f64756c6520746f2063616c6c2074686973206d6574686f64a264697066735822122098ee3789a403446af1c8bf2ca8365c780712400a1a4e50c1c393d0f14effcea564736f6c634300060c0033

Deployed Bytecode Sourcemap

1156:1950:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2271:124;;;;;;;;;;;;;;;;-1:-1:-1;2271:124:4;-1:-1:-1;;;;;2271:124:4;;:::i;:::-;;;;;;;;;;;;;;;;;;1806:295;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1806:295:4;;;;;;;;;;;;;;;;;:::i;:::-;;2629:120;;;;;;;;;;;;;;;;-1:-1:-1;2629:120:4;-1:-1:-1;;;;;2629:120:4;;:::i;:::-;;;;;;;;;;;;;;;;2980:124;;;;;;;;;;;;;;;;-1:-1:-1;2980:124:4;-1:-1:-1;;;;;2980:124:4;;:::i;:::-;;;;-1:-1:-1;;;;;2980:124:4;;;;;;;;;;;;;;2271;-1:-1:-1;;;;;2361:16:4;2338:4;2361:16;;;;;;;;;;:21;2385:3;-1:-1:-1;;2271:124:4:o;1806:295::-;1909:7;1098::5;-1:-1:-1;;;;;1090:27:5;;1118:10;1090:39;;;;;;;;;;;;;-1:-1:-1;;;;;1090:39:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1090:39:5;1082:104;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1928:16:4;::::1;:7;:16:::0;;;::::1;::::0;;;;;;:37;;;1979:18;;;::::1;::::0;:56:::1;;-1:-1:-1::0;;;;;;2012:16:4;;::::1;:7;:16:::0;;;::::1;::::0;;;;;;:23:::1;;::::0;2001:34;;::::1;2012:23:::0;::::1;2001:34;;1979:56;1975:120;;;-1:-1:-1::0;;;;;2051:16:4;;::::1;:7;:16:::0;;;::::1;::::0;;;;;;:23:::1;;:33:::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;1975:120:::1;1806:295:::0;;;;:::o;2629:120::-;-1:-1:-1;;;;;2721:16:4;2695:7;2721:16;;;;;;;;;;:21;;2629:120::o;2980:124::-;-1:-1:-1;;;;;3074:16:4;;;3048:7;3074:16;;;;;;;;;;:23;;;;;2980:124::o

Swarm Source

ipfs://98ee3789a403446af1c8bf2ca8365c780712400a1a4e50c1c393d0f14effcea5

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.