ETH Price: $2,442.43 (-9.32%)

Contract

0x6B18C5fAA3FF2DE595E8c3d5416101517BfdA55f

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Release2621884762024-10-10 1:17:16479 days ago1728523036IN
Hamachi: Vesting
0 ETH0.000001710.01
Release2610698102024-10-06 18:58:45482 days ago1728241125IN
Hamachi: Vesting
0 ETH0.000001640.01
Release2362480852024-07-26 12:40:26554 days ago1721997626IN
Hamachi: Vesting
0 ETH0.000001270.01
Release2304050042024-07-09 13:20:04571 days ago1720531204IN
Hamachi: Vesting
0 ETH0.000001560.01
Release2201436192024-06-09 19:48:03601 days ago1717962483IN
Hamachi: Vesting
0 ETH0.000001820.01
Release2172248672024-06-01 8:27:48609 days ago1717230468IN
Hamachi: Vesting
0 ETH0.000001480.01
Release2172247762024-06-01 8:27:25609 days ago1717230445IN
Hamachi: Vesting
0 ETH0.000001530.01
Release2143010012024-05-23 19:11:03618 days ago1716491463IN
Hamachi: Vesting
0 ETH0.000001750.01
Release2091086302024-05-08 11:38:36633 days ago1715168316IN
Hamachi: Vesting
0 ETH0.000001370.010843
Release2076854022024-05-04 8:16:35637 days ago1714810595IN
Hamachi: Vesting
0 ETH0.000001340.01
Release2023069702024-04-18 13:22:56653 days ago1713446576IN
Hamachi: Vesting
0 ETH0.000001480.01
Release2000516792024-04-11 22:45:28660 days ago1712875528IN
Hamachi: Vesting
0 ETH0.000001570.01
Release1978296052024-04-05 11:41:06666 days ago1712317266IN
Hamachi: Vesting
0 ETH0.000001850.01
Release1953359822024-03-29 5:38:08673 days ago1711690688IN
Hamachi: Vesting
0 ETH0.000002670.01
Release1929734102024-03-22 9:04:05680 days ago1711098245IN
Hamachi: Vesting
0 ETH0.000001770.01
Release1929731862024-03-22 9:03:09680 days ago1711098189IN
Hamachi: Vesting
0 ETH0.000001930.01
Release1929727642024-03-22 9:01:23680 days ago1711098083IN
Hamachi: Vesting
0 ETH0.000001930.01
Release1929724372024-03-22 9:00:01680 days ago1711098001IN
Hamachi: Vesting
0 ETH0.000001760.01
Release1929720892024-03-22 8:58:35680 days ago1711097915IN
Hamachi: Vesting
0 ETH0.000001960.01
Release1929716192024-03-22 8:56:37680 days ago1711097797IN
Hamachi: Vesting
0 ETH0.000002130.01
Release1929714062024-03-22 8:55:44680 days ago1711097744IN
Hamachi: Vesting
0 ETH0.000002130.01
Release1929712572024-03-22 8:55:06680 days ago1711097706IN
Hamachi: Vesting
0 ETH0.000002130.01
Release1929710602024-03-22 8:54:17680 days ago1711097657IN
Hamachi: Vesting
0 ETH0.000001960.01
Release1929708792024-03-22 8:53:32680 days ago1711097612IN
Hamachi: Vesting
0 ETH0.000001960.01
Release1929702752024-03-22 8:51:01680 days ago1711097461IN
Hamachi: Vesting
0 ETH0.000001920.01
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
720866602023-03-21 10:18:461047 days ago1679393926
Hamachi: Vesting
0 ETH
720866602023-03-21 10:18:461047 days ago1679393926
Hamachi: Vesting
0 ETH
720864132023-03-21 10:17:501047 days ago1679393870
Hamachi: Vesting
0 ETH
720864132023-03-21 10:17:501047 days ago1679393870
Hamachi: Vesting
0 ETH
720864132023-03-21 10:17:501047 days ago1679393870
Hamachi: Vesting
0 ETH
720864132023-03-21 10:17:501047 days ago1679393870
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720860822023-03-21 10:16:241047 days ago1679393784
Hamachi: Vesting
0 ETH
720859362023-03-21 10:15:471047 days ago1679393747
Hamachi: Vesting
0 ETH
720859362023-03-21 10:15:471047 days ago1679393747
Hamachi: Vesting
0 ETH
720859142023-03-21 10:15:421047 days ago1679393742
Hamachi: Vesting
0 ETH
720859142023-03-21 10:15:421047 days ago1679393742
Hamachi: Vesting
0 ETH
720855342023-03-21 10:14:061047 days ago1679393646
Hamachi: Vesting
0 ETH
720855342023-03-21 10:14:061047 days ago1679393646
Hamachi: Vesting
0 ETH
720855342023-03-21 10:14:061047 days ago1679393646
Hamachi: Vesting
0 ETH
720855342023-03-21 10:14:061047 days ago1679393646
Hamachi: Vesting
0 ETH
720855292023-03-21 10:14:051047 days ago1679393645
Hamachi: Vesting
0 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Diamond

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 99999 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "./libraries/LibDiamond.sol";
import {DiamondCutAndLoupeFacet} from "./facets/DiamondCutAndLoupeFacet.sol";
import {IERC173} from "./interfaces/IERC173.sol";
import {IERC165} from "./interfaces/IERC165.sol";

// When no function exists for function called
error FunctionNotFound(bytes4 _functionSelector);

contract Diamond {
    constructor(
        address vestingToken,
        address diamondCutAndLoupeFacetAddress,
        address methodsExposureFacetAddress
    ) payable {
        LibDiamond.setContractOwner(msg.sender);
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        LibDiamond.VestingStorage storage vs = LibDiamond.vestingStorage();

        require(vestingToken != address(0x0));
        vs.token = vestingToken;

        ds.methodsExposureFacetAddress = methodsExposureFacetAddress;

        ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true;
        ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true;
        ds.supportedInterfaces[type(IERC173).interfaceId] = true;
        ds.supportedInterfaces[type(IERC165).interfaceId] = true;

        bytes4[] memory selectors = new bytes4[](6);
        selectors[0] = DiamondCutAndLoupeFacet.diamondCut.selector;
        selectors[1] = DiamondCutAndLoupeFacet.facets.selector;
        selectors[2] = DiamondCutAndLoupeFacet.facetFunctionSelectors.selector;
        selectors[3] = DiamondCutAndLoupeFacet.facetAddresses.selector;
        selectors[4] = DiamondCutAndLoupeFacet.facetAddress.selector;
        selectors[5] = DiamondCutAndLoupeFacet.supportsInterface.selector;

        LibDiamond.addFunctions(diamondCutAndLoupeFacetAddress, selectors);
    }

    function implementation() public view returns (address) {
        LibDiamond.DiamondStorage storage _ds = LibDiamond.diamondStorage();
        return _ds.methodsExposureFacetAddress;
    }

    // =========== Lifecycle ===========

    // Find facet for function that is called and execute the
    // function if a facet is found and return any value.
    // To learn more about this implementation read EIP 2535
    fallback() external payable {
        address facet = LibDiamond
            .diamondStorage()
            .selectorToFacetAndPosition[msg.sig]
            .facetAddress;
        require(facet != address(0), "Diamond: Function does not exist");
        assembly {
            calldatacopy(0, 0, calldatasize())
            let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch result
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    receive() external payable {}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

import "../libraries/LibDiamond.sol";
import {IERC165} from "../interfaces/IERC165.sol";

contract DiamondCutAndLoupeFacet is IDiamondCut, IDiamondLoupe, IERC165 {

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _diamondCut Contains the facet addresses and function selectors
    /// @param _init The address of the contract or facet to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function diamondCut(
        IDiamondCut.FacetCut[] calldata _diamondCut,
        address _init,
        bytes calldata _calldata
    ) external {
        LibDiamond.enforceIsContractOwner();
        LibDiamond.diamondCut(_diamondCut, _init, _calldata);
    }

    /// These functions are expected to be called frequently by tools.

    /// @notice Gets all facets and their selectors.
    /// @return facets_ Facet
    function facets() external override view returns (Facet[] memory facets_) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        uint256 numFacets = ds.facetAddresses.length;
        facets_ = new Facet[](numFacets);
        for (uint256 i; i < numFacets; i++) {
            address facetAddress_ = ds.facetAddresses[i];
            facets_[i].facetAddress = facetAddress_;
            facets_[i].functionSelectors = ds.facetFunctionSelectors[facetAddress_].functionSelectors;
        }
    }

    /// @notice Gets all the function selectors provided by a facet.
    /// @param _facet The facet address.
    /// @return facetFunctionSelectors_
    function facetFunctionSelectors(address _facet) external override view returns (bytes4[] memory facetFunctionSelectors_) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facetFunctionSelectors_ = ds.facetFunctionSelectors[_facet].functionSelectors;
    }

    /// @notice Get all the facet addresses used by a diamond.
    /// @return facetAddresses_
    function facetAddresses() external override view returns (address[] memory facetAddresses_) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facetAddresses_ = ds.facetAddresses;
    }

    /// @notice Gets the facet that supports the given selector.
    /// @dev If facet is not found return address(0).
    /// @param _functionSelector The function selector.
    /// @return facetAddress_ The facet address.
    function facetAddress(bytes4 _functionSelector) external override view returns (address facetAddress_) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        facetAddress_ = ds.selectorToFacetAndPosition[_functionSelector].facetAddress;
    }

    // This implements ERC-165.
    function supportsInterface(bytes4 _interfaceId) external override view returns (bool) {
        LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
        return ds.supportedInterfaces[_interfaceId];
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceId The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IDiamondCut {
    enum FacetCutAction {
        Add,
        Replace,
        Remove
    }
    // Add=0, Replace=1, Remove=2

    struct FacetCut {
        address facetAddress;
        FacetCutAction action;
        bytes4[] functionSelectors;
    }

    /// @notice Add/replace/remove any number of functions and optionally execute
    ///         a function with delegatecall
    /// @param _diamondCut Contains the facet addresses and function selectors
    /// @param _init The address of the contract or facet to execute _calldata
    /// @param _calldata A function call, including function selector and arguments
    ///                  _calldata is executed with delegatecall on _init
    function diamondCut(
        FacetCut[] calldata _diamondCut,
        address _init,
        bytes calldata _calldata
    ) external;

    event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);
}

/******************************************************************************\
* Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen)
* EIP-2535 Diamond Standard: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/

// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
    /// These functions are expected to be called frequently
    /// by tools.

    struct Facet {
        address facetAddress;
        bytes4[] functionSelectors;
    }

    /// @notice Gets all facet addresses and their four byte function selectors.
    /// @return facets_ Facet
    function facets() external view returns (Facet[] memory facets_);

    /// @notice Gets all the function selectors supported by a specific facet.
    /// @param _facet The facet address.
    /// @return facetFunctionSelectors_
    function facetFunctionSelectors(address _facet)
        external
        view
        returns (bytes4[] memory facetFunctionSelectors_);

    /// @notice Get all the facet addresses used by a diamond.
    /// @return facetAddresses_
    function facetAddresses()
        external
        view
        returns (address[] memory facetAddresses_);

    /// @notice Gets the facet that supports the given selector.
    /// @dev If facet is not found return address(0).
    /// @param _functionSelector The function selector.
    /// @return facetAddress_ The facet address.
    function facetAddress(bytes4 _functionSelector)
        external
        view
        returns (address facetAddress_);
}

library LibDiamond {
    bytes32 constant DIAMOND_STORAGE_POSITION =
        keccak256("diamond.standard.diamond.storage");
    bytes32 constant VESTING_STORAGE_POSITION =
        keccak256("diamond.standard.vesting.storage");

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    event DiamondCut(
        IDiamondCut.FacetCut[] _diamondCut,
        address _init,
        bytes _calldata
    );

    struct FacetAddressAndPosition {
        address facetAddress;
        uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array
    }

    struct FacetFunctionSelectors {
        bytes4[] functionSelectors;
        uint16 facetAddressPosition; // position of facetAddress in facetAddresses array
    }

    struct DiamondStorage {
        // maps function selector to the facet address and
        // the position of the selector in the facetFunctionSelectors.selectors array
        mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;
        // maps facet addresses to function selectors
        mapping(address => FacetFunctionSelectors) facetFunctionSelectors;
        // facet addresses
        address[] facetAddresses;
        // Used to query if a contract implements an interface.
        // Used to implement ERC-165.
        mapping(bytes4 => bool) supportedInterfaces;
        address contractOwner;
        address methodsExposureFacetAddress;
    }

    function diamondStorage()
        internal
        pure
        returns (DiamondStorage storage ds)
    {
        bytes32 position = DIAMOND_STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }

    // ----- VESTING ----- //

    struct VestingSchedule {
        bool initialized;
        // beneficiary of tokens after they are released
        address beneficiary;
        // cliff period in seconds
        uint256 cliff;
        // start time of the vesting period
        uint256 start;
        // duration of the vesting period in seconds
        uint256 duration;
        // duration of a slice period for the vesting in seconds
        uint256 slicePeriodSeconds;
        // total amount of tokens to be released at the end of the vesting
        uint256 amountTotal;
        // amount of tokens released
        uint256 released;
    }

    struct CreateVesting {
        address _beneficiary;
        uint256 _start;
        uint256 _cliff;
        uint256 _duration;
        uint256 _slicePeriodSeconds;
        uint256 _amount;
    }

    struct VestingStorage {
        mapping(address => LibDiamond.VestingSchedule) vestingSchedules;
        uint256 totalAmountInVesting;
        address token;
    }

    function vestingStorage()
        internal
        pure
        returns (VestingStorage storage rs)
    {
        bytes32 position = VESTING_STORAGE_POSITION;
        assembly {
            rs.slot := position
        }
    }

    function setContractOwner(address _newOwner) internal {
        DiamondStorage storage ds = diamondStorage();
        address previousOwner = ds.contractOwner;
        ds.contractOwner = _newOwner;
        emit OwnershipTransferred(previousOwner, _newOwner);
    }

    function contractOwner() internal view returns (address contractOwner_) {
        contractOwner_ = diamondStorage().contractOwner;
    }

    function enforceIsContractOwner() internal view {
        require(
            msg.sender == diamondStorage().contractOwner,
            "LibDiamond: Must be contract owner"
        );
    }

    // Internal function version of diamondCut
    function diamondCut(
        IDiamondCut.FacetCut[] memory _diamondCut,
        address _init,
        bytes memory _calldata
    ) internal {
        for (
            uint256 facetIndex;
            facetIndex < _diamondCut.length;
            facetIndex++
        ) {
            IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;
            if (action == IDiamondCut.FacetCutAction.Add) {
                addFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            } else if (action == IDiamondCut.FacetCutAction.Replace) {
                replaceFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            } else if (action == IDiamondCut.FacetCutAction.Remove) {
                removeFunctions(
                    _diamondCut[facetIndex].facetAddress,
                    _diamondCut[facetIndex].functionSelectors
                );
            } else {
                revert("LibDiamondCut: Incorrect FacetCutAction");
            }
        }
        emit DiamondCut(_diamondCut, _init, _calldata);
        initializeDiamondCut(_init, _calldata);
    }

    function addFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "LibDiamondCut: No selectors in facet to cut"
        );
        DiamondStorage storage ds = diamondStorage();
        require(
            _facetAddress != address(0),
            "LibDiamondCut: Add facet can't be address(0)"
        );
        uint16 selectorPosition = uint16(
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.length
        );
        // add new facet address if it does not exist
        if (selectorPosition == 0) {
            enforceHasContractCode(
                _facetAddress,
                "LibDiamondCut: New facet has no code"
            );
            ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition = uint16(ds.facetAddresses.length);
            ds.facetAddresses.push(_facetAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            require(
                oldFacetAddress == address(0),
                "LibDiamondCut: Can't add function that already exists"
            );
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(
                selector
            );
            ds
                .selectorToFacetAndPosition[selector]
                .facetAddress = _facetAddress;
            ds
                .selectorToFacetAndPosition[selector]
                .functionSelectorPosition = selectorPosition;
            selectorPosition++;
        }
    }

    function replaceFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "LibDiamondCut: No selectors in facet to cut"
        );
        DiamondStorage storage ds = diamondStorage();
        require(
            _facetAddress != address(0),
            "LibDiamondCut: Add facet can't be address(0)"
        );
        uint16 selectorPosition = uint16(
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.length
        );
        // add new facet address if it does not exist
        if (selectorPosition == 0) {
            enforceHasContractCode(
                _facetAddress,
                "LibDiamondCut: New facet has no code"
            );
            ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition = uint16(ds.facetAddresses.length);
            ds.facetAddresses.push(_facetAddress);
        }
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            require(
                oldFacetAddress != _facetAddress,
                "LibDiamondCut: Can't replace function with same function"
            );
            removeFunction(oldFacetAddress, selector);
            // add function
            ds
                .selectorToFacetAndPosition[selector]
                .functionSelectorPosition = selectorPosition;
            ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(
                selector
            );
            ds
                .selectorToFacetAndPosition[selector]
                .facetAddress = _facetAddress;
            selectorPosition++;
        }
    }

    function removeFunctions(
        address _facetAddress,
        bytes4[] memory _functionSelectors
    ) internal {
        require(
            _functionSelectors.length > 0,
            "LibDiamondCut: No selectors in facet to cut"
        );
        DiamondStorage storage ds = diamondStorage();
        // if function does not exist then do nothing and return
        require(
            _facetAddress == address(0),
            "LibDiamondCut: Remove facet address must be address(0)"
        );
        for (
            uint256 selectorIndex;
            selectorIndex < _functionSelectors.length;
            selectorIndex++
        ) {
            bytes4 selector = _functionSelectors[selectorIndex];
            address oldFacetAddress = ds
                .selectorToFacetAndPosition[selector]
                .facetAddress;
            removeFunction(oldFacetAddress, selector);
        }
    }

    function removeFunction(address _facetAddress, bytes4 _selector) internal {
        DiamondStorage storage ds = diamondStorage();
        require(
            _facetAddress != address(0),
            "LibDiamondCut: Can't remove function that doesn't exist"
        );
        // an immutable function is a function defined directly in a diamond
        require(
            _facetAddress != address(this),
            "LibDiamondCut: Can't remove immutable function"
        );
        // replace selector with last selector, then delete last selector
        uint256 selectorPosition = ds
            .selectorToFacetAndPosition[_selector]
            .functionSelectorPosition;
        uint256 lastSelectorPosition = ds
            .facetFunctionSelectors[_facetAddress]
            .functionSelectors
            .length - 1;
        // if not the same then replace _selector with lastSelector
        if (selectorPosition != lastSelectorPosition) {
            bytes4 lastSelector = ds
                .facetFunctionSelectors[_facetAddress]
                .functionSelectors[lastSelectorPosition];
            ds.facetFunctionSelectors[_facetAddress].functionSelectors[
                    selectorPosition
                ] = lastSelector;
            ds
                .selectorToFacetAndPosition[lastSelector]
                .functionSelectorPosition = uint16(selectorPosition);
        }
        // delete the last selector
        ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();
        delete ds.selectorToFacetAndPosition[_selector];

        // if no more selectors for facet address then delete the facet address
        if (lastSelectorPosition == 0) {
            // replace facet address with last facet address and delete last facet address
            uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;
            uint256 facetAddressPosition = ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition;
            if (facetAddressPosition != lastFacetAddressPosition) {
                address lastFacetAddress = ds.facetAddresses[
                    lastFacetAddressPosition
                ];
                ds.facetAddresses[facetAddressPosition] = lastFacetAddress;
                ds
                    .facetFunctionSelectors[lastFacetAddress]
                    .facetAddressPosition = uint16(facetAddressPosition);
            }
            ds.facetAddresses.pop();
            delete ds
                .facetFunctionSelectors[_facetAddress]
                .facetAddressPosition;
        }
    }

    function initializeDiamondCut(address _init, bytes memory _calldata)
        internal
    {
        if (_init == address(0)) {
            require(
                _calldata.length == 0,
                "LibDiamondCut: _init is address(0) but_calldata is not empty"
            );
        } else {
            require(
                _calldata.length > 0,
                "LibDiamondCut: _calldata is empty but _init is not address(0)"
            );
            if (_init != address(this)) {
                enforceHasContractCode(
                    _init,
                    "LibDiamondCut: _init address has no code"
                );
            }
            (bool success, bytes memory error) = _init.delegatecall(_calldata);
            if (!success) {
                if (error.length > 0) {
                    // bubble up the error
                    revert(string(error));
                } else {
                    revert("LibDiamondCut: _init function reverted");
                }
            }
        }
    }

    function enforceHasContractCode(
        address _contract,
        string memory _errorMessage
    ) internal view {
        uint256 contractSize;
        assembly {
            contractSize := extcodesize(_contract)
        }
        require(contractSize > 0, _errorMessage);
    }
}

contract WithStorage {
    function _ds() internal pure returns (LibDiamond.DiamondStorage storage) {
        return LibDiamond.diamondStorage();
    }

    function _vs() internal pure returns (LibDiamond.VestingStorage storage) {
        return LibDiamond.vestingStorage();
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 99999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"vestingToken","type":"address"},{"internalType":"address","name":"diamondCutAndLoupeFacetAddress","type":"address"},{"internalType":"address","name":"methodsExposureFacetAddress","type":"address"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052604051620010c3380380620010c38339810160408190526200002691620006d7565b6200003c33620002c460201b6200019c1760201c565b6000620000536200034860201b620001781760201c565b905060006200006c6200035b60201b620002561760201c565b90506001600160a01b0385166200008257600080fd5b6002810180546001600160a01b038781166001600160a01b031992831617909255600584018054928616929091169190911790556307e4c70760e21b60009081526003830160209081526040808320805460ff1990811660019081179092556348e2b09360e01b855282852080548216831790556307f5828d60e41b855282852080548216831790556301ffc9a760e01b8552828520805490911690911790558051600680825260e0820190925291820160c080368337019050509050631f931c1c60e01b816000815181106200015d576200015d62000721565b6001600160e01b0319909216602092830291909101909101528051637a0ed62760e01b908290600190811062000197576200019762000721565b6001600160e01b03199092166020928302919091019091015280516356fe50af60e11b9082906002908110620001d157620001d162000721565b6001600160e01b03199092166020928302919091019091015280516314bbdacb60e21b90829060039081106200020b576200020b62000721565b6001600160e01b03199092166020928302919091019091015280516366ffd66360e11b908290600490811062000245576200024562000721565b6001600160e01b03199092166020928302919091019091015280516301ffc9a760e01b90829060059081106200027f576200027f62000721565b60200260200101906001600160e01b03191690816001600160e01b03191681525050620002b885826200037f60201b6200027a1760201c565b505050505050620007e5565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b038481169182179093556040516000805160206200107f833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6000805160206200107f83398151915290565b7f1d13c928c6ddd083b2e900bc06bd778ad4c2a31689349d887aca9d000ea4d75590565b6000815111620003ea5760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084015b60405180910390fd5b6000805160206200107f8339815191526001600160a01b038316620004675760405162461bcd60e51b815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201526b65206164647265737328302960a01b6064820152608401620003e1565b6001600160a01b03831660009081526001820160205260408120549061ffff821690036200051057620004b4846040518060600160405280602481526020016200109f6024913962000690565b6002820180546001600160a01b038616600081815260018087016020908152604083208201805461ffff191661ffff90961695909517909455845490810185559381529190912090910180546001600160a01b03191690911790555b60005b83518110156200068957600084828151811062000534576200053462000721565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03168015620005dc5760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c72656164792065786973747300000000000000000000006064820152608401620003e1565b6001600160a01b03871660008181526001878101602090815260408084208054938401815584528184206008840401805463ffffffff60079095166004026101000a948502191660e089901c94909402939093179092556001600160e01b031986168352889052902080546001600160b01b031916909117600160a01b61ffff871602179055836200066e816200074d565b94505050508080620006809062000771565b91505062000513565b5050505050565b813b8181620006b45760405162461bcd60e51b8152600401620003e191906200078d565b50505050565b80516001600160a01b0381168114620006d257600080fd5b919050565b600080600060608486031215620006ed57600080fd5b620006f884620006ba565b92506200070860208501620006ba565b91506200071860408501620006ba565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600061ffff80831681810362000767576200076762000737565b6001019392505050565b60006001820162000786576200078662000737565b5060010190565b600060208083528351808285015260005b81811015620007bc578581018301518582016040015282016200079e565b81811115620007cf576000604083870101525b50601f01601f1916929092016040019392505050565b61088a80620007f56000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461012057610029565b3661002957005b600080357fffffffff000000000000000000000000000000000000000000000000000000001681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205473ffffffffffffffffffffffffffffffffffffffff16806100fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460448201526064015b60405180910390fd5b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b34801561012c57600080fd5b507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1321546040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811673ffffffffffffffffffffffffffffffffffffffff8481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f1d13c928c6ddd083b2e900bc06bd778ad4c2a31689349d887aca9d000ea4d75590565b600081511161030b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f2063757400000000000000000000000000000000000000000060648201526084016100f3565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff83166103cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201527f652061646472657373283029000000000000000000000000000000000000000060648201526084016100f3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001820160205260408120549061ffff821690036104c35761042584604051806060016040528060248152602001610831602491396106c5565b60028201805473ffffffffffffffffffffffffffffffffffffffff861660008181526001808701602090815260408320820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff90961695909517909455845490810185559381529190912090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b60005b83518110156106be5760008482815181106104e3576104e3610706565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff1680156105c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016100f3565b73ffffffffffffffffffffffffffffffffffffffff871660008181526001878101602090815260408084208054938401815584528184206008840401805463ffffffff60079095166004026101000a948502191660e089901c94909402939093179092557fffffffff0000000000000000000000000000000000000000000000000000000086168352889052902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169091177401000000000000000000000000000000000000000061ffff871602179055836106a681610764565b945050505080806106b690610785565b9150506104c6565b5050505050565b813b8181610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f391906107bd565b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061ffff80831681810361077b5761077b610735565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036107b6576107b6610735565b5060010190565b600060208083528351808285015260005b818110156107ea578581018301518582016040015282016107ce565b818111156107fc576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fe4c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a26469706673582212202ac91be46c5d717d3f397c6faba1aa86a65e47161a30c3c015c99cfcfeea73f564736f6c634300080d0033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f646500000000000000000000000002150e97271fdc0d6e3a16d9094a0948266f07dd000000000000000000000000bf865fe8188460fcc4f091a1676fe71a8302f220000000000000000000000000f528677bcd4394b2ef1f2567232c3a2424fff54f

Deployed Bytecode

0x6080604052600436106100225760003560e01c80635c60da1b1461012057610029565b3661002957005b600080357fffffffff000000000000000000000000000000000000000000000000000000001681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205473ffffffffffffffffffffffffffffffffffffffff16806100fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460448201526064015b60405180910390fd5b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b34801561012c57600080fd5b507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1321546040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811673ffffffffffffffffffffffffffffffffffffffff8481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b7f1d13c928c6ddd083b2e900bc06bd778ad4c2a31689349d887aca9d000ea4d75590565b600081511161030b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f2063757400000000000000000000000000000000000000000060648201526084016100f3565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff83166103cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201527f652061646472657373283029000000000000000000000000000000000000000060648201526084016100f3565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001820160205260408120549061ffff821690036104c35761042584604051806060016040528060248152602001610831602491396106c5565b60028201805473ffffffffffffffffffffffffffffffffffffffff861660008181526001808701602090815260408320820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff90961695909517909455845490810185559381529190912090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b60005b83518110156106be5760008482815181106104e3576104e3610706565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff1680156105c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016100f3565b73ffffffffffffffffffffffffffffffffffffffff871660008181526001878101602090815260408084208054938401815584528184206008840401805463ffffffff60079095166004026101000a948502191660e089901c94909402939093179092557fffffffff0000000000000000000000000000000000000000000000000000000086168352889052902080547fffffffffffffffffffff00000000000000000000000000000000000000000000169091177401000000000000000000000000000000000000000061ffff871602179055836106a681610764565b945050505080806106b690610785565b9150506104c6565b5050505050565b813b8181610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f391906107bd565b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061ffff80831681810361077b5761077b610735565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036107b6576107b6610735565b5060010190565b600060208083528351808285015260005b818110156107ea578581018301518582016040015282016107ce565b818111156107fc576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01692909201604001939250505056fe4c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a26469706673582212202ac91be46c5d717d3f397c6faba1aa86a65e47161a30c3c015c99cfcfeea73f564736f6c634300080d0033

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

00000000000000000000000002150e97271fdc0d6e3a16d9094a0948266f07dd000000000000000000000000bf865fe8188460fcc4f091a1676fe71a8302f220000000000000000000000000f528677bcd4394b2ef1f2567232c3a2424fff54f

-----Decoded View---------------
Arg [0] : vestingToken (address): 0x02150e97271fDC0D6E3A16d9094A0948266F07dD
Arg [1] : diamondCutAndLoupeFacetAddress (address): 0xbf865fe8188460FcC4F091A1676Fe71A8302f220
Arg [2] : methodsExposureFacetAddress (address): 0xf528677bCD4394B2Ef1f2567232c3a2424FFf54f

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000002150e97271fdc0d6e3a16d9094a0948266f07dd
Arg [1] : 000000000000000000000000bf865fe8188460fcc4f091a1676fe71a8302f220
Arg [2] : 000000000000000000000000f528677bcd4394b2ef1f2567232c3a2424fff54f


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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  ]
[ 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.