Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
EmergencyPauseFacet
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import { LibDiamond } from "../Libraries/LibDiamond.sol";
import { LibDiamondLoupe } from "../Libraries/LibDiamondLoupe.sol";
import { UnAuthorized, InvalidCallData, DiamondIsPaused } from "../Errors/GenericErrors.sol";
import { IDiamondLoupe } from "lifi/Interfaces/IDiamondLoupe.sol";
import { IDiamondCut } from "lifi/Interfaces/IDiamondCut.sol";
import { DiamondCutFacet } from "lifi/Facets/DiamondCutFacet.sol";
/// @title EmergencyPauseFacet (Admin only)
/// @author LI.FI (https://li.fi)
/// @notice Allows a LI.FI-owned and -controlled, non-multisig "PauserWallet" to remove a facet or pause the diamond in case of emergency
/// @custom:version 1.0.0
/// @dev Admin-Facet for emergency purposes only
contract EmergencyPauseFacet {
/// Events ///
event EmergencyFacetRemoved(
address indexed facetAddress,
address indexed msgSender
);
event EmergencyPaused(address indexed msgSender);
event EmergencyUnpaused(address indexed msgSender);
/// Errors ///
error FacetIsNotRegistered();
error NoFacetToPause();
/// Storage ///
address public immutable pauserWallet;
bytes32 internal constant NAMESPACE =
keccak256("com.lifi.facets.emergencyPauseFacet");
address internal immutable _emergencyPauseFacetAddress;
struct Storage {
IDiamondLoupe.Facet[] facets;
}
/// Modifiers ///
modifier OnlyPauserWalletOrOwner() {
if (
msg.sender != pauserWallet &&
msg.sender != LibDiamond.contractOwner()
) revert UnAuthorized();
_;
}
/// Constructor ///
/// @param _pauserWallet The address of the wallet that can execute emergency facet removal actions
constructor(address _pauserWallet) {
pauserWallet = _pauserWallet;
_emergencyPauseFacetAddress = address(this);
}
/// External Methods ///
/// @notice Removes the given facet from the diamond
/// @param _facetAddress The address of the facet that should be removed
/// @dev can only be executed by pauserWallet (non-multisig for fast response time) or by the diamond owner
function removeFacet(
address _facetAddress
) external OnlyPauserWalletOrOwner {
// make sure that the EmergencyPauseFacet itself cannot be removed through this function
if (_facetAddress == _emergencyPauseFacetAddress)
revert InvalidCallData();
// get function selectors for this facet
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
bytes4[] memory functionSelectors = ds
.facetFunctionSelectors[_facetAddress]
.functionSelectors;
// do not continue if no registered function selectors were found
if (functionSelectors.length == 0) revert FacetIsNotRegistered();
// make sure that DiamondCutFacet cannot be removed
if (functionSelectors[0] == DiamondCutFacet.diamondCut.selector)
revert InvalidCallData();
// remove facet
LibDiamond.removeFunctions(address(0), functionSelectors);
emit EmergencyFacetRemoved(_facetAddress, msg.sender);
}
/// @notice Effectively pauses the diamond contract by overwriting the facetAddress-to-function-selector mappings in storage for all facets
/// and redirecting all function selectors to the EmergencyPauseFacet (this will remain as the only registered facet) so that
/// a meaningful error message will be returned when third parties try to call the diamond
/// @dev can only be executed by pauserWallet (non-multisig for fast response time) or by the diamond owner
/// @dev This function could potentially run out of gas if too many facets/function selectors are involved. We mitigate this issue by having a test on
/// @dev forked mainnet (which has most facets) that checks if the diamond can be paused
function pauseDiamond() external OnlyPauserWalletOrOwner {
Storage storage s = getStorage();
// get a list of all facets that need to be removed (=all facets except EmergencyPauseFacet)
IDiamondLoupe.Facet[]
memory facets = _getAllFacetFunctionSelectorsToBeRemoved();
// prevent invalid contract state
if (facets.length == 0) revert NoFacetToPause();
// go through all facets
for (uint256 i; i < facets.length; ) {
// redirect all function selectors to this facet (i.e. to its fallback function with the DiamondIsPaused() error message)
LibDiamond.replaceFunctions(
_emergencyPauseFacetAddress,
facets[i].functionSelectors
);
// write facet information to storage (so it can be easily reactivated later on)
s.facets.push(facets[i]);
// gas-efficient way to increase loop counter
unchecked {
++i;
}
}
emit EmergencyPaused(msg.sender);
}
/// @notice Unpauses the diamond contract by re-adding all facetAddress-to-function-selector mappings to storage
/// @dev can only be executed by diamond owner (multisig)
/// @param _blacklist The address(es) of facet(s) that should not be reactivated
function unpauseDiamond(address[] calldata _blacklist) external {
// make sure this function can only be called by the owner
LibDiamond.enforceIsContractOwner();
// get all facets from storage
Storage storage s = getStorage();
// iterate through all facets and reinstate the facet with its function selectors
for (uint256 i; i < s.facets.length; ) {
LibDiamond.replaceFunctions(
s.facets[i].facetAddress,
s.facets[i].functionSelectors
);
// gas-efficient way to increase loop counter
unchecked {
++i;
}
}
// go through blacklist and overwrite all function selectors with zero address
// It would be easier to not reinstate these facets in the first place but
// a) that would leave their function selectors associated with address of EmergencyPauseFacet (=> throws 'DiamondIsPaused() error when called)
// b) it consumes a lot of gas to check every facet address if it's part of the blacklist
bytes4[] memory currentSelectors;
for (uint256 i; i < _blacklist.length; ) {
currentSelectors = LibDiamondLoupe.facetFunctionSelectors(
_blacklist[i]
);
// make sure that the DiamondCutFacet cannot be removed as this would make the diamond immutable
if (currentSelectors[0] == DiamondCutFacet.diamondCut.selector)
continue;
// build FacetCut parameter
IDiamondCut.FacetCut[]
memory facetCut = new IDiamondCut.FacetCut[](1);
facetCut[0] = IDiamondCut.FacetCut({
facetAddress: address(0), // needs to be address(0) for removals
action: IDiamondCut.FacetCutAction.Remove,
functionSelectors: currentSelectors
});
// remove facet and its selectors from diamond
LibDiamond.diamondCut(facetCut, address(0), "");
// gas-efficient way to increase loop counter
unchecked {
++i;
}
}
// free storage
delete s.facets;
emit EmergencyUnpaused(msg.sender);
}
/// INTERNAL HELPER FUNCTIONS
function _getAllFacetFunctionSelectorsToBeRemoved()
internal
view
returns (IDiamondLoupe.Facet[] memory toBeRemoved)
{
// get a list of all registered facet addresses
IDiamondLoupe.Facet[] memory allFacets = LibDiamondLoupe.facets();
// initiate return variable with allFacets length - 1 (since we will not remove the EmergencyPauseFacet)
toBeRemoved = new IDiamondLoupe.Facet[](allFacets.length - 1);
// iterate through facets, copy every facet but EmergencyPauseFacet
uint256 toBeRemovedCounter;
for (uint256 i; i < allFacets.length; ) {
// if its not the EmergencyPauseFacet, copy to the return value variable
if (allFacets[i].facetAddress != _emergencyPauseFacetAddress) {
toBeRemoved[toBeRemovedCounter].facetAddress = allFacets[i]
.facetAddress;
toBeRemoved[toBeRemovedCounter].functionSelectors = allFacets[
i
].functionSelectors;
// gas-efficient way to increase counter
unchecked {
++toBeRemovedCounter;
}
}
// gas-efficient way to increase loop counter
unchecked {
++i;
}
}
}
/// @dev fetch local storage
function getStorage() private pure returns (Storage storage s) {
bytes32 namespace = NAMESPACE;
// solhint-disable-next-line no-inline-assembly
assembly {
s.slot := namespace
}
}
// this function will be called when the diamond is paused to return a meaningful error message instead of "FunctionDoesNotExist"
fallback() external payable {
revert DiamondIsPaused();
}
// only added to silence compiler warnings that arose after adding the fallback function
receive() external payable {}
}// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
import { IDiamondCut } from "../Interfaces/IDiamondCut.sol";
import { LibUtil } from "../Libraries/LibUtil.sol";
import { OnlyContractOwner } from "../Errors/GenericErrors.sol";
/// Implementation of EIP-2535 Diamond Standard
/// https://eips.ethereum.org/EIPS/eip-2535
library LibDiamond {
bytes32 internal constant DIAMOND_STORAGE_POSITION =
keccak256("diamond.standard.diamond.storage");
// Diamond specific errors
error IncorrectFacetCutAction();
error NoSelectorsInFace();
error FunctionAlreadyExists();
error FacetAddressIsZero();
error FacetAddressIsNotZero();
error FacetContainsNoCode();
error FunctionDoesNotExist();
error FunctionIsImmutable();
error InitZeroButCalldataNotEmpty();
error CalldataEmptyButInitNotZero();
error InitReverted();
// ----------------
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;
// solhint-disable-next-line no-inline-assembly
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 {
if (msg.sender != diamondStorage().contractOwner)
revert OnlyContractOwner();
}
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; ) {
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 IncorrectFacetCutAction();
}
unchecked {
++facetIndex;
}
}
emit DiamondCut(_diamondCut, _init, _calldata);
initializeDiamondCut(_init, _calldata);
}
function addFunctions(
address _facetAddress,
bytes4[] memory _functionSelectors
) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsZero();
}
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;
) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds
.selectorToFacetAndPosition[selector]
.facetAddress;
if (!LibUtil.isZeroAddress(oldFacetAddress)) {
revert FunctionAlreadyExists();
}
addFunction(ds, selector, selectorPosition, _facetAddress);
unchecked {
++selectorPosition;
++selectorIndex;
}
}
}
function replaceFunctions(
address _facetAddress,
bytes4[] memory _functionSelectors
) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsZero();
}
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;
) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds
.selectorToFacetAndPosition[selector]
.facetAddress;
if (oldFacetAddress == _facetAddress) {
revert FunctionAlreadyExists();
}
removeFunction(ds, oldFacetAddress, selector);
addFunction(ds, selector, selectorPosition, _facetAddress);
unchecked {
++selectorPosition;
++selectorIndex;
}
}
}
function removeFunctions(
address _facetAddress,
bytes4[] memory _functionSelectors
) internal {
if (_functionSelectors.length == 0) {
revert NoSelectorsInFace();
}
DiamondStorage storage ds = diamondStorage();
// if function does not exist then do nothing and return
if (!LibUtil.isZeroAddress(_facetAddress)) {
revert FacetAddressIsNotZero();
}
for (
uint256 selectorIndex;
selectorIndex < _functionSelectors.length;
) {
bytes4 selector = _functionSelectors[selectorIndex];
address oldFacetAddress = ds
.selectorToFacetAndPosition[selector]
.facetAddress;
removeFunction(ds, oldFacetAddress, selector);
unchecked {
++selectorIndex;
}
}
}
function addFacet(
DiamondStorage storage ds,
address _facetAddress
) internal {
enforceHasContractCode(_facetAddress);
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 {
if (LibUtil.isZeroAddress(_facetAddress)) {
revert FunctionDoesNotExist();
}
// an immutable function is a function defined directly in a diamond
if (_facetAddress == address(this)) {
revert FunctionIsImmutable();
}
// 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 (LibUtil.isZeroAddress(_init)) {
if (_calldata.length != 0) {
revert InitZeroButCalldataNotEmpty();
}
} else {
if (_calldata.length == 0) {
revert CalldataEmptyButInitNotZero();
}
if (_init != address(this)) {
enforceHasContractCode(_init);
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory error) = _init.delegatecall(_calldata);
if (!success) {
if (error.length > 0) {
// bubble up the error
revert(string(error));
} else {
revert InitReverted();
}
}
}
}
function enforceHasContractCode(address _contract) internal view {
uint256 contractSize;
// solhint-disable-next-line no-inline-assembly
assembly {
contractSize := extcodesize(_contract)
}
if (contractSize == 0) {
revert FacetContainsNoCode();
}
}
}// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
import { LibDiamond } from "../Libraries/LibDiamond.sol";
import { IDiamondLoupe } from "../Interfaces/IDiamondLoupe.sol";
/// Library for DiamondLoupe functions (to avoid using external calls when using DiamondLoupe)
library LibDiamondLoupe {
function facets()
internal
view
returns (IDiamondLoupe.Facet[] memory facets_)
{
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
uint256 numFacets = ds.facetAddresses.length;
facets_ = new IDiamondLoupe.Facet[](numFacets);
for (uint256 i = 0; i < numFacets; ) {
address facetAddress_ = ds.facetAddresses[i];
facets_[i].facetAddress = facetAddress_;
facets_[i].functionSelectors = ds
.facetFunctionSelectors[facetAddress_]
.functionSelectors;
unchecked {
++i;
}
}
}
function facetFunctionSelectors(
address _facet
) internal view returns (bytes4[] memory facetFunctionSelectors_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetFunctionSelectors_ = ds
.facetFunctionSelectors[_facet]
.functionSelectors;
}
function facetAddresses()
internal
view
returns (address[] memory facetAddresses_)
{
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddresses_ = ds.facetAddresses;
}
function facetAddress(
bytes4 _functionSelector
) internal view returns (address facetAddress_) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
facetAddress_ = ds
.selectorToFacetAndPosition[_functionSelector]
.facetAddress;
}
}// SPDX-License-Identifier: MIT /// @custom:version 1.0.0 pragma solidity 0.8.17; error AlreadyInitialized(); error CannotAuthoriseSelf(); error CannotBridgeToSameNetwork(); error ContractCallNotAllowed(); error CumulativeSlippageTooHigh(uint256 minAmount, uint256 receivedAmount); error DiamondIsPaused(); error ExternalCallFailed(); error FunctionDoesNotExist(); error InformationMismatch(); error InsufficientBalance(uint256 required, uint256 balance); error InvalidAmount(); error InvalidCallData(); error InvalidConfig(); error InvalidContract(); error InvalidDestinationChain(); error InvalidFallbackAddress(); error InvalidReceiver(); error InvalidSendingToken(); error NativeAssetNotSupported(); error NativeAssetTransferFailed(); error NoSwapDataProvided(); error NoSwapFromZeroBalance(); error NotAContract(); error NotInitialized(); error NoTransferToNullAddress(); error NullAddrIsNotAnERC20Token(); error NullAddrIsNotAValidSpender(); error OnlyContractOwner(); error RecoveryAddressCannotBeZero(); error ReentrancyError(); error TokenNotSupported(); error UnAuthorized(); error UnsupportedChainId(uint256 chainId); error WithdrawFailed(); error ZeroAmount();
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
// A loupe is a small magnifying glass used to look at diamonds.
// These functions look at diamonds
interface IDiamondLoupe {
/// These functions are expected to be called frequently
/// by tools.
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
/// @notice Gets all facet addresses and their four byte function selectors.
/// @return facets_ Facet
function facets() external view returns (Facet[] memory facets_);
/// @notice Gets all the function selectors supported by a specific facet.
/// @param _facet The facet address.
/// @return facetFunctionSelectors_
function facetFunctionSelectors(
address _facet
) external view returns (bytes4[] memory facetFunctionSelectors_);
/// @notice Get all the facet addresses used by a diamond.
/// @return facetAddresses_
function facetAddresses()
external
view
returns (address[] memory facetAddresses_);
/// @notice Gets the facet that supports the given selector.
/// @dev If facet is not found return address(0).
/// @param _functionSelector The function selector.
/// @return facetAddress_ The facet address.
function facetAddress(
bytes4 _functionSelector
) external view returns (address facetAddress_);
}// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
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.17;
import { IDiamondCut } from "../Interfaces/IDiamondCut.sol";
import { LibDiamond } from "../Libraries/LibDiamond.sol";
/// @title Diamond Cut Facet
/// @author LI.FI (https://li.fi)
/// @notice Core EIP-2535 Facet for upgrading Diamond Proxies.
/// @custom:version 1.0.0
contract DiamondCutFacet is IDiamondCut {
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(
FacetCut[] calldata _diamondCut,
address _init,
bytes calldata _calldata
) external override {
LibDiamond.enforceIsContractOwner();
LibDiamond.diamondCut(_diamondCut, _init, _calldata);
}
}// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
import "./LibBytes.sol";
library LibUtil {
using LibBytes for bytes;
function getRevertMsg(
bytes memory _res
) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_res.length < 68) return "Transaction reverted silently";
bytes memory revertData = _res.slice(4, _res.length - 4); // Remove the selector which is the first 4 bytes
return abi.decode(revertData, (string)); // All that remains is the revert string
}
/// @notice Determines whether the given address is the zero address
/// @param addr The address to verify
/// @return Boolean indicating if the address is the zero address
function isZeroAddress(address addr) internal pure returns (bool) {
return addr == address(0);
}
function revertWith(bytes memory data) internal pure {
assembly {
let dataSize := mload(data) // Load the size of the data
let dataPtr := add(data, 0x20) // Advance data pointer to the next word
revert(dataPtr, dataSize) // Revert with the given data
}
}
}// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity 0.8.17;
library LibBytes {
// solhint-disable no-inline-assembly
// LibBytes specific errors
error SliceOverflow();
error SliceOutOfBounds();
error AddressOutOfBounds();
bytes16 private constant _SYMBOLS = "0123456789abcdef";
// -------------------------
function slice(
bytes memory _bytes,
uint256 _start,
uint256 _length
) internal pure returns (bytes memory) {
if (_length + 31 < _length) revert SliceOverflow();
if (_bytes.length < _start + _length) revert SliceOutOfBounds();
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// The first word of the slice result is potentially a partial
// word read from the original array. To read it, we calculate
// the length of that partial word and start copying that many
// bytes into the array. The first word we copy will start with
// data we don't care about, but the last `lengthmod` bytes will
// land at the beginning of the contents of the new array. When
// we're done copying, we overwrite the full first word with
// the actual length of the slice.
let lengthmod := and(_length, 31)
// The multiplication in the next line is necessary
// because when slicing multiples of 32 bytes (lengthmod == 0)
// the following copy loop was copying the origin's length
// and then ending prematurely not copying everything it should.
let mc := add(
add(tempBytes, lengthmod),
mul(0x20, iszero(lengthmod))
)
let end := add(mc, _length)
for {
// The multiplication in the next line has the same exact purpose
// as the one above.
let cc := add(
add(
add(_bytes, lengthmod),
mul(0x20, iszero(lengthmod))
),
_start
)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
mstore(tempBytes, _length)
//update free-memory pointer
//allocating the array padded to 32 bytes like the compiler does now
mstore(0x40, and(add(mc, 31), not(31)))
}
//if we want a zero-length slice let's just return a zero-length array
default {
tempBytes := mload(0x40)
//zero out the 32 bytes slice we are about to return
//we need to do it because Solidity does not garbage collect
mstore(tempBytes, 0)
mstore(0x40, add(tempBytes, 0x20))
}
}
return tempBytes;
}
function toAddress(
bytes memory _bytes,
uint256 _start
) internal pure returns (address) {
if (_bytes.length < _start + 20) {
revert AddressOutOfBounds();
}
address tempAddress;
assembly {
tempAddress := div(
mload(add(add(_bytes, 0x20), _start)),
0x1000000000000000000000000
)
}
return tempAddress;
}
/// Copied from OpenZeppelin's `Strings.sol` utility library.
/// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/8335676b0e99944eef6a742e16dcd9ff6e68e609/contracts/utils/Strings.sol
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";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}{
"remappings": [
"@eth-optimism/=node_modules/@hop-protocol/sdk/node_modules/@eth-optimism/",
"@uniswap/=node_modules/@uniswap/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"hardhat/=node_modules/hardhat/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"celer-network/=lib/sgn-v2-contracts/",
"create3-factory/=lib/create3-factory/src/",
"solmate/=lib/solmate/src/",
"solady/=lib/solady/src/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"lifi/=src/",
"test/=test/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"sgn-v2-contracts/=lib/sgn-v2-contracts/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 1000000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_pauserWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CalldataEmptyButInitNotZero","type":"error"},{"inputs":[],"name":"DiamondIsPaused","type":"error"},{"inputs":[],"name":"FacetAddressIsNotZero","type":"error"},{"inputs":[],"name":"FacetAddressIsZero","type":"error"},{"inputs":[],"name":"FacetContainsNoCode","type":"error"},{"inputs":[],"name":"FacetIsNotRegistered","type":"error"},{"inputs":[],"name":"FunctionAlreadyExists","type":"error"},{"inputs":[],"name":"FunctionDoesNotExist","type":"error"},{"inputs":[],"name":"FunctionIsImmutable","type":"error"},{"inputs":[],"name":"IncorrectFacetCutAction","type":"error"},{"inputs":[],"name":"InitReverted","type":"error"},{"inputs":[],"name":"InitZeroButCalldataNotEmpty","type":"error"},{"inputs":[],"name":"InvalidCallData","type":"error"},{"inputs":[],"name":"NoFacetToPause","type":"error"},{"inputs":[],"name":"NoSelectorsInFace","type":"error"},{"inputs":[],"name":"OnlyContractOwner","type":"error"},{"inputs":[],"name":"UnAuthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"facetAddress","type":"address"},{"indexed":true,"internalType":"address","name":"msgSender","type":"address"}],"name":"EmergencyFacetRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"}],"name":"EmergencyPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"msgSender","type":"address"}],"name":"EmergencyUnpaused","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"pauseDiamond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauserWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_facetAddress","type":"address"}],"name":"removeFacet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_blacklist","type":"address[]"}],"name":"unpauseDiamond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60c060405234801561001057600080fd5b506040516200240b3803806200240b83398101604081905261003191610046565b6001600160a01b03166080523060a052610076565b60006020828403121561005857600080fd5b81516001600160a01b038116811461006f57600080fd5b9392505050565b60805160a051612354620000b7600039600081816101e60152818161086c015261115201526000818160d001528181610148015261075701526123546000f3fe6080604052600436106100435760003560e01c80630340e9051461007c5780632fc487ae1461009e5780635ad317a4146100be578063f86368ae1461011b5761004a565b3661004a57005b6040517f0149422e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34801561008857600080fd5b5061009c610097366004611f6b565b610130565b005b3480156100aa57600080fd5b5061009c6100b9366004611fa8565b61047d565b3480156100ca57600080fd5b506100f27f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561012757600080fd5b5061009c61073f565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015906101ad57507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205473ffffffffffffffffffffffffffffffffffffffff163314155b156101e4576040517fbe24598300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610269576040517f1c49f4d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020908152604080832080548251818502810185019093528083527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c949383018282801561035557602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116103025790505b505050505090508051600003610397576040517f40d4c9d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80517f1f931c1c000000000000000000000000000000000000000000000000000000009082906000906103cc576103cc61201d565b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361042a576040517f1c49f4d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610435600082610984565b604051339073ffffffffffffffffffffffffffffffffffffffff8516907f706807c5bad215e3dcb9056c9bcb73bbede85a028c0256ae6ab6d04c7181336090600090a3505050565b610485610ac0565b7f363d25a6b563e4e505e09cc7b49c0772239b412c54b5ffbf5d7c1d77a49f57f260005b81548110156105b7576105af8260000182815481106104ca576104ca61201d565b6000918252602090912060029091020154835473ffffffffffffffffffffffffffffffffffffffff909116908490849081106105085761050861201d565b90600052602060002090600202016001018054806020026020016040519081016040528092919081815260200182805480156105a557602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116105525790505b5050505050610b35565b6001016104a9565b50606060005b83811015610702576105f48585838181106105da576105da61201d565b90506020020160208101906105ef9190611f6b565b610de5565b80519092507f1f931c1c0000000000000000000000000000000000000000000000000000000090839060009061062c5761062c61201d565b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603156105bd57604080516001808252818301909252600091816020015b6040805160608082018352600080835260208301529181019190915281526020019060019003908161067057905050604080516060810190915260008152909150602081016002815260200184815250816000815181106106d3576106d361201d565b60200260200101819052506106f981600060405180602001604052806000815250610ee5565b506001016105bd565b5061070e826000611e1b565b60405133907ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf90600090a250505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015906107bc57507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205473ffffffffffffffffffffffffffffffffffffffff163314155b156107f3576040517fbe24598300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f363d25a6b563e4e505e09cc7b49c0772239b412c54b5ffbf5d7c1d77a49f57f2600061081e6110c6565b9050805160000361085b576040517f8bce42e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8151811015610954576108ae7f000000000000000000000000000000000000000000000000000000000000000083838151811061089d5761089d61201d565b602002602001015160200151610b35565b826000018282815181106108c4576108c461201d565b602090810291909101810151825460018082018555600094855293839020825160029092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091178155818301518051929491936109469392850192910190611e3f565b50505080600101905061085e565b5060405133907fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab7079145690600090a25050565b80516000036109bf576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff831615610a2e576040517f79c9df2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015610aba576000838281518110610a4e57610a4e61201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529185905260409091205490915073ffffffffffffffffffffffffffffffffffffffff16610ab084828461126b565b5050600101610a31565b50505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6004015473ffffffffffffffffffffffffffffffffffffffff163314610b33576040517f277d76f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b8051600003610b70576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316610bde576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610c2657610c268285611734565b60005b8351811015610dde576000848281518110610c4657610c4661201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff9081169087168103610cda576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ce585828461126b565b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff000000000000000000000000000000000000000016179055505060019182019101610c29565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9390929190830182828015610ed857602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060040190602082600301049283019260010382029150808411610e855790505b5050505050915050919050565b60005b835181101561107b576000848281518110610f0557610f0561201d565b602002602001015160200151905060006002811115610f2657610f2661207b565b816002811115610f3857610f3861207b565b03610f8657610f81858381518110610f5257610f5261201d565b602002602001015160000151868481518110610f7057610f7061201d565b6020026020010151604001516117aa565b611072565b6001816002811115610f9a57610f9a61207b565b03610fe357610f81858381518110610fb457610fb461201d565b602002602001015160000151868481518110610fd257610fd261201d565b602002602001015160400151610b35565b6002816002811115610ff757610ff761207b565b0361104057610f818583815181106110115761101161201d565b60200260200101516000015186848151811061102f5761102f61201d565b602002602001015160400151610984565b6040517fe548e6b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610ee8565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb6738383836040516110af93929190612118565b60405180910390a16110c18282611a43565b505050565b606060006110d2611be4565b9050600181516110e29190612280565b67ffffffffffffffff8111156110fa576110fa61204c565b60405190808252806020026020018201604052801561114057816020015b6040805180820190915260008152606060208201528152602001906001900390816111185790505b5091506000805b8251811015611265577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168382815181106111995761119961201d565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff161461125d578281815181106111d2576111d261201d565b6020026020010151600001518483815181106111f0576111f061201d565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905282518390829081106112295761122961201d565b6020026020010151602001518483815181106112475761124761201d565b6020026020010151602001819052508160010191505b600101611147565b50505090565b73ffffffffffffffffffffffffffffffffffffffff82166112b8576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff831603611307576040517fc3c5ec3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152602084815260408083205473ffffffffffffffffffffffffffffffffffffffff86168452600180880190935290832054740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16929161139191612280565b90508082146114d85773ffffffffffffffffffffffffffffffffffffffff8416600090815260018601602052604081208054839081106113d3576113d361201d565b6000918252602080832060088304015473ffffffffffffffffffffffffffffffffffffffff8916845260018a019091526040909220805460079092166004026101000a90920460e01b9250829190859081106114315761143161201d565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790557fffffffff0000000000000000000000000000000000000000000000000000000092909216825286905260409020805473ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000006bffffffffffffffffffffffff8516021790555b73ffffffffffffffffffffffffffffffffffffffff84166000908152600186016020526040902080548061150e5761150e6122c0565b6000828152602080822060087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90940193840401805463ffffffff600460078716026101000a0219169055919092557fffffffff000000000000000000000000000000000000000000000000000000008516825286905260408120819055819003610dde5760028501546000906115a790600190612280565b73ffffffffffffffffffffffffffffffffffffffff861660009081526001808901602052604090912001549091508082146116955760008760020183815481106115f3576115f361201d565b60009182526020909120015460028901805473ffffffffffffffffffffffffffffffffffffffff90921692508291849081106116315761163161201d565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055929091168152600189810190925260409020018190555b866002018054806116a8576116a86122c0565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff88168252600189810190915260408220015550505050505050565b61173d81611dde565b60028201805473ffffffffffffffffffffffffffffffffffffffff90921660008181526001948501602090815260408220860185905594840183559182529290200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b80516000036117e5576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316611853576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600182016020526040812054906bffffffffffffffffffffffff8216900361189b5761189b8285611734565b60005b8351811015610dde5760008482815181106118bb576118bb61201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff16801561194a576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff00000000000000000000000000000000000000001617905550506001918201910161189e565b73ffffffffffffffffffffffffffffffffffffffff8216611a9b57805115611a97576040517f9811686000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8051600003611ad6576040517f4220056600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82163014611afc57611afc82611dde565b6000808373ffffffffffffffffffffffffffffffffffffffff1683604051611b2491906122ef565b600060405180830381855af49150503d8060008114611b5f576040519150601f19603f3d011682016040523d82523d6000602084013e611b64565b606091505b509150915081610aba57805115611bb257806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba9919061230b565b60405180910390fd5b6040517fc53ebed500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff811115611c4457611c4461204c565b604051908082528060200260200182016040528015611c8a57816020015b604080518082019091526000815260606020820152815260200190600190039081611c625790505b50925060005b81811015611265576000836002018281548110611caf57611caf61201d565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080858381518110611cef57611cef61201d565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9283169052908216600090815260018601825260409081902080548251818502810185019093528083529192909190830182828015611db057602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060040190602082600301049283019260010382029150808411611d5d5790505b5050505050858381518110611dc757611dc761201d565b602090810291909101810151015250600101611c90565b803b6000819003611a97576040517fe350060000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5080546000825560020290600052602060002090810190611e3c9190611eeb565b50565b82805482825590600052602060002090600701600890048101928215611edb5791602002820160005b83821115611ea957835183826101000a81548163ffffffff021916908360e01c02179055509260200192600401602081600301049283019260010302611e68565b8015611ed95782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611ea9565b505b50611ee7929150611f31565b5090565b80821115611ee75780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000611f286001830182611f46565b50600201611eeb565b5b80821115611ee75760008155600101611f32565b508054600082556007016008900490600052602060002090810190611e3c9190611f31565b600060208284031215611f7d57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114611fa157600080fd5b9392505050565b60008060208385031215611fbb57600080fd5b823567ffffffffffffffff80821115611fd357600080fd5b818501915085601f830112611fe757600080fd5b813581811115611ff657600080fd5b8660208260051b850101111561200b57600080fd5b60209290920196919550909350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b838110156120c55781810151838201526020016120ad565b50506000910152565b600081518084526120e68160208601602086016120aa565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015612243577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808a8503018652815188850173ffffffffffffffffffffffffffffffffffffffff825116865284820151600381106121ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b8083101561222e5783517fffffffff000000000000000000000000000000000000000000000000000000001682529286019260019290920191908601906121ec565b50978501979550505090820190600101612141565b505073ffffffffffffffffffffffffffffffffffffffff8a1690880152868103604088015261227281896120ce565b9a9950505050505050505050565b818103818111156122ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082516123018184602087016120aa565b9190910192915050565b602081526000611fa160208301846120ce56fea26469706673582212206ec2fd45deebaa245f89b8df9b26bc2aba9501c212184222a2ec3d2001bdd2df64736f6c63430008110033000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee
Deployed Bytecode
0x6080604052600436106100435760003560e01c80630340e9051461007c5780632fc487ae1461009e5780635ad317a4146100be578063f86368ae1461011b5761004a565b3661004a57005b6040517f0149422e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b34801561008857600080fd5b5061009c610097366004611f6b565b610130565b005b3480156100aa57600080fd5b5061009c6100b9366004611fa8565b61047d565b3480156100ca57600080fd5b506100f27f000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee81565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b34801561012757600080fd5b5061009c61073f565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee16148015906101ad57507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205473ffffffffffffffffffffffffffffffffffffffff163314155b156101e4576040517fbe24598300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f0000000000000000000000006f2baa7cd5f156ca1b132f7ff11e0fa2ad775f6173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610269576040517f1c49f4d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d6020908152604080832080548251818502810185019093528083527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c949383018282801561035557602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116103025790505b505050505090508051600003610397576040517f40d4c9d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80517f1f931c1c000000000000000000000000000000000000000000000000000000009082906000906103cc576103cc61201d565b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361042a576040517f1c49f4d100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610435600082610984565b604051339073ffffffffffffffffffffffffffffffffffffffff8516907f706807c5bad215e3dcb9056c9bcb73bbede85a028c0256ae6ab6d04c7181336090600090a3505050565b610485610ac0565b7f363d25a6b563e4e505e09cc7b49c0772239b412c54b5ffbf5d7c1d77a49f57f260005b81548110156105b7576105af8260000182815481106104ca576104ca61201d565b6000918252602090912060029091020154835473ffffffffffffffffffffffffffffffffffffffff909116908490849081106105085761050861201d565b90600052602060002090600202016001018054806020026020016040519081016040528092919081815260200182805480156105a557602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600401906020826003010492830192600103820291508084116105525790505b5050505050610b35565b6001016104a9565b50606060005b83811015610702576105f48585838181106105da576105da61201d565b90506020020160208101906105ef9190611f6b565b610de5565b80519092507f1f931c1c0000000000000000000000000000000000000000000000000000000090839060009061062c5761062c61201d565b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603156105bd57604080516001808252818301909252600091816020015b6040805160608082018352600080835260208301529181019190915281526020019060019003908161067057905050604080516060810190915260008152909150602081016002815260200184815250816000815181106106d3576106d361201d565b60200260200101819052506106f981600060405180602001604052806000815250610ee5565b506001016105bd565b5061070e826000611e1b565b60405133907ff5cbf596165cc457b2cd92e8d8450827ee314968160a5696402d75766fc52caf90600090a250505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee16148015906107bc57507fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c13205473ffffffffffffffffffffffffffffffffffffffff163314155b156107f3576040517fbe24598300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f363d25a6b563e4e505e09cc7b49c0772239b412c54b5ffbf5d7c1d77a49f57f2600061081e6110c6565b9050805160000361085b576040517f8bce42e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8151811015610954576108ae7f0000000000000000000000006f2baa7cd5f156ca1b132f7ff11e0fa2ad775f6183838151811061089d5761089d61201d565b602002602001015160200151610b35565b826000018282815181106108c4576108c461201d565b602090810291909101810151825460018082018555600094855293839020825160029092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091178155818301518051929491936109469392850192910190611e3f565b50505080600101905061085e565b5060405133907fb8fad2fa0ed7a383e747c309ef2c4391d7b65592a48893e57ccc1fab7079145690600090a25050565b80516000036109bf576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff831615610a2e576040517f79c9df2200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015610aba576000838281518110610a4e57610a4e61201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529185905260409091205490915073ffffffffffffffffffffffffffffffffffffffff16610ab084828461126b565b5050600101610a31565b50505050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6004015473ffffffffffffffffffffffffffffffffffffffff163314610b33576040517f277d76f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b8051600003610b70576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316610bde576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600182016020526040812054906bffffffffffffffffffffffff82169003610c2657610c268285611734565b60005b8351811015610dde576000848281518110610c4657610c4661201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff9081169087168103610cda576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ce585828461126b565b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff000000000000000000000000000000000000000016179055505060019182019101610c29565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131d602090815260409182902080548351818402810184019094528084526060937fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c9390929190830182828015610ed857602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060040190602082600301049283019260010382029150808411610e855790505b5050505050915050919050565b60005b835181101561107b576000848281518110610f0557610f0561201d565b602002602001015160200151905060006002811115610f2657610f2661207b565b816002811115610f3857610f3861207b565b03610f8657610f81858381518110610f5257610f5261201d565b602002602001015160000151868481518110610f7057610f7061201d565b6020026020010151604001516117aa565b611072565b6001816002811115610f9a57610f9a61207b565b03610fe357610f81858381518110610fb457610fb461201d565b602002602001015160000151868481518110610fd257610fd261201d565b602002602001015160400151610b35565b6002816002811115610ff757610ff761207b565b0361104057610f818583815181106110115761101161201d565b60200260200101516000015186848151811061102f5761102f61201d565b602002602001015160400151610984565b6040517fe548e6b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600101610ee8565b507f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb6738383836040516110af93929190612118565b60405180910390a16110c18282611a43565b505050565b606060006110d2611be4565b9050600181516110e29190612280565b67ffffffffffffffff8111156110fa576110fa61204c565b60405190808252806020026020018201604052801561114057816020015b6040805180820190915260008152606060208201528152602001906001900390816111185790505b5091506000805b8251811015611265577f0000000000000000000000006f2baa7cd5f156ca1b132f7ff11e0fa2ad775f6173ffffffffffffffffffffffffffffffffffffffff168382815181106111995761119961201d565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff161461125d578281815181106111d2576111d261201d565b6020026020010151600001518483815181106111f0576111f061201d565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff909116905282518390829081106112295761122961201d565b6020026020010151602001518483815181106112475761124761201d565b6020026020010151602001819052508160010191505b600101611147565b50505090565b73ffffffffffffffffffffffffffffffffffffffff82166112b8576040517fa9ad62f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff831603611307576040517fc3c5ec3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081166000908152602084815260408083205473ffffffffffffffffffffffffffffffffffffffff86168452600180880190935290832054740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16929161139191612280565b90508082146114d85773ffffffffffffffffffffffffffffffffffffffff8416600090815260018601602052604081208054839081106113d3576113d361201d565b6000918252602080832060088304015473ffffffffffffffffffffffffffffffffffffffff8916845260018a019091526040909220805460079092166004026101000a90920460e01b9250829190859081106114315761143161201d565b600091825260208083206008830401805463ffffffff60079094166004026101000a938402191660e09590951c929092029390931790557fffffffff0000000000000000000000000000000000000000000000000000000092909216825286905260409020805473ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000006bffffffffffffffffffffffff8516021790555b73ffffffffffffffffffffffffffffffffffffffff84166000908152600186016020526040902080548061150e5761150e6122c0565b6000828152602080822060087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90940193840401805463ffffffff600460078716026101000a0219169055919092557fffffffff000000000000000000000000000000000000000000000000000000008516825286905260408120819055819003610dde5760028501546000906115a790600190612280565b73ffffffffffffffffffffffffffffffffffffffff861660009081526001808901602052604090912001549091508082146116955760008760020183815481106115f3576115f361201d565b60009182526020909120015460028901805473ffffffffffffffffffffffffffffffffffffffff90921692508291849081106116315761163161201d565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff948516179055929091168152600189810190925260409020018190555b866002018054806116a8576116a86122c0565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590920190925573ffffffffffffffffffffffffffffffffffffffff88168252600189810190915260408220015550505050505050565b61173d81611dde565b60028201805473ffffffffffffffffffffffffffffffffffffffff90921660008181526001948501602090815260408220860185905594840183559182529290200180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b80516000036117e5576040517f7bc5595000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c73ffffffffffffffffffffffffffffffffffffffff8316611853576040517fc68ec83a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600182016020526040812054906bffffffffffffffffffffffff8216900361189b5761189b8285611734565b60005b8351811015610dde5760008482815181106118bb576118bb61201d565b6020908102919091018101517fffffffff00000000000000000000000000000000000000000000000000000000811660009081529186905260409091205490915073ffffffffffffffffffffffffffffffffffffffff16801561194a576040517fa023275d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fffffffff000000000000000000000000000000000000000000000000000000008216600081815260208781526040808320805473ffffffffffffffffffffffffffffffffffffffff908116740100000000000000000000000000000000000000006bffffffffffffffffffffffff8c16021782558c168085526001808c0185529285208054938401815585528385206008840401805463ffffffff60079095166004026101000a948502191660e08a901c94909402939093179092559390925287905281547fffffffffffffffffffffffff00000000000000000000000000000000000000001617905550506001918201910161189e565b73ffffffffffffffffffffffffffffffffffffffff8216611a9b57805115611a97576040517f9811686000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b8051600003611ad6576040517f4220056600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82163014611afc57611afc82611dde565b6000808373ffffffffffffffffffffffffffffffffffffffff1683604051611b2491906122ef565b600060405180830381855af49150503d8060008114611b5f576040519150601f19603f3d011682016040523d82523d6000602084013e611b64565b606091505b509150915081610aba57805115611bb257806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba9919061230b565b60405180910390fd5b6040517fc53ebed500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e546060907fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c908067ffffffffffffffff811115611c4457611c4461204c565b604051908082528060200260200182016040528015611c8a57816020015b604080518082019091526000815260606020820152815260200190600190039081611c625790505b50925060005b81811015611265576000836002018281548110611caf57611caf61201d565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080858381518110611cef57611cef61201d565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff9283169052908216600090815260018601825260409081902080548251818502810185019093528083529192909190830182828015611db057602002820191906000526020600020906000905b82829054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060040190602082600301049283019260010382029150808411611d5d5790505b5050505050858381518110611dc757611dc761201d565b602090810291909101810151015250600101611c90565b803b6000819003611a97576040517fe350060000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5080546000825560020290600052602060002090810190611e3c9190611eeb565b50565b82805482825590600052602060002090600701600890048101928215611edb5791602002820160005b83821115611ea957835183826101000a81548163ffffffff021916908360e01c02179055509260200192600401602081600301049283019260010302611e68565b8015611ed95782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611ea9565b505b50611ee7929150611f31565b5090565b80821115611ee75780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000611f286001830182611f46565b50600201611eeb565b5b80821115611ee75760008155600101611f32565b508054600082556007016008900490600052602060002090810190611e3c9190611f31565b600060208284031215611f7d57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114611fa157600080fd5b9392505050565b60008060208385031215611fbb57600080fd5b823567ffffffffffffffff80821115611fd357600080fd5b818501915085601f830112611fe757600080fd5b813581811115611ff657600080fd5b8660208260051b850101111561200b57600080fd5b60209290920196919550909350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60005b838110156120c55781810151838201526020016120ad565b50506000910152565b600081518084526120e68160208601602086016120aa565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b84811015612243577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808a8503018652815188850173ffffffffffffffffffffffffffffffffffffffff825116865284820151600381106121ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b8083101561222e5783517fffffffff000000000000000000000000000000000000000000000000000000001682529286019260019290920191908601906121ec565b50978501979550505090820190600101612141565b505073ffffffffffffffffffffffffffffffffffffffff8a1690880152868103604088015261227281896120ce565b9a9950505050505050505050565b818103818111156122ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082516123018184602087016120aa565b9190910192915050565b602081526000611fa160208301846120ce56fea26469706673582212206ec2fd45deebaa245f89b8df9b26bc2aba9501c212184222a2ec3d2001bdd2df64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee
-----Decoded View---------------
Arg [0] : _pauserWallet (address): 0xd38743b48d26743C0Ec6898d699394FBc94657Ee
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d38743b48d26743c0ec6898d699394fbc94657ee
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Token Allocations
FRAX
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| FRAXTAL | 100.00% | $0.869253 | 0.000000015083 | <$0.000001 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.