ETH Price: $2,511.07 (-0.10%)

Contract

0x946019166F2fD9090014ad2592971f0Ef9646dB3
 

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
163283172023-01-03 19:22:23784 days ago1672773743  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenAuth

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : TokenAuth.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {AllowList} from "./abstract/AllowList.sol";
import {ITokenAuth} from "./interfaces/ITokenAuth.sol";

/// @title TokenAuth - Token allowlist
/// @notice An allowlist of approved ERC20 tokens.
contract TokenAuth is ITokenAuth, AllowList {
    string public constant NAME = "TokenAuth";
    string public constant VERSION = "0.0.1";

    constructor(address _controller) AllowList(_controller) {}
}

File 2 of 8 : AllowList.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {Controllable} from "./Controllable.sol";
import {IAllowList} from "../interfaces/IAllowList.sol";

/// @title AllowList - Tracks approved addresses
/// @notice An abstract contract for tracking allowed and denied addresses.
abstract contract AllowList is IAllowList, Controllable {
    mapping(address => bool) public allowed;

    modifier onlyAllowed() {
        if (!allowed[msg.sender]) {
            revert Forbidden();
        }
        _;
    }

    constructor(address _controller) Controllable(_controller) {}

    /// @inheritdoc IAllowList
    function denied(address caller) external view returns (bool) {
        return !allowed[caller];
    }

    /// @inheritdoc IAllowList
    function allow(address caller) external onlyController {
        allowed[caller] = true;
        emit Allow(caller);
    }

    /// @inheritdoc IAllowList
    function deny(address caller) external onlyController {
        allowed[caller] = false;
        emit Deny(caller);
    }
}

File 3 of 8 : Controllable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IControllable} from "../interfaces/IControllable.sol";

/// @title Controllable - Controller management functions
/// @notice An abstract base contract for contracts managed by the Controller.
abstract contract Controllable is IControllable {
    address public controller;

    modifier onlyController() {
        if (msg.sender != controller) {
            revert Forbidden();
        }
        _;
    }

    constructor(address _controller) {
        if (_controller == address(0)) {
            revert ZeroAddress();
        }
        controller = _controller;
    }

    /// @inheritdoc IControllable
    function setDependency(bytes32 _name, address) external virtual onlyController {
        revert InvalidDependency(_name);
    }
}

File 4 of 8 : IAllowList.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IControllable} from "./IControllable.sol";

interface IAllowList is IControllable {
    event Allow(address caller);
    event Deny(address caller);

    /// @notice Check whether the given `caller` address is allowed.
    /// @param caller The caller address.
    /// @return True if caller is allowed, false if caller is denied.
    function allowed(address caller) external view returns (bool);

    /// @notice Check whether the given `caller` address is denied.
    /// @param caller The caller address.
    /// @return True if caller is denied, false if caller is allowed.
    function denied(address caller) external view returns (bool);

    /// @notice Add a caller address to the allowlist.
    /// @param caller The caller address.
    function allow(address caller) external;

    /// @notice Remove a caller address from the allowlist.
    /// @param caller The caller address.
    function deny(address caller) external;
}

File 5 of 8 : IAnnotated.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IAnnotated {
    /// @notice Get contract name.
    /// @return Contract name.
    function NAME() external returns (string memory);

    /// @notice Get contract version.
    /// @return Contract version.
    function VERSION() external returns (string memory);
}

File 6 of 8 : ICommonErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface ICommonErrors {
    /// @notice The provided address is the zero address.
    error ZeroAddress();
    /// @notice The attempted action is not allowed.
    error Forbidden();
    /// @notice The requested entity cannot be found.
    error NotFound();
}

File 7 of 8 : IControllable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {ICommonErrors} from "./ICommonErrors.sol";

interface IControllable is ICommonErrors {
    /// @notice The dependency with the given `name` is invalid.
    error InvalidDependency(bytes32 name);

    /// @notice Get controller address.
    /// @return Controller address.
    function controller() external returns (address);

    /// @notice Set a named dependency to the given contract address.
    /// @param _name bytes32 name of the dependency to set.
    /// @param _contract address of the dependency.
    function setDependency(bytes32 _name, address _contract) external;
}

File 8 of 8 : ITokenAuth.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import {IAllowList} from "./IAllowList.sol";
import {IAnnotated} from "./IAnnotated.sol";

interface ITokenAuth is IAllowList, IAnnotated {}

Settings
{
  "remappings": [
    "ds-test/=lib/ds-test/src/",
    "erc4626-tests/=lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "operator-filter-registry/=lib/operator-filter-registry/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Forbidden","type":"error"},{"inputs":[{"internalType":"bytes32","name":"name","type":"bytes32"}],"name":"InvalidDependency","type":"error"},{"inputs":[],"name":"NotFound","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Allow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Deny","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"allow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"denied","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"deny","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"setDependency","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516104b03803806104b083398101604081905261002f91610080565b80806001600160a01b0381166100585760405163d92e233d60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055506100b09050565b60006020828403121561009257600080fd5b81516001600160a01b03811681146100a957600080fd5b9392505050565b6103f1806100bf6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063f77c47911161005b578063f77c479114610126578063fc9d96ba14610151578063ff9913e81461017e578063ffa1ad741461019157600080fd5b80637238695e1461008d5780639c52a7f1146100a2578063a3f4df7e146100b5578063d63a8e11146100f3575b600080fd5b6100a061009b36600461031f565b6101b5565b005b6100a06100b036600461034b565b610200565b6100dd604051806040016040528060098152602001680a8ded6cadc82eae8d60bb1b81525081565b6040516100ea919061036d565b60405180910390f35b61011661010136600461034b565b60016020526000908152604090205460ff1681565b60405190151581526020016100ea565b600054610139906001600160a01b031681565b6040516001600160a01b0390911681526020016100ea565b61011661015f36600461034b565b6001600160a01b031660009081526001602052604090205460ff161590565b6100a061018c36600461034b565b610283565b6100dd60405180604001604052806005815260200164302e302e3160d81b81525081565b6000546001600160a01b031633146101e057604051631dd2188d60e31b815260040160405180910390fd5b60405163580aaaa560e11b81526004810183905260240160405180910390fd5b6000546001600160a01b0316331461022b57604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b91015b60405180910390a150565b6000546001600160a01b031633146102ae57604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527f16c61d7230298bd24fb91c350e2c76dd94d2e45ebc2c5216331577721b0193539101610278565b80356001600160a01b038116811461031a57600080fd5b919050565b6000806040838503121561033257600080fd5b8235915061034260208401610303565b90509250929050565b60006020828403121561035d57600080fd5b61036682610303565b9392505050565b600060208083528351808285015260005b8181101561039a5785810183015185820160400152820161037e565b506000604082860101526040601f19601f830116850101925050509291505056fea2646970667358221220c68b08490e363373decdf9478a295a9fa9355508e56e54ab7b917df703fb293c64736f6c6343000811003300000000000000000000000011fbbcf6e33913f22d4763731188df806e7bc8b1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063f77c47911161005b578063f77c479114610126578063fc9d96ba14610151578063ff9913e81461017e578063ffa1ad741461019157600080fd5b80637238695e1461008d5780639c52a7f1146100a2578063a3f4df7e146100b5578063d63a8e11146100f3575b600080fd5b6100a061009b36600461031f565b6101b5565b005b6100a06100b036600461034b565b610200565b6100dd604051806040016040528060098152602001680a8ded6cadc82eae8d60bb1b81525081565b6040516100ea919061036d565b60405180910390f35b61011661010136600461034b565b60016020526000908152604090205460ff1681565b60405190151581526020016100ea565b600054610139906001600160a01b031681565b6040516001600160a01b0390911681526020016100ea565b61011661015f36600461034b565b6001600160a01b031660009081526001602052604090205460ff161590565b6100a061018c36600461034b565b610283565b6100dd60405180604001604052806005815260200164302e302e3160d81b81525081565b6000546001600160a01b031633146101e057604051631dd2188d60e31b815260040160405180910390fd5b60405163580aaaa560e11b81526004810183905260240160405180910390fd5b6000546001600160a01b0316331461022b57604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b91015b60405180910390a150565b6000546001600160a01b031633146102ae57604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527f16c61d7230298bd24fb91c350e2c76dd94d2e45ebc2c5216331577721b0193539101610278565b80356001600160a01b038116811461031a57600080fd5b919050565b6000806040838503121561033257600080fd5b8235915061034260208401610303565b90509250929050565b60006020828403121561035d57600080fd5b61036682610303565b9392505050565b600060208083528351808285015260005b8181101561039a5785810183015185820160400152820161037e565b506000604082860101526040601f19601f830116850101925050509291505056fea2646970667358221220c68b08490e363373decdf9478a295a9fa9355508e56e54ab7b917df703fb293c64736f6c63430008110033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000011fbBCF6e33913F22D4763731188Df806e7Bc8B1

-----Decoded View---------------
Arg [0] : _controller (address): 0x11fbBCF6e33913F22D4763731188Df806e7Bc8B1

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000011fbBCF6e33913F22D4763731188Df806e7Bc8B1


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.