Contract 0xC7Aea42D91D9a59dFBdDF95a62503bDe57EdDBe7

Contract Overview

Balance:
0.00088 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x83939436d924984bc4102787fe3c525e6dc97d48bbabdc02c36a0f6850c6130a0x60806040219263242021-11-26 0:30:089 days 20 hrs ago0x79a03b4a918c2dfa0b9d8ec87be03d5cdf356af0 IN  Contract Creation0 MATIC0.0039052405
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xe84a9889c31d92cd6ae8d1b8a897a441076d799aecaa210145e2886f5d8f3af6219324232021-11-26 4:10:339 days 16 hrs ago 0xe57e97a7585ab6b96e6fb8311df3a07b5442e966 0xc7aea42d91d9a59dfbddf95a62503bde57eddbe70.00088 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Management

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : Management.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Management/AccessControl.sol";
import "./Management/IAccessControl.sol";

/**
 * @title Management contract
 */
contract Management is AccessControl {
    receive() external payable {}
    fallback() external payable {}

    event Withdrawal (address caller, address receiver, uint256 amount);

    constructor() {
        _setupRole(ADMIN_KEY, msg.sender);
        _setupRole(SYSTEM_KEY, msg.sender);
    }

    function balance() public view returns (uint256) {
        return address(this).balance;
    }

    function withdraw(address receiver) public onlyRole(SYSTEM_KEY) {
        uint256 _balance = address(this).balance;
        (bool success, ) = payable(receiver).call{value: address(this).balance}("");
        require(success, "Management: ether transfer failed");

        emit Withdrawal (msg.sender, receiver, _balance);
    }
}

File 2 of 6 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "./ERC165/ERC165.sol";
import "./utils/Strings.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 */
abstract contract AccessControl is IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant ADMIN_KEY = 0x00;
    bytes32 public constant SYSTEM_KEY = keccak256("SYSTEM_KEY");

    /**
     * @dev Modifier that checks that an account has a specific role
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, msg.sender);
        _;
    }

    /**
     * @dev Returns true if this contract implements the interface defined by `interfaceId`
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == msg.sender, "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as `role` admin role
     *
     * Emits a {RoleAdminChanged} event
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, msg.sender);
        }
    }

    /**
     * @dev Revokes `role` from `account`
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, msg.sender);
        }
    }
}

File 3 of 6 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection
 */
interface IAccessControl {
    /**
     * @dev AccessControl functions
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    function grantRole(bytes32 role, address account) external;

    function revokeRole(bytes32 role, address account) external;

    function renounceRole(bytes32 role, address account) external;

    /**
     * @dev AccessControl events
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
}

File 4 of 6 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by `interfaceId`
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 5 of 6 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    function toString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 6 of 6 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard as defined in the EIP
 */
interface IERC165 {
    /**
     * @dev ERC165 standard functions
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ADMIN_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SYSTEM_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b506100246000801b3361005960201b60201c565b6100547f1e35743f9000f88c8996ed58ed6692fcdd8108ec9608aaba54d640b7a3308bac3361005960201b60201c565b6101b6565b610069828261006d60201b60201c565b5050565b61007d828261014c60201b60201c565b61014857600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611254806101c56000396000f3fe6080604052600436106100955760003560e01c80638bde8b10116100595780638bde8b101461019357806391d14854146101be578063b69ef8a8146101fb578063d547741f14610226578063dc0b1e371461024f5761009c565b806301ffc9a71461009e578063248a9ca3146100db5780632f2ff15d1461011857806336568abe1461014157806351cff8d91461016a5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610c0e565b61027a565b6040516100d29190610f09565b60405180910390f35b3480156100e757600080fd5b5061010260048036038101906100fd9190610ba9565b6102f4565b60405161010f9190610f24565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190610bd2565b610313565b005b34801561014d57600080fd5b5061016860048036038101906101639190610bd2565b610335565b005b34801561017657600080fd5b50610191600480360381019061018c9190610b80565b6103b1565b005b34801561019f57600080fd5b506101a86104ce565b6040516101b59190610f24565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e09190610bd2565b6104d5565b6040516101f29190610f09565b60405180910390f35b34801561020757600080fd5b5061021061053f565b60405161021d9190610fc1565b60405180910390f35b34801561023257600080fd5b5061024d60048036038101906102489190610bd2565b610547565b005b34801561025b57600080fd5b50610264610569565b6040516102719190610f24565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806102ed57506102ec8261058d565b5b9050919050565b6000806000838152602001908152602001600020600101549050919050565b61031c826102f4565b61032681336105f7565b6103308383610694565b505050565b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146103a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039a90610fa1565b60405180910390fd5b6103ad828261076d565b5050565b7f1e35743f9000f88c8996ed58ed6692fcdd8108ec9608aaba54d640b7a3308bac6103dc81336105f7565b600047905060008373ffffffffffffffffffffffffffffffffffffffff164760405161040790610e83565b60006040518083038185875af1925050503d8060008114610444576040519150601f19603f3d011682016040523d82523d6000602084013e610449565b606091505b505090508061048d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048490610f81565b60405180910390fd5b7f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b63983385846040516104c093929190610ed2565b60405180910390a150505050565b6000801b81565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600047905090565b610550826102f4565b61055a81336105f7565b610564838361076d565b505050565b7f1e35743f9000f88c8996ed58ed6692fcdd8108ec9608aaba54d640b7a3308bac81565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61060182826104d5565b610690576106268173ffffffffffffffffffffffffffffffffffffffff166014610847565b6106348360001c6020610847565b604051602001610645929190610e98565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106879190610f3f565b60405180910390fd5b5050565b61069e82826104d5565b61076957600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b61077782826104d5565b1561084357600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b60606000600283600261085a9190611064565b610864919061100e565b67ffffffffffffffff8111156108a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156108d55781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610933577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106109bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026109fd9190611064565b610a07919061100e565b90505b6001811115610af3577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110610a6f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b828281518110610aac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080610aec9061116f565b9050610a0a565b5060008414610b37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2e90610f61565b60405180910390fd5b8091505092915050565b600081359050610b50816111d9565b92915050565b600081359050610b65816111f0565b92915050565b600081359050610b7a81611207565b92915050565b600060208284031215610b9257600080fd5b6000610ba084828501610b41565b91505092915050565b600060208284031215610bbb57600080fd5b6000610bc984828501610b56565b91505092915050565b60008060408385031215610be557600080fd5b6000610bf385828601610b56565b9250506020610c0485828601610b41565b9150509250929050565b600060208284031215610c2057600080fd5b6000610c2e84828501610b6b565b91505092915050565b610c40816110be565b82525050565b610c4f816110d0565b82525050565b610c5e816110dc565b82525050565b6000610c6f82610fdc565b610c798185610ff2565b9350610c8981856020860161113c565b610c92816111c8565b840191505092915050565b6000610ca882610fdc565b610cb28185611003565b9350610cc281856020860161113c565b80840191505092915050565b6000610cdb602083610ff2565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000610d1b602183610ff2565b91507f4d616e6167656d656e743a206574686572207472616e73666572206661696c6560008301527f64000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d81600083610fe7565b9150600082019050919050565b6000610d9b601783611003565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b6000610ddb601183611003565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b6000610e1b602f83610ff2565b91507f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008301527f20726f6c657320666f722073656c6600000000000000000000000000000000006020830152604082019050919050565b610e7d81611132565b82525050565b6000610e8e82610d74565b9150819050919050565b6000610ea382610d8e565b9150610eaf8285610c9d565b9150610eba82610dce565b9150610ec68284610c9d565b91508190509392505050565b6000606082019050610ee76000830186610c37565b610ef46020830185610c37565b610f016040830184610e74565b949350505050565b6000602082019050610f1e6000830184610c46565b92915050565b6000602082019050610f396000830184610c55565b92915050565b60006020820190508181036000830152610f598184610c64565b905092915050565b60006020820190508181036000830152610f7a81610cce565b9050919050565b60006020820190508181036000830152610f9a81610d0e565b9050919050565b60006020820190508181036000830152610fba81610e0e565b9050919050565b6000602082019050610fd66000830184610e74565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061101982611132565b915061102483611132565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561105957611058611199565b5b828201905092915050565b600061106f82611132565b915061107a83611132565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156110b3576110b2611199565b5b828202905092915050565b60006110c982611112565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561115a57808201518184015260208101905061113f565b83811115611169576000848401525b50505050565b600061117a82611132565b9150600082141561118e5761118d611199565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b6111e2816110be565b81146111ed57600080fd5b50565b6111f9816110dc565b811461120457600080fd5b50565b611210816110e6565b811461121b57600080fd5b5056fea26469706673582212203234c28bc4ab4766554a441326df2faa1dad7989e16e087985dfe8d51a72b62e64736f6c63430008000033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading