Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DiamondLoupeFacet
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 { LibDiamond } from "../libraries/LibDiamond.sol"; import { IDiamondLoupe } from "../interfaces/IDiamondLoupe.sol"; import { IERC165 } from "../interfaces/IERC165.sol"; // The functions in DiamondLoupeFacet MUST be added to a diamond. // The EIP-2535 Diamond standard requires these functions contract DiamondLoupeFacet is IDiamondLoupe, IERC165 { // Diamond Loupe Functions //////////////////////////////////////////////////////////////////// /// These functions are expected to be called frequently by tools. // // struct Facet { // address facetAddress; // bytes4[] functionSelectors; // } /// @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(); facets_ = new Facet[](ds.selectorCount); uint8[] memory numFacetSelectors = new uint8[](ds.selectorCount); uint256 numFacets; uint256 selectorIndex; // loop through function selectors for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) { bytes32 slot = ds.selectorSlots[slotIndex]; for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) { selectorIndex++; if (selectorIndex > ds.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); address facetAddress_ = address(bytes20(ds.facets[selector])); bool continueLoop; for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { if (facets_[facetIndex].facetAddress == facetAddress_) { facets_[facetIndex].functionSelectors[numFacetSelectors[facetIndex]] = selector; // probably will never have more than 256 functions from one facet contract require(numFacetSelectors[facetIndex] < 255); numFacetSelectors[facetIndex]++; continueLoop = true; break; } } if (continueLoop) { continue; } facets_[numFacets].facetAddress = facetAddress_; facets_[numFacets].functionSelectors = new bytes4[](ds.selectorCount); facets_[numFacets].functionSelectors[0] = selector; numFacetSelectors[numFacets] = 1; numFacets++; } } for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { uint256 numSelectors = numFacetSelectors[facetIndex]; bytes4[] memory selectors = facets_[facetIndex].functionSelectors; // setting the number of selectors assembly { mstore(selectors, numSelectors) } } // setting the number of facets assembly { mstore(facets_, numFacets) } } /// @notice Gets all the function selectors supported by a specific facet. /// @param _facet The facet address. /// @return _facetFunctionSelectors The selectors associated with a facet address. function facetFunctionSelectors(address _facet) external override view returns (bytes4[] memory _facetFunctionSelectors) { LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); uint256 numSelectors; _facetFunctionSelectors = new bytes4[](ds.selectorCount); uint256 selectorIndex; // loop through function selectors for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) { bytes32 slot = ds.selectorSlots[slotIndex]; for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) { selectorIndex++; if (selectorIndex > ds.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); address facet = address(bytes20(ds.facets[selector])); if (_facet == facet) { _facetFunctionSelectors[numSelectors] = selector; numSelectors++; } } } // Set the number of selectors in the array assembly { mstore(_facetFunctionSelectors, numSelectors) } } /// @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_ = new address[](ds.selectorCount); uint256 numFacets; uint256 selectorIndex; // loop through function selectors for (uint256 slotIndex; selectorIndex < ds.selectorCount; slotIndex++) { bytes32 slot = ds.selectorSlots[slotIndex]; for (uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++) { selectorIndex++; if (selectorIndex > ds.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); address facetAddress_ = address(bytes20(ds.facets[selector])); bool continueLoop; for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { if (facetAddress_ == facetAddresses_[facetIndex]) { continueLoop = true; break; } } if (continueLoop) { continue; } facetAddresses_[numFacets] = facetAddress_; numFacets++; } } // Set the number of facet addresses in the array assembly { mstore(facetAddresses_, numFacets) } } /// @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_ = address(bytes20(ds.facets[_functionSelector])); } // 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; /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; // Remember to add the loupe functions from DiamondLoupeFacet to the diamond. // The loupe functions are required by the EIP2535 Diamonds standard library LibDiamond { bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage"); struct DiamondStorage { // maps function selectors to the facets that execute the functions. // and maps the selectors to their position in the selectorSlots array. // func selector => address facet, selector position mapping(bytes4 => bytes32) facets; // array of slots of function selectors. // each slot holds 8 function selectors. mapping(uint256 => bytes32) selectorSlots; // The number of function selectors in selectorSlots uint16 selectorCount; // Used to query if a contract implements an interface. // Used to implement ERC-165. mapping(bytes4 => bool) supportedInterfaces; // owner of the contract address contractOwner; } function diamondStorage() internal pure returns (DiamondStorage storage ds) { bytes32 position = DIAMOND_STORAGE_POSITION; assembly { ds.slot := position } } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); 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"); } event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata); bytes32 constant CLEAR_ADDRESS_MASK = bytes32(uint256(0xffffffffffffffffffffffff)); bytes32 constant CLEAR_SELECTOR_MASK = bytes32(uint256(0xffffffff << 224)); // Internal function version of diamondCut // This code is almost the same as the external diamondCut, // except it is using 'Facet[] memory _diamondCut' instead of // 'Facet[] calldata _diamondCut'. // The code is duplicated to prevent copying calldata to memory which // causes an error for a two dimensional array. function diamondCut( IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata ) internal { DiamondStorage storage ds = diamondStorage(); uint256 originalSelectorCount = ds.selectorCount; uint256 selectorCount = originalSelectorCount; bytes32 selectorSlot; // Check if last selector slot is not full // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" if (selectorCount & 7 > 0) { // get last selectorSlot // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8" selectorSlot = ds.selectorSlots[selectorCount >> 3]; } // loop through diamond cut for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) { (selectorCount, selectorSlot) = addReplaceRemoveFacetSelectors( selectorCount, selectorSlot, _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].action, _diamondCut[facetIndex].functionSelectors ); } if (selectorCount != originalSelectorCount) { ds.selectorCount = uint16(selectorCount); } // If last selector slot is not full // "selectorCount & 7" is a gas efficient modulo by eight "selectorCount % 8" if (selectorCount & 7 > 0) { // "selectorSlot >> 3" is a gas efficient division by 8 "selectorSlot / 8" ds.selectorSlots[selectorCount >> 3] = selectorSlot; } emit DiamondCut(_diamondCut, _init, _calldata); initializeDiamondCut(_init, _calldata); } function addReplaceRemoveFacetSelectors( uint256 _selectorCount, bytes32 _selectorSlot, address _newFacetAddress, IDiamondCut.FacetCutAction _action, bytes4[] memory _selectors ) internal returns (uint256, bytes32) { DiamondStorage storage ds = diamondStorage(); require(_selectors.length > 0, "LibDiamondCut: No selectors in facet to cut"); if (_action == IDiamondCut.FacetCutAction.Add) { enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Add facet has no code"); for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { bytes4 selector = _selectors[selectorIndex]; bytes32 oldFacet = ds.facets[selector]; require(address(bytes20(oldFacet)) == address(0), "LibDiamondCut: Can't add function that already exists"); // add facet for selector ds.facets[selector] = bytes20(_newFacetAddress) | bytes32(_selectorCount); // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8" uint256 selectorInSlotPosition = (_selectorCount & 7) << 5; // clear selector position in slot and add selector _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> selectorInSlotPosition)) | (bytes32(selector) >> selectorInSlotPosition); // if slot is full then write it to storage if (selectorInSlotPosition == 224) { // "_selectorSlot >> 3" is a gas efficient division by 8 "_selectorSlot / 8" ds.selectorSlots[_selectorCount >> 3] = _selectorSlot; _selectorSlot = 0; } _selectorCount++; } } else if (_action == IDiamondCut.FacetCutAction.Replace) { enforceHasContractCode(_newFacetAddress, "LibDiamondCut: Replace facet has no code"); for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { bytes4 selector = _selectors[selectorIndex]; bytes32 oldFacet = ds.facets[selector]; address oldFacetAddress = address(bytes20(oldFacet)); // only useful if immutable functions exist require(oldFacetAddress != address(this), "LibDiamondCut: Can't replace immutable function"); require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function"); require(oldFacetAddress != address(0), "LibDiamondCut: Can't replace function that doesn't exist"); // replace old facet address ds.facets[selector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(_newFacetAddress); } } else if (_action == IDiamondCut.FacetCutAction.Remove) { require(_newFacetAddress == address(0), "LibDiamondCut: Remove facet address must be address(0)"); // "_selectorCount >> 3" is a gas efficient division by 8 "_selectorCount / 8" uint256 selectorSlotCount = _selectorCount >> 3; // "_selectorCount & 7" is a gas efficient modulo by eight "_selectorCount % 8" uint256 selectorInSlotIndex = _selectorCount & 7; for (uint256 selectorIndex; selectorIndex < _selectors.length; selectorIndex++) { if (_selectorSlot == 0) { // get last selectorSlot selectorSlotCount--; _selectorSlot = ds.selectorSlots[selectorSlotCount]; selectorInSlotIndex = 7; } else { selectorInSlotIndex--; } bytes4 lastSelector; uint256 oldSelectorsSlotCount; uint256 oldSelectorInSlotPosition; // adding a block here prevents stack too deep error { bytes4 selector = _selectors[selectorIndex]; bytes32 oldFacet = ds.facets[selector]; require(address(bytes20(oldFacet)) != address(0), "LibDiamondCut: Can't remove function that doesn't exist"); // only useful if immutable functions exist require(address(bytes20(oldFacet)) != address(this), "LibDiamondCut: Can't remove immutable function"); // replace selector with last selector in ds.facets // gets the last selector lastSelector = bytes4(_selectorSlot << (selectorInSlotIndex << 5)); if (lastSelector != selector) { // update last selector slot position info ds.facets[lastSelector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(ds.facets[lastSelector]); } delete ds.facets[selector]; uint256 oldSelectorCount = uint16(uint256(oldFacet)); // "oldSelectorCount >> 3" is a gas efficient division by 8 "oldSelectorCount / 8" oldSelectorsSlotCount = oldSelectorCount >> 3; // "oldSelectorCount & 7" is a gas efficient modulo by eight "oldSelectorCount % 8" oldSelectorInSlotPosition = (oldSelectorCount & 7) << 5; } if (oldSelectorsSlotCount != selectorSlotCount) { bytes32 oldSelectorSlot = ds.selectorSlots[oldSelectorsSlotCount]; // clears the selector we are deleting and puts the last selector in its place. oldSelectorSlot = (oldSelectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) | (bytes32(lastSelector) >> oldSelectorInSlotPosition); // update storage with the modified slot ds.selectorSlots[oldSelectorsSlotCount] = oldSelectorSlot; } else { // clears the selector we are deleting and puts the last selector in its place. _selectorSlot = (_selectorSlot & ~(CLEAR_SELECTOR_MASK >> oldSelectorInSlotPosition)) | (bytes32(lastSelector) >> oldSelectorInSlotPosition); } if (selectorInSlotIndex == 0) { delete ds.selectorSlots[selectorSlotCount]; _selectorSlot = 0; } } _selectorCount = selectorSlotCount * 8 + selectorInSlotIndex; } else { revert("LibDiamondCut: Incorrect FacetCutAction"); } return (_selectorCount, _selectorSlot); } 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); } }
// 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 /******************************************************************************/ // 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_); }
// 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; /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ 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); }
{
"optimizer": {
"enabled": true,
"runs": 10000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"bytes4","name":"_functionSelector","type":"bytes4"}],"name":"facetAddress","outputs":[{"internalType":"address","name":"facetAddress_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facetAddresses","outputs":[{"internalType":"address[]","name":"facetAddresses_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_facet","type":"address"}],"name":"facetFunctionSelectors","outputs":[{"internalType":"bytes4[]","name":"_facetFunctionSelectors","type":"bytes4[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facets","outputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondLoupe.Facet[]","name":"facets_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50610d9d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637a0ed627116100505780637a0ed627146100fa578063adfca15e1461010f578063cdffacc61461012f57600080fd5b806301ffc9a71461006c57806352ef6b2c146100e5575b600080fd5b6100d061007a366004610a90565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100ed6101b8565b6040516100dc9190610ad9565b6101026103d4565b6040516100dc9190610b90565b61012261011d366004610c38565b6108c9565b6040516100dc9190610c6e565b61019361013d366004610a90565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205460601c90565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100dc565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561021b5761021b610c81565b604051908082528060200260200182016040528015610244578160200160208202803683370190505b50915060008060005b600284015461ffff168210156103cc576000818152600185016020526040812054905b60088110156103b7578361028381610cdf565b600288015490955061ffff16851115905061029d576103b7565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020889052604081205460601c90805b8881101561034d578a81815181106102f7576102f7610d18565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561033b576001915061034d565b8061034581610cdf565b9150506102dd565b50801561035c575050506103a5565b818a898151811061036f5761036f610d18565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101528761039e81610cdf565b9850505050505b806103af81610cdf565b915050610270565b505080806103c490610cdf565b91505061024d565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561043757610437610c81565b60405190808252806020026020018201604052801561047d57816020015b6040805180820190915260008152606060208201528152602001906001900390816104555790505b50600282015490925060009061ffff1667ffffffffffffffff8111156104a5576104a5610c81565b6040519080825280602002602001820160405280156104ce578160200160208202803683370190505b50905060008060005b600285015461ffff16821015610857576000818152600186016020526040812054905b6008811015610842578361050d81610cdf565b600289015490955061ffff16851115905061052757610842565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020899052604081205460601c90805b888110156106c9578273ffffffffffffffffffffffffffffffffffffffff168c828151811061059857610598610d18565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1614156106b757838c82815181106105d3576105d3610d18565b6020026020010151602001518b83815181106105f1576105f1610d18565b602002602001015160ff168151811061060c5761060c610d18565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060ff8a828151811061066c5761066c610d18565b602002602001015160ff161061068157600080fd5b89818151811061069357610693610d18565b6020026020010180518091906106a890610d47565b60ff16905250600191506106c9565b806106c181610cdf565b915050610567565b5080156106d857505050610830565b818b89815181106106eb576106eb610d18565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260028a015461ffff1667ffffffffffffffff81111561073157610731610c81565b60405190808252806020026020018201604052801561075a578160200160208202803683370190505b508b898151811061076d5761076d610d18565b602002602001015160200181905250828b898151811061078f5761078f610d18565b6020026020010151602001516000815181106107ad576107ad610d18565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525050600189898151811061080d5761080d610d18565b60ff909216602092830291909101909101528761082981610cdf565b9850505050505b8061083a81610cdf565b9150506104fa565b5050808061084f90610cdf565b9150506104d7565b5060005b828110156108be57600084828151811061087757610877610d18565b602002602001015160ff169050600087838151811061089857610898610d18565b6020026020010151602001519050818152505080806108b690610cdf565b91505061085b565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9060009061ffff1667ffffffffffffffff81111561092f5761092f610c81565b604051908082528060200260200182016040528015610958578160200160208202803683370190505b5092506000805b600284015461ffff16821015610a86576000818152600185016020526040812054905b6008811015610a71578361099581610cdf565b600288015490955061ffff1685111590506109af57610a71565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020889052604090205460601c73ffffffffffffffffffffffffffffffffffffffff8a16811415610a5c5781898881518110610a1d57610a1d610d18565b7fffffffff000000000000000000000000000000000000000000000000000000009092166020928302919091019091015286610a5881610cdf565b9750505b50508080610a6990610cdf565b915050610982565b50508080610a7e90610cdf565b91505061095f565b5050825250919050565b600060208284031215610aa257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ad257600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015610b2757835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610af5565b50909695505050505050565b600081518084526020808501945080840160005b83811015610b855781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610b47565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610c2a578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff168452870151878401879052610c1787850182610b33565b9588019593505090860190600101610bb7565b509098975050505050505050565b600060208284031215610c4a57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610ad257600080fd5b602081526000610ad26020830184610b33565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610d1157610d11610cb0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff821660ff811415610d5e57610d5e610cb0565b6001019291505056fea2646970667358221220b6afd85f1c94d163c6e86763fefd11fb840a07be46177aaa60c2b7526dd4b3cd64736f6c634300080b0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c80637a0ed627116100505780637a0ed627146100fa578063adfca15e1461010f578063cdffacc61461012f57600080fd5b806301ffc9a71461006c57806352ef6b2c146100e5575b600080fd5b6100d061007a366004610a90565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100ed6101b8565b6040516100dc9190610ad9565b6101026103d4565b6040516100dc9190610b90565b61012261011d366004610c38565b6108c9565b6040516100dc9190610c6e565b61019361013d366004610a90565b7fffffffff000000000000000000000000000000000000000000000000000000001660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604090205460601c90565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100dc565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561021b5761021b610c81565b604051908082528060200260200182016040528015610244578160200160208202803683370190505b50915060008060005b600284015461ffff168210156103cc576000818152600185016020526040812054905b60088110156103b7578361028381610cdf565b600288015490955061ffff16851115905061029d576103b7565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020889052604081205460601c90805b8881101561034d578a81815181106102f7576102f7610d18565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561033b576001915061034d565b8061034581610cdf565b9150506102dd565b50801561035c575050506103a5565b818a898151811061036f5761036f610d18565b73ffffffffffffffffffffffffffffffffffffffff909216602092830291909101909101528761039e81610cdf565b9850505050505b806103af81610cdf565b915050610270565b505080806103c490610cdf565b91505061024d565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff1667ffffffffffffffff81111561043757610437610c81565b60405190808252806020026020018201604052801561047d57816020015b6040805180820190915260008152606060208201528152602001906001900390816104555790505b50600282015490925060009061ffff1667ffffffffffffffff8111156104a5576104a5610c81565b6040519080825280602002602001820160405280156104ce578160200160208202803683370190505b50905060008060005b600285015461ffff16821015610857576000818152600186016020526040812054905b6008811015610842578361050d81610cdf565b600289015490955061ffff16851115905061052757610842565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020899052604081205460601c90805b888110156106c9578273ffffffffffffffffffffffffffffffffffffffff168c828151811061059857610598610d18565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1614156106b757838c82815181106105d3576105d3610d18565b6020026020010151602001518b83815181106105f1576105f1610d18565b602002602001015160ff168151811061060c5761060c610d18565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505060ff8a828151811061066c5761066c610d18565b602002602001015160ff161061068157600080fd5b89818151811061069357610693610d18565b6020026020010180518091906106a890610d47565b60ff16905250600191506106c9565b806106c181610cdf565b915050610567565b5080156106d857505050610830565b818b89815181106106eb576106eb610d18565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905260028a015461ffff1667ffffffffffffffff81111561073157610731610c81565b60405190808252806020026020018201604052801561075a578160200160208202803683370190505b508b898151811061076d5761076d610d18565b602002602001015160200181905250828b898151811061078f5761078f610d18565b6020026020010151602001516000815181106107ad576107ad610d18565b60200260200101907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681525050600189898151811061080d5761080d610d18565b60ff909216602092830291909101909101528761082981610cdf565b9850505050505b8061083a81610cdf565b9150506104fa565b5050808061084f90610cdf565b9150506104d7565b5060005b828110156108be57600084828151811061087757610877610d18565b602002602001015160ff169050600087838151811061089857610898610d18565b6020026020010151602001519050818152505080806108b690610cdf565b91505061085b565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9060009061ffff1667ffffffffffffffff81111561092f5761092f610c81565b604051908082528060200260200182016040528015610958578160200160208202803683370190505b5092506000805b600284015461ffff16821015610a86576000818152600185016020526040812054905b6008811015610a71578361099581610cdf565b600288015490955061ffff1685111590506109af57610a71565b600581901b82901b7fffffffff00000000000000000000000000000000000000000000000000000000811660009081526020889052604090205460601c73ffffffffffffffffffffffffffffffffffffffff8a16811415610a5c5781898881518110610a1d57610a1d610d18565b7fffffffff000000000000000000000000000000000000000000000000000000009092166020928302919091019091015286610a5881610cdf565b9750505b50508080610a6990610cdf565b915050610982565b50508080610a7e90610cdf565b91505061095f565b5050825250919050565b600060208284031215610aa257600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ad257600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015610b2757835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101610af5565b50909695505050505050565b600081518084526020808501945080840160005b83811015610b855781517fffffffff000000000000000000000000000000000000000000000000000000001687529582019590820190600101610b47565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610c2a578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff168452870151878401879052610c1787850182610b33565b9588019593505090860190600101610bb7565b509098975050505050505050565b600060208284031215610c4a57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610ad257600080fd5b602081526000610ad26020830184610b33565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610d1157610d11610cb0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff821660ff811415610d5e57610d5e610cb0565b6001019291505056fea2646970667358221220b6afd85f1c94d163c6e86763fefd11fb840a07be46177aaa60c2b7526dd4b3cd64736f6c634300080b0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.