0%
    Verified
  • Verified
  • Proxy

This contract is a proxy and the implementation details are not yet known.

0x3853ec5742df47a6d7bafeb19c4716a9eedf8fc4
Copied
Copied
Diamond Source Code
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 * * Implementation of a diamond. /******************************************************************************/ import {LibDiamond} from "./libraries/LibDiamond.sol"; import {IDiamondCut} from "./interfaces/IDiamondCut.sol"; contract Diamond { struct Initialization { address initContract; bytes initData; } /// @notice This construct a diamond contract /// @param _contractOwner the owner of the contract. With default DiamondCutFacet, this is the sole address allowed to make further cuts. /// @param _diamondCut the list of facet to add /// @param _initializations the list of initialization pair to execute. This allow to setup a contract with multiple level of independent initialization. constructor( address _contractOwner, IDiamondCut.FacetCut[] memory _diamondCut, Initialization[] memory _initializations ) payable { if (_contractOwner != address(0)) { LibDiamond.setContractOwner(_contractOwner); } LibDiamond.diamondCut(_diamondCut, address(0), ""); for (uint256 i = 0; i < _initializations.length; i++) { LibDiamond.initializeDiamondCut(_initializations[i].initContract, _initializations[i].initData); } } // Find facet for function that is called and execute the // function if a facet is found and return any value. fallback() external payable { LibDiamond.DiamondStorage storage ds; bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION; // get diamond storage assembly { ds.slot := position } // get facet from function selector address facet = ds.selectorToFacetAndPosition[msg.sig].facetAddress; require(facet != address(0), "Diamond: Function does not exist"); // Execute external function from facet using delegatecall and return any value. assembly { // copy function selector and any arguments calldatacopy(0, 0, calldatasize()) // execute function call using the facet let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0) // get any return value returndatacopy(0, 0, returndatasize()) // return any return value or error back to the caller switch result case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } receive() external payable {} } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ interface IDiamondCut { enum FacetCutAction {Add, Replace, Remove} // Add=0, Replace=1, Remove=2 struct FacetCut { address facetAddress; FacetCutAction action; bytes4[] functionSelectors; } /// @notice Add/replace/remove any number of functions and optionally execute /// a function with delegatecall /// @param _diamondCut Contains the facet addresses and function selectors /// @param _init The address of the contract or facet to execute _calldata /// @param _calldata A function call, including function selector and arguments /// _calldata is executed with delegatecall on _init function diamondCut( FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata ) external; event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata); } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************************************************\ * Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen) * EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535 /******************************************************************************/ import { IDiamondCut } from "../interfaces/IDiamondCut.sol"; library LibDiamond { bytes32 constant DIAMOND_STORAGE_POSITION = keccak256("diamond.standard.diamond.storage"); struct FacetAddressAndPosition { address facetAddress; uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array } struct FacetFunctionSelectors { bytes4[] functionSelectors; uint256 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 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(); require(_facetAddress != address(0), "LibDiamondCut: Add facet can't be address(0)"); uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length); // add new facet address if it does not exist if (selectorPosition == 0) { addFacet(ds, _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"); addFunction(ds, selector, selectorPosition, _facetAddress); 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)"); uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length); // add new facet address if it does not exist if (selectorPosition == 0) { addFacet(ds, _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(ds, oldFacetAddress, selector); addFunction(ds, selector, selectorPosition, _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(ds, oldFacetAddress, selector); } } function addFacet(DiamondStorage storage ds, address _facetAddress) internal { enforceHasContractCode(_facetAddress, "LibDiamondCut: New facet has no code"); ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds.facetAddresses.length; ds.facetAddresses.push(_facetAddress); } function addFunction(DiamondStorage storage ds, bytes4 _selector, uint96 _selectorPosition, address _facetAddress) internal { ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = _selectorPosition; ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(_selector); ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress; } function removeFunction(DiamondStorage storage ds, address _facetAddress, bytes4 _selector) internal { 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 = uint96(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 = 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 revert(string(error)); } else { revert("LibDiamondCut: _init function reverted"); } } } } function enforceHasContractCode(address _contract, string memory _errorMessage) internal view { uint256 contractSize; assembly { contractSize := extcodesize(_contract) } require(contractSize > 0, _errorMessage); } }
Diamond ABI
Copied
[{"inputs":[{"internalType":"address","name":"_contractOwner","type":"address"},{"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[]"},{"components":[{"internalType":"address","name":"initContract","type":"address"},{"internalType":"bytes","name":"initData","type":"bytes"}],"internalType":"struct Diamond.Initialization[]","name":"_initializations","type":"tuple[]"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]
Diamond Bytecode
Copied
60806040526040516200321e3803806200321e833981016040819052620000269162001340565b6001600160a01b038316156200004c576200004c83620000f760201b620001071760201c565b62000074826000604051806020016040528060008152506200017b60201b620001c11760201c565b60005b8151811015620000ed57620000d88282815181106200009a576200009a62001514565b602002602001015160000151838381518110620000bb57620000bb62001514565b602002602001015160200151620003d960201b620004051760201c565b80620000e48162001540565b91505062000077565b505050506200173d565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080546001600160a01b031981166001600160a01b0384811691821790935560405160008051602062003172833981519152939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b83518110156200038a5760008482815181106200019f576200019f62001514565b602002602001015160200151905060006002811115620001c357620001c36200155e565b816002811115620001d857620001d86200155e565b1415620002375762000231858381518110620001f857620001f862001514565b60200260200101516000015186848151811062000219576200021962001514565b602002602001015160400151620005fe60201b60201c565b62000374565b60018160028111156200024e576200024e6200155e565b1415620002a757620002318583815181106200026e576200026e62001514565b6020026020010151600001518684815181106200028f576200028f62001514565b6020026020010151604001516200088860201b60201c565b6002816002811115620002be57620002be6200155e565b1415620003175762000231858381518110620002de57620002de62001514565b602002602001015160000151868481518110620002ff57620002ff62001514565b60200260200101516040015162000b1e60201b60201c565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084015b60405180910390fd5b5080620003818162001540565b9150506200017e565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673838383604051620003c093929190620015a2565b60405180910390a1620003d48282620003d9565b505050565b6001600160a01b03821662000463578051156200045f5760405162461bcd60e51b815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d7074790000000060648201526084016200036b565b5050565b6000815111620004dc5760405162461bcd60e51b815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f74206164647265737328302900000060648201526084016200036b565b6001600160a01b038216301462000512576200051282604051806060016040528060288152602001620031926028913962000c7e565b600080836001600160a01b0316836040516200052f9190620016a9565b600060405180830381855af49150503d80600081146200056c576040519150601f19603f3d011682016040523d82523d6000602084013e62000571565b606091505b509150915081620005f857805115620005a0578060405162461bcd60e51b81526004016200036b9190620016c7565b60405162461bcd60e51b815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e2072656044820152651d995c9d195960d21b60648201526084016200036b565b50505050565b6000815111620006545760405162461bcd60e51b815260206004820152602b6024820152600080516020620031fe83398151915260448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016200036b565b600080516020620031728339815191526001600160a01b038316620006c05760405162461bcd60e51b815260206004820152602c6024820152600080516020620031ba83398151915260448201526b65206164647265737328302960a01b60648201526084016200036b565b6001600160a01b03831660009081526001820160205260409020546001600160601b038116620006f657620006f6828562000ca2565b60005b8351811015620008815760008482815181106200071a576200071a62001514565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b03168015620007c25760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016200036b565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b031916179055836200086681620016e3565b94505050508080620008789062001540565b915050620006f9565b5050505050565b6000815111620008de5760405162461bcd60e51b815260206004820152602b6024820152600080516020620031fe83398151915260448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016200036b565b600080516020620031728339815191526001600160a01b0383166200094a5760405162461bcd60e51b815260206004820152602c6024820152600080516020620031ba83398151915260448201526b65206164647265737328302960a01b60648201526084016200036b565b6001600160a01b03831660009081526001820160205260409020546001600160601b038116620009805762000980828562000ca2565b60005b835181101562000881576000848281518110620009a457620009a462001514565b6020908102919091018101516001600160e01b031981166000908152918690526040909120549091506001600160a01b0390811690871681141562000a525760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016200036b565b62000a5f85828462000d0f565b6001600160e01b0319821660008181526020878152604080832080546001600160a01b03908116600160a01b6001600160601b038c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281546001600160a01b0319161790558362000b0381620016e3565b9450505050808062000b159062001540565b91505062000983565b600081511162000b745760405162461bcd60e51b815260206004820152602b6024820152600080516020620031fe83398151915260448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016200036b565b600080516020620031728339815191526001600160a01b0383161562000c035760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d75737420626520616464726573732830290000000000000000000060648201526084016200036b565b60005b8251811015620005f857600083828151811062000c275762000c2762001514565b6020908102919091018101516001600160e01b031981166000908152918590526040909120549091506001600160a01b031662000c6684828462000d0f565b5050808062000c759062001540565b91505062000c06565b813b8181620005f85760405162461bcd60e51b81526004016200036b9190620016c7565b62000cc781604051806060016040528060248152602001620031da6024913962000c7e565b6002820180546001600160a01b0390921660008181526001948501602090815260408220860185905594840183559182529290200180546001600160a01b0319169091179055565b6001600160a01b03821662000d8d5760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016200036b565b6001600160a01b03821630141562000dff5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016200036b565b6001600160e01b03198116600090815260208481526040808320546001600160a01b0386168452600180880190935290832054600160a01b9091046001600160601b0316929162000e50916200170d565b905080821462000f49576001600160a01b0384166000908152600186016020526040812080548390811062000e895762000e8962001514565b600091825260208083206008830401546001600160a01b038916845260018a019091526040909220805460079092166004026101000a90920460e01b92508291908590811062000edd5762000edd62001514565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790556001600160e01b03199290921682528690526040902080546001600160a01b0316600160a01b6001600160601b038516021790555b6001600160a01b0384166000908152600186016020526040902080548062000f755762000f7562001727565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a0219169055919092556001600160e01b0319851682528690526040812055806200088157600285015460009062000fd7906001906200170d565b6001600160a01b03861660009081526001808901602052604090912001549091508082146200108d5760008760020183815481106200101a576200101a62001514565b6000918252602090912001546002890180546001600160a01b0390921692508291849081106200104e576200104e62001514565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600189810190925260409020018190555b86600201805480620010a357620010a362001727565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388168252600189810190915260408220015550505050505050565b80516001600160a01b03811681146200110457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171562001144576200114462001109565b60405290565b604051606081016001600160401b038111828210171562001144576200114462001109565b604051601f8201601f191681016001600160401b03811182821017156200119a576200119a62001109565b604052919050565b60006001600160401b03821115620011be57620011be62001109565b5060051b60200190565b60005b83811015620011e5578181015183820152602001620011cb565b83811115620005f85750506000910152565b6000601f83818401126200120a57600080fd5b82516020620012236200121d83620011a2565b6200116f565b82815260059290921b850181019181810190878411156200124357600080fd5b8287015b84811015620013345780516001600160401b0380821115620012695760008081fd5b908901906040601f19838d038101821315620012855760008081fd5b6200128f6200111f565b6200129c898601620010ec565b81528285015184811115620012b15760008081fd5b8086019550508d603f860112620012c85760008081fd5b8885015184811115620012df57620012df62001109565b620012f08a848e840116016200116f565b94508085528e848288010111156200130a57600092508283fd5b6200131b818b8701868901620011c8565b5080890193909352505084525091830191830162001247565b50979650505050505050565b6000806000606084860312156200135657600080fd5b6200136184620010ec565b60208501519093506001600160401b03808211156200137f57600080fd5b818601915086601f8301126200139457600080fd5b8151620013a56200121d82620011a2565b8082825260208201915060208360051b860101925089831115620013c857600080fd5b602085015b83811015620014e057805185811115620013e657600080fd5b86016060818d03601f19011215620013fd57600080fd5b620014076200114a565b6200141560208301620010ec565b81526040820151600381106200142a57600080fd5b60208201526060820151878111156200144257600080fd5b8083019250508c603f8301126200145857600080fd5b60208201516200146c6200121d82620011a2565b81815260059190911b83016040019060208101908f8311156200148e57600080fd5b6040850194505b82851015620014c95784516001600160e01b031981168114620014b757600080fd5b82526020948501949091019062001495565b6040840152505084525060209283019201620013cd565b5060408901519096509350505080821115620014fb57600080fd5b506200150a86828701620011f7565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156200155757620015576200152a565b5060010190565b634e487b7160e01b600052602160045260246000fd5b600081518084526200158e816020860160208601620011c8565b601f01601f19169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b848110156200167757898403607f19018652815180516001600160a01b031685528381015189860190600381106200161357634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015620016615783516001600160e01b031916825292860192600192909201919086019062001635565b50978501979550505090820190600101620015cb565b50506001600160a01b038a169088015286810360408801526200169b818962001574565b9a9950505050505050505050565b60008251620016bd818460208701620011c8565b9190910192915050565b602081526000620016dc602083018462001574565b9392505050565b60006001600160601b03828116808214156200170357620017036200152a565b6001019392505050565b6000828210156200172257620017226200152a565b500390565b634e487b7160e01b600052603160045260246000fd5b611a25806200174d6000396000f3fe60806040523661000b57005b600080357fffffffff000000000000000000000000000000000000000000000000000000001681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020819052604090912054819073ffffffffffffffffffffffffffffffffffffffff16806100e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f7420657869737460448201526064015b60405180910390fd5b3660008037600080366000845af43d6000803e808015610102573d6000f35b3d6000fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c132080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811673ffffffffffffffffffffffffffffffffffffffff8481169182179093556040517fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c939092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b60005b83518110156103ba5760008482815181106101e1576101e1611657565b60200260200101516020015190506000600281111561020257610202611686565b81600281111561021457610214611686565b14156102635761025e85838151811061022f5761022f611657565b60200260200101516000015186848151811061024d5761024d611657565b6020026020010151604001516106be565b6103a7565b600181600281111561027757610277611686565b14156102c15761025e85838151811061029257610292611657565b6020026020010151600001518684815181106102b0576102b0611657565b602002602001015160400151610a71565b60028160028111156102d5576102d5611686565b141561031f5761025e8583815181106102f0576102f0611657565b60200260200101516000015186848151811061030e5761030e611657565b602002602001015160400151610e2e565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f7272656374204661636574437560448201527f74416374696f6e0000000000000000000000000000000000000000000000000060648201526084016100da565b50806103b2816116e4565b9150506101c4565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb6738383836040516103ee93929190611793565b60405180910390a16104008282610405565b505050565b73ffffffffffffffffffffffffffffffffffffffff82166104b3578051156104af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f4c69624469616d6f6e644375743a205f696e697420697320616464726573732860448201527f3029206275745f63616c6c64617461206973206e6f7420656d7074790000000060648201526084016100da565b5050565b6000815111610544576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603d60248201527f4c69624469616d6f6e644375743a205f63616c6c6461746120697320656d707460448201527f7920627574205f696e6974206973206e6f74206164647265737328302900000060648201526084016100da565b73ffffffffffffffffffffffffffffffffffffffff8216301461058357610583826040518060600160405280602881526020016119a46028913961101b565b6000808373ffffffffffffffffffffffffffffffffffffffff16836040516105ab91906118fb565b600060405180830381855af49150503d80600081146105e6576040519150601f19603f3d011682016040523d82523d6000602084013e6105eb565b606091505b5091509150816106b85780511561063057806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100da9190611917565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4c69624469616d6f6e644375743a205f696e69742066756e6374696f6e20726560448201527f766572746564000000000000000000000000000000000000000000000000000060648201526084016100da565b50505050565b600081511161074f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f2063757400000000000000000000000000000000000000000060648201526084016100da565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201527f652061646472657373283029000000000000000000000000000000000000000060648201526084016100da565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001820160205260409020546bffffffffffffffffffffffff8116610858576108588285611056565b60005b8351811015610a6a57600084828151811061087857610878611657565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff16801561095d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016100da565b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff00000000000000000000000000000000000000001617905583610a5281611931565b94505050508080610a62906116e4565b91505061085b565b5050505050565b6000815111610b02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f2063757400000000000000000000000000000000000000000060648201526084016100da565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316610bc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4c69624469616d6f6e644375743a204164642066616365742063616e2774206260448201527f652061646472657373283029000000000000000000000000000000000000000060648201526084016100da565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001820160205260409020546bffffffffffffffffffffffff8116610c0b57610c0b8285611056565b60005b8351811015610a6a576000848281518110610c2b57610c2b611657565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff908116908716811415610d16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016100da565b610d218582846110e5565b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff00000000000000000000000000000000000000001617905583610e1681611931565b94505050508080610e26906116e4565b915050610c0e565b6000815111610ebf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201527f6163657420746f2063757400000000000000000000000000000000000000000060648201526084016100da565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff831615610f84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d75737420626520616464726573732830290000000000000000000060648201526084016100da565b60005b82518110156106b8576000838281518110610fa457610fa4611657565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529185905260409091205490915073ffffffffffffffffffffffffffffffffffffffff166110068482846110e5565b50508080611013906116e4565b915050610f87565b813b81816106b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100da9190611917565b611078816040518060600160405280602481526020016119cc6024913961101b565b60028201805473ffffffffffffffffffffffffffffffffffffffff90921660008181526001948501602090815260408220860185905594840183559182529290200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b73ffffffffffffffffffffffffffffffffffffffff8216611188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016100da565b73ffffffffffffffffffffffffffffffffffffffff821630141561122e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201527f7461626c652066756e6374696f6e00000000000000000000000000000000000060648201526084016100da565b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152602084815260408083205473ffffffffffffffffffffffffffffffffffffffff86168452600180880190935290832054740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff1692916112b89161195d565b90508082146113ff5773ffffffffffffffffffffffffffffffffffffffff8416600090815260018601602052604081208054839081106112fa576112fa611657565b6000918252602080832060088304015473ffffffffffffffffffffffffffffffffffffffff8916845260018a019091526040909220805460079092166004026101000a90920460e01b92508291908590811061135857611358611657565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790557fffffffff0000000000000000000000000000000000000000000000000000000092909216825286905260409020805473ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000006bffffffffffffffffffffffff8516021790555b73ffffffffffffffffffffffffffffffffffffffff84166000908152600186016020526040902080548061143557611435611974565b6000828152602080822060087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90940193840401805463ffffffff600460078716026101000a0219169055919092557fffffffff0000000000000000000000000000000000000000000000000000000085168252869052604081205580610a6a5760028501546000906114ca9060019061195d565b73ffffffffffffffffffffffffffffffffffffffff861660009081526001808901602052604090912001549091508082146115b857600087600201838154811061151657611516611657565b60009182526020909120015460028901805473ffffffffffffffffffffffffffffffffffffffff909216925082918490811061155457611554611657565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055929091168152600189810190925260409020018190555b866002018054806115cb576115cb611974565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff88168252600189810190915260408220015550505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611716576117166116b5565b5060010190565b60005b83811015611738578181015183820152602001611720565b838111156106b85750506000910152565b6000815180845261176181602086016020860161171d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b848110156118be577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808a8503018652815188850173ffffffffffffffffffffffffffffffffffffffff82511686528482015160038110611845577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b808310156118a95783517fffffffff00000000000000000000000000000000000000000000000000000000168252928601926001929092019190860190611867565b509785019795505050908201906001016117bc565b505073ffffffffffffffffffffffffffffffffffffffff8a169088015286810360408801526118ed8189611749565b9a9950505050505050505050565b6000825161190d81846020870161171d565b9190910192915050565b60208152600061192a6020830184611749565b9392505050565b60006bffffffffffffffffffffffff80831681811415611953576119536116b5565b6001019392505050565b60008282101561196f5761196f6116b5565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfe4c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f6465a26469706673582212202b18a533b03703e1326000cf2f36b1c6ec631cff163a752d939e5ee79ad2cde364736f6c634300080a0033c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a204164642066616365742063616e277420624c69624469616d6f6e644375743a204e657720666163657420686173206e6f20636f64654c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e2066000000000000000000000000e62cff2138f0e501653bd5fd8c9a54067752f97f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000062000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004a00000000000000000000000003ba34476e28d3b0778b6dfd19a2a8619f02b2215000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000019095ea7b30000000000000000000000000000000000000000000000000000000070a082310000000000000000000000000000000000000000000000000000000025ee18f700000000000000000000000000000000000000000000000000000000c23dc68f000000000000000000000000000000000000000000000000000000005bbb217700000000000000000000000000000000000000000000000000000000081812fc000000000000000000000000000000000000000000000000000000008129fc1c00000000000000000000000000000000000000000000000000000000e985e9c5000000000000000000000000000000000000000000000000000000002ba112bc0000000000000000000000000000000000000000000000000000000006fdde03000000000000000000000000000000000000000000000000000000008da5cb5b000000000000000000000000000000000000000000000000000000006352211e0000000000000000000000000000000000000000000000000000000042842e0e00000000000000000000000000000000000000000000000000000000b88d4fde00000000000000000000000000000000000000000000000000000000a22cb4650000000000000000000000000000000000000000000000000000000055f804b3000000000000000000000000000000000000000000000000000000000c4b5a810000000000000000000000000000000000000000000000000000000001ffc9a70000000000000000000000000000000000000000000000000000000095d89b4100000000000000000000000000000000000000000000000000000000c87b56dd000000000000000000000000000000000000000000000000000000008462151c0000000000000000000000000000000000000000000000000000000099a2557a0000000000000000000000000000000000000000000000000000000018160ddd0000000000000000000000000000000000000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000000000000000000000000000429dbde7913c0ed51e4b21163760b92ee66ff5f50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000011f931c1c0000000000000000000000000000000000000000000000000000000000000000000000000000000051d21e284392bb7f652a47a6feff514071673b3e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004cdffacc60000000000000000000000000000000000000000000000000000000052ef6b2c00000000000000000000000000000000000000000000000000000000adfca15e000000000000000000000000000000000000000000000000000000007a0ed62700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000e68d85348f227d2ebee814c38918f8a2d7d9b603000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a42a84809100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000148e2b093000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ba34476e28d3b0778b6dfd19a2a8619f02b2215000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000048129fc1c00000000000000000000000000000000000000000000000000000000
Smart Contracts contract page background

Checkout more smart contracts

    Ethereum  logo

    SHILAINU

    Verified

    The following smart contract is the SHILAINU token contract, which is an ERC20 token with a total supply of 1 trillion. It includes features such as transaction limits, fees, and automatic liquidity provision. The contract also has a blacklist mode and the ability to set fee and transaction exemptions for specific addresses. The purpose of the contract is to provide a decentralized currency for the Shiba Inu community.

    0x20c3fa331a385b63ee39137e99d0cf2db142fce1
    Copied
    • Verified
    • Fungible Token
    • ERC20
    Ethereum  logo

    Token

    Verified

    The following smart contract is a token contract that implements the ERC20 standard. It includes features such as a fee system, wallet and transaction limits, and liquidity provision. The contract also allows for the destruction of tokens through a fee system. The contract is designed to be used with the Uniswap decentralized exchange.

    0xd015422879a1308ba557510345e944b912b9ab73
    Copied
    • Verified
    Ethereum  logo

    OptimizedTransparentUpgradeableProxy

    Verified

    This contract is a proxy and the implementation details are not yet known.

    0x644192291cc835a93d6330b24ea5f5fedd0eef9e
    Copied
    • Verified
    • Proxy
Section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key