Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
DiamondCutFacet
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 20000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GNU GPLv3 pragma solidity 0.8.20; /******************************************************************************\ * 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"; import {LibDiamond} from "../../libraries/LibDiamond.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; // Remember to add the loupe functions from DiamondLoupeFacet to the diamond. // The loupe functions are required by the EIP2535 Diamonds standard contract DiamondCutFacet is IDiamondCut, ReentrancyGuard { /// @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 override nonReentrant { LibDiamond.enforceIsDiamondOwner(); LibDiamond.DiamondStorage storage ds = LibDiamond.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 // "selectorCount >> 3" is a gas efficient division by 8 "selectorCount / 8" selectorSlot = ds.selectorSlots[selectorCount >> 3]; } // loop through diamond cut for (uint256 facetIndex; facetIndex < _diamondCut.length; ) { (selectorCount, selectorSlot) = LibDiamond .addReplaceRemoveFacetSelectors( selectorCount, selectorSlot, _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].action, _diamondCut[facetIndex].functionSelectors ); unchecked { facetIndex++; } } 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) { // "selectorCount >> 3" is a gas efficient division by 8 "selectorCount / 8" ds.selectorSlots[selectorCount >> 3] = selectorSlot; } emit DiamondCut(_diamondCut, _init, _calldata); LibDiamond.initializeDiamondCut(_init, _calldata); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: GNU GPLv3 pragma solidity 0.8.20; /******************************************************************************\ * https://github.com/mudgen/diamond-2-hardhat/blob/main/contracts/interfaces/IDiamondCut.sol * 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); }
// SPDX-License-Identifier: GNU GPLv3 pragma solidity 0.8.20; /******************************************************************************\ * 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 error InitializationFunctionReverted( address _initializationContractAddress, bytes _calldata ); 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 diamondOwner; } 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 setDiamondOwner(address _newOwner) internal { DiamondStorage storage ds = diamondStorage(); address previousOwner = ds.diamondOwner; ds.diamondOwner = _newOwner; emit OwnershipTransferred(previousOwner, _newOwner); } function getDiamondOwner() internal view returns (address contractOwner_) { contractOwner_ = diamondStorage().diamondOwner; } function enforceIsDiamondOwner() internal view { require( msg.sender == diamondStorage().diamondOwner, "LibDiamond: Must be diamond 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; ) { (selectorCount, selectorSlot) = addReplaceRemoveFacetSelectors( selectorCount, selectorSlot, _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].action, _diamondCut[facetIndex].functionSelectors ); unchecked { facetIndex++; } } 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; ) { 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" // " << 5 is the same as multiplying by 32 ( * 32) 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++; unchecked { selectorIndex++; } } } else if (_action == IDiamondCut.FacetCutAction.Replace) { enforceHasContractCode( _newFacetAddress, "LibDiamondCut: Replace facet has no code" ); for (uint256 selectorIndex; selectorIndex < _selectors.length; ) { 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); unchecked { selectorIndex++; } } } 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; ) { 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 // " << 5 is the same as multiplying by 32 ( * 32) 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" // " << 5 is the same as multiplying by 32 ( * 32) 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; } unchecked { selectorIndex++; } } _selectorCount = selectorSlotCount * 8 + selectorInSlotIndex; } else { revert("LibDiamondCut: Incorrect FacetCutAction"); } return (_selectorCount, _selectorSlot); } function initializeDiamondCut( address _init, bytes memory _calldata ) internal { if (_init == address(0)) { return; } enforceHasContractCode( _init, "LibDiamondCut: _init address has no code" ); (bool success, bytes memory error) = _init.delegatecall(_calldata); if (!success) { if (error.length > 0) { // bubble up error /// @solidity memory-safe-assembly assembly { let returndata_size := mload(error) revert(add(32, error), returndata_size) } } else { revert InitializationFunctionReverted(_init, _calldata); } } } function enforceHasContractCode( address _contract, string memory _errorMessage ) internal view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } require(contractSize > 0, _errorMessage); } }
{ "evmVersion": "paris", "viaIR": true, "optimizer": { "enabled": true, "runs": 20000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_initializationContractAddress","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"InitializationFunctionReverted","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"indexed":false,"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"indexed":false,"internalType":"address","name":"_init","type":"address"},{"indexed":false,"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"DiamondCut","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"internalType":"address","name":"_init","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"diamondCut","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080806040523461001b57600160005561160090816100218239f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c631f931c1c1461002857600080fd5b346104455760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104455767ffffffffffffffff60043511610445573660236004350112156104455767ffffffffffffffff6004356004013511610445573660246004356004013560051b6004350101116104455773ffffffffffffffffffffffffffffffffffffffff60243516602435036104455767ffffffffffffffff60443511610445573660236044350112156104455767ffffffffffffffff604435600401351161044557366024604435600401356044350101116104455760026000541461123a57600260005573ffffffffffffffffffffffffffffffffffffffff7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1320541633036111b6577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5461ffff81168060009260078116611178575b5060005b6004356004013581106104f257508103610481575b6007811661044a575b50506040516060810160608252600435600401359052608081019060806004356004013560051b820101916024600435019060005b6004356004013581106102d6576102cf856000867f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67360209173ffffffffffffffffffffffffffffffffffffffff60243516838201528085036040820152604435600401358552828160246044350196604435600401358884830137600460443501358181018401889052601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01601030190a16102ac6102a760443560040135611391565b611320565b600460443501358082529093828501376044356004013583010152602435611468565b6001600055005b9091937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084820301835284357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7d6004353603018112156104455760043501602481013573ffffffffffffffffffffffffffffffffffffffff81168091036104455782526044810135600381101561044557602083015260648101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbd8236030181121561044557019067ffffffffffffffff60248301351161044557602482013560051b3603604483011361044557806060604060809301526060810160248401359052019060448101906000905b60248101358210610404575050506020806001929601930191016101e1565b9091926020806001927fffffffff0000000000000000000000000000000000000000000000000000000061043788611364565b1681520194019201906103e5565b600080fd5b60031c6000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260406000205580806101ac565b61ffff81167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00007fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5416177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e556101a3565b9161050c8360049593953560040135602460043501611262565b359073ffffffffffffffffffffffffffffffffffffffff821682036104455760206105438560043560040135602460043501611262565b01356003811015610445576105648560043560040135602460043501611262565b917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe183360301604084013512156104455767ffffffffffffffff6040840135840135116104455760408301358301803560051b3603602090910113610445576105d96020604085013585013560051b01611320565b6040840135840180358083529194916020808701923660059390931b0101116104455760206040830135830101905b60408301358301803560051b016020018210611160575050508094918351156110dc57806108d05750509261069461063e6112d1565b602481527f4c69624469616d6f6e644375743a2041646420666163657420686173206e6f2060208201527f636f646500000000000000000000000000000000000000000000000000000000604082015284611583565b6000935b82518510156108be577fffffffff000000000000000000000000000000000000000000000000000000006106cc86856113f6565b5116806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260406000205460601c61083a57806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052827fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008660601b161760406000205560e08360051b161c907fffffffff0000000000000000000000000000000000000000000000000000000060e08460051b161c1916179060e0808260051b1614610800575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107d1576001948501940190610698565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b908160031c6000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260406000205560009061079d565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c72656164792065786973747300000000000000000000006064820152fd5b9150949250600191505b93920161018e565b939691959294929360018103610bde5750506109436108ed6112d1565b602881527f4c69624469616d6f6e644375743a205265706c6163652066616365742068617360208201527f206e6f20636f6465000000000000000000000000000000000000000000000000604082015287611583565b60005b8451811015610bd0577fffffffff0000000000000000000000000000000000000000000000000000000061097a82876113f6565b511690816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040600020548060601c308114610b4c5773ffffffffffffffffffffffffffffffffffffffff8a168114610ac85715610a44576001926000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526bffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008a60601b1691161760406000205501610946565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e277420657869737400000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e00000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e00000000000000000000000000000000006064820152fd5b5092509350916001906108c8565b6002919496935096919496146000146110585773ffffffffffffffffffffffffffffffffffffffff16610fd4579060078160031c9116916000925b8651841015610fa95781610f96575050610c32906113cb565b90816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604060002054906007905b7fffffffff00000000000000000000000000000000000000000000000000000000610c9182896113f6565b5116806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604060002054908160601c8015610f12573014610e8e577fffffffff00000000000000000000000000000000000000000000000000000000858560051b1b1690808203610e26575b60009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040812055600382901c611fff16868114610dec576000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020526040600020917fffffffff0000000000000000000000000000000000000000000000000000000060e084549260051b1692831c921c19161790555b8115610db5575b600101929190610c19565b60008481527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604081208190559250610daa565b5091939060e07fffffffff000000000000000000000000000000000000000000000000000000009160051b1692831c921c19161791610da3565b816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260406000207fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008154166bffffffffffffffffffffffff8516179055610d03565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e0000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e27742065786973740000000000000000006064820152fd5b610fa390939192936113cb565b90610c66565b91925094508160031b91808304600814901517156107d15780820182116107d15760019101936108c8565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d7573742062652061646472657373283029000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f206375740000000000000000000000000000000000000000006064820152fd5b6020809161116d84611364565b815201910190610608565b611fff91935060031c166000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604060002054918361018a565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4c69624469616d6f6e643a204d757374206265206469616d6f6e64206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b807f3ee5aeb50000000000000000000000000000000000000000000000000000000060049252fd5b91908110156112a25760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610445570190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b604051906060820182811067ffffffffffffffff8211176112f157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176112f157604052565b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361044557565b67ffffffffffffffff81116112f157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b80156107d1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b80518210156112a25760209160051b010190565b919082519283825260005b8481106114545750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611415565b9073ffffffffffffffffffffffffffffffffffffffff821691821561157e57600080916114ec6114966112d1565b602881527f4c69624469616d6f6e644375743a205f696e697420616464726573732068617360208201527f206e6f20636f6465000000000000000000000000000000000000000000000000604082015282611583565b83519060208501905af4913d15611576573d9261150b6102a785611391565b9384523d6000602086013e5b1561152157505050565b82511561153057825160208401fd5b6115726040519283927f192105d7000000000000000000000000000000000000000000000000000000008452600484015260406024840152604483019061140a565b0390fd5b606092611517565b505050565b3b1561158c5750565b611572906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061140a56fea26469706673582212205738ecbf3d7d33d512184c65fca915f8b8b6a369810bfc63dd9835556fd5632464736f6c63430008140033
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c631f931c1c1461002857600080fd5b346104455760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104455767ffffffffffffffff60043511610445573660236004350112156104455767ffffffffffffffff6004356004013511610445573660246004356004013560051b6004350101116104455773ffffffffffffffffffffffffffffffffffffffff60243516602435036104455767ffffffffffffffff60443511610445573660236044350112156104455767ffffffffffffffff604435600401351161044557366024604435600401356044350101116104455760026000541461123a57600260005573ffffffffffffffffffffffffffffffffffffffff7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c1320541633036111b6577fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5461ffff81168060009260078116611178575b5060005b6004356004013581106104f257508103610481575b6007811661044a575b50506040516060810160608252600435600401359052608081019060806004356004013560051b820101916024600435019060005b6004356004013581106102d6576102cf856000867f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67360209173ffffffffffffffffffffffffffffffffffffffff60243516838201528085036040820152604435600401358552828160246044350196604435600401358884830137600460443501358181018401889052601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01601030190a16102ac6102a760443560040135611391565b611320565b600460443501358082529093828501376044356004013583010152602435611468565b6001600055005b9091937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8084820301835284357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7d6004353603018112156104455760043501602481013573ffffffffffffffffffffffffffffffffffffffff81168091036104455782526044810135600381101561044557602083015260648101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbd8236030181121561044557019067ffffffffffffffff60248301351161044557602482013560051b3603604483011361044557806060604060809301526060810160248401359052019060448101906000905b60248101358210610404575050506020806001929601930191016101e1565b9091926020806001927fffffffff0000000000000000000000000000000000000000000000000000000061043788611364565b1681520194019201906103e5565b600080fd5b60031c6000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260406000205580806101ac565b61ffff81167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00007fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5416177fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e556101a3565b9161050c8360049593953560040135602460043501611262565b359073ffffffffffffffffffffffffffffffffffffffff821682036104455760206105438560043560040135602460043501611262565b01356003811015610445576105648560043560040135602460043501611262565b917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe183360301604084013512156104455767ffffffffffffffff6040840135840135116104455760408301358301803560051b3603602090910113610445576105d96020604085013585013560051b01611320565b6040840135840180358083529194916020808701923660059390931b0101116104455760206040830135830101905b60408301358301803560051b016020018210611160575050508094918351156110dc57806108d05750509261069461063e6112d1565b602481527f4c69624469616d6f6e644375743a2041646420666163657420686173206e6f2060208201527f636f646500000000000000000000000000000000000000000000000000000000604082015284611583565b6000935b82518510156108be577fffffffff000000000000000000000000000000000000000000000000000000006106cc86856113f6565b5116806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260406000205460601c61083a57806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052827fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008660601b161760406000205560e08360051b161c907fffffffff0000000000000000000000000000000000000000000000000000000060e08460051b161c1916179060e0808260051b1614610800575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107d1576001948501940190610698565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b908160031c6000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d60205260406000205560009061079d565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c72656164792065786973747300000000000000000000006064820152fd5b9150949250600191505b93920161018e565b939691959294929360018103610bde5750506109436108ed6112d1565b602881527f4c69624469616d6f6e644375743a205265706c6163652066616365742068617360208201527f206e6f20636f6465000000000000000000000000000000000000000000000000604082015287611583565b60005b8451811015610bd0577fffffffff0000000000000000000000000000000000000000000000000000000061097a82876113f6565b511690816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040600020548060601c308114610b4c5773ffffffffffffffffffffffffffffffffffffffff8a168114610ac85715610a44576001926000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526bffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008a60601b1691161760406000205501610946565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e277420657869737400000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e00000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e00000000000000000000000000000000006064820152fd5b5092509350916001906108c8565b6002919496935096919496146000146110585773ffffffffffffffffffffffffffffffffffffffff16610fd4579060078160031c9116916000925b8651841015610fa95781610f96575050610c32906113cb565b90816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604060002054906007905b7fffffffff00000000000000000000000000000000000000000000000000000000610c9182896113f6565b5116806000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604060002054908160601c8015610f12573014610e8e577fffffffff00000000000000000000000000000000000000000000000000000000858560051b1b1690808203610e26575b60009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020526040812055600382901c611fff16868114610dec576000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020526040600020917fffffffff0000000000000000000000000000000000000000000000000000000060e084549260051b1692831c921c19161790555b8115610db5575b600101929190610c19565b60008481527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604081208190559250610daa565b5091939060e07fffffffff000000000000000000000000000000000000000000000000000000009160051b1692831c921c19161791610da3565b816000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c60205260406000207fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008154166bffffffffffffffffffffffff8516179055610d03565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e0000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e27742065786973740000000000000000006064820152fd5b610fa390939192936113cb565b90610c66565b91925094508160031b91808304600814901517156107d15780820182116107d15760019101936108c8565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d7573742062652061646472657373283029000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f206375740000000000000000000000000000000000000000006064820152fd5b6020809161116d84611364565b815201910190610608565b611fff91935060031c166000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602052604060002054918361018a565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4c69624469616d6f6e643a204d757374206265206469616d6f6e64206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b807f3ee5aeb50000000000000000000000000000000000000000000000000000000060049252fd5b91908110156112a25760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa181360301821215610445570190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b604051906060820182811067ffffffffffffffff8211176112f157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176112f157604052565b35907fffffffff000000000000000000000000000000000000000000000000000000008216820361044557565b67ffffffffffffffff81116112f157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b80156107d1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b80518210156112a25760209160051b010190565b919082519283825260005b8481106114545750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201611415565b9073ffffffffffffffffffffffffffffffffffffffff821691821561157e57600080916114ec6114966112d1565b602881527f4c69624469616d6f6e644375743a205f696e697420616464726573732068617360208201527f206e6f20636f6465000000000000000000000000000000000000000000000000604082015282611583565b83519060208501905af4913d15611576573d9261150b6102a785611391565b9384523d6000602086013e5b1561152157505050565b82511561153057825160208401fd5b6115726040519283927f192105d7000000000000000000000000000000000000000000000000000000008452600484015260406024840152604483019061140a565b0390fd5b606092611517565b505050565b3b1561158c5750565b611572906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061140a56fea26469706673582212205738ecbf3d7d33d512184c65fca915f8b8b6a369810bfc63dd9835556fd5632464736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.