ETH Price: $3,362.53 (+0.33%)

Contract

0xb8bb9f4c8a6C899D38c6330FB2B9D10608A6ED1b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60808060212297652024-11-20 15:12:232 days ago1732115543IN
 Contract Creation
0 ETH0.0027276117.10542706

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x70Ce4De9...27865B746
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
LayerZeroViewFacet

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 5 : LayerZeroViewFacet.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**************************************

    security-contact:
    - [email protected]

    maintainers:
    - [email protected]
    - [email protected]
    - [email protected]
    - [email protected]

    contributors:
    - [email protected]

**************************************/

// Local imports - libraries
import { LibCrossChainEvmConfiguration } from "../../libraries/storage/cross-chain/LibCrossChainEvmConfiguration.sol";
import { LibLayerZeroSender } from "../../libraries/storage/cross-chain/layer-zero/LibLayerZeroSender.sol";
import { LibLayerZeroReceiver } from "../../libraries/storage/cross-chain/layer-zero/LibLayerZeroReceiver.sol";

// Local imports - interfaces
import { ILayerZeroViewFacet } from "../../interfaces/cross-chain/ILayerZeroViewFacet.sol";

contract LayerZeroViewFacet is ILayerZeroViewFacet {
    /// @dev Getter for cross-chain configured diamonds.
    /// @param _chainId ID of another chain
    /// @return Address of fundraising diamond
    function getRemoteDiamond(uint256 _chainId) external view returns (address) {
        // return
        return LibCrossChainEvmConfiguration.getFundraising(_chainId);
    }

    /// @dev Getter for cross-chain enabled functions.
    /// @param _chainId ID of another chain
    /// @param _selector Byte4 encoded function selector
    /// @return True if function is whitelisted for cross-chain calls
    function getSupportedFunction(uint256 _chainId, bytes4 _selector) external view returns (bool) {
        // return
        return LibCrossChainEvmConfiguration.getSupportedFunction(_chainId, _selector);
    }

    /// @dev Getter for network to which sender can send messages.
    /// @param _chainId ID of another chain
    /// @return LayerZero network id for correctly mapped network
    function getOutgoingNetwork(uint256 _chainId) external view returns (uint32) {
        // return
        return LibLayerZeroSender.getNetwork(_chainId);
    }

    /// @dev Getter for network from which receiver can receive messages.
    /// @param _lzChainId ID of another chain in LayerZero format
    /// @return Native network id for correctly mapped network
    function getIncomingNetwork(uint32 _lzChainId) external view returns (uint256) {
        // return
        return LibLayerZeroReceiver.getNetwork(_lzChainId);
    }
}

File 2 of 5 : LibCrossChainEvmConfiguration.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**************************************

    security-contact:
    - [email protected]

    maintainers:
    - [email protected]
    - [email protected]
    - [email protected]
    - [email protected]

    contributors:
    - [email protected]

**************************************/

/// @notice Library containing cross-chain EVM configuration
library LibCrossChainEvmConfiguration {
    // -----------------------------------------------------------------------
    //                              Constants
    // -----------------------------------------------------------------------

    /// @dev Cross-chain EVM configuration storage pointer.
    bytes32 internal constant CC_EVM_CONFIG_STORAGE_POSITION = keccak256("angelblock.cc.evm.config");

    // -----------------------------------------------------------------------
    //                              Structs
    // -----------------------------------------------------------------------

    /// @dev Cross-chain EVM configuration storage struct.
    /// @param fundraisings Mapping of native chain id to fundraising address on the given chain
    /// @param supportedFunctions Mapping of native chain id to supported 4 byte signature of function
    struct EvmConfigurationStorage {
        mapping(uint256 => address) fundraisings;
        mapping(uint256 => mapping(bytes4 => bool)) supportedFunctions;
    }

    // -----------------------------------------------------------------------
    //                              Diamond storage
    // -----------------------------------------------------------------------

    /// @dev Function returning cross-chain evm configuration storage at storage pointer slot.
    /// @return ecs EvmConfigurationStorage struct instance at storage pointer position
    function evmConfigurationStorage() internal pure returns (EvmConfigurationStorage storage ecs) {
        // declare position
        bytes32 position = CC_EVM_CONFIG_STORAGE_POSITION;

        // set slot to position
        assembly {
            ecs.slot := position
        }

        // explicit return
        return ecs;
    }

    // -----------------------------------------------------------------------
    //                              Getters
    // -----------------------------------------------------------------------

    /// @dev Diamond storage getter: Fundraising address.
    /// @param _nativeChainId ID of the chain
    /// @return Address of the fundraising
    function getFundraising(uint256 _nativeChainId) internal view returns (address) {
        // return
        return evmConfigurationStorage().fundraisings[_nativeChainId];
    }

    /// @dev Diamond storage getter: Supported function.
    /// @param _nativeChainId ID of the chain
    /// @param _supportedFunctionSelector Selector of function
    /// @return True if function is supported
    function getSupportedFunction(uint256 _nativeChainId, bytes4 _supportedFunctionSelector) internal view returns (bool) {
        // return
        return evmConfigurationStorage().supportedFunctions[_nativeChainId][_supportedFunctionSelector];
    }

    // -----------------------------------------------------------------------
    //                              Setters
    // -----------------------------------------------------------------------

    /// @dev Diamond storage setter: Fundraising address.
    /// @param _nativeChainId ID of the chain
    /// @param _fundraising Address of the fundraising
    function setFundraising(uint256 _nativeChainId, address _fundraising) internal {
        // set fundraising
        evmConfigurationStorage().fundraisings[_nativeChainId] = _fundraising;
    }

    /// @dev Diamond storage setter: Supported function.
    /// @param _nativeChainId ID of the chain
    /// @param _supportedFunctionSelector Selector of function
    /// @param _isSupported Boolean if function is supported
    function setSupportedFunction(uint256 _nativeChainId, bytes4 _supportedFunctionSelector, bool _isSupported) internal {
        // set supported function
        evmConfigurationStorage().supportedFunctions[_nativeChainId][_supportedFunctionSelector] = _isSupported;
    }
}

File 3 of 5 : LibLayerZeroSender.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**************************************

    security-contact:
    - [email protected]

    maintainers:
    - [email protected]
    - [email protected]
    - [email protected]
    - [email protected]

    contributors:
    - [email protected]

**************************************/

/// @notice Library containing necessary information for sending messages via LayerZero
library LibLayerZeroSender {
    // -----------------------------------------------------------------------
    //                              Storage pointer
    // -----------------------------------------------------------------------

    /// @dev Raise storage pointer.
    bytes32 internal constant LZ_SENDER_STORAGE_POSITION = keccak256("angelblock.cc.lz.v2.sender");

    // -----------------------------------------------------------------------
    //                              Structs
    // -----------------------------------------------------------------------

    /// @dev LayerZero sender struct.
    /// @param refundAddress Refund address
    /// @param networks Mapping of native network id to LZ network id for supported networks
    struct LayerZeroSenderStorage {
        address refundAddress;
        mapping(uint256 => uint32) networks;
    }

    // -----------------------------------------------------------------------
    //                              Storage
    // -----------------------------------------------------------------------

    // diamond storage getter
    function lzSenderStorage() internal pure returns (LayerZeroSenderStorage storage lzs) {
        // declare position
        bytes32 position = LZ_SENDER_STORAGE_POSITION;

        // set slot to position
        assembly {
            lzs.slot := position
        }

        // explicit return
        return lzs;
    }

    // -----------------------------------------------------------------------
    //                              Getters / setters
    // -----------------------------------------------------------------------

    /// @dev Diamond storage getter: refund address.
    /// @return Refund address
    function getRefundAddress() internal view returns (address) {
        // return
        return lzSenderStorage().refundAddress;
    }

    /// @dev Diamond storage getter: network.
    /// @param _nativeChainId Native chain id for given network
    /// @return LayerZero network id
    function getNetwork(uint256 _nativeChainId) internal view returns (uint32) {
        // return
        return lzSenderStorage().networks[_nativeChainId];
    }

    /// @dev Diamond storage setter: refund address.
    /// @param _refundAddress New refund address for LayerZero calls
    function setRefundAddress(address _refundAddress) internal {
        lzSenderStorage().refundAddress = _refundAddress;
    }

    /// @dev Diamond storage setter: network.
    /// @param _nativeChainId Native chain id
    /// @param _layerZeroChainId Network chain id in LayerZero format
    function setNetwork(uint256 _nativeChainId, uint32 _layerZeroChainId) internal {
        lzSenderStorage().networks[_nativeChainId] = _layerZeroChainId;
    }
}

File 4 of 5 : LibLayerZeroReceiver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**************************************

    security-contact:
    - [email protected]

    maintainers:
    - [email protected]
    - [email protected]
    - [email protected]
    - [email protected]

    contributors:
    - [email protected]

**************************************/

// ToDo : Migration with clearing data from V1 storage version
library LibLayerZeroReceiver {
    bytes32 internal constant LZ_RECEIVER_STORAGE_POSITION = keccak256("angelblock.cc.lz.v2.receiver");

    struct LayerZeroReceiverStorage {
        mapping(uint32 => uint256) networks;
        mapping(uint32 => mapping(bytes32 => uint64)) lastNonce;
    }

    // diamond storage getter
    function lzReceiverStorage() internal pure returns (LayerZeroReceiverStorage storage lzrs) {
        // declare position
        bytes32 position = LZ_RECEIVER_STORAGE_POSITION;

        // set slot to position
        assembly {
            lzrs.slot := position
        }

        // explicit return
        return lzrs;
    }

    // -----------------------------------------------------------------------
    //                              Getters / setters
    // -----------------------------------------------------------------------

    /// @dev Diamond storage getter: native network id.
    /// @param _layerZeroChainId LayerZeroV2 chain id for given native network
    /// @return Native network id
    function getNetwork(uint32 _layerZeroChainId) internal view returns (uint256) {
        return lzReceiverStorage().networks[_layerZeroChainId];
    }

    /// @dev Diamond storage setter: native network for LayerZeroV2 network id.
    /// @param _layerZeroChainId LayerZeroV2 chain id
    /// @param _nativeChainId Native chain id
    function setNetwork(uint32 _layerZeroChainId, uint256 _nativeChainId) internal {
        lzReceiverStorage().networks[_layerZeroChainId] = _nativeChainId;
    }

    /// @dev Diamond storage getter: get last nonce.
    /// @param _layerZeroChainId LayerZeroV2 chain id
    /// @param _srcAddress Address in bytes32 (LayerZeroV2 format)
    /// @return Last used nonce
    function getLastNonce(uint32 _layerZeroChainId, bytes32 _srcAddress) internal view returns (uint64) {
        return lzReceiverStorage().lastNonce[_layerZeroChainId][_srcAddress];
    }

    /// @dev Diamond storage setter: last used nonce.
    /// @param _layerZeroChainId LayerZeroV2 chain id
    /// @param _srcAddress Address in bytes32 (LayerZeroV2 format)
    /// @param _nonce Nonce
    function setNonceUsed(uint32 _layerZeroChainId, bytes32 _srcAddress, uint64 _nonce) internal {
        lzReceiverStorage().lastNonce[_layerZeroChainId][_srcAddress] = _nonce;
    }
}

File 5 of 5 : ILayerZeroViewFacet.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**************************************

    security-contact:
    - [email protected]

    maintainers:
    - [email protected]
    - [email protected]
    - [email protected]
    - [email protected]

    contributors:
    - [email protected]

**************************************/

interface ILayerZeroViewFacet {
    /// @dev Getter for cross-chain configured diamonds.
    /// @param _chainId ID of another chain
    /// @return Address of fundraising diamond
    function getRemoteDiamond(uint256 _chainId) external view returns (address);

    /// @dev Getter for cross-chain enabled functions.
    /// @param _chainId ID of another chain
    /// @param _selector Byte4 encoded function selector
    /// @return True if function is whitelisted for cross-chain calls
    function getSupportedFunction(uint256 _chainId, bytes4 _selector) external view returns (bool);

    /// @dev Getter for network to which sender can send messages.
    /// @param _chainId ID of another chain
    /// @return LayerZero network id for correctly mapped network
    function getOutgoingNetwork(uint256 _chainId) external view returns (uint32);

    /// @dev Getter for network from which receiver can receive messages.
    /// @param _lzChainId ID of another chain in LayerZero format
    /// @return Native network id for correctly mapped network
    function getIncomingNetwork(uint32 _lzChainId) external view returns (uint256);
}

Settings
{
  "remappings": [
    "@openzeppelin/=src/fundraising/node_modules/@openzeppelin/",
    "ds-test/=src/fundraising/node_modules/ds-test/src/",
    "forge-std/=src/fundraising/node_modules/forge-std/src/",
    "@layerzerolabs/lz-evm-oapp-v2/=src/fundraising/node_modules/@layerzerolabs/lz-evm-oapp-v2/",
    "@layerzerolabs/lz-evm-messagelib-v2/=src/fundraising/node_modules/@layerzerolabs/lz-evm-messagelib-v2/",
    "@layerzerolabs/lz-evm-protocol-v2/=src/fundraising/node_modules/@layerzerolabs/lz-evm-protocol-v2/",
    "solidity-bytes-utils/=src/fundraising/node_modules/solidity-bytes-utils/",
    "ethereum-xcm-v3/=src/fundraising/node_modules/ethereum-xcm-v3/",
    "base58-solidity/=src/fundraising/node_modules/base58-solidity/",
    "safe/=src/fundraising/node_modules/safe/",
    "surl/=src/fundraising/node_modules/surl/src/",
    "murky/=src/fundraising/node_modules/murky/",
    "stringutils/=node_modules/stringutils/src/",
    "permit2/=node_modules/permit2/src/",
    "hardhat/=src/fundraising/node_modules/hardhat/",
    "openzeppelin-contracts/=src/fundraising/node_modules/murky/lib/openzeppelin-contracts/",
    "solidity-stringutils/=src/fundraising/node_modules/surl/lib/solidity-stringutils/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yul": true
    }
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint32","name":"_lzChainId","type":"uint32"}],"name":"getIncomingNetwork","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"getOutgoingNetwork","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"getRemoteDiamond","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"bytes4","name":"_selector","type":"bytes4"}],"name":"getSupportedFunction","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x60806040818152600436101561001457600080fd5b600091823560e01c90816373ac71ba1461015d575080638566d5a6146100f157806395ecb474146100a45763da2990001461004e57600080fd5b346100a05760203660031901126100a05760043582527ff6d13f7412e547870332b41e12245afcb7d558e215b48ce696ab1c680af6a7736020908152918190205490516001600160a01b039091168152f35b5080fd5b50346100a05760203660031901126100a05763ffffffff8160209360043581527ff0eb99ac3554f9674e53e01a2c3f3f46c41664575cc6216a02c3bba3b58e2a9e85522054169051908152f35b50346100a057806003193601126100a05760243563ffffffff60e01b8116809103610159578160209360ff9260043582527ff6d13f7412e547870332b41e12245afcb7d558e215b48ce696ab1c680af6a7748652828220908252855220541690519015158152f35b8280fd5b919050346101595760203660031901126101595760043563ffffffff81168091036101b1579260209381527f68ecbd8660bd18de933bd1897c878df8ab72af4dc9937788eaf9ac2bbb852aea845220548152f35b8380fdfea2646970667358221220386699a9a91bc683f57d66bbeb5956d734aebc1264a80f8977d9ff0e7aad64b464736f6c63430008190033

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.