Source Code
Overview
ETH Balance
0 ETH
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.23+commit.f704f362
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; // solhint-disable max-line-length // source: https://github.com/mudgen/diamond-3/blob/b009cd08b7822bad727bbcc47aa1b50d8b50f7f0/contracts/facets/DiamondCutFacet.sol#L1 /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamond Standard: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ import "../../interfaces/diamond/standard/IDiamondCut.sol"; import "../../libraries/diamond/standard/LibDiamond.sol"; 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.diamondCut(_diamondCut, _init, _calldata); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamond Standard: 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; } event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata); /// @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; }
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
library GelatoBytes {
function calldataSliceSelector(
bytes calldata _bytes
) internal pure returns (bytes4 selector) {
selector =
_bytes[0] |
(bytes4(_bytes[1]) >> 8) |
(bytes4(_bytes[2]) >> 16) |
(bytes4(_bytes[3]) >> 24);
}
function memorySliceSelector(
bytes memory _bytes
) internal pure returns (bytes4 selector) {
selector =
_bytes[0] |
(bytes4(_bytes[1]) >> 8) |
(bytes4(_bytes[2]) >> 16) |
(bytes4(_bytes[3]) >> 24);
}
function revertWithError(
bytes memory _bytes,
string memory _tracingInfo
) internal pure {
// 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err
if (_bytes.length % 32 == 4) {
bytes4 selector;
assembly {
selector := mload(add(0x20, _bytes))
}
if (selector == 0x08c379a0) {
// Function selector for Error(string)
assembly {
_bytes := add(_bytes, 68)
}
revert(string(abi.encodePacked(_tracingInfo, string(_bytes))));
} else {
revert(
string(abi.encodePacked(_tracingInfo, "NoErrorSelector"))
);
}
} else {
revert(
string(abi.encodePacked(_tracingInfo, "UnexpectedReturndata"))
);
}
}
function returnError(
bytes memory _bytes,
string memory _tracingInfo
) internal pure returns (string memory) {
// 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err
if (_bytes.length % 32 == 4) {
bytes4 selector;
assembly {
selector := mload(add(0x20, _bytes))
}
if (selector == 0x08c379a0) {
// Function selector for Error(string)
assembly {
_bytes := add(_bytes, 68)
}
return string(abi.encodePacked(_tracingInfo, string(_bytes)));
} else {
return
string(abi.encodePacked(_tracingInfo, "NoErrorSelector"));
}
} else {
return
string(abi.encodePacked(_tracingInfo, "UnexpectedReturndata"));
}
}
}// SPDX-License-Identifier: MIT pragma solidity 0.8.23; // solhint-disable max-line-length // https://github.com/mudgen/diamond-3/blob/b009cd08b7822bad727bbcc47aa1b50d8b50f7f0/contracts/libraries/LibDiamond.sol#L1 /******************************************************************************\ * Author: Nick Mudge <[email protected]> (https://twitter.com/mudgen) * EIP-2535 Diamond Standard: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ import "../../../interfaces/diamond/standard/IDiamondCut.sol"; // Custom due to incorrect string casting (non UTF-8 formatted) import {GelatoBytes} from "../../../libraries/GelatoBytes.sol"; library LibDiamond { bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage"); struct FacetAddressAndPosition { address facetAddress; uint16 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array } struct FacetFunctionSelectors { bytes4[] functionSelectors; uint16 facetAddressPosition; // position of facetAddress in facetAddresses array } struct DiamondStorage { // maps function selector to the facet address and // the position of the selector in the facetFunctionSelectors.selectors array mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition; // maps facet addresses to function selectors mapping(address => FacetFunctionSelectors) facetFunctionSelectors; // facet addresses address[] facetAddresses; // Used to query if a contract implements an interface. // Used to implement ERC-165. mapping(bytes4 => bool) supportedInterfaces; // 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 isContractOwner(address _guy) internal view returns (bool) { return _guy == contractOwner(); } function enforceIsContractOwner() internal view { require( msg.sender == diamondStorage().contractOwner, "LibDiamond: Must be contract owner" ); } event DiamondCut( IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata ); // Internal function version of diamondCut function diamondCut( IDiamondCut.FacetCut[] memory _diamondCut, address _init, bytes memory _calldata ) internal { for ( uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++ ) { IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action; if (action == IDiamondCut.FacetCutAction.Add) { addFunctions( _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors ); } else if (action == IDiamondCut.FacetCutAction.Replace) { replaceFunctions( _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors ); } else if (action == IDiamondCut.FacetCutAction.Remove) { removeFunctions( _diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors ); } else { revert("LibDiamondCut: Incorrect FacetCutAction"); } } emit DiamondCut(_diamondCut, _init, _calldata); initializeDiamondCut(_init, _calldata); } function addFunctions( address _facetAddress, bytes4[] memory _functionSelectors ) internal { require( _functionSelectors.length > 0, "LibDiamondCut: No selectors in facet to cut" ); DiamondStorage storage ds = diamondStorage(); // uint16 selectorCount = uint16(diamondStorage().selectors.length); require( _facetAddress != address(0), "LibDiamondCut: Add facet can't be address(0)" ); uint16 selectorPosition = uint16( ds.facetFunctionSelectors[_facetAddress].functionSelectors.length ); // add new facet address if it does not exist if (selectorPosition == 0) { enforceHasContractCode( _facetAddress, "LibDiamondCut: New facet has no code" ); ds .facetFunctionSelectors[_facetAddress] .facetAddressPosition = uint16(ds.facetAddresses.length); ds.facetAddresses.push(_facetAddress); } for ( uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++ ) { bytes4 selector = _functionSelectors[selectorIndex]; address oldFacetAddress = ds .selectorToFacetAndPosition[selector] .facetAddress; require( oldFacetAddress == address(0), "LibDiamondCut: Can't add function that already exists" ); ds.facetFunctionSelectors[_facetAddress].functionSelectors.push( selector ); ds .selectorToFacetAndPosition[selector] .facetAddress = _facetAddress; ds .selectorToFacetAndPosition[selector] .functionSelectorPosition = selectorPosition; selectorPosition++; } } function replaceFunctions( address _facetAddress, bytes4[] memory _functionSelectors ) internal { require( _functionSelectors.length > 0, "LibDiamondCut: No selectors in facet to cut" ); DiamondStorage storage ds = diamondStorage(); require( _facetAddress != address(0), "LibDiamondCut: Add facet can't be address(0)" ); uint16 selectorPosition = uint16( ds.facetFunctionSelectors[_facetAddress].functionSelectors.length ); // add new facet address if it does not exist if (selectorPosition == 0) { enforceHasContractCode( _facetAddress, "LibDiamondCut: New facet has no code" ); ds .facetFunctionSelectors[_facetAddress] .facetAddressPosition = uint16(ds.facetAddresses.length); ds.facetAddresses.push(_facetAddress); } for ( uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++ ) { bytes4 selector = _functionSelectors[selectorIndex]; address oldFacetAddress = ds .selectorToFacetAndPosition[selector] .facetAddress; require( oldFacetAddress != _facetAddress, "LibDiamondCut: Can't replace function with same function" ); removeFunction(oldFacetAddress, selector); // add function ds .selectorToFacetAndPosition[selector] .functionSelectorPosition = selectorPosition; ds.facetFunctionSelectors[_facetAddress].functionSelectors.push( selector ); ds .selectorToFacetAndPosition[selector] .facetAddress = _facetAddress; selectorPosition++; } } function removeFunctions( address _facetAddress, bytes4[] memory _functionSelectors ) internal { require( _functionSelectors.length > 0, "LibDiamondCut: No selectors in facet to cut" ); DiamondStorage storage ds = diamondStorage(); // if function does not exist then do nothing and return require( _facetAddress == address(0), "LibDiamondCut: Remove facet address must be address(0)" ); for ( uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++ ) { bytes4 selector = _functionSelectors[selectorIndex]; address oldFacetAddress = ds .selectorToFacetAndPosition[selector] .facetAddress; removeFunction(oldFacetAddress, selector); } } function removeFunction(address _facetAddress, bytes4 _selector) internal { DiamondStorage storage ds = diamondStorage(); require( _facetAddress != address(0), "LibDiamondCut: Can't remove function that doesn't exist" ); // an immutable function is a function defined directly in a diamond require( _facetAddress != address(this), "LibDiamondCut: Can't remove immutable function" ); // replace selector with last selector, then delete last selector uint256 selectorPosition = ds .selectorToFacetAndPosition[_selector] .functionSelectorPosition; uint256 lastSelectorPosition = ds .facetFunctionSelectors[_facetAddress] .functionSelectors .length - 1; // if not the same then replace _selector with lastSelector if (selectorPosition != lastSelectorPosition) { bytes4 lastSelector = ds .facetFunctionSelectors[_facetAddress] .functionSelectors[lastSelectorPosition]; ds.facetFunctionSelectors[_facetAddress].functionSelectors[ selectorPosition ] = lastSelector; ds .selectorToFacetAndPosition[lastSelector] .functionSelectorPosition = uint16(selectorPosition); } // delete the last selector ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop(); delete ds.selectorToFacetAndPosition[_selector]; // if no more selectors for facet address then delete the facet address if (lastSelectorPosition == 0) { // replace facet address with last facet address and delete last facet address uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1; uint256 facetAddressPosition = ds .facetFunctionSelectors[_facetAddress] .facetAddressPosition; if (facetAddressPosition != lastFacetAddressPosition) { address lastFacetAddress = ds.facetAddresses[ lastFacetAddressPosition ]; ds.facetAddresses[facetAddressPosition] = lastFacetAddress; ds .facetFunctionSelectors[lastFacetAddress] .facetAddressPosition = uint16(facetAddressPosition); } ds.facetAddresses.pop(); delete ds .facetFunctionSelectors[_facetAddress] .facetAddressPosition; } } function initializeDiamondCut( address _init, bytes memory _calldata ) internal { if (_init == address(0)) { require( _calldata.length == 0, "LibDiamondCut: _init is address(0) but_calldata is not empty" ); } else { require( _calldata.length > 0, "LibDiamondCut: _calldata is empty but _init is not address(0)" ); if (_init != address(this)) { enforceHasContractCode( _init, "LibDiamondCut: _init address has no code" ); } (bool success, bytes memory error) = _init.delegatecall(_calldata); if (!success) { if (error.length > 0) { // bubble up the error GelatoBytes.revertWithError(error, "LibDiamondCut:_init:"); } 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); } }
{
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract ABI
API[{"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"},{"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
60808060405234610016576114bc908161001c8239f35b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c631f931c1c1461002857600080fd5b346100b15760603660031901126100b15760043567ffffffffffffffff8082116100ad57366023830112156100ad578160040135918183116100a9573660248460051b830101116100a95761007b6100b4565b6044359283116100a5576100a29361009960249436906004016100e3565b949093016101d5565b80f35b8480fd5b8380fd5b8280fd5b80fd5b602435906001600160a01b03821682036100ca57565b600080fd5b35906001600160a01b03821682036100ca57565b9181601f840112156100ca5782359167ffffffffffffffff83116100ca57602083818601950101116100ca57565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761014357604052565b610111565b90601f8019910116810190811067ffffffffffffffff82111761014357604052565b67ffffffffffffffff81116101435760051b60200190565b67ffffffffffffffff811161014357601f01601f191660200190565b9291926101aa82610182565b916101b86040519384610148565b8294818452818301116100ca578281602093846000960137010152565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205493959491936001600160a01b03163303610347576102148461016a565b9360406102246040519687610148565b8186526020928387019060059360051b8101933685116100ca5781925b8584106102675750505050505050610265939461025f91369161019e565b91610535565b565b67ffffffffffffffff84358181116100ca578401906060823603126100ca5786519161029283610127565b61029b816100cf565b83528981013560038110156100ca578a840152878101359182116100ca570136601f820112156100ca5780356102d08161016a565b916102dd89519384610148565b8183528a80840192871b820101903682116100ca57908b80959396949201955b81871061031857505083945088820152815201930192610241565b9395929450909282356001600160e01b0319811681036100ca57818d92918392520192019492908b94926102fd565b60405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201526132b960f11b6064820152608490fd5b634e487b7160e01b600052603260045260246000fd5b80518210156103c15760209160051b010190565b610397565b600311156103d057565b634e487b7160e01b600052602160045260246000fd5b5160038110156103d05790565b60005b8381106104065750506000910152565b81810151838201526020016103f6565b9060209161042f815180928185528580860191016103f3565b601f01601f1916010190565b9392909360609260608201606083528651809152608094608084019160808160051b860101966020809a01936000915b8383106104a0575050505050506104909061049d959683019060018060a01b03169052565b6040818403910152610416565b90565b909192939498607f198882030183528951908681019060018060a01b0383511681528d83015160038110156103d057848f9493928592838201528a604080960151958201528451809452019201906000905b8082106105115750505090806001929b0193019301919493929061046b565b82516001600160e01b03191684528f949384019390920191600191909101906104f2565b92909160005b84518110156106765761055a602061055383886103ad565b51016103e6565b610563816103c6565b806105a557508061059f61058a61057c600194896103ad565b51516001600160a01b031690565b6040610596848a6103ad565b51015190610c88565b0161053b565b6105ae816103c6565b600181036105e45750806105df6105ca61057c600194896103ad565b60406105d6848a6103ad565b51015190610ac2565b61059f565b806105f06002926103c6565b0361061d57806105df61060861057c600194896103ad565b6040610614848a6103ad565b51015190610750565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b6064820152608490fd5b0390fd5b509092917f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67381610265946106b0856040519384938461043b565b0390a1610f1d565b156106bf57565b60405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b6064820152608490fd5b63ffffffff60e01b166000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604060002090565b91909161075f835115156106b8565b6001600160a01b03166107c25760005b82518110156107bd57806107b761079961078b600194876103ad565b516001600160e01b03191690565b6107b26107a582610718565b546001600160a01b031690565b611173565b0161076f565b509050565b60405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f76652066616365742061646472604482015275657373206d757374206265206164647265737328302960501b6064820152608490fd5b1561082d57565b60405162461bcd60e51b815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201526b65206164647265737328302960a01b6064820152608490fd5b6001600160a01b031660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020526040902090565b604051906108cd82610127565b6024825263636f646560e01b6040837f4c69624469616d6f6e644375743a204e657720666163657420686173206e6f2060208201520152565b60008051602061146783398151915280548210156103c1576000527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbef0190600090565b600080516020611467833981519152908154600160401b81101561014357600181018084558110156103c157610265926000527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbef019060018060a01b03166bffffffffffffffffffffffff60a01b825416179055565b156109c657565b60405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e00000000000000006064820152608490fd5b91909180548310156103c157600052601c60206000208360031c019260021b1690565b90815491600160401b8310156101435782610a7791600161026595018155610a31565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b634e487b7160e01b600052601160045260246000fd5b61ffff809116908114610abd5760010190565b610a94565b919091610ad1835115156106b8565b6001600160a01b0381811690610ae8821515610826565b610afc610af484610887565b5461ffff1690565b9461ffff861615610bc5575b6000955b8151871015610bbc57610bb4600191610baf87610b90610b2f61078b8d896103ad565b610b4d81610b3f6107a582610718565b6107b28d8d831614156109bf565b610b7985610b5a83610718565b805461ffff60a01b191660a09290921b61ffff60a01b16919091179055565b610b8b81610b8685610887565b610a54565b610718565b80546001600160a01b0319166001600160a01b03909216919091179055565b610aaa565b960195610b0c565b50505050509050565b610bd6610bd06108c0565b85611315565b610c10610bf36000805160206114678339815191525461ffff1690565b6001610bfe87610887565b019061ffff1661ffff19825416179055565b610c1984610949565b610b08565b15610c2557565b60405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f6044820152746e207468617420616c72656164792065786973747360581b6064820152608490fd5b919091610c97835115156106b8565b610cab6001600160a01b0382161515610826565b610cb7610af482610887565b9261ffff841615610d37575b6000935b8151851015610d3057610d2881610baf600193610b5a610cea61078b8b896103ad565b610d0e610d08610cfc6107a584610718565b6001600160a01b031690565b15610c1e565b610d1b81610b868b610887565b610b8b89610b9083610718565b940193610cc7565b5050509050565b610d48610d426108c0565b83611315565b610d70610d656000805160206114678339815191525461ffff1690565b6001610bfe85610887565b610d7982610949565b610cc3565b15610d8557565b60405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f7420616464726573732830290000006064820152608490fd5b60405190610dfd82610127565b6028825267206e6f20636f646560c01b6040837f4c69624469616d6f6e644375743a205f696e697420616464726573732068617360208201520152565b3d15610e65573d90610e4b82610182565b91610e596040519384610148565b82523d6000602084013e565b606090565b604051906040820182811067ffffffffffffffff8211176101435760405260148252732634b12234b0b6b7b73221baba1d2fb4b734ba1d60611b6020830152565b15610eb257565b60405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d707479000000006064820152608490fd5b906001600160a01b03821680610f3a575061026591505115610eab565b906000928392610f4c83511515610d7e565b3003610fd6575b602082519201905af4610f64610e3a565b9015610f6d5750565b805115610f8257610f7c610e6a565b90611359565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656044820152651d995c9d195960d21b6064820152608490fd5b610fe7610fe1610df0565b82611315565b610f53565b15610ff357565b60405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e27742065786973740000000000000000006064820152608490fd5b1561106557565b60405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b6064820152608490fd5b600019810191908211610abd57565b634e487b7160e01b600052603160045260246000fd5b805480156111105760001901906110fd8282610a31565b63ffffffff82549160031b1b1916905555565b6110d0565b600080516020611467833981519152805490811561111057600019820191808310156103c15760008290527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbee0180546001600160a01b031916905555565b906111946001600160a01b03831661118c811515610fec565b30141561105e565b60006111eb6111ba6111b36111a885610718565b5460a01c61ffff1690565b61ffff1690565b92846111ce6111c882610887565b546110c1565b94858082036112b6575b50506111e6610b8b91610887565b6110e6565b55156111f45750565b600161124561026592611215600080516020611467833981519152546110c1565b61122e6111b38561122585610887565b015461ffff1690565b818103611251575b5050611240611115565b610887565b01805461ffff19169055565b84610bfe61ffff61127c6112676112af96610906565b905460039190911b1c6001600160a01b031690565b936112a88561128a83610906565b90919060018060a01b038084549260031b9316831b921b1916179055565b1692610887565b3880611236565b61ffff826112f585610a776112db966112ed6112e0610b5a986112db6112fc9c610887565b610a31565b90549060031b1c60e01b90565b978893610887565b1691610718565b8438856111d8565b90602061049d928181520190610416565b3b1561131e5750565b60405162461bcd60e51b815260206004820152908190610672906024830190610416565b90611355602092828151948592016103f3565b0190565b60046113668251601f1690565b0361140557602081015162461bcd60e51b91906001600160e01b03191682036113cf576113a6926113ad6113bb9260446040519687946020860190611342565b9101611342565b03601f198101845283610148565b610672604051928392835260048301611304565b506113bb6113ea926113ad6040519485926020840190611342565b6e2737a2b93937b929b2b632b1ba37b960891b8152600f0190565b6040516106729061144e816114406114206020830188611342565b73556e657870656374656452657475726e6461746160601b815260140190565b03601f198101835282610148565b60405162461bcd60e51b81529182916004830161130456fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ea26469706673582212201c908194378652ad57af449bca7280dc423616f10c2d8824f80a182d2160389b64736f6c63430008170033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b6000803560e01c631f931c1c1461002857600080fd5b346100b15760603660031901126100b15760043567ffffffffffffffff8082116100ad57366023830112156100ad578160040135918183116100a9573660248460051b830101116100a95761007b6100b4565b6044359283116100a5576100a29361009960249436906004016100e3565b949093016101d5565b80f35b8480fd5b8380fd5b8280fd5b80fd5b602435906001600160a01b03821682036100ca57565b600080fd5b35906001600160a01b03821682036100ca57565b9181601f840112156100ca5782359167ffffffffffffffff83116100ca57602083818601950101116100ca57565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761014357604052565b610111565b90601f8019910116810190811067ffffffffffffffff82111761014357604052565b67ffffffffffffffff81116101435760051b60200190565b67ffffffffffffffff811161014357601f01601f191660200190565b9291926101aa82610182565b916101b86040519384610148565b8294818452818301116100ca578281602093846000960137010152565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205493959491936001600160a01b03163303610347576102148461016a565b9360406102246040519687610148565b8186526020928387019060059360051b8101933685116100ca5781925b8584106102675750505050505050610265939461025f91369161019e565b91610535565b565b67ffffffffffffffff84358181116100ca578401906060823603126100ca5786519161029283610127565b61029b816100cf565b83528981013560038110156100ca578a840152878101359182116100ca570136601f820112156100ca5780356102d08161016a565b916102dd89519384610148565b8183528a80840192871b820101903682116100ca57908b80959396949201955b81871061031857505083945088820152815201930192610241565b9395929450909282356001600160e01b0319811681036100ca57818d92918392520192019492908b94926102fd565b60405162461bcd60e51b815260206004820152602260248201527f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60448201526132b960f11b6064820152608490fd5b634e487b7160e01b600052603260045260246000fd5b80518210156103c15760209160051b010190565b610397565b600311156103d057565b634e487b7160e01b600052602160045260246000fd5b5160038110156103d05790565b60005b8381106104065750506000910152565b81810151838201526020016103f6565b9060209161042f815180928185528580860191016103f3565b601f01601f1916010190565b9392909360609260608201606083528651809152608094608084019160808160051b860101966020809a01936000915b8383106104a0575050505050506104909061049d959683019060018060a01b03169052565b6040818403910152610416565b90565b909192939498607f198882030183528951908681019060018060a01b0383511681528d83015160038110156103d057848f9493928592838201528a604080960151958201528451809452019201906000905b8082106105115750505090806001929b0193019301919493929061046b565b82516001600160e01b03191684528f949384019390920191600191909101906104f2565b92909160005b84518110156106765761055a602061055383886103ad565b51016103e6565b610563816103c6565b806105a557508061059f61058a61057c600194896103ad565b51516001600160a01b031690565b6040610596848a6103ad565b51015190610c88565b0161053b565b6105ae816103c6565b600181036105e45750806105df6105ca61057c600194896103ad565b60406105d6848a6103ad565b51015190610ac2565b61059f565b806105f06002926103c6565b0361061d57806105df61060861057c600194896103ad565b6040610614848a6103ad565b51015190610750565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b6064820152608490fd5b0390fd5b509092917f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb67381610265946106b0856040519384938461043b565b0390a1610f1d565b156106bf57565b60405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b6064820152608490fd5b63ffffffff60e01b166000527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c602052604060002090565b91909161075f835115156106b8565b6001600160a01b03166107c25760005b82518110156107bd57806107b761079961078b600194876103ad565b516001600160e01b03191690565b6107b26107a582610718565b546001600160a01b031690565b611173565b0161076f565b509050565b60405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f76652066616365742061646472604482015275657373206d757374206265206164647265737328302960501b6064820152608490fd5b1561082d57565b60405162461bcd60e51b815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201526b65206164647265737328302960a01b6064820152608490fd5b6001600160a01b031660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020526040902090565b604051906108cd82610127565b6024825263636f646560e01b6040837f4c69624469616d6f6e644375743a204e657720666163657420686173206e6f2060208201520152565b60008051602061146783398151915280548210156103c1576000527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbef0190600090565b600080516020611467833981519152908154600160401b81101561014357600181018084558110156103c157610265926000527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbef019060018060a01b03166bffffffffffffffffffffffff60a01b825416179055565b156109c657565b60405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e00000000000000006064820152608490fd5b91909180548310156103c157600052601c60206000208360031c019260021b1690565b90815491600160401b8310156101435782610a7791600161026595018155610a31565b90919063ffffffff83549160031b9260e01c831b921b1916179055565b634e487b7160e01b600052601160045260246000fd5b61ffff809116908114610abd5760010190565b610a94565b919091610ad1835115156106b8565b6001600160a01b0381811690610ae8821515610826565b610afc610af484610887565b5461ffff1690565b9461ffff861615610bc5575b6000955b8151871015610bbc57610bb4600191610baf87610b90610b2f61078b8d896103ad565b610b4d81610b3f6107a582610718565b6107b28d8d831614156109bf565b610b7985610b5a83610718565b805461ffff60a01b191660a09290921b61ffff60a01b16919091179055565b610b8b81610b8685610887565b610a54565b610718565b80546001600160a01b0319166001600160a01b03909216919091179055565b610aaa565b960195610b0c565b50505050509050565b610bd6610bd06108c0565b85611315565b610c10610bf36000805160206114678339815191525461ffff1690565b6001610bfe87610887565b019061ffff1661ffff19825416179055565b610c1984610949565b610b08565b15610c2557565b60405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f6044820152746e207468617420616c72656164792065786973747360581b6064820152608490fd5b919091610c97835115156106b8565b610cab6001600160a01b0382161515610826565b610cb7610af482610887565b9261ffff841615610d37575b6000935b8151851015610d3057610d2881610baf600193610b5a610cea61078b8b896103ad565b610d0e610d08610cfc6107a584610718565b6001600160a01b031690565b15610c1e565b610d1b81610b868b610887565b610b8b89610b9083610718565b940193610cc7565b5050509050565b610d48610d426108c0565b83611315565b610d70610d656000805160206114678339815191525461ffff1690565b6001610bfe85610887565b610d7982610949565b610cc3565b15610d8557565b60405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f7420616464726573732830290000006064820152608490fd5b60405190610dfd82610127565b6028825267206e6f20636f646560c01b6040837f4c69624469616d6f6e644375743a205f696e697420616464726573732068617360208201520152565b3d15610e65573d90610e4b82610182565b91610e596040519384610148565b82523d6000602084013e565b606090565b604051906040820182811067ffffffffffffffff8211176101435760405260148252732634b12234b0b6b7b73221baba1d2fb4b734ba1d60611b6020830152565b15610eb257565b60405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d707479000000006064820152608490fd5b906001600160a01b03821680610f3a575061026591505115610eab565b906000928392610f4c83511515610d7e565b3003610fd6575b602082519201905af4610f64610e3a565b9015610f6d5750565b805115610f8257610f7c610e6a565b90611359565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656044820152651d995c9d195960d21b6064820152608490fd5b610fe7610fe1610df0565b82611315565b610f53565b15610ff357565b60405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e27742065786973740000000000000000006064820152608490fd5b1561106557565b60405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b6064820152608490fd5b600019810191908211610abd57565b634e487b7160e01b600052603160045260246000fd5b805480156111105760001901906110fd8282610a31565b63ffffffff82549160031b1b1916905555565b6110d0565b600080516020611467833981519152805490811561111057600019820191808310156103c15760008290527fb5c239a29faf02594141bbc5e6982a9b85ba2b4d59c3ed3baaf4cb8e5e11cbee0180546001600160a01b031916905555565b906111946001600160a01b03831661118c811515610fec565b30141561105e565b60006111eb6111ba6111b36111a885610718565b5460a01c61ffff1690565b61ffff1690565b92846111ce6111c882610887565b546110c1565b94858082036112b6575b50506111e6610b8b91610887565b6110e6565b55156111f45750565b600161124561026592611215600080516020611467833981519152546110c1565b61122e6111b38561122585610887565b015461ffff1690565b818103611251575b5050611240611115565b610887565b01805461ffff19169055565b84610bfe61ffff61127c6112676112af96610906565b905460039190911b1c6001600160a01b031690565b936112a88561128a83610906565b90919060018060a01b038084549260031b9316831b921b1916179055565b1692610887565b3880611236565b61ffff826112f585610a776112db966112ed6112e0610b5a986112db6112fc9c610887565b610a31565b90549060031b1c60e01b90565b978893610887565b1691610718565b8438856111d8565b90602061049d928181520190610416565b3b1561131e5750565b60405162461bcd60e51b815260206004820152908190610672906024830190610416565b90611355602092828151948592016103f3565b0190565b60046113668251601f1690565b0361140557602081015162461bcd60e51b91906001600160e01b03191682036113cf576113a6926113ad6113bb9260446040519687946020860190611342565b9101611342565b03601f198101845283610148565b610672604051928392835260048301611304565b506113bb6113ea926113ad6040519485926020840190611342565b6e2737a2b93937b929b2b632b1ba37b960891b8152600f0190565b6040516106729061144e816114406114206020830188611342565b73556e657870656374656452657475726e6461746160601b815260140190565b03601f198101835282610148565b60405162461bcd60e51b81529182916004830161130456fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ea26469706673582212201c908194378652ad57af449bca7280dc423616f10c2d8824f80a182d2160389b64736f6c63430008170033
Loading...
Loading
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.