More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 76 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Fallback Add... | 18682170 | 453 days ago | IN | 0 ETH | 0.00091156 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.03550968 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.01399656 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.00237588 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.00481462 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.00254573 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.01774324 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.00633275 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.09373 | ||||
Diamond Cut | 18675887 | 454 days ago | IN | 0 ETH | 0.01535582 | ||||
Set Fallback Add... | 18675887 | 454 days ago | IN | 0 ETH | 0.00101264 | ||||
Diamond Cut | 18388868 | 494 days ago | IN | 0 ETH | 0.00103897 | ||||
Diamond Cut | 18388868 | 494 days ago | IN | 0 ETH | 0.03014485 | ||||
Diamond Cut | 18388868 | 494 days ago | IN | 0 ETH | 0.0080623 | ||||
Set Fallback Add... | 18388868 | 494 days ago | IN | 0 ETH | 0.00047239 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.00120166 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.00063543 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.00322082 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.00139548 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.01573187 | ||||
Diamond Cut | 18338672 | 501 days ago | IN | 0 ETH | 0.00606336 | ||||
Set Fallback Add... | 18338672 | 501 days ago | IN | 0 ETH | 0.00025273 | ||||
Mint NFT And Tra... | 18330961 | 503 days ago | IN | 0.01 ETH | 0.00279522 | ||||
Mint NFT | 18330957 | 503 days ago | IN | 0.01 ETH | 0.00282532 | ||||
Mint NFT And Tra... | 18330951 | 503 days ago | IN | 0.01 ETH | 0.00293971 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
18330961 | 503 days ago | 0.00975 ETH | ||||
18330961 | 503 days ago | 0.00025 ETH | ||||
18330957 | 503 days ago | 0.00975 ETH | ||||
18330957 | 503 days ago | 0.00025 ETH | ||||
18330951 | 503 days ago | 0.00975 ETH | ||||
18330951 | 503 days ago | 0.00025 ETH | ||||
18330866 | 503 days ago | 0.00975 ETH | ||||
18330866 | 503 days ago | 0.00025 ETH | ||||
18327197 | 503 days ago | 0.00975 ETH | ||||
18327197 | 503 days ago | 0.00025 ETH | ||||
18324915 | 503 days ago | 0.00975 ETH | ||||
18324915 | 503 days ago | 0.00025 ETH | ||||
18168230 | 525 days ago | 0.00975 ETH | ||||
18168230 | 525 days ago | 0.00025 ETH | ||||
18146574 | 528 days ago | 0.00975 ETH | ||||
18146574 | 528 days ago | 0.00025 ETH | ||||
18133024 | 530 days ago | 0.00975 ETH | ||||
18133024 | 530 days ago | 0.00025 ETH | ||||
18133002 | 530 days ago | 0.00975 ETH | ||||
18133002 | 530 days ago | 0.00025 ETH | ||||
18119352 | 532 days ago | 0.00975 ETH | ||||
18119352 | 532 days ago | 0.00025 ETH | ||||
18118896 | 532 days ago | 0.00975 ETH | ||||
18118896 | 532 days ago | 0.00025 ETH | ||||
18108255 | 534 days ago | 0.00975 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x37fDf634...74546F536 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
D4ADiamond
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import { SolidStateDiamond } from "@solidstate/contracts/proxy/diamond/SolidStateDiamond.sol"; contract D4ADiamond is SolidStateDiamond { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IOwnable, Ownable, OwnableInternal } from '../../access/ownable/Ownable.sol'; import { ISafeOwnable, SafeOwnable } from '../../access/ownable/SafeOwnable.sol'; import { IERC165 } from '../../interfaces/IERC165.sol'; import { IERC173 } from '../../interfaces/IERC173.sol'; import { ERC165Base, ERC165BaseStorage } from '../../introspection/ERC165/base/ERC165Base.sol'; import { DiamondBase } from './base/DiamondBase.sol'; import { DiamondFallback, IDiamondFallback } from './fallback/DiamondFallback.sol'; import { DiamondReadable, IDiamondReadable } from './readable/DiamondReadable.sol'; import { DiamondWritable, IDiamondWritable } from './writable/DiamondWritable.sol'; import { ISolidStateDiamond } from './ISolidStateDiamond.sol'; /** * @title SolidState "Diamond" proxy reference implementation */ abstract contract SolidStateDiamond is ISolidStateDiamond, DiamondBase, DiamondFallback, DiamondReadable, DiamondWritable, SafeOwnable, ERC165Base { constructor() { bytes4[] memory selectors = new bytes4[](12); uint256 selectorIndex; // register DiamondFallback selectors[selectorIndex++] = IDiamondFallback .getFallbackAddress .selector; selectors[selectorIndex++] = IDiamondFallback .setFallbackAddress .selector; _setSupportsInterface(type(IDiamondFallback).interfaceId, true); // register DiamondWritable selectors[selectorIndex++] = IDiamondWritable.diamondCut.selector; _setSupportsInterface(type(IDiamondWritable).interfaceId, true); // register DiamondReadable selectors[selectorIndex++] = IDiamondReadable.facets.selector; selectors[selectorIndex++] = IDiamondReadable .facetFunctionSelectors .selector; selectors[selectorIndex++] = IDiamondReadable.facetAddresses.selector; selectors[selectorIndex++] = IDiamondReadable.facetAddress.selector; _setSupportsInterface(type(IDiamondReadable).interfaceId, true); // register ERC165 selectors[selectorIndex++] = IERC165.supportsInterface.selector; _setSupportsInterface(type(IERC165).interfaceId, true); // register SafeOwnable selectors[selectorIndex++] = Ownable.owner.selector; selectors[selectorIndex++] = SafeOwnable.nomineeOwner.selector; selectors[selectorIndex++] = Ownable.transferOwnership.selector; selectors[selectorIndex++] = SafeOwnable.acceptOwnership.selector; _setSupportsInterface(type(IERC173).interfaceId, true); // diamond cut FacetCut[] memory facetCuts = new FacetCut[](1); facetCuts[0] = FacetCut({ target: address(this), action: FacetCutAction.ADD, selectors: selectors }); _diamondCut(facetCuts, address(0), ''); // set owner _setOwner(msg.sender); } receive() external payable {} function _transferOwnership( address account ) internal virtual override(OwnableInternal, SafeOwnable) { super._transferOwnership(account); } /** * @inheritdoc DiamondFallback */ function _getImplementation() internal view override(DiamondBase, DiamondFallback) returns (address implementation) { implementation = super._getImplementation(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { IOwnable } from './IOwnable.sol'; import { OwnableInternal } from './OwnableInternal.sol'; /** * @title Ownership access control based on ERC173 */ abstract contract Ownable is IOwnable, OwnableInternal { /** * @inheritdoc IERC173 */ function owner() public view virtual returns (address) { return _owner(); } /** * @inheritdoc IERC173 */ function transferOwnership(address account) public virtual onlyOwner { _transferOwnership(account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { Ownable } from './Ownable.sol'; import { ISafeOwnable } from './ISafeOwnable.sol'; import { OwnableInternal } from './OwnableInternal.sol'; import { SafeOwnableInternal } from './SafeOwnableInternal.sol'; /** * @title Ownership access control based on ERC173 with ownership transfer safety check */ abstract contract SafeOwnable is ISafeOwnable, Ownable, SafeOwnableInternal { /** * @inheritdoc ISafeOwnable */ function nomineeOwner() public view virtual returns (address) { return _nomineeOwner(); } /** * @inheritdoc ISafeOwnable */ function acceptOwnership() public virtual onlyNomineeOwner { _acceptOwnership(); } function _transferOwnership( address account ) internal virtual override(OwnableInternal, SafeOwnableInternal) { super._transferOwnership(account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165Internal } from './IERC165Internal.sol'; /** * @title ERC165 interface registration interface * @dev see https://eips.ethereum.org/EIPS/eip-165 */ interface IERC165 is IERC165Internal { /** * @notice query whether contract has registered support for given interface * @param interfaceId interface id * @return bool whether interface is supported */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173Internal } from './IERC173Internal.sol'; /** * @title Contract ownership standard interface * @dev see https://eips.ethereum.org/EIPS/eip-173 */ interface IERC173 is IERC173Internal { /** * @notice get the ERC173 contract owner * @return contract owner */ function owner() external view returns (address); /** * @notice transfer contract ownership to new account * @param account address of new owner */ function transferOwnership(address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165 } from '../../../interfaces/IERC165.sol'; import { IERC165Base } from './IERC165Base.sol'; import { ERC165BaseInternal } from './ERC165BaseInternal.sol'; import { ERC165BaseStorage } from './ERC165BaseStorage.sol'; /** * @title ERC165 implementation */ abstract contract ERC165Base is IERC165Base, ERC165BaseInternal { /** * @inheritdoc IERC165 */ function supportsInterface(bytes4 interfaceId) public view returns (bool) { return _supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { Proxy } from '../../Proxy.sol'; import { IDiamondBase } from './IDiamondBase.sol'; import { DiamondBaseStorage } from './DiamondBaseStorage.sol'; /** * @title EIP-2535 "Diamond" proxy base contract * @dev see https://eips.ethereum.org/EIPS/eip-2535 */ abstract contract DiamondBase is IDiamondBase, Proxy { /** * @inheritdoc Proxy */ function _getImplementation() internal view virtual override returns (address implementation) { // inline storage layout retrieval uses less gas DiamondBaseStorage.Layout storage l; bytes32 slot = DiamondBaseStorage.STORAGE_SLOT; assembly { l.slot := slot } implementation = address(bytes20(l.facets[msg.sig])); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { OwnableInternal } from '../../../access/ownable/OwnableInternal.sol'; import { DiamondBase } from '../base/DiamondBase.sol'; import { DiamondBaseStorage } from '../base/DiamondBaseStorage.sol'; import { IDiamondFallback } from './IDiamondFallback.sol'; /** * @title Fallback feature for EIP-2535 "Diamond" proxy */ abstract contract DiamondFallback is IDiamondFallback, OwnableInternal, DiamondBase { /** * @inheritdoc IDiamondFallback */ function getFallbackAddress() external view returns (address fallbackAddress) { fallbackAddress = _getFallbackAddress(); } /** * @inheritdoc IDiamondFallback */ function setFallbackAddress(address fallbackAddress) external onlyOwner { _setFallbackAddress(fallbackAddress); } /** * @inheritdoc DiamondBase * @notice query custom fallback address is no implementation is found */ function _getImplementation() internal view virtual override returns (address implementation) { implementation = super._getImplementation(); if (implementation == address(0)) { implementation = _getFallbackAddress(); } } /** * @notice query the address of the fallback implementation * @return fallbackAddress address of fallback implementation */ function _getFallbackAddress() internal view virtual returns (address fallbackAddress) { fallbackAddress = DiamondBaseStorage.layout().fallbackAddress; } /** * @notice set the address of the fallback implementation * @param fallbackAddress address of fallback implementation */ function _setFallbackAddress(address fallbackAddress) internal virtual { DiamondBaseStorage.layout().fallbackAddress = fallbackAddress; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { DiamondBaseStorage } from '../base/DiamondBaseStorage.sol'; import { IDiamondReadable } from './IDiamondReadable.sol'; /** * @title EIP-2535 "Diamond" proxy introspection contract * @dev derived from https://github.com/mudgen/diamond-2 (MIT license) */ abstract contract DiamondReadable is IDiamondReadable { /** * @inheritdoc IDiamondReadable */ function facets() external view returns (Facet[] memory diamondFacets) { DiamondBaseStorage.Layout storage l = DiamondBaseStorage.layout(); diamondFacets = new Facet[](l.selectorCount); uint8[] memory numFacetSelectors = new uint8[](l.selectorCount); uint256 numFacets; uint256 selectorIndex; // loop through function selectors for (uint256 slotIndex; selectorIndex < l.selectorCount; slotIndex++) { bytes32 slot = l.selectorSlots[slotIndex]; for ( uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++ ) { selectorIndex++; if (selectorIndex > l.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); address facet = address(bytes20(l.facets[selector])); bool continueLoop; for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { if (diamondFacets[facetIndex].target == facet) { diamondFacets[facetIndex].selectors[ numFacetSelectors[facetIndex] ] = selector; // probably will never have more than 256 functions from one facet contract require(numFacetSelectors[facetIndex] < 255); numFacetSelectors[facetIndex]++; continueLoop = true; break; } } if (continueLoop) { continue; } diamondFacets[numFacets].target = facet; diamondFacets[numFacets].selectors = new bytes4[]( l.selectorCount ); diamondFacets[numFacets].selectors[0] = selector; numFacetSelectors[numFacets] = 1; numFacets++; } } for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { uint256 numSelectors = numFacetSelectors[facetIndex]; bytes4[] memory selectors = diamondFacets[facetIndex].selectors; // setting the number of selectors assembly { mstore(selectors, numSelectors) } } // setting the number of facets assembly { mstore(diamondFacets, numFacets) } } /** * @inheritdoc IDiamondReadable */ function facetFunctionSelectors( address facet ) external view returns (bytes4[] memory selectors) { DiamondBaseStorage.Layout storage l = DiamondBaseStorage.layout(); selectors = new bytes4[](l.selectorCount); uint256 numSelectors; uint256 selectorIndex; // loop through function selectors for (uint256 slotIndex; selectorIndex < l.selectorCount; slotIndex++) { bytes32 slot = l.selectorSlots[slotIndex]; for ( uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++ ) { selectorIndex++; if (selectorIndex > l.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); if (facet == address(bytes20(l.facets[selector]))) { selectors[numSelectors] = selector; numSelectors++; } } } // set the number of selectors in the array assembly { mstore(selectors, numSelectors) } } /** * @inheritdoc IDiamondReadable */ function facetAddresses() external view returns (address[] memory addresses) { DiamondBaseStorage.Layout storage l = DiamondBaseStorage.layout(); addresses = new address[](l.selectorCount); uint256 numFacets; uint256 selectorIndex; for (uint256 slotIndex; selectorIndex < l.selectorCount; slotIndex++) { bytes32 slot = l.selectorSlots[slotIndex]; for ( uint256 selectorSlotIndex; selectorSlotIndex < 8; selectorSlotIndex++ ) { selectorIndex++; if (selectorIndex > l.selectorCount) { break; } bytes4 selector = bytes4(slot << (selectorSlotIndex << 5)); address facet = address(bytes20(l.facets[selector])); bool continueLoop; for (uint256 facetIndex; facetIndex < numFacets; facetIndex++) { if (facet == addresses[facetIndex]) { continueLoop = true; break; } } if (continueLoop) { continue; } addresses[numFacets] = facet; numFacets++; } } // set the number of facet addresses in the array assembly { mstore(addresses, numFacets) } } /** * @inheritdoc IDiamondReadable */ function facetAddress( bytes4 selector ) external view returns (address facet) { facet = address(bytes20(DiamondBaseStorage.layout().facets[selector])); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { OwnableInternal } from '../../../access/ownable/OwnableInternal.sol'; import { IDiamondWritable } from './IDiamondWritable.sol'; import { DiamondWritableInternal } from './DiamondWritableInternal.sol'; /** * @title EIP-2535 "Diamond" proxy update contract */ abstract contract DiamondWritable is IDiamondWritable, DiamondWritableInternal, OwnableInternal { /** * @inheritdoc IDiamondWritable */ function diamondCut( FacetCut[] calldata facetCuts, address target, bytes calldata data ) external onlyOwner { _diamondCut(facetCuts, target, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { ISafeOwnable } from '../../access/ownable/ISafeOwnable.sol'; import { IERC165 } from '../../interfaces/IERC165.sol'; import { IDiamondBase } from './base/IDiamondBase.sol'; import { IDiamondFallback } from './fallback/IDiamondFallback.sol'; import { IDiamondReadable } from './readable/IDiamondReadable.sol'; import { IDiamondWritable } from './writable/IDiamondWritable.sol'; interface ISolidStateDiamond is IDiamondBase, IDiamondFallback, IDiamondReadable, IDiamondWritable, ISafeOwnable, IERC165 { receive() external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { IOwnableInternal } from './IOwnableInternal.sol'; interface IOwnable is IOwnableInternal, IERC173 {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173 } from '../../interfaces/IERC173.sol'; import { AddressUtils } from '../../utils/AddressUtils.sol'; import { IOwnableInternal } from './IOwnableInternal.sol'; import { OwnableStorage } from './OwnableStorage.sol'; abstract contract OwnableInternal is IOwnableInternal { using AddressUtils for address; modifier onlyOwner() { if (msg.sender != _owner()) revert Ownable__NotOwner(); _; } modifier onlyTransitiveOwner() { if (msg.sender != _transitiveOwner()) revert Ownable__NotTransitiveOwner(); _; } function _owner() internal view virtual returns (address) { return OwnableStorage.layout().owner; } function _transitiveOwner() internal view virtual returns (address owner) { owner = _owner(); while (owner.isContract()) { try IERC173(owner).owner() returns (address transitiveOwner) { owner = transitiveOwner; } catch { break; } } } function _transferOwnership(address account) internal virtual { _setOwner(account); } function _setOwner(address account) internal virtual { OwnableStorage.Layout storage l = OwnableStorage.layout(); emit OwnershipTransferred(l.owner, account); l.owner = account; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IOwnable } from './IOwnable.sol'; import { ISafeOwnableInternal } from './ISafeOwnableInternal.sol'; interface ISafeOwnable is ISafeOwnableInternal, IOwnable { /** * @notice get the nominated owner who has permission to call acceptOwnership */ function nomineeOwner() external view returns (address); /** * @notice accept transfer of contract ownership */ function acceptOwnership() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { ISafeOwnableInternal } from './ISafeOwnableInternal.sol'; import { OwnableInternal } from './OwnableInternal.sol'; import { SafeOwnableStorage } from './SafeOwnableStorage.sol'; abstract contract SafeOwnableInternal is ISafeOwnableInternal, OwnableInternal { modifier onlyNomineeOwner() { if (msg.sender != _nomineeOwner()) revert SafeOwnable__NotNomineeOwner(); _; } /** * @notice get the nominated owner who has permission to call acceptOwnership */ function _nomineeOwner() internal view virtual returns (address) { return SafeOwnableStorage.layout().nomineeOwner; } /** * @notice accept transfer of contract ownership */ function _acceptOwnership() internal virtual { _setOwner(msg.sender); delete SafeOwnableStorage.layout().nomineeOwner; } /** * @notice grant permission to given address to claim contract ownership */ function _transferOwnership(address account) internal virtual override { _setNomineeOwner(account); } /** * @notice set nominee owner */ function _setNomineeOwner(address account) internal virtual { SafeOwnableStorage.layout().nomineeOwner = account; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title ERC165 interface registration interface */ interface IERC165Internal { }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title Partial ERC173 interface needed by internal functions */ interface IERC173Internal { event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IERC165 } from '../../../interfaces/IERC165.sol'; import { IERC165BaseInternal } from './IERC165BaseInternal.sol'; interface IERC165Base is IERC165, IERC165BaseInternal {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC165BaseInternal } from './IERC165BaseInternal.sol'; import { ERC165BaseStorage } from './ERC165BaseStorage.sol'; /** * @title ERC165 implementation */ abstract contract ERC165BaseInternal is IERC165BaseInternal { /** * @notice indicates whether an interface is already supported based on the interfaceId * @param interfaceId id of interface to check * @return bool indicating whether interface is supported */ function _supportsInterface( bytes4 interfaceId ) internal view virtual returns (bool) { return ERC165BaseStorage.layout().supportedInterfaces[interfaceId]; } /** * @notice sets status of interface support * @param interfaceId id of interface to set status for * @param status boolean indicating whether interface will be set as supported */ function _setSupportsInterface( bytes4 interfaceId, bool status ) internal virtual { if (interfaceId == 0xffffffff) revert ERC165Base__InvalidInterfaceId(); ERC165BaseStorage.layout().supportedInterfaces[interfaceId] = status; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library ERC165BaseStorage { struct Layout { mapping(bytes4 => bool) supportedInterfaces; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.ERC165Base'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { AddressUtils } from '../utils/AddressUtils.sol'; import { IProxy } from './IProxy.sol'; /** * @title Base proxy contract */ abstract contract Proxy is IProxy { using AddressUtils for address; /** * @notice delegate all calls to implementation contract * @dev reverts if implementation address contains no code, for compatibility with metamorphic contracts * @dev memory location in use by assembly may be unsafe in other contexts */ fallback() external payable virtual { address implementation = _getImplementation(); if (!implementation.isContract()) revert Proxy__ImplementationIsNotContract(); assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall( gas(), implementation, 0, calldatasize(), 0, 0 ) returndatacopy(0, 0, returndatasize()) switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @notice get logic implementation address * @return implementation address */ function _getImplementation() internal virtual returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IProxy } from '../../IProxy.sol'; interface IDiamondBase is IProxy {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @dev derived from https://github.com/mudgen/diamond-2 (MIT license) */ library DiamondBaseStorage { struct Layout { // function selector => (facet address, selector slot position) mapping(bytes4 => bytes32) facets; // total number of selectors registered uint16 selectorCount; // array of selector slots with 8 selectors per slot mapping(uint256 => bytes32) selectorSlots; address fallbackAddress; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.DiamondBase'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IDiamondBase } from '../base/IDiamondBase.sol'; interface IDiamondFallback is IDiamondBase { /** * @notice query the address of the fallback implementation * @return fallbackAddress address of fallback implementation */ function getFallbackAddress() external view returns (address fallbackAddress); /** * @notice set the address of the fallback implementation * @param fallbackAddress address of fallback implementation */ function setFallbackAddress(address fallbackAddress) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title Diamond proxy introspection interface * @dev see https://eips.ethereum.org/EIPS/eip-2535 */ interface IDiamondReadable { struct Facet { address target; bytes4[] selectors; } /** * @notice get all facets and their selectors * @return diamondFacets array of structured facet data */ function facets() external view returns (Facet[] memory diamondFacets); /** * @notice get all selectors for given facet address * @param facet address of facet to query * @return selectors array of function selectors */ function facetFunctionSelectors( address facet ) external view returns (bytes4[] memory selectors); /** * @notice get addresses of all facets used by diamond * @return addresses array of facet addresses */ function facetAddresses() external view returns (address[] memory addresses); /** * @notice get the address of the facet associated with given selector * @param selector function selector to query * @return facet facet address (zero address if not found) */ function facetAddress( bytes4 selector ) external view returns (address facet); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IDiamondWritableInternal } from './IDiamondWritableInternal.sol'; /** * @title Diamond proxy upgrade interface * @dev see https://eips.ethereum.org/EIPS/eip-2535 */ interface IDiamondWritable is IDiamondWritableInternal { /** * @notice update diamond facets and optionally execute arbitrary initialization function * @param facetCuts array of structured Diamond facet update data * @param target optional target of initialization delegatecall * @param data optional initialization function call data */ function diamondCut( FacetCut[] calldata facetCuts, address target, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { AddressUtils } from "../../../utils/AddressUtils.sol"; import { DiamondBaseStorage } from "../base/DiamondBaseStorage.sol"; import { IDiamondWritableInternal } from "./IDiamondWritableInternal.sol"; abstract contract DiamondWritableInternal is IDiamondWritableInternal { using AddressUtils for address; bytes32 private constant CLEAR_ADDRESS_MASK = bytes32(uint256(0xffffffffffffffffffffffff)); bytes32 private constant CLEAR_SELECTOR_MASK = bytes32(uint256(0xffffffff << 224)); /** * @notice update functions callable on Diamond proxy * @param facetCuts array of structured Diamond facet update data * @param target optional recipient of initialization delegatecall * @param data optional initialization call data */ function _diamondCut(FacetCut[] memory facetCuts, address target, bytes memory data) internal { DiamondBaseStorage.Layout storage l = DiamondBaseStorage.layout(); unchecked { uint256 originalSelectorCount = l.selectorCount; uint256 selectorCount = originalSelectorCount; bytes32 selectorSlot; // Check if last selector slot is not full if (selectorCount & 7 > 0) { // get last selectorSlot selectorSlot = l.selectorSlots[selectorCount >> 3]; } for (uint256 i; i < facetCuts.length; i++) { FacetCut memory facetCut = facetCuts[i]; FacetCutAction action = facetCut.action; if (facetCut.selectors.length == 0) { revert DiamondWritable__SelectorNotSpecified(); } if (action == FacetCutAction.ADD) { (selectorCount, selectorSlot) = _addFacetSelectors(l, selectorCount, selectorSlot, facetCut); } else if (action == FacetCutAction.REPLACE) { _replaceFacetSelectors(l, facetCut); } else if (action == FacetCutAction.REMOVE) { (selectorCount, selectorSlot) = _removeFacetSelectors(l, selectorCount, selectorSlot, facetCut); } } if (selectorCount != originalSelectorCount) { l.selectorCount = uint16(selectorCount); } // If last selector slot is not full if (selectorCount & 7 > 0) { l.selectorSlots[selectorCount >> 3] = selectorSlot; } emit DiamondCut(facetCuts, target, data); _initialize(target, data); } } function _addFacetSelectors( DiamondBaseStorage.Layout storage l, uint256 selectorCount, bytes32 selectorSlot, FacetCut memory facetCut ) internal returns (uint256, bytes32) { unchecked { if (facetCut.target != address(this) && !facetCut.target.isContract()) { revert DiamondWritable__TargetHasNoCode(); } for (uint256 i; i < facetCut.selectors.length; i++) { bytes4 selector = facetCut.selectors[i]; bytes32 oldFacet = l.facets[selector]; if (address(bytes20(oldFacet)) != address(0)) { revert DiamondWritable__SelectorAlreadyAdded(); } // add facet for selector l.facets[selector] = bytes20(facetCut.target) | bytes32(selectorCount); 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) { l.selectorSlots[selectorCount >> 3] = selectorSlot; selectorSlot = 0; } selectorCount++; } return (selectorCount, selectorSlot); } } function _removeFacetSelectors( DiamondBaseStorage.Layout storage l, uint256 selectorCount, bytes32 selectorSlot, FacetCut memory facetCut ) internal returns (uint256, bytes32) { unchecked { if (facetCut.target != address(0)) { revert DiamondWritable__RemoveTargetNotZeroAddress(); } uint256 selectorSlotCount = selectorCount >> 3; uint256 selectorInSlotIndex = selectorCount & 7; for (uint256 i; i < facetCut.selectors.length; i++) { bytes4 selector = facetCut.selectors[i]; bytes32 oldFacet = l.facets[selector]; if (address(bytes20(oldFacet)) == address(0)) { revert DiamondWritable__SelectorNotFound(); } if (address(bytes20(oldFacet)) == address(this)) { revert DiamondWritable__SelectorIsImmutable(); } if (selectorSlot == 0) { selectorSlotCount--; selectorSlot = l.selectorSlots[selectorSlotCount]; selectorInSlotIndex = 7; } else { selectorInSlotIndex--; } bytes4 lastSelector; uint256 oldSelectorsSlotCount; uint256 oldSelectorInSlotPosition; // adding a block here prevents stack too deep error { // replace selector with last selector in l.facets lastSelector = bytes4(selectorSlot << (selectorInSlotIndex << 5)); if (lastSelector != selector) { // update last selector slot position info l.facets[lastSelector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(l.facets[lastSelector]); } delete l.facets[selector]; uint256 oldSelectorCount = uint16(uint256(oldFacet)); oldSelectorsSlotCount = oldSelectorCount >> 3; oldSelectorInSlotPosition = (oldSelectorCount & 7) << 5; } if (oldSelectorsSlotCount != selectorSlotCount) { bytes32 oldSelectorSlot = l.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 l.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 l.selectorSlots[selectorSlotCount]; selectorSlot = 0; } } selectorCount = (selectorSlotCount << 3) | selectorInSlotIndex; return (selectorCount, selectorSlot); } } function _replaceFacetSelectors(DiamondBaseStorage.Layout storage l, FacetCut memory facetCut) internal { unchecked { if (!facetCut.target.isContract()) { revert DiamondWritable__TargetHasNoCode(); } for (uint256 i; i < facetCut.selectors.length; i++) { bytes4 selector = facetCut.selectors[i]; bytes32 oldFacet = l.facets[selector]; address oldFacetAddress = address(bytes20(oldFacet)); if (oldFacetAddress == address(0)) { revert DiamondWritable__SelectorNotFound(); } if (oldFacetAddress == address(this)) { revert DiamondWritable__SelectorIsImmutable(); } if (oldFacetAddress == facetCut.target) { revert DiamondWritable__ReplaceTargetIsIdentical(); } // replace old facet address l.facets[selector] = (oldFacet & CLEAR_ADDRESS_MASK) | bytes20(facetCut.target); } } } function _initialize(address target, bytes memory data) private { if ((target == address(0)) != (data.length == 0)) { revert DiamondWritable__InvalidInitializationParameters(); } if (target != address(0)) { if (target != address(this)) { if (!target.isContract()) { revert DiamondWritable__TargetHasNoCode(); } } (bool success,) = target.delegatecall(data); if (!success) { assembly { returndatacopy(0, 0, returndatasize()) revert(0, returndatasize()) } } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IERC173Internal } from '../../interfaces/IERC173Internal.sol'; interface IOwnableInternal is IERC173Internal { error Ownable__NotOwner(); error Ownable__NotTransitiveOwner(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { UintUtils } from './UintUtils.sol'; library AddressUtils { using UintUtils for uint256; error AddressUtils__InsufficientBalance(); error AddressUtils__NotContract(); error AddressUtils__SendValueFailed(); function toString(address account) internal pure returns (string memory) { return uint256(uint160(account)).toHexString(20); } function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable account, uint256 amount) internal { (bool success, ) = account.call{ value: amount }(''); if (!success) revert AddressUtils__SendValueFailed(); } function functionCall( address target, bytes memory data ) internal returns (bytes memory) { return functionCall(target, data, 'AddressUtils: failed low-level call'); } function functionCall( address target, bytes memory data, string memory error ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, error); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, 'AddressUtils: failed low-level call with value' ); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory error ) internal returns (bytes memory) { if (value > address(this).balance) revert AddressUtils__InsufficientBalance(); return _functionCallWithValue(target, data, value, error); } /** * @notice execute arbitrary external call with limited gas usage and amount of copied return data * @dev derived from https://github.com/nomad-xyz/ExcessivelySafeCall (MIT License) * @param target recipient of call * @param gasAmount gas allowance for call * @param value native token value to include in call * @param maxCopy maximum number of bytes to copy from return data * @param data encoded call data * @return success whether call is successful * @return returnData copied return data */ function excessivelySafeCall( address target, uint256 gasAmount, uint256 value, uint16 maxCopy, bytes memory data ) internal returns (bool success, bytes memory returnData) { returnData = new bytes(maxCopy); assembly { // execute external call via assembly to avoid automatic copying of return data success := call( gasAmount, target, value, add(data, 0x20), mload(data), 0, 0 ) // determine whether to limit amount of data to copy let toCopy := returndatasize() if gt(toCopy, maxCopy) { toCopy := maxCopy } // store the length of the copied bytes mstore(returnData, toCopy) // copy the bytes from returndata[0:toCopy] returndatacopy(add(returnData, 0x20), 0, toCopy) } } function _functionCallWithValue( address target, bytes memory data, uint256 value, string memory error ) private returns (bytes memory) { if (!isContract(target)) revert AddressUtils__NotContract(); (bool success, bytes memory returnData) = target.call{ value: value }( data ); if (success) { return returnData; } else if (returnData.length > 0) { assembly { let returnData_size := mload(returnData) revert(add(32, returnData), returnData_size) } } else { revert(error); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library OwnableStorage { struct Layout { address owner; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.Ownable'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import { IOwnableInternal } from './IOwnableInternal.sol'; interface ISafeOwnableInternal is IOwnableInternal { error SafeOwnable__NotNomineeOwner(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; library SafeOwnableStorage { struct Layout { address nomineeOwner; } bytes32 internal constant STORAGE_SLOT = keccak256('solidstate.contracts.storage.SafeOwnable'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IERC165Internal } from '../../../interfaces/IERC165Internal.sol'; interface IERC165BaseInternal is IERC165Internal { error ERC165Base__InvalidInterfaceId(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; interface IProxy { error Proxy__ImplementationIsNotContract(); fallback() external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; interface IDiamondWritableInternal { enum FacetCutAction { ADD, REPLACE, REMOVE } event DiamondCut(FacetCut[] facetCuts, address target, bytes data); error DiamondWritable__InvalidInitializationParameters(); error DiamondWritable__RemoveTargetNotZeroAddress(); error DiamondWritable__ReplaceTargetIsIdentical(); error DiamondWritable__SelectorAlreadyAdded(); error DiamondWritable__SelectorIsImmutable(); error DiamondWritable__SelectorNotFound(); error DiamondWritable__SelectorNotSpecified(); error DiamondWritable__TargetHasNoCode(); struct FacetCut { address target; FacetCutAction action; bytes4[] selectors; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /** * @title utility functions for uint256 operations * @dev derived from https://github.com/OpenZeppelin/openzeppelin-contracts/ (MIT license) */ library UintUtils { error UintUtils__InsufficientHexLength(); bytes16 private constant HEX_SYMBOLS = '0123456789abcdef'; function add(uint256 a, int256 b) internal pure returns (uint256) { return b < 0 ? sub(a, -b) : a + uint256(b); } function sub(uint256 a, int256 b) internal pure returns (uint256) { return b < 0 ? add(a, -b) : a - uint256(b); } function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return '0'; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return '0x00'; } uint256 length = 0; for (uint256 temp = value; temp != 0; temp >>= 8) { unchecked { length++; } } return toHexString(value, length); } function toHexString( uint256 value, uint256 length ) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = '0'; buffer[1] = 'x'; unchecked { for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_SYMBOLS[value & 0xf]; value >>= 4; } } if (value != 0) revert UintUtils__InsufficientHexLength(); return string(buffer); } }
{ "remappings": [ "@chainlink/=node_modules/@chainlink/", "@eth-optimism/=node_modules/@eth-optimism/", "@openzeppelin/=node_modules/@openzeppelin/", "@solidstate/=node_modules/@solidstate/", "@uniswap/=node_modules/@uniswap/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solady/=lib/solady/src/", "solmate/=lib/solmate/src/", "lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/", "lib/solady:ds-test/=lib/solady/lib/ds-test/src/", "lib/solady:forge-std/=lib/solady/test/utils/forge-std/", "lib/solmate:ds-test/=lib/solmate/lib/ds-test/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": false }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"DiamondWritable__InvalidInitializationParameters","type":"error"},{"inputs":[],"name":"DiamondWritable__RemoveTargetNotZeroAddress","type":"error"},{"inputs":[],"name":"DiamondWritable__ReplaceTargetIsIdentical","type":"error"},{"inputs":[],"name":"DiamondWritable__SelectorAlreadyAdded","type":"error"},{"inputs":[],"name":"DiamondWritable__SelectorIsImmutable","type":"error"},{"inputs":[],"name":"DiamondWritable__SelectorNotFound","type":"error"},{"inputs":[],"name":"DiamondWritable__SelectorNotSpecified","type":"error"},{"inputs":[],"name":"DiamondWritable__TargetHasNoCode","type":"error"},{"inputs":[],"name":"ERC165Base__InvalidInterfaceId","type":"error"},{"inputs":[],"name":"Ownable__NotOwner","type":"error"},{"inputs":[],"name":"Ownable__NotTransitiveOwner","type":"error"},{"inputs":[],"name":"Proxy__ImplementationIsNotContract","type":"error"},{"inputs":[],"name":"SafeOwnable__NotNomineeOwner","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"enum IDiamondWritableInternal.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"indexed":false,"internalType":"struct IDiamondWritableInternal.FacetCut[]","name":"facetCuts","type":"tuple[]"},{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"DiamondCut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"enum IDiamondWritableInternal.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"internalType":"struct IDiamondWritableInternal.FacetCut[]","name":"facetCuts","type":"tuple[]"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"diamondCut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"facetAddress","outputs":[{"internalType":"address","name":"facet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facetAddresses","outputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"facet","type":"address"}],"name":"facetFunctionSelectors","outputs":[{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"facets","outputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"internalType":"struct IDiamondReadable.Facet[]","name":"diamondFacets","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFallbackAddress","outputs":[{"internalType":"address","name":"fallbackAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nomineeOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fallbackAddress","type":"address"}],"name":"setFallbackAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106100ab5760003560e01c80638ab5150a116100645780638ab5150a146102205780638da5cb5b14610235578063914237651461024a578063adfca15e1461026a578063cdffacc614610297578063f2fde38b146102de576100b2565b806301ffc9a71461010c5780631f931c1c1461017a5780632c4080591461019a57806352ef6b2c146101c757806379ba5097146101e95780637a0ed627146101fe576100b2565b366100b257005b60006100bc6102fe565b90506001600160a01b0381163b6100e6576040516321f27f0d60e21b815260040160405180910390fd5b3660008037600080366000845af43d6000803e808015610105573d6000f35b3d6000fd5b005b34801561011857600080fd5b5061016561012736600461153d565b6001600160e01b03191660009081527ffc606c433378e3a7e0a6a531deac289b66caa1b4aa8554fd4ab2c6f1570f92d8602052604090205460ff1690565b60405190151581526020015b60405180910390f35b34801561018657600080fd5b5061010a6101953660046115bf565b61030d565b3480156101a657600080fd5b506101af610397565b6040516001600160a01b039091168152602001610171565b3480156101d357600080fd5b506101dc6103ca565b6040516101719190611671565b3480156101f557600080fd5b5061010a61057c565b34801561020a57600080fd5b506102136105bf565b6040516101719190611703565b34801561022c57600080fd5b506101af6109f6565b34801561024157600080fd5b506101af610a00565b34801561025657600080fd5b5061010a610265366004611780565b610a0a565b34801561027657600080fd5b5061028a610285366004611780565b610a83565b604051610171919061179b565b3480156102a357600080fd5b506101af6102b236600461153d565b6001600160e01b0319166000908152600080516020611b75833981519152602052604090205460601c90565b3480156102ea57600080fd5b5061010a6102f9366004611780565b610bde565b6000610308610c20565b905090565b610315610c81565b6001600160a01b0316336001600160a01b03161461034657604051632f7a8ee160e01b815260040160405180910390fd5b6103906103538587611871565b8484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610cb492505050565b5050505050565b60006103087f177481ac65e4292921c69f62d1cc7f57541261e5d61c8175cf4e36a01c9bfc96546001600160a01b031690565b600080516020611b5583398151915254606090600080516020611b758339815191529061ffff1667ffffffffffffffff811115610409576104096117dd565b604051908082528060200260200182016040528015610432578160200160208202803683370190505b50915060008060005b600184015461ffff16821015610574576000818152600285016020526040812054905b600881101561055f5783610471816119bb565b600188015490955061ffff168511905061055f57600581901b82901b6001600160e01b0319811660009081526020889052604081205460601c90805b88811015610502578a81815181106104c7576104c76119d4565b60200260200101516001600160a01b0316836001600160a01b0316036104f05760019150610502565b806104fa816119bb565b9150506104ad565b5080156105115750505061054d565b818a8981518110610524576105246119d4565b6001600160a01b039092166020928302919091019091015287610546816119bb565b9850505050505b80610557816119bb565b91505061045e565b5050808061056c906119bb565b91505061043b565b505082525090565b610584610e70565b6001600160a01b0316336001600160a01b0316146105b55760405163efd1052d60e01b815260040160405180910390fd5b6105bd610e98565b565b600080516020611b5583398151915254606090600080516020611b758339815191529061ffff1667ffffffffffffffff8111156105fe576105fe6117dd565b60405190808252806020026020018201604052801561064457816020015b60408051808201909152600081526060602082015281526020019060019003908161061c5790505b50600182015490925060009061ffff1667ffffffffffffffff81111561066c5761066c6117dd565b604051908082528060200260200182016040528015610695578160200160208202803683370190505b50905060008060005b600185015461ffff16821015610984576000818152600286016020526040812054905b600881101561096f57836106d4816119bb565b600189015490955061ffff168511905061096f57600581901b82901b6001600160e01b0319811660009081526020899052604081205460601c90805b8881101561082d57826001600160a01b03168c8281518110610734576107346119d4565b6020026020010151600001516001600160a01b03160361081b57838c8281518110610761576107616119d4565b6020026020010151602001518b838151811061077f5761077f6119d4565b602002602001015160ff168151811061079a5761079a6119d4565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060ff8a82815181106107d0576107d06119d4565b602002602001015160ff16106107e557600080fd5b8981815181106107f7576107f76119d4565b60200260200101805180919061080c906119ea565b60ff169052506001915061082d565b80610825816119bb565b915050610710565b50801561083c5750505061095d565b818b898151811061084f5761084f6119d4565b60209081029190910101516001600160a01b03909116905260018a015461ffff1667ffffffffffffffff811115610888576108886117dd565b6040519080825280602002602001820160405280156108b1578160200160208202803683370190505b508b89815181106108c4576108c46119d4565b602002602001015160200181905250828b89815181106108e6576108e66119d4565b602002602001015160200151600081518110610904576109046119d4565b60200260200101906001600160e01b03191690816001600160e01b03191681525050600189898151811061093a5761093a6119d4565b60ff9092166020928302919091019091015287610956816119bb565b9850505050505b80610967816119bb565b9150506106c1565b5050808061097c906119bb565b91505061069e565b5060005b828110156109eb5760008482815181106109a4576109a46119d4565b602002602001015160ff16905060008783815181106109c5576109c56119d4565b6020026020010151602001519050818152505080806109e3906119bb565b915050610988565b508185525050505090565b6000610308610e70565b6000610308610c81565b610a12610c81565b6001600160a01b0316336001600160a01b031614610a4357604051632f7a8ee160e01b815260040160405180910390fd5b7f177481ac65e4292921c69f62d1cc7f57541261e5d61c8175cf4e36a01c9bfc9680546001600160a01b0319166001600160a01b03831617905550565b50565b600080516020611b5583398151915254606090600080516020611b758339815191529061ffff1667ffffffffffffffff811115610ac257610ac26117dd565b604051908082528060200260200182016040528015610aeb578160200160208202803683370190505b50915060008060005b600184015461ffff16821015610bd4576000818152600285016020526040812054905b6008811015610bbf5783610b2a816119bb565b600188015490955061ffff1685119050610bbf57600581901b82901b6001600160e01b0319811660009081526020889052604090205460601c6001600160a01b038a1603610bac5780888781518110610b8557610b856119d4565b6001600160e01b03199092166020928302919091019091015285610ba8816119bb565b9650505b5080610bb7816119bb565b915050610b17565b50508080610bcc906119bb565b915050610af4565b5050825250919050565b610be6610c81565b6001600160a01b0316336001600160a01b031614610c1757604051632f7a8ee160e01b815260040160405180910390fd5b610a8081610ed2565b600080356001600160e01b0319168152600080516020611b75833981519152602052604090205460601c80610c7e57507f177481ac65e4292921c69f62d1cc7f57541261e5d61c8175cf4e36a01c9bfc96546001600160a01b031690565b90565b60007f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f6716804605b546001600160a01b0316919050565b600080516020611b5583398151915254600080516020611b758339815191529061ffff811690819060009060071615610cff5750600381901c60009081526002840160205260409020545b60005b8751811015610de4576000888281518110610d1f57610d1f6119d4565b60200260200101519050600081602001519050816040015151600003610d585760405163eb6c3aeb60e01b815260040160405180910390fd5b6000816002811115610d6c57610d6c611a09565b03610d8757610d7d87868685610f15565b9095509350610dda565b6001816002811115610d9b57610d9b611a09565b03610daf57610daa8783611054565b610dda565b6002816002811115610dc357610dc3611a09565b03610dda57610dd48786868561119f565b90955093505b5050600101610d02565b50828214610e005760018401805461ffff191661ffff84161790555b6007821615610e2257600382901c600090815260028501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051610e5593929190611a6f565b60405180910390a1610e6786866113c2565b50505050505050565b60007f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce6617890610ca5565b610ea1336114a6565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319169055565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b038316179055610a8081818181565b805160009081906001600160a01b03163014801590610f3d575082516001600160a01b03163b155b15610f5b57604051633ddc5cab60e21b815260040160405180910390fd5b60005b83604001515181101561104757600084604001518281518110610f8357610f836119d4565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c15610fcf57604051634923a77160e11b815260040160405180910390fd5b85516001600160e01b0319838116600081815260208d90526040902060609390931b6001600160601b0319168b1790925560058a901b60e090811692831c91831c1999909916179781900361103857600389901c600090815260028b0160205260408120989098555b50505060019586019501610f5e565b5093959294509192505050565b80516001600160a01b03163b61107d57604051633ddc5cab60e21b815260040160405180910390fd5b60005b81604001515181101561119a576000826040015182815181106110a5576110a56119d4565b6020908102919091018101516001600160e01b03198116600090815291869052604090912054909150606081901c806110f1576040516337e25a9760e11b815260040160405180910390fd5b306001600160a01b0382160361111a5760405163e983573160e01b815260040160405180910390fd5b84600001516001600160a01b0316816001600160a01b031603611150576040516330baabf360e11b815260040160405180910390fd5b5083516001600160e01b031992909216600090815260208690526040902060609290921b6001600160601b0319166bffffffffffffffffffffffff91909116179055600101611080565b505050565b805160009081906001600160a01b0316156111cd57604051633ab3490960e21b815260040160405180910390fd5b600385901c6007861660005b8560400151518110156113ae576000866040015182815181106111fe576111fe6119d4565b6020908102919091018101516001600160e01b031981166000908152918c9052604090912054909150606081901c611249576040516337e25a9760e11b815260040160405180910390fd5b30606082901c0361126d5760405163e983573160e01b815260040160405180910390fd5b600089900361129957600019909401600081815260028c016020526040902054985093600793506112a1565b600019909301925b600584901b89901b6000806001600160e01b0319808416908616146112f8576001600160e01b03198316600090815260208f90526040902080546001600160601b0319166bffffffffffffffffffffffff86161790555b50506001600160e01b03198316600090815260208d90526040812055611fff600383901c1660e0600584901b1687821461135b57600082815260028f016020526040902080546001600160e01b031980841c19909116908516831c17905561137f565b80836001600160e01b031916901c816001600160e01b031960001b901c198d16179b505b8660000361139d57600088815260028f01602052604081208190559b505b5050600190930192506111d9915050565b5060039190911b1796939550929350505050565b8051156001600160a01b03831615146113ee576040516326df4ccd60e01b815260040160405180910390fd5b6001600160a01b038216156114a2576001600160a01b0382163014611435576001600160a01b0382163b61143557604051633ddc5cab60e21b815260040160405180910390fd5b6000826001600160a01b03168260405161144f9190611b38565b600060405180830381855af49150503d806000811461148a576040519150601f19603f3d011682016040523d82523d6000602084013e61148f565b606091505b505090508061119a573d6000803e3d6000fd5b5050565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160e01b03198116811461153857600080fd5b919050565b60006020828403121561154f57600080fd5b61155882611520565b9392505050565b80356001600160a01b038116811461153857600080fd5b60008083601f84011261158857600080fd5b50813567ffffffffffffffff8111156115a057600080fd5b6020830191508360208285010111156115b857600080fd5b9250929050565b6000806000806000606086880312156115d757600080fd5b853567ffffffffffffffff808211156115ef57600080fd5b818801915088601f83011261160357600080fd5b81358181111561161257600080fd5b8960208260051b850101111561162757600080fd5b6020830197508096505061163d6020890161155f565b9450604088013591508082111561165357600080fd5b5061166088828901611576565b969995985093965092949392505050565b6020808252825182820181905260009190848201906040850190845b818110156116b25783516001600160a01b03168352928401929184019160010161168d565b50909695505050505050565b600081518084526020808501945080840160005b838110156116f85781516001600160e01b031916875295820195908201906001016116d2565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561177257888303603f19018552815180516001600160a01b0316845287015187840187905261175f878501826116be565b958801959350509086019060010161172a565b509098975050505050505050565b60006020828403121561179257600080fd5b6115588261155f565b6020808252825182820181905260009190848201906040850190845b818110156116b25783516001600160e01b031916835292840192918401916001016117b7565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611816576118166117dd565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611845576118456117dd565b604052919050565b600067ffffffffffffffff821115611867576118676117dd565b5060051b60200190565b600061188461187f8461184d565b61181c565b83815260208082019190600586811b8601368111156118a257600080fd5b865b8181101561199857803567ffffffffffffffff808211156118c55760008081fd5b818a019150606082360312156118db5760008081fd5b6118e36117f3565b6118ec8361155f565b815286830135600381106119005760008081fd5b81880152604083810135838111156119185760008081fd5b939093019236601f85011261192f57600092508283fd5b8335925061193f61187f8461184d565b83815292871b8401880192888101903685111561195c5760008081fd5b948901945b848610156119815761197286611520565b82529489019490890190611961565b9183019190915250885250509483019483016118a4565b5092979650505050505050565b634e487b7160e01b600052601160045260246000fd5b6000600182016119cd576119cd6119a5565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103611a0057611a006119a5565b60010192915050565b634e487b7160e01b600052602160045260246000fd5b60005b83811015611a3a578181015183820152602001611a22565b50506000910152565b60008151808452611a5b816020860160208601611a1f565b601f01601f19169290920160200192915050565b6000606080830181845280875180835260808601915060808160051b87010192506020808a016000805b84811015611b0857898703607f19018652825180516001600160a01b031688528481015160038110611ad957634e487b7160e01b84526021600452602484fd5b88860152604090810151908801899052611af5898901826116be565b9750509483019491830191600101611a99565b5050506001600160a01b0389169087015250508381036040850152611b2d8186611a43565b979650505050505050565b60008251611b4a818460208701611a1f565b919091019291505056fe177481ac65e4292921c69f62d1cc7f57541261e5d61c8175cf4e36a01c9bfc94177481ac65e4292921c69f62d1cc7f57541261e5d61c8175cf4e36a01c9bfc93
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.