Source Code
Overview
POL Balance
0 POL
More Info
ContractCreator
Multichain Info
N/A
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.9+commit.e5eed63a
Optimization Enabled:
Yes with 1000 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 { IDiamondCut } from "../interfaces/IDiamondCut.sol"; import { LibDiamond } from "../libraries/LibDiamond.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 { /// @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 { LibDiamond.enforceIsContractOwner(); 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 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); }
// 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 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 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; ) { (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 (selectorInSlotIndex == 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); } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_initializationContractAddress","type":"address"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"InitializationFunctionReverted","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
608060405234801561001057600080fd5b506111d4806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80631f931c1c14610030575b600080fd5b61004361003e366004610cce565b610045565b005b61004d610271565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff8116908190600090600716156100bc5750600381901c60009081526001840160205260409020545b60005b888110156101a95761019c83838c8c858181106100de576100de610d80565b90506020028101906100f09190610d96565b6100fe906020810190610db6565b8d8d8681811061011057610110610d80565b90506020028101906101229190610d96565b610133906040810190602001610de7565b8e8e8781811061014557610145610d80565b90506020028101906101579190610d96565b610165906040810190610e02565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061031a92505050565b90935091506001016100bf565b508282146101c55760028401805461ffff191661ffff84161790555b60078216156101e757600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673898989898960405161021e959493929190610edb565b60405180910390a16102668787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b6392505050565b505050505050505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600401546001600160a01b031633146103185760405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201527f657200000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b565b600080807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905060008451116103b85760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f20637574000000000000000000000000000000000000000000606482015260840161030f565b60008560028111156103cc576103cc610e4c565b1415610540576103f48660405180606001604052806024815260200161112b60249139610c48565b60005b845181101561053a57600085828151811061041457610414610d80565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156104b55760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c7265616479206578697374730000000000000000000000606482015260840161030f565b6001600160e01b031980831660008181526020879052604090206bffffffffffffffffffffffff1960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81141561051e5760038c901c600090815260018601602052604081209b909b555b8b6105288161101a565b9c5050600190930192506103f7915050565b50610b57565b600185600281111561055457610554610e4c565b141561078f5761057c8660405180606001604052806028815260200161117760289139610c48565b60005b845181101561053a57600085828151811061059c5761059c610d80565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c308114156106405760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e0000000000000000000000000000000000606482015260840161030f565b896001600160a01b0316816001600160a01b031614156106c85760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606482015260840161030f565b6001600160a01b0381166107445760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e27742065786973740000000000000000606482015260840161030f565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166bffffffffffffffffffffffff1960608a901b1617905560010161057f565b60028560028111156107a3576107a3610e4c565b1415610ae9576001600160a01b038616156108265760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d757374206265206164647265737328302900000000000000000000606482015260840161030f565b600388901c6007891660005b8651811015610ac9578161086a578261084a81611035565b60008181526001870160205260409020549b509350600792506108789050565b8161087481611035565b9250505b6000806000808a858151811061089057610890610d80565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c6109305760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e2774206578697374000000000000000000606482015260840161030f565b606081901c3014156109aa5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e000000000000000000000000000000000000606482015260840161030f565b600587901b8f901b94506001600160e01b031980861690831614610a05576001600160e01b03198516600090815260208a90526040902080546bffffffffffffffffffffffff19166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e0169050858214610a6a576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c179055610aa3565b80837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c816001600160e01b031960001b901c198e16179c505b84610abe57600086815260018801602052604081208190559c505b505050600101610832565b5080610ad683600861104c565b610ae0919061106b565b99505050610b57565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e00000000000000000000000000000000000000000000000000606482015260840161030f565b50959694955050505050565b6001600160a01b038216610b75575050565b610b978260405180606001604052806028815260200161114f60289139610c48565b600080836001600160a01b031683604051610bb291906110af565b600060405180830381855af49150503d8060008114610bed576040519150601f19603f3d011682016040523d82523d6000602084013e610bf2565b606091505b509150915081610c4257805115610c0c5780518082602001fd5b83836040517f192105d700000000000000000000000000000000000000000000000000000000815260040161030f9291906110ed565b50505050565b813b8181610c425760405162461bcd60e51b815260040161030f9190611117565b80356001600160a01b0381168114610c8057600080fd5b919050565b60008083601f840112610c9757600080fd5b50813567ffffffffffffffff811115610caf57600080fd5b602083019150836020828501011115610cc757600080fd5b9250929050565b600080600080600060608688031215610ce657600080fd5b853567ffffffffffffffff80821115610cfe57600080fd5b818801915088601f830112610d1257600080fd5b813581811115610d2157600080fd5b8960208260051b8501011115610d3657600080fd5b60208301975080965050610d4c60208901610c69565b94506040880135915080821115610d6257600080fd5b50610d6f88828901610c85565b969995985093965092949392505050565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112610dac57600080fd5b9190910192915050565b600060208284031215610dc857600080fd5b610dd182610c69565b9392505050565b803560038110610c8057600080fd5b600060208284031215610df957600080fd5b610dd182610dd8565b6000808335601e19843603018112610e1957600080fd5b83018035915067ffffffffffffffff821115610e3457600080fd5b6020019150600581901b3603821315610cc757600080fd5b634e487b7160e01b600052602160045260246000fd5b818352600060208085019450826000805b86811015610ea65782356001600160e01b03198116808214610e93578384fd5b8952509683019691830191600101610e73565b50959695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060808252818101869052600090600560808085019089831b8601018a855b8b811015610fd157878303607f190184528135368e9003605e19018112610f2057600080fd5b8d016001600160a01b03610f3382610c69565b1684526020610f43818301610dd8565b60038110610f6157634e487b7160e01b600052602160045260246000fd5b8582015260408281013536849003601e19018112610f7e57600080fd5b8301803567ffffffffffffffff811115610f9757600080fd5b808a1b3603851315610fa857600080fd5b8a83890152610fbc8b890182868501610e62565b98840198975050509301925050600101610efa565b50506001600160a01b03891660208701528581036040870152610ff581888a610eb2565b9b9a5050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982141561102e5761102e611004565b5060010190565b60008161104457611044611004565b506000190190565b600081600019048311821515161561106657611066611004565b500290565b6000821982111561107e5761107e611004565b500190565b60005b8381101561109e578181015183820152602001611086565b83811115610c425750506000910152565b60008251610dac818460208701611083565b600081518084526110d9816020860160208601611083565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820152600061110f60408301846110c1565b949350505050565b602081526000610dd160208301846110c156fe4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a2646970667358221220792b90f9e9197935df60e7d60ab6be0c293a1b1d11c21eea845bea0b9bdd82d164736f6c63430008090033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80631f931c1c14610030575b600080fd5b61004361003e366004610cce565b610045565b005b61004d610271565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e547fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9061ffff8116908190600090600716156100bc5750600381901c60009081526001840160205260409020545b60005b888110156101a95761019c83838c8c858181106100de576100de610d80565b90506020028101906100f09190610d96565b6100fe906020810190610db6565b8d8d8681811061011057610110610d80565b90506020028101906101229190610d96565b610133906040810190602001610de7565b8e8e8781811061014557610145610d80565b90506020028101906101579190610d96565b610165906040810190610e02565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061031a92505050565b90935091506001016100bf565b508282146101c55760028401805461ffff191661ffff84161790555b60078216156101e757600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673898989898960405161021e959493929190610edb565b60405180910390a16102668787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b6392505050565b505050505050505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c600401546001600160a01b031633146103185760405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201527f657200000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b565b600080807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c905060008451116103b85760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f20637574000000000000000000000000000000000000000000606482015260840161030f565b60008560028111156103cc576103cc610e4c565b1415610540576103f48660405180606001604052806024815260200161112b60249139610c48565b60005b845181101561053a57600085828151811061041457610414610d80565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156104b55760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c7265616479206578697374730000000000000000000000606482015260840161030f565b6001600160e01b031980831660008181526020879052604090206bffffffffffffffffffffffff1960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81141561051e5760038c901c600090815260018601602052604081209b909b555b8b6105288161101a565b9c5050600190930192506103f7915050565b50610b57565b600185600281111561055457610554610e4c565b141561078f5761057c8660405180606001604052806028815260200161117760289139610c48565b60005b845181101561053a57600085828151811061059c5761059c610d80565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c308114156106405760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201527f757461626c652066756e6374696f6e0000000000000000000000000000000000606482015260840161030f565b896001600160a01b0316816001600160a01b031614156106c85760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e0000000000000000606482015260840161030f565b6001600160a01b0381166107445760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e27742065786973740000000000000000606482015260840161030f565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166bffffffffffffffffffffffff1960608a901b1617905560010161057f565b60028560028111156107a3576107a3610e4c565b1415610ae9576001600160a01b038616156108265760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d757374206265206164647265737328302900000000000000000000606482015260840161030f565b600388901c6007891660005b8651811015610ac9578161086a578261084a81611035565b60008181526001870160205260409020549b509350600792506108789050565b8161087481611035565b9250505b6000806000808a858151811061089057610890610d80565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c6109305760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e2774206578697374000000000000000000606482015260840161030f565b606081901c3014156109aa5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e000000000000000000000000000000000000606482015260840161030f565b600587901b8f901b94506001600160e01b031980861690831614610a05576001600160e01b03198516600090815260208a90526040902080546bffffffffffffffffffffffff19166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e0169050858214610a6a576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c179055610aa3565b80837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c816001600160e01b031960001b901c198e16179c505b84610abe57600086815260018801602052604081208190559c505b505050600101610832565b5080610ad683600861104c565b610ae0919061106b565b99505050610b57565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e00000000000000000000000000000000000000000000000000606482015260840161030f565b50959694955050505050565b6001600160a01b038216610b75575050565b610b978260405180606001604052806028815260200161114f60289139610c48565b600080836001600160a01b031683604051610bb291906110af565b600060405180830381855af49150503d8060008114610bed576040519150601f19603f3d011682016040523d82523d6000602084013e610bf2565b606091505b509150915081610c4257805115610c0c5780518082602001fd5b83836040517f192105d700000000000000000000000000000000000000000000000000000000815260040161030f9291906110ed565b50505050565b813b8181610c425760405162461bcd60e51b815260040161030f9190611117565b80356001600160a01b0381168114610c8057600080fd5b919050565b60008083601f840112610c9757600080fd5b50813567ffffffffffffffff811115610caf57600080fd5b602083019150836020828501011115610cc757600080fd5b9250929050565b600080600080600060608688031215610ce657600080fd5b853567ffffffffffffffff80821115610cfe57600080fd5b818801915088601f830112610d1257600080fd5b813581811115610d2157600080fd5b8960208260051b8501011115610d3657600080fd5b60208301975080965050610d4c60208901610c69565b94506040880135915080821115610d6257600080fd5b50610d6f88828901610c85565b969995985093965092949392505050565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112610dac57600080fd5b9190910192915050565b600060208284031215610dc857600080fd5b610dd182610c69565b9392505050565b803560038110610c8057600080fd5b600060208284031215610df957600080fd5b610dd182610dd8565b6000808335601e19843603018112610e1957600080fd5b83018035915067ffffffffffffffff821115610e3457600080fd5b6020019150600581901b3603821315610cc757600080fd5b634e487b7160e01b600052602160045260246000fd5b818352600060208085019450826000805b86811015610ea65782356001600160e01b03198116808214610e93578384fd5b8952509683019691830191600101610e73565b50959695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060808252818101869052600090600560808085019089831b8601018a855b8b811015610fd157878303607f190184528135368e9003605e19018112610f2057600080fd5b8d016001600160a01b03610f3382610c69565b1684526020610f43818301610dd8565b60038110610f6157634e487b7160e01b600052602160045260246000fd5b8582015260408281013536849003601e19018112610f7e57600080fd5b8301803567ffffffffffffffff811115610f9757600080fd5b808a1b3603851315610fa857600080fd5b8a83890152610fbc8b890182868501610e62565b98840198975050509301925050600101610efa565b50506001600160a01b03891660208701528581036040870152610ff581888a610eb2565b9b9a5050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982141561102e5761102e611004565b5060010190565b60008161104457611044611004565b506000190190565b600081600019048311821515161561106657611066611004565b500290565b6000821982111561107e5761107e611004565b500190565b60005b8381101561109e578181015183820152602001611086565b83811115610c425750506000910152565b60008251610dac818460208701611083565b600081518084526110d9816020860160208601611083565b601f01601f19169290920160200192915050565b6001600160a01b038316815260406020820152600061110f60408301846110c1565b949350505050565b602081526000610dd160208301846110c156fe4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465a2646970667358221220792b90f9e9197935df60e7d60ab6be0c293a1b1d11c21eea845bea0b9bdd82d164736f6c63430008090033
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.