Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 19782600 | 117 days ago | IN | 0 ETH | 0.0164165 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
SwapOwnerModule
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import {Module, Enum} from "@gnosis.pm/zodiac/contracts/core/Module.sol"; import {IOwnerManager} from "./interface/IOwnerManager.sol"; import {IDelay} from "./interface/IDelay.sol"; contract SwapOwnerModule is Module { event SwapOwnerSetup( address indexed initiator, address indexed owner, address indexed avatar, address target ); event SwapOwner(address indexed oldOwner, address indexed newOwner); mapping(uint256 => uint256) public swapNonceToDelayQueueNonce; uint256 public swapTxNonce; /// @param _avatar Address of the avatar (e.g. a Gnosis Safe) Avatars must expose an interface like IAvatar.sol. /// @param _target Address of the contract that will call execTransactionFromModule function (Delay modifier) /// @param _owner Address of the owner constructor(address _target, address _avatar, address _owner) { bytes memory initParams = abi.encode(_target, _avatar, _owner); setUp(initParams); } /// @notice Public setup function to allow deployment via factory / proxy pattern /// @param initializeParams ABI encoded parameters (see constructor) function setUp(bytes memory initializeParams) public override initializer { (address _target, address _avatar, address _owner) = abi.decode( initializeParams, (address, address, address) ); require(_avatar != address(0), "Avatar can not be zero address"); require(_target != address(0), "Target can not be zero address"); require(_owner != address(0), "Owner can not be zero address"); __Ownable_init(_owner); avatar = _avatar; target = _target; emit SwapOwnerSetup(msg.sender, _target, _avatar, _owner); emit AvatarSet(address(0), _avatar); emit TargetSet(address(0), _target); } /** * @notice Craft a payload that will call the function swapOwner in the Safe contract which replaces the owner `oldOwner` in the Safe with `newOwner`. * @dev This can only be done via a Safe transaction. * @dev Validation is done * @dev https://github.com/safe-global/safe-contracts/blob/0acdd35a203299585438f53885df630f9d486a86/contracts/base/OwnerManager.sol#L99 * @param prevOwner Owner that pointed to the owner to be replaced in the linked list * @param oldOwner Owner address to be replaced. * @param newOwner New owner address. */ function startRecovery( address prevOwner, address oldOwner, address newOwner ) external onlyOwner { IDelay delay = IDelay(target); // Nonce given by the delay to the current recovery uint256 delayQueueNonce = delay.queueNonce(); if (swapTxNonce > 0) { _checkLastQueuedTx(delay); } require( _swapOwner(prevOwner, oldOwner, newOwner), "Module transaction failed" ); //Map the swapNonce to the delay nonce to be able to find the transaction in the delay contract swapNonceToDelayQueueNonce[swapTxNonce] = delayQueueNonce; swapTxNonce++; emit SwapOwner(oldOwner, newOwner); } function _checkLastQueuedTx(IDelay delay) internal view { // Current executable nonce from delay uint256 delayTxNonce = delay.txNonce(); uint256 txCooldown = delay.txCooldown(); uint256 txExpiration = delay.txExpiration(); // Nonce given by the delay to the last recovery queued uint256 lastTxQueueNonce = swapNonceToDelayQueueNonce[swapTxNonce - 1]; //Check if transaction has not been executed and if a tx has ever been queued if (lastTxQueueNonce >= delayTxNonce) { uint256 lastTxCreatedAt = delay.txCreatedAt(lastTxQueueNonce); //Require the cooldown period to have passed require( block.timestamp - lastTxCreatedAt > txCooldown, "Cooldown period has not passed" ); //Check if transaction has an expiration if (txExpiration > 0) { //Require the transaction to be expired require( lastTxCreatedAt + txCooldown + txExpiration < block.timestamp, "Transaction has not expired" ); } else { revert("A recovery is pending execution"); } } } function _swapOwner( address prevOwner, address oldOwner, address newOwner ) internal returns (bool) { return exec( // avatar, in our case the safe will execute the below function avatar, 0, abi.encodeCall( IOwnerManager.swapOwner, (prevOwner, oldOwner, newOwner) ), Enum.Operation.Call ); } }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title Enum - Collection of enums /// @author Richard Meissner - <[email protected]> contract Enum { enum Operation {Call, DelegateCall} }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol"; import {ExecutionTracker} from "../signature/ExecutionTracker.sol"; import {IAvatar} from "../interfaces/IAvatar.sol"; import {Module} from "./Module.sol"; import {SignatureChecker} from "../signature/SignatureChecker.sol"; /// @title Modifier Interface - A contract that sits between a Module and an Avatar and enforce some additional logic. abstract contract Modifier is Module, ExecutionTracker, SignatureChecker, IAvatar { address internal constant SENTINEL_MODULES = address(0x1); /// Mapping of modules. mapping(address => address) internal modules; /// `sender` is not an authorized module. /// @param sender The address of the sender. error NotAuthorized(address sender); /// `module` is invalid. error InvalidModule(address module); /// `pageSize` is invalid. error InvalidPageSize(); /// `module` is already disabled. error AlreadyDisabledModule(address module); /// `module` is already enabled. error AlreadyEnabledModule(address module); /// @dev `setModules()` was already called. error SetupModulesAlreadyCalled(); /* -------------------------------------------------- You must override both of the following virtual functions, execTransactionFromModule() and execTransactionFromModuleReturnData(). It is recommended that implementations of both functions make use the onlyModule modifier. */ /// @dev Passes a transaction to the modifier. /// @notice Can only be called by enabled modules. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction. function execTransactionFromModule( address to, uint256 value, bytes calldata data, Enum.Operation operation ) public virtual returns (bool success); /// @dev Passes a transaction to the modifier, expects return data. /// @notice Can only be called by enabled modules. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction. function execTransactionFromModuleReturnData( address to, uint256 value, bytes calldata data, Enum.Operation operation ) public virtual returns (bool success, bytes memory returnData); /* -------------------------------------------------- */ modifier moduleOnly() { if (modules[msg.sender] == address(0)) { (bytes32 hash, address signer) = moduleTxSignedBy(); // is the signer a module? if (modules[signer] == address(0)) { revert NotAuthorized(msg.sender); } // is the provided signature fresh? if (consumed[signer][hash]) { revert HashAlreadyConsumed(hash); } consumed[signer][hash] = true; emit HashExecuted(hash); } _; } function sentOrSignedByModule() internal view returns (address) { if (modules[msg.sender] != address(0)) { return msg.sender; } (, address signer) = moduleTxSignedBy(); if (modules[signer] != address(0)) { return signer; } return address(0); } /// @dev Disables a module on the modifier. /// @notice This can only be called by the owner. /// @param prevModule Module that pointed to the module to be removed in the linked list. /// @param module Module to be removed. function disableModule( address prevModule, address module ) public override onlyOwner { if (module == address(0) || module == SENTINEL_MODULES) revert InvalidModule(module); if (modules[prevModule] != module) revert AlreadyDisabledModule(module); modules[prevModule] = modules[module]; modules[module] = address(0); emit DisabledModule(module); } /// @dev Enables a module that can add transactions to the queue /// @param module Address of the module to be enabled /// @notice This can only be called by the owner function enableModule(address module) public override onlyOwner { if (module == address(0) || module == SENTINEL_MODULES) revert InvalidModule(module); if (modules[module] != address(0)) revert AlreadyEnabledModule(module); modules[module] = modules[SENTINEL_MODULES]; modules[SENTINEL_MODULES] = module; emit EnabledModule(module); } /// @dev Returns if an module is enabled /// @return True if the module is enabled function isModuleEnabled( address _module ) public view override returns (bool) { return SENTINEL_MODULES != _module && modules[_module] != address(0); } /// @dev Returns array of modules. /// If all entries fit into a single page, the next pointer will be 0x1. /// If another page is present, next will be the last element of the returned array. /// @param start Start of the page. Has to be a module or start pointer (0x1 address) /// @param pageSize Maximum number of modules that should be returned. Has to be > 0 /// @return array Array of modules. /// @return next Start of the next page. function getModulesPaginated( address start, uint256 pageSize ) external view override returns (address[] memory array, address next) { if (start != SENTINEL_MODULES && !isModuleEnabled(start)) { revert InvalidModule(start); } if (pageSize == 0) { revert InvalidPageSize(); } // Init array with max page size array = new address[](pageSize); // Populate return array uint256 moduleCount = 0; next = modules[start]; while ( next != address(0) && next != SENTINEL_MODULES && moduleCount < pageSize ) { array[moduleCount] = next; next = modules[next]; moduleCount++; } // Because of the argument validation we can assume that // the `currentModule` will always be either a module address // or sentinel address (aka the end). If we haven't reached the end // inside the loop, we need to set the next pointer to the last element // because it skipped over to the next module which is neither included // in the current page nor won't be included in the next one // if you pass it as a start. if (next != SENTINEL_MODULES) { next = array[moduleCount - 1]; } // Set correct size of returned array // solhint-disable-next-line no-inline-assembly assembly { mstore(array, moduleCount) } } /// @dev Initializes the modules linked list. /// @notice Should be called as part of the `setUp` / initializing function and can only be called once. function setupModules() internal { if (modules[SENTINEL_MODULES] != address(0)) revert SetupModulesAlreadyCalled(); modules[SENTINEL_MODULES] = SENTINEL_MODULES; } }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol"; import {FactoryFriendly} from "../factory/FactoryFriendly.sol"; import {IAvatar} from "../interfaces/IAvatar.sol"; /// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract. abstract contract Module is FactoryFriendly { /// @dev Address that will ultimately execute function calls. address public avatar; /// @dev Address that this module will pass transactions to. address public target; /// @dev Emitted each time the avatar is set. event AvatarSet(address indexed previousAvatar, address indexed newAvatar); /// @dev Emitted each time the Target is set. event TargetSet(address indexed previousTarget, address indexed newTarget); /// @dev Sets the avatar to a new avatar (`newAvatar`). /// @notice Can only be called by the current owner. function setAvatar(address _avatar) public onlyOwner { address previousAvatar = avatar; avatar = _avatar; emit AvatarSet(previousAvatar, _avatar); } /// @dev Sets the target to a new target (`newTarget`). /// @notice Can only be called by the current owner. function setTarget(address _target) public onlyOwner { address previousTarget = target; target = _target; emit TargetSet(previousTarget, _target); } /// @dev Passes a transaction to be executed by the avatar. /// @notice Can only be called by this contract. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call. function exec( address to, uint256 value, bytes memory data, Enum.Operation operation ) internal virtual returns (bool success) { return IAvatar(target).execTransactionFromModule(to, value, data, operation); } /// @dev Passes a transaction to be executed by the target and returns data. /// @notice Can only be called by this contract. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call. function execAndReturnData( address to, uint256 value, bytes memory data, Enum.Operation operation ) internal virtual returns (bool success, bytes memory returnData) { return IAvatar(target).execTransactionFromModuleReturnData( to, value, data, operation ); } }
// SPDX-License-Identifier: LGPL-3.0-only /// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state pragma solidity >=0.7.0 <0.9.0; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; abstract contract FactoryFriendly is OwnableUpgradeable { function setUp(bytes memory initializeParams) public virtual; }
// SPDX-License-Identifier: LGPL-3.0-only /// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract. pragma solidity >=0.7.0 <0.9.0; import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol"; interface IAvatar { event EnabledModule(address module); event DisabledModule(address module); event ExecutionFromModuleSuccess(address indexed module); event ExecutionFromModuleFailure(address indexed module); /// @dev Enables a module on the avatar. /// @notice Can only be called by the avatar. /// @notice Modules should be stored as a linked list. /// @notice Must emit EnabledModule(address module) if successful. /// @param module Module to be enabled. function enableModule(address module) external; /// @dev Disables a module on the avatar. /// @notice Can only be called by the avatar. /// @notice Must emit DisabledModule(address module) if successful. /// @param prevModule Address that pointed to the module to be removed in the linked list /// @param module Module to be removed. function disableModule(address prevModule, address module) external; /// @dev Allows a Module to execute a transaction. /// @notice Can only be called by an enabled module. /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful. /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call. function execTransactionFromModule( address to, uint256 value, bytes memory data, Enum.Operation operation ) external returns (bool success); /// @dev Allows a Module to execute a transaction and return data /// @notice Can only be called by an enabled module. /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful. /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful. /// @param to Destination address of module transaction. /// @param value Ether value of module transaction. /// @param data Data payload of module transaction. /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call. function execTransactionFromModuleReturnData( address to, uint256 value, bytes memory data, Enum.Operation operation ) external returns (bool success, bytes memory returnData); /// @dev Returns if an module is enabled /// @return True if the module is enabled function isModuleEnabled(address module) external view returns (bool); /// @dev Returns array of modules. /// @param start Start of the page. /// @param pageSize Maximum number of modules that should be returned. /// @return array Array of modules. /// @return next Start of the next page. function getModulesPaginated( address start, uint256 pageSize ) external view returns (address[] memory array, address next); }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0 <0.9.0; /// @title ExecutionTracker - A contract that keeps track of executed and invalidated hashes contract ExecutionTracker { error HashAlreadyConsumed(bytes32); event HashExecuted(bytes32); event HashInvalidated(bytes32); mapping(address => mapping(bytes32 => bool)) public consumed; function invalidate(bytes32 hash) external { consumed[msg.sender][hash] = true; emit HashInvalidated(hash); } }
// SPDX-License-Identifier: LGPL-3.0-only /* solhint-disable one-contract-per-file */ pragma solidity >=0.7.0 <0.9.0; interface IERC1271 { /** * @notice EIP1271 method to validate a signature. * @param hash Hash of the data signed on the behalf of address(this). * @param signature Signature byte array associated with _data. * * MUST return the bytes4 magic value 0x1626ba7e when function passes. * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) * MUST allow external calls */ function isValidSignature( bytes32 hash, bytes memory signature ) external view returns (bytes4); }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0 <0.9.0; import {IERC1271} from "./IERC1271.sol"; /// @title SignatureChecker - A contract that retrieves and validates signatures appended to transaction calldata. /// @dev currently supports eip-712 and eip-1271 signatures abstract contract SignatureChecker { /** * @notice Searches for a signature, validates it, and returns the signer's address. * @dev When signature not found or invalid, zero address is returned * @return The address of the signer. */ function moduleTxSignedBy() internal view returns (bytes32, address) { bytes calldata data = msg.data; /* * The idea is to extend `onlyModule` and provide signature checking * without code changes to inheriting contracts (Modifiers). * * Since it's a generic mechanism, there is no way to conclusively * identify the trailing bytes as a signature. We simply slice those * and recover signer. * * As a result, we impose a minimum calldata length equal to a function * selector plus salt, plus a signature (i.e., 4 + 32 + 65 bytes), any * shorter and calldata it guaranteed to not contain a signature. */ if (data.length < 4 + 32 + 65) { return (bytes32(0), address(0)); } (uint8 v, bytes32 r, bytes32 s) = _splitSignature(data); uint256 end = data.length - (32 + 65); bytes32 salt = bytes32(data[end:]); /* * When handling contract signatures: * v - is zero * r - contains the signer * s - contains the offset within calldata where the signer specific * signature is located * * We detect contract signatures by checking: * 1- `v` is zero * 2- `s` points within the buffer, is after selector, is before * salt and delimits a non-zero length buffer */ if (v == 0) { uint256 start = uint256(s); if (start < 4 || start > end) { return (bytes32(0), address(0)); } address signer = address(uint160(uint256(r))); bytes32 hash = moduleTxHash(data[:start], salt); return _isValidContractSignature(signer, hash, data[start:end]) ? (hash, signer) : (bytes32(0), address(0)); } else { bytes32 hash = moduleTxHash(data[:end], salt); return (hash, ecrecover(hash, v, r, s)); } } /** * @notice Hashes the transaction EIP-712 data structure. * @dev The produced hash is intended to be signed. * @param data The current transaction's calldata. * @param salt The salt value. * @return The 32-byte hash that is to be signed. */ function moduleTxHash( bytes calldata data, bytes32 salt ) public view returns (bytes32) { bytes32 domainSeparator = keccak256( abi.encode(DOMAIN_SEPARATOR_TYPEHASH, block.chainid, this) ); bytes memory moduleTxData = abi.encodePacked( bytes1(0x19), bytes1(0x01), domainSeparator, keccak256(abi.encode(MODULE_TX_TYPEHASH, keccak256(data), salt)) ); return keccak256(moduleTxData); } /** * @dev Extracts signature from calldata, and divides it into `uint8 v, bytes32 r, bytes32 s`. * @param data The current transaction's calldata. * @return v The ECDSA v value * @return r The ECDSA r value * @return s The ECDSA s value */ function _splitSignature( bytes calldata data ) private pure returns (uint8 v, bytes32 r, bytes32 s) { v = uint8(bytes1(data[data.length - 1:])); r = bytes32(data[data.length - 65:]); s = bytes32(data[data.length - 33:]); } /** * @dev Calls the signer contract, and validates the contract signature. * @param signer The address of the signer contract. * @param hash Hash of the data signed * @param signature The contract signature. * @return result Indicates whether the signature is valid. */ function _isValidContractSignature( address signer, bytes32 hash, bytes calldata signature ) internal view returns (bool result) { uint256 size; // eslint-disable-line no-inline-assembly assembly { size := extcodesize(signer) } if (size == 0) { return false; } (, bytes memory returnData) = signer.staticcall( abi.encodeWithSelector( IERC1271.isValidSignature.selector, hash, signature ) ); return bytes4(returnData) == EIP1271_MAGIC_VALUE; } // keccak256( // "EIP712Domain(uint256 chainId,address verifyingContract)" // ); bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218; // keccak256( // "ModuleTx(bytes data,bytes32 salt)" // ); bytes32 private constant MODULE_TX_TYPEHASH = 0x2939aeeda3ca260200c9f7b436b19e13207547ccc65cfedc857751c5ea6d91d4; // bytes4(keccak256( // "isValidSignature(bytes32,bytes)" // )); bytes4 private constant EIP1271_MAGIC_VALUE = 0x1626ba7e; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { /// @custom:storage-location erc7201:openzeppelin.storage.Ownable struct OwnableStorage { address _owner; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300; function _getOwnableStorage() private pure returns (OwnableStorage storage $) { assembly { $.slot := OwnableStorageLocation } } /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ function __Ownable_init(address initialOwner) internal onlyInitializing { __Ownable_init_unchained(initialOwner); } function __Ownable_init_unchained(address initialOwner) internal onlyInitializing { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { OwnableStorage storage $ = _getOwnableStorage(); return $._owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { OwnableStorage storage $ = _getOwnableStorage(); address oldOwner = $._owner; $._owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0; import {Enum} from "@gnosis.pm/zodiac/contracts/core/Modifier.sol"; interface IDelay { event DelaySetup( address indexed initiator, address indexed owner, address indexed avatar, address target ); event TxCooldownSet(uint256 cooldown); event TxExpirationSet(uint256 expiration); event TxNonceSet(uint256 nonce); event TransactionAdded( uint256 indexed queueNonce, bytes32 indexed txHash, address to, uint256 value, bytes data, Enum.Operation operation ); function txCooldown() external view returns (uint256); function txExpiration() external view returns (uint256); function txNonce() external view returns (uint256); function queueNonce() external view returns (uint256); function txHash(uint256) external view returns (bytes32); function txCreatedAt(uint256) external view returns (uint256); function setTxCooldown(uint256 _txCooldown) external; function setTxExpiration(uint256 _txExpiration) external; function setTxNonce(uint256 _txNonce) external; function execTransactionFromModule( address to, uint256 value, bytes calldata data, Enum.Operation operation ) external returns (bool success); function execTransactionFromModuleReturnData( address to, uint256 value, bytes calldata data, Enum.Operation operation ) external returns (bool success, bytes memory returnData); function executeNextTx( address to, uint256 value, bytes calldata data, Enum.Operation operation ) external; function skipExpired() external; function getTransactionHash( address to, uint256 value, bytes memory data, Enum.Operation operation ) external pure returns (bytes32); function getTxHash(uint256 _nonce) external view returns (bytes32); function getTxCreatedAt(uint256 _nonce) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; interface IOwnerManager { function swapOwner( address prevOwner, address oldOwner, address newOwner ) external; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"address","name":"_avatar","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAvatar","type":"address"},{"indexed":true,"internalType":"address","name":"newAvatar","type":"address"}],"name":"AvatarSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"SwapOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"avatar","type":"address"},{"indexed":false,"internalType":"address","name":"target","type":"address"}],"name":"SwapOwnerSetup","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTarget","type":"address"},{"indexed":true,"internalType":"address","name":"newTarget","type":"address"}],"name":"TargetSet","type":"event"},{"inputs":[],"name":"avatar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_avatar","type":"address"}],"name":"setAvatar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"}],"name":"setTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"initializeParams","type":"bytes"}],"name":"setUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"prevOwner","type":"address"},{"internalType":"address","name":"oldOwner","type":"address"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"startRecovery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"swapNonceToDelayQueueNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTxNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"target","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162001598380380620015988339810160408190526200003491620004cc565b604080516001600160a01b038581166020830152848116828401528316606080830191909152825180830390910181526080909101909152620000778162000081565b5050505062000520565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff1615906001600160401b0316600081158015620000cc5750825b90506000826001600160401b03166001148015620000e95750303b155b905081158015620000f8575080155b15620001175760405163f92ee8a960e01b815260040160405180910390fd5b84546001600160401b031916600117855583156200014657845460ff60401b1916680100000000000000001785555b600080600088806020019051810190620001619190620004cc565b919450925090506001600160a01b038216620001c45760405162461bcd60e51b815260206004820152601e60248201527f4176617461722063616e206e6f74206265207a65726f2061646472657373000060448201526064015b60405180910390fd5b6001600160a01b0383166200021c5760405162461bcd60e51b815260206004820152601e60248201527f5461726765742063616e206e6f74206265207a65726f206164647265737300006044820152606401620001bb565b6001600160a01b038116620002745760405162461bcd60e51b815260206004820152601d60248201527f4f776e65722063616e206e6f74206265207a65726f20616464726573730000006044820152606401620001bb565b6200027f81620003a1565b600080546001600160a01b038481166001600160a01b0319928316811790935560018054878316931683179055604051908416815233907f9d9801101556f034bcc1397421d75392ea64fedfba0cf8c9f68e2f92e1c901309060200160405180910390a46040516001600160a01b038316906000907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce342908290a36040516001600160a01b038416906000907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d6908290a350505083156200039957845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b620003ab620003b9565b620003b6816200040a565b50565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166200040857604051631afcd79f60e31b815260040160405180910390fd5b565b62000414620003b9565b6001600160a01b0381166200044057604051631e4fbdf760e01b815260006004820152602401620001bb565b620003b6817f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6001600160a01b0381168114620003b657600080fd5b600080600060608486031215620004e257600080fd5b8351620004ef81620004b6565b60208501519093506200050281620004b6565b60408501519092506200051581620004b6565b809150509250925092565b61106880620005306000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c8063776d1a0111610081578063d4b839921161005b578063d4b839921461019b578063eaa10a71146101ae578063f2fde38b146101ce57600080fd5b8063776d1a01146101455780638da5cb5b14610158578063a4f9edbf1461018857600080fd5b80633866f8ee116100b25780633866f8ee146100ff5780635aef7de614610112578063715018a61461013d57600080fd5b8063086cfca8146100ce5780632c3fb1ee146100e3575b600080fd5b6100e16100dc366004610d80565b6101e1565b005b6100ec60035481565b6040519081526020015b60405180910390f35b6100e161010d366004610da4565b610246565b600054610125906001600160a01b031681565b6040516001600160a01b0390911681526020016100f6565b6100e16103b8565b6100e1610153366004610d80565b6103cc565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610125565b6100e1610196366004610e05565b610433565b600154610125906001600160a01b031681565b6100ec6101bc366004610eb6565b60026020526000908152604090205481565b6100e16101dc366004610d80565b610772565b6101e96107c9565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce3429190a35050565b61024e6107c9565b600154604080517fde8dd91d00000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691600091839163de8dd91d916004808201926020929091908290030181865afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da9190610ecf565b600354909150156102ee576102ee8261083d565b6102f9858585610b38565b61034a5760405162461bcd60e51b815260206004820152601960248201527f4d6f64756c65207472616e73616374696f6e206661696c65640000000000000060448201526064015b60405180910390fd5b6003805460009081526002602052604081208390558154919061036c83610efe565b9190505550826001600160a01b0316846001600160a01b03167f5c052f7304d0f72e7905fed3689c2ae0bae5ac36b59f97d5a6118cabc28dccdb60405160405180910390a35050505050565b6103c06107c9565b6103ca6000610bd1565b565b6103d46107c9565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801561047e5750825b905060008267ffffffffffffffff16600114801561049b5750303b155b9050811580156104a9575080155b156104e0576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561051457845468ff00000000000000001916680100000000000000001785555b60008060008880602001905181019061052d9190610f17565b919450925090506001600160a01b03821661058a5760405162461bcd60e51b815260206004820152601e60248201527f4176617461722063616e206e6f74206265207a65726f206164647265737300006044820152606401610341565b6001600160a01b0383166105e05760405162461bcd60e51b815260206004820152601e60248201527f5461726765742063616e206e6f74206265207a65726f206164647265737300006044820152606401610341565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152601d60248201527f4f776e65722063616e206e6f74206265207a65726f20616464726573730000006044820152606401610341565b61063f81610c4f565b600080546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19928316811790935560018054878316931683179055604051908416815233907f9d9801101556f034bcc1397421d75392ea64fedfba0cf8c9f68e2f92e1c901309060200160405180910390a46040516001600160a01b038316906000907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce342908290a36040516001600160a01b038416906000907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d6908290a3505050831561076a57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b61077a6107c9565b6001600160a01b0381166107bd576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610341565b6107c681610bd1565b50565b336107fb7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146103ca576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610341565b6000816001600160a01b031663c66323e56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a19190610ecf565b90506000826001600160a01b031663dcafac096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190610ecf565b90506000836001600160a01b031663605df59c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096d9190610ecf565b905060006002600060016003546109849190610f59565b8152602001908152602001600020549050838110610b31576040517f258148cc000000000000000000000000000000000000000000000000000000008152600481018290526000906001600160a01b0387169063258148cc90602401602060405180830381865afa1580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190610ecf565b905083610a2e8242610f59565b11610a7b5760405162461bcd60e51b815260206004820152601e60248201527f436f6f6c646f776e20706572696f6420686173206e6f742070617373656400006044820152606401610341565b8215610ae9574283610a8d8684610f72565b610a979190610f72565b10610ae45760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e20686173206e6f74206578706972656400000000006044820152606401610341565b61076a565b60405162461bcd60e51b815260206004820152601f60248201527f41207265636f766572792069732070656e64696e6720657865637574696f6e006044820152606401610341565b5050505050565b600080546040516001600160a01b03868116602483015285811660448301528481166064830152610bc9921690839060840160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe318b52b000000000000000000000000000000000000000000000000000000001790526000610c60565b949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b610c57610cfc565b6107c681610d63565b6001546040517f468721a70000000000000000000000000000000000000000000000000000000081526000916001600160a01b03169063468721a790610cb0908890889088908890600401610f85565b6020604051808303816000875af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611010565b95945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166103ca576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61077a610cfc565b6001600160a01b03811681146107c657600080fd5b600060208284031215610d9257600080fd5b8135610d9d81610d6b565b9392505050565b600080600060608486031215610db957600080fd5b8335610dc481610d6b565b92506020840135610dd481610d6b565b91506040840135610de481610d6b565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610e1757600080fd5b813567ffffffffffffffff80821115610e2f57600080fd5b818401915084601f830112610e4357600080fd5b813581811115610e5557610e55610def565b604051601f8201601f19908116603f01168101908382118183101715610e7d57610e7d610def565b81604052828152876020848701011115610e9657600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215610ec857600080fd5b5035919050565b600060208284031215610ee157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060018201610f1057610f10610ee8565b5060010190565b600080600060608486031215610f2c57600080fd5b8351610f3781610d6b565b6020850151909350610f4881610d6b565b6040850151909250610de481610d6b565b81810381811115610f6c57610f6c610ee8565b92915050565b80820180821115610f6c57610f6c610ee8565b6001600160a01b038516815260006020858184015260806040840152845180608085015260005b81811015610fc85786810183015185820160a001528201610fac565b50600060a0828601015260a0601f19601f830116850101925050506002831061100157634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b60006020828403121561102257600080fd5b81518015158114610d9d57600080fdfea2646970667358221220a882b4d6e88110de015bff26061daf1d2b62693a743f02108a3820d480b88e0264736f6c63430008140033000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100c95760003560e01c8063776d1a0111610081578063d4b839921161005b578063d4b839921461019b578063eaa10a71146101ae578063f2fde38b146101ce57600080fd5b8063776d1a01146101455780638da5cb5b14610158578063a4f9edbf1461018857600080fd5b80633866f8ee116100b25780633866f8ee146100ff5780635aef7de614610112578063715018a61461013d57600080fd5b8063086cfca8146100ce5780632c3fb1ee146100e3575b600080fd5b6100e16100dc366004610d80565b6101e1565b005b6100ec60035481565b6040519081526020015b60405180910390f35b6100e161010d366004610da4565b610246565b600054610125906001600160a01b031681565b6040516001600160a01b0390911681526020016100f6565b6100e16103b8565b6100e1610153366004610d80565b6103cc565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610125565b6100e1610196366004610e05565b610433565b600154610125906001600160a01b031681565b6100ec6101bc366004610eb6565b60026020526000908152604090205481565b6100e16101dc366004610d80565b610772565b6101e96107c9565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce3429190a35050565b61024e6107c9565b600154604080517fde8dd91d00000000000000000000000000000000000000000000000000000000815290516001600160a01b0390921691600091839163de8dd91d916004808201926020929091908290030181865afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da9190610ecf565b600354909150156102ee576102ee8261083d565b6102f9858585610b38565b61034a5760405162461bcd60e51b815260206004820152601960248201527f4d6f64756c65207472616e73616374696f6e206661696c65640000000000000060448201526064015b60405180910390fd5b6003805460009081526002602052604081208390558154919061036c83610efe565b9190505550826001600160a01b0316846001600160a01b03167f5c052f7304d0f72e7905fed3689c2ae0bae5ac36b59f97d5a6118cabc28dccdb60405160405180910390a35050505050565b6103c06107c9565b6103ca6000610bd1565b565b6103d46107c9565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d690600090a35050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801561047e5750825b905060008267ffffffffffffffff16600114801561049b5750303b155b9050811580156104a9575080155b156104e0576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561051457845468ff00000000000000001916680100000000000000001785555b60008060008880602001905181019061052d9190610f17565b919450925090506001600160a01b03821661058a5760405162461bcd60e51b815260206004820152601e60248201527f4176617461722063616e206e6f74206265207a65726f206164647265737300006044820152606401610341565b6001600160a01b0383166105e05760405162461bcd60e51b815260206004820152601e60248201527f5461726765742063616e206e6f74206265207a65726f206164647265737300006044820152606401610341565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152601d60248201527f4f776e65722063616e206e6f74206265207a65726f20616464726573730000006044820152606401610341565b61063f81610c4f565b600080546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19928316811790935560018054878316931683179055604051908416815233907f9d9801101556f034bcc1397421d75392ea64fedfba0cf8c9f68e2f92e1c901309060200160405180910390a46040516001600160a01b038316906000907f52ae88b092de36f87fb43fe794eb1381023b9c1bce563a871154022c63dce342908290a36040516001600160a01b038416906000907f90cc2f570a6eb594b1580ea3e41247d2d73a55281889e86bd4ec2fc29c7e62d6908290a3505050831561076a57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b61077a6107c9565b6001600160a01b0381166107bd576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610341565b6107c681610bd1565b50565b336107fb7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146103ca576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610341565b6000816001600160a01b031663c66323e56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a19190610ecf565b90506000826001600160a01b031663dcafac096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109079190610ecf565b90506000836001600160a01b031663605df59c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096d9190610ecf565b905060006002600060016003546109849190610f59565b8152602001908152602001600020549050838110610b31576040517f258148cc000000000000000000000000000000000000000000000000000000008152600481018290526000906001600160a01b0387169063258148cc90602401602060405180830381865afa1580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190610ecf565b905083610a2e8242610f59565b11610a7b5760405162461bcd60e51b815260206004820152601e60248201527f436f6f6c646f776e20706572696f6420686173206e6f742070617373656400006044820152606401610341565b8215610ae9574283610a8d8684610f72565b610a979190610f72565b10610ae45760405162461bcd60e51b815260206004820152601b60248201527f5472616e73616374696f6e20686173206e6f74206578706972656400000000006044820152606401610341565b61076a565b60405162461bcd60e51b815260206004820152601f60248201527f41207265636f766572792069732070656e64696e6720657865637574696f6e006044820152606401610341565b5050505050565b600080546040516001600160a01b03868116602483015285811660448301528481166064830152610bc9921690839060840160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe318b52b000000000000000000000000000000000000000000000000000000001790526000610c60565b949350505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b610c57610cfc565b6107c681610d63565b6001546040517f468721a70000000000000000000000000000000000000000000000000000000081526000916001600160a01b03169063468721a790610cb0908890889088908890600401610f85565b6020604051808303816000875af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611010565b95945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff166103ca576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61077a610cfc565b6001600160a01b03811681146107c657600080fd5b600060208284031215610d9257600080fd5b8135610d9d81610d6b565b9392505050565b600080600060608486031215610db957600080fd5b8335610dc481610d6b565b92506020840135610dd481610d6b565b91506040840135610de481610d6b565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600060208284031215610e1757600080fd5b813567ffffffffffffffff80821115610e2f57600080fd5b818401915084601f830112610e4357600080fd5b813581811115610e5557610e55610def565b604051601f8201601f19908116603f01168101908382118183101715610e7d57610e7d610def565b81604052828152876020848701011115610e9657600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208284031215610ec857600080fd5b5035919050565b600060208284031215610ee157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060018201610f1057610f10610ee8565b5060010190565b600080600060608486031215610f2c57600080fd5b8351610f3781610d6b565b6020850151909350610f4881610d6b565b6040850151909250610de481610d6b565b81810381811115610f6c57610f6c610ee8565b92915050565b80820180821115610f6c57610f6c610ee8565b6001600160a01b038516815260006020858184015260806040840152845180608085015260005b81811015610fc85786810183015185820160a001528201610fac565b50600060a0828601015260a0601f19601f830116850101925050506002831061100157634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b60006020828403121561102257600080fd5b81518015158114610d9d57600080fdfea2646970667358221220a882b4d6e88110de015bff26061daf1d2b62693a743f02108a3820d480b88e0264736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _target (address): 0x0000000000000000000000000000000000000001
Arg [1] : _avatar (address): 0x0000000000000000000000000000000000000001
Arg [2] : _owner (address): 0x0000000000000000000000000000000000000001
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.