From 9e6d6e7a13a5bf0069a1823a0403bcdefb5f9f90 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Tue, 25 Jun 2024 17:00:36 -0400 Subject: [PATCH] Deploy DecentHats on Sepolia --- deploy/core/017_deploy_DecentHats.ts | 12 + deployments/sepolia/DecentHats.json | 216 ++++++++++++++++++ .../29ceffef49251ae6baac9879f5f29e05.json | 80 +++++++ 3 files changed, 308 insertions(+) create mode 100644 deploy/core/017_deploy_DecentHats.ts create mode 100644 deployments/sepolia/DecentHats.json create mode 100644 deployments/sepolia/solcInputs/29ceffef49251ae6baac9879f5f29e05.json diff --git a/deploy/core/017_deploy_DecentHats.ts b/deploy/core/017_deploy_DecentHats.ts new file mode 100644 index 00000000..633a450d --- /dev/null +++ b/deploy/core/017_deploy_DecentHats.ts @@ -0,0 +1,12 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable"; +import { ethers } from "hardhat"; + +const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const kv = await hre.deployments.get("KeyValuePairs"); + const hatsAddress = "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137"; + await deployNonUpgradeable(hre, "DecentHats", [hatsAddress, kv.address]); +}; + +export default func; diff --git a/deployments/sepolia/DecentHats.json b/deployments/sepolia/DecentHats.json new file mode 100644 index 00000000..41f03e1a --- /dev/null +++ b/deployments/sepolia/DecentHats.json @@ -0,0 +1,216 @@ +{ + "address": "0x88E72194d93BF417310b197275D972CF78406163", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IHats", + "name": "_hats", + "type": "address" + }, + { + "internalType": "address", + "name": "_keyValuePairs", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_topHatDetails", + "type": "string" + }, + { + "internalType": "string", + "name": "_topHatImageURI", + "type": "string" + }, + { + "components": [ + { + "internalType": "address", + "name": "eligibility", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxSupply", + "type": "uint32" + }, + { + "internalType": "address", + "name": "toggle", + "type": "address" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + }, + { + "internalType": "string", + "name": "imageURI", + "type": "string" + }, + { + "internalType": "bool", + "name": "isMutable", + "type": "bool" + }, + { + "internalType": "address", + "name": "wearer", + "type": "address" + } + ], + "internalType": "struct DecentHats.Hat", + "name": "_adminHat", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "eligibility", + "type": "address" + }, + { + "internalType": "uint32", + "name": "maxSupply", + "type": "uint32" + }, + { + "internalType": "address", + "name": "toggle", + "type": "address" + }, + { + "internalType": "string", + "name": "details", + "type": "string" + }, + { + "internalType": "string", + "name": "imageURI", + "type": "string" + }, + { + "internalType": "bool", + "name": "isMutable", + "type": "bool" + }, + { + "internalType": "address", + "name": "wearer", + "type": "address" + } + ], + "internalType": "struct DecentHats.Hat[]", + "name": "_hats", + "type": "tuple[]" + } + ], + "name": "createAndDeclareTree", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "hats", + "outputs": [ + { + "internalType": "contract IHats", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keyValuePairs", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xf81bf8ff23f908ff35164f44366e441ea5919a424522223b2a856e27c1997527", + "receipt": { + "to": null, + "from": "0xfcf7a2794D066110162ADdcE3085dfd6221D4ddD", + "contractAddress": "0x88E72194d93BF417310b197275D972CF78406163", + "transactionIndex": 32, + "gasUsed": "863023", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x11f8164944bd9543f9268008bb7d67034b39e2028578466bb725998361afc2f7", + "transactionHash": "0xf81bf8ff23f908ff35164f44366e441ea5919a424522223b2a856e27c1997527", + "logs": [], + "blockNumber": 6186036, + "cumulativeGasUsed": "6420203", + "status": 1, + "byzantium": true + }, + "args": [ + "0x3bc1A0Ad72417f2d411118085256fC53CBdDd137", + "0xC0E08581b70cF745770154f3E9a9A8890198b024" + ], + "numDeployments": 1, + "solcInputHash": "29ceffef49251ae6baac9879f5f29e05", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IHats\",\"name\":\"_hats\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_keyValuePairs\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_topHatDetails\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_topHatImageURI\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"eligibility\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxSupply\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"toggle\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"imageURI\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"isMutable\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"wearer\",\"type\":\"address\"}],\"internalType\":\"struct DecentHats.Hat\",\"name\":\"_adminHat\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"eligibility\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"maxSupply\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"toggle\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"details\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"imageURI\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"isMutable\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"wearer\",\"type\":\"address\"}],\"internalType\":\"struct DecentHats.Hat[]\",\"name\":\"_hats\",\"type\":\"tuple[]\"}],\"name\":\"createAndDeclareTree\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hats\",\"outputs\":[{\"internalType\":\"contract IHats\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"keyValuePairs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/DecentHats.sol\":\"DecentHats\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Enum - Collection of enums\\n/// @author Richard Meissner - \\ncontract Enum {\\n enum Operation {Call, DelegateCall}\\n}\\n\",\"keccak256\":\"0x473e45b1a5cc47be494b0e123c9127f0c11c1e0992a321ae5a644c0bfdb2c14f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/core/Module.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../interfaces/IAvatar.sol\\\";\\nimport \\\"../factory/FactoryFriendly.sol\\\";\\nimport \\\"../guard/Guardable.sol\\\";\\n\\nabstract contract Module is FactoryFriendly, Guardable {\\n /// @dev Address that will ultimately execute function calls.\\n address public avatar;\\n /// @dev Address that this module will pass transactions to.\\n address public target;\\n\\n /// @dev Emitted each time the avatar is set.\\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\\n /// @dev Emitted each time the Target is set.\\n event TargetSet(address indexed previousTarget, address indexed newTarget);\\n\\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\\n /// @notice Can only be called by the current owner.\\n function setAvatar(address _avatar) public onlyOwner {\\n address previousAvatar = avatar;\\n avatar = _avatar;\\n emit AvatarSet(previousAvatar, _avatar);\\n }\\n\\n /// @dev Sets the target to a new target (`newTarget`).\\n /// @notice Can only be called by the current owner.\\n function setTarget(address _target) public onlyOwner {\\n address previousTarget = target;\\n target = _target;\\n emit TargetSet(previousTarget, _target);\\n }\\n\\n /// @dev Passes a transaction to be executed by the avatar.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success) {\\n /// Check if a transactioon guard is enabled.\\n if (guard != address(0)) {\\n IGuard(guard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n bytes(\\\"0x\\\"),\\n msg.sender\\n );\\n }\\n success = IAvatar(target).execTransactionFromModule(\\n to,\\n value,\\n data,\\n operation\\n );\\n if (guard != address(0)) {\\n IGuard(guard).checkAfterExecution(bytes32(\\\"0x\\\"), success);\\n }\\n return success;\\n }\\n\\n /// @dev Passes a transaction to be executed by the target and returns data.\\n /// @notice Can only be called by this contract.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execAndReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) internal returns (bool success, bytes memory returnData) {\\n /// Check if a transactioon guard is enabled.\\n if (guard != address(0)) {\\n IGuard(guard).checkTransaction(\\n /// Transaction info used by module transactions.\\n to,\\n value,\\n data,\\n operation,\\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\\n 0,\\n 0,\\n 0,\\n address(0),\\n payable(0),\\n bytes(\\\"0x\\\"),\\n msg.sender\\n );\\n }\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(to, value, data, operation);\\n if (guard != address(0)) {\\n IGuard(guard).checkAfterExecution(bytes32(\\\"0x\\\"), success);\\n }\\n return (success, returnData);\\n }\\n}\\n\",\"keccak256\":\"0x1b9b6f3b43db68f3c142b326544115d1b1fa1f319c980922ea0a29aa80f53664\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nabstract contract FactoryFriendly is OwnableUpgradeable {\\n function setUp(bytes memory initializeParams) public virtual;\\n}\\n\",\"keccak256\":\"0x96e61585b7340a901a54eb4c157ce28b630bff3d9d4597dfaac692128ea458c4\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\nimport \\\"../interfaces/IGuard.sol\\\";\\n\\nabstract contract BaseGuard is IERC165 {\\n function supportsInterface(bytes4 interfaceId)\\n external\\n pure\\n override\\n returns (bool)\\n {\\n return\\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\\n }\\n\\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external virtual;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\\n}\\n\",\"keccak256\":\"0xa825848d06a1fc3cb7ad86727c669c8fc6b3bd8dbe419a617830ddcd5e245e47\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/guard/Guardable.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"./BaseGuard.sol\\\";\\n\\n/// @title Guardable - A contract that manages fallback calls made to this contract\\ncontract Guardable is OwnableUpgradeable {\\n address public guard;\\n\\n event ChangedGuard(address guard);\\n\\n /// `guard_` does not implement IERC165.\\n error NotIERC165Compliant(address guard_);\\n\\n /// @dev Set a guard that checks transactions before execution.\\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\\n function setGuard(address _guard) external onlyOwner {\\n if (_guard != address(0)) {\\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\\n revert NotIERC165Compliant(_guard);\\n }\\n guard = _guard;\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() external view returns (address _guard) {\\n return guard;\\n }\\n}\\n\",\"keccak256\":\"0xebdcfbe7f0822d8afcc21a1ca8d809417b438cc8b27c3547190a1627a9f5110f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\n\\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IAvatar {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n /// @dev Enables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Modules should be stored as a linked list.\\n /// @notice Must emit EnabledModule(address module) if successful.\\n /// @param module Module to be enabled.\\n function enableModule(address module) external;\\n\\n /// @dev Disables a module on the avatar.\\n /// @notice Can only be called by the avatar.\\n /// @notice Must emit DisabledModule(address module) if successful.\\n /// @param prevModule Address that pointed to the module to be removed in the linked list\\n /// @param module Module to be removed.\\n function disableModule(address prevModule, address module) external;\\n\\n /// @dev Allows a Module to execute a transaction.\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success);\\n\\n /// @dev Allows a Module to execute a transaction and return data\\n /// @notice Can only be called by an enabled module.\\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\\n /// @param to Destination address of module transaction.\\n /// @param value Ether value of module transaction.\\n /// @param data Data payload of module transaction.\\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) external returns (bool success, bytes memory returnData);\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) external view returns (bool);\\n\\n /// @dev Returns array of modules.\\n /// @param start Start of the page.\\n /// @param pageSize Maximum number of modules that should be returned.\\n /// @return array Array of modules.\\n /// @return next Start of the next page.\\n function getModulesPaginated(address start, uint256 pageSize)\\n external\\n view\\n returns (address[] memory array, address next);\\n}\\n\",\"keccak256\":\"0xcd5508ffe596eef8fbccfd5fc4f10a34397773547ce64e212d48b5212865ec1f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\n\\ninterface IGuard {\\n function checkTransaction(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver,\\n bytes memory signatures,\\n address msgSender\\n ) external;\\n\\n function checkAfterExecution(bytes32 txHash, bool success) external;\\n}\\n\",\"keccak256\":\"0xd0d855accbc5fba81c67ab22cdbb03325a8a4d7f6b7e981d1ff0fec3178e464d\",\"license\":\"LGPL-3.0-only\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xaf159a8b1923ad2a26d516089bceca9bdeaeacd04be50983ea00ba63070f08a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/DecentHats.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity =0.8.19;\\n\\nimport {Enum} from \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport {IAvatar} from \\\"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\\\";\\nimport {IHats} from \\\"./interfaces/hats/IHats.sol\\\";\\nimport {Strings} from \\\"@openzeppelin/contracts/utils/Strings.sol\\\";\\n\\ncontract DecentHats {\\n struct Hat {\\n address eligibility;\\n uint32 maxSupply;\\n address toggle;\\n string details;\\n string imageURI;\\n bool isMutable;\\n address wearer;\\n }\\n\\n IHats public hats;\\n address public keyValuePairs;\\n\\n constructor(IHats _hats, address _keyValuePairs) {\\n hats = _hats;\\n keyValuePairs = _keyValuePairs;\\n }\\n\\n function createAndDeclareTree(\\n string memory _topHatDetails,\\n string memory _topHatImageURI,\\n Hat calldata _adminHat,\\n Hat[] calldata _hats\\n ) public {\\n uint256 topHatId = hats.mintTopHat(\\n msg.sender,\\n _topHatDetails,\\n _topHatImageURI\\n );\\n\\n string[] memory keys = new string[](1);\\n keys[0] = \\\"hatsTreeId\\\";\\n\\n string[] memory values = new string[](1);\\n values[0] = Strings.toString(topHatId);\\n\\n IAvatar(msg.sender).execTransactionFromModule(\\n keyValuePairs,\\n 0,\\n abi.encodeWithSignature(\\n \\\"updateValues(string[],string[])\\\",\\n keys,\\n values\\n ),\\n Enum.Operation.Call\\n );\\n\\n uint256 adminHatId = hats.createHat(\\n topHatId,\\n _adminHat.details,\\n _adminHat.maxSupply,\\n _adminHat.eligibility,\\n _adminHat.toggle,\\n _adminHat.isMutable,\\n _adminHat.imageURI\\n );\\n\\n if (_adminHat.wearer != address(0)) {\\n hats.mintHat(adminHatId, _adminHat.wearer);\\n }\\n\\n for (uint256 i = 0; i < _hats.length; ) {\\n Hat memory hat = _hats[i];\\n uint256 hatId = hats.createHat(\\n adminHatId,\\n hat.details,\\n hat.maxSupply,\\n hat.eligibility,\\n hat.toggle,\\n hat.isMutable,\\n hat.imageURI\\n );\\n\\n if (hat.wearer != address(0)) {\\n hats.mintHat(hatId, hat.wearer);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc6a63df892da9fcdfd9f08e5e658626178ab8fa364957f05e1e7fb45f6468905\",\"license\":\"MIT\"},\"contracts/interfaces/hats/IHats.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\n// Copyright (C) 2023 Haberdasher Labs\\n//\\n// This program is free software: you can redistribute it and/or modify\\n// it under the terms of the GNU Affero General Public License as published by\\n// the Free Software Foundation, either version 3 of the License, or\\n// (at your option) any later version.\\n//\\n// This program is distributed in the hope that it will be useful,\\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n// GNU Affero General Public License for more details.\\n//\\n// You should have received a copy of the GNU Affero General Public License\\n// along with this program. If not, see .\\n\\npragma solidity >=0.8.13;\\n\\ninterface IHats {\\n function mintTopHat(\\n address _target,\\n string memory _details,\\n string memory _imageURI\\n ) external returns (uint256 topHatId);\\n\\n function createHat(\\n uint256 _admin,\\n string calldata _details,\\n uint32 _maxSupply,\\n address _eligibility,\\n address _toggle,\\n bool _mutable,\\n string calldata _imageURI\\n ) external returns (uint256 newHatId);\\n\\n function mintHat(\\n uint256 _hatId,\\n address _wearer\\n ) external returns (bool success);\\n}\\n\",\"keccak256\":\"0xdb503e09bd0a8b36dd7fc39fe0dada01c14cdb089c92ccfda94c31e689a5ebff\",\"license\":\"AGPL-3.0\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610e8a380380610e8a83398101604081905261002f91610078565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100b2565b6001600160a01b038116811461007557600080fd5b50565b6000806040838503121561008b57600080fd5b825161009681610060565b60208401519092506100a781610060565b809150509250929050565b610dc9806100c16000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063447a7a8514610046578063bb70162b14610075578063f99f02381461008a575b600080fd5b600154610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046107cc565b61009d565b005b600054610059906001600160a01b031681565b60008054604051631a64dfad60e01b81526001600160a01b0390911690631a64dfad906100d29033908a908a906004016108ce565b6020604051808303816000875af11580156100f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610115919061090e565b60408051600180825281830190925291925060009190816020015b60608152602001906001900390816101305790505090506040518060400160405280600a8152602001691a185d1cd51c9959525960b21b8152508160008151811061017d5761017d610927565b6020908102919091010152604080516001808252818301909252600091816020015b606081526020019060019003908161019f5790505090506101bf836105ab565b816000815181106101d2576101d2610927565b6020908102919091010152600154604051339163468721a7916001600160a01b039091169060009061020a9087908790602401610995565b60408051601f198184030181529181526020820180516001600160e01b031663579374b960e11b1790525160e085901b6001600160e01b0319168152610258939291906000906004016109c3565b6020604051808303816000875af1158015610277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029b9190610a2a565b50600080546001600160a01b031663b052925e856102bc60608b018b610a4e565b6102cc60408d0160208e01610aae565b6102d960208e018e610ae0565b8d60400160208101906102ec9190610ae0565b8e60a00160208101906102ff9190610b06565b8f806080019061030f9190610a4e565b6040518a63ffffffff1660e01b815260040161033399989796959493929190610b4c565b6020604051808303816000875af1158015610352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610376919061090e565b9050600061038a60e0890160c08a01610ae0565b6001600160a01b03161461042c576000546001600160a01b031663641f776e826103ba60e08b0160c08c01610ae0565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b031660248201526044016020604051808303816000875af1158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610a2a565b505b60005b8581101561059f57600087878381811061044b5761044b610927565b905060200281019061045d9190610bb4565b61046690610bd4565b6000805460608301516020840151845160408087015160a088015160808901519251635829492f60e11b815298995096976001600160a01b039096169663b052925e966104bf968d969095909490939291600401610c96565b6020604051808303816000875af11580156104de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610502919061090e565b60c08301519091506001600160a01b0316156105955760005460c083015160405163320fbbb760e11b8152600481018490526001600160a01b03918216602482015291169063641f776e906044016020604051808303816000875af115801561056f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105939190610a2a565b505b505060010161042f565b50505050505050505050565b6060816000036105d25750506040805180820190915260018152600360fc1b602082015290565b8160005b81156105fc57806105e681610d10565b91506105f59050600a83610d3f565b91506105d6565b60008167ffffffffffffffff811115610617576106176106b4565b6040519080825280601f01601f191660200182016040528015610641576020820181803683370190505b5090505b84156106ac57610656600183610d53565b9150610663600a86610d6c565b61066e906030610d80565b60f81b81838151811061068357610683610927565b60200101906001600160f81b031916908160001a9053506106a5600a86610d3f565b9450610645565b949350505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156106ed576106ed6106b4565b60405290565b600082601f83011261070457600080fd5b813567ffffffffffffffff8082111561071f5761071f6106b4565b604051601f8301601f19908116603f01168101908282118183101715610747576107476106b4565b8160405283815286602085880101111561076057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008083601f84011261079257600080fd5b50813567ffffffffffffffff8111156107aa57600080fd5b6020830191508360208260051b85010111156107c557600080fd5b9250929050565b6000806000806000608086880312156107e457600080fd5b853567ffffffffffffffff808211156107fc57600080fd5b61080889838a016106f3565b9650602088013591508082111561081e57600080fd5b61082a89838a016106f3565b9550604088013591508082111561084057600080fd5b9087019060e0828a03121561085457600080fd5b9093506060870135908082111561086a57600080fd5b5061087788828901610780565b969995985093965092949392505050565b6000815180845260005b818110156108ae57602081850181015186830182015201610892565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03841681526060602082018190526000906108f290830185610888565b82810360408401526109048185610888565b9695505050505050565b60006020828403121561092057600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600082825180855260208086019550808260051b84010181860160005b8481101561098857601f19868403018952610976838351610888565b9884019892509083019060010161095a565b5090979650505050505050565b6040815260006109a8604083018561093d565b82810360208401526109ba818561093d565b95945050505050565b60018060a01b03851681528360208201526080604082015260006109ea6080830185610888565b905060028310610a0a57634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b8015158114610a2757600080fd5b50565b600060208284031215610a3c57600080fd5b8151610a4781610a19565b9392505050565b6000808335601e19843603018112610a6557600080fd5b83018035915067ffffffffffffffff821115610a8057600080fd5b6020019150368190038213156107c557600080fd5b803563ffffffff81168114610aa957600080fd5b919050565b600060208284031215610ac057600080fd5b610a4782610a95565b80356001600160a01b0381168114610aa957600080fd5b600060208284031215610af257600080fd5b610a4782610ac9565b8035610aa981610a19565b600060208284031215610b1857600080fd5b8135610a4781610a19565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815260e060208201526000610b6660e083018a8c610b23565b63ffffffff891660408401526001600160a01b0388811660608501528716608084015285151560a084015282810360c0840152610ba4818587610b23565b9c9b505050505050505050505050565b6000823560de19833603018112610bca57600080fd5b9190910192915050565b600060e08236031215610be657600080fd5b610bee6106ca565b610bf783610ac9565b8152610c0560208401610a95565b6020820152610c1660408401610ac9565b6040820152606083013567ffffffffffffffff80821115610c3657600080fd5b610c42368387016106f3565b60608401526080850135915080821115610c5b57600080fd5b50610c68368286016106f3565b608083015250610c7a60a08401610afb565b60a0820152610c8b60c08401610ac9565b60c082015292915050565b87815260e060208201526000610caf60e0830189610888565b63ffffffff881660408401526001600160a01b0387811660608501528616608084015284151560a084015282810360c0840152610cec8185610888565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201610d2257610d22610cfa565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082610d4e57610d4e610d29565b500490565b81810381811115610d6657610d66610cfa565b92915050565b600082610d7b57610d7b610d29565b500690565b80820180821115610d6657610d66610cfa56fea26469706673582212200139617055d0039cef8ac3ef9018a7cb919127000138bf66ab566c5e5b5e55ab64736f6c63430008130033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063447a7a8514610046578063bb70162b14610075578063f99f02381461008a575b600080fd5b600154610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046107cc565b61009d565b005b600054610059906001600160a01b031681565b60008054604051631a64dfad60e01b81526001600160a01b0390911690631a64dfad906100d29033908a908a906004016108ce565b6020604051808303816000875af11580156100f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610115919061090e565b60408051600180825281830190925291925060009190816020015b60608152602001906001900390816101305790505090506040518060400160405280600a8152602001691a185d1cd51c9959525960b21b8152508160008151811061017d5761017d610927565b6020908102919091010152604080516001808252818301909252600091816020015b606081526020019060019003908161019f5790505090506101bf836105ab565b816000815181106101d2576101d2610927565b6020908102919091010152600154604051339163468721a7916001600160a01b039091169060009061020a9087908790602401610995565b60408051601f198184030181529181526020820180516001600160e01b031663579374b960e11b1790525160e085901b6001600160e01b0319168152610258939291906000906004016109c3565b6020604051808303816000875af1158015610277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029b9190610a2a565b50600080546001600160a01b031663b052925e856102bc60608b018b610a4e565b6102cc60408d0160208e01610aae565b6102d960208e018e610ae0565b8d60400160208101906102ec9190610ae0565b8e60a00160208101906102ff9190610b06565b8f806080019061030f9190610a4e565b6040518a63ffffffff1660e01b815260040161033399989796959493929190610b4c565b6020604051808303816000875af1158015610352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610376919061090e565b9050600061038a60e0890160c08a01610ae0565b6001600160a01b03161461042c576000546001600160a01b031663641f776e826103ba60e08b0160c08c01610ae0565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b031660248201526044016020604051808303816000875af1158015610406573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042a9190610a2a565b505b60005b8581101561059f57600087878381811061044b5761044b610927565b905060200281019061045d9190610bb4565b61046690610bd4565b6000805460608301516020840151845160408087015160a088015160808901519251635829492f60e11b815298995096976001600160a01b039096169663b052925e966104bf968d969095909490939291600401610c96565b6020604051808303816000875af11580156104de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610502919061090e565b60c08301519091506001600160a01b0316156105955760005460c083015160405163320fbbb760e11b8152600481018490526001600160a01b03918216602482015291169063641f776e906044016020604051808303816000875af115801561056f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105939190610a2a565b505b505060010161042f565b50505050505050505050565b6060816000036105d25750506040805180820190915260018152600360fc1b602082015290565b8160005b81156105fc57806105e681610d10565b91506105f59050600a83610d3f565b91506105d6565b60008167ffffffffffffffff811115610617576106176106b4565b6040519080825280601f01601f191660200182016040528015610641576020820181803683370190505b5090505b84156106ac57610656600183610d53565b9150610663600a86610d6c565b61066e906030610d80565b60f81b81838151811061068357610683610927565b60200101906001600160f81b031916908160001a9053506106a5600a86610d3f565b9450610645565b949350505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156106ed576106ed6106b4565b60405290565b600082601f83011261070457600080fd5b813567ffffffffffffffff8082111561071f5761071f6106b4565b604051601f8301601f19908116603f01168101908282118183101715610747576107476106b4565b8160405283815286602085880101111561076057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008083601f84011261079257600080fd5b50813567ffffffffffffffff8111156107aa57600080fd5b6020830191508360208260051b85010111156107c557600080fd5b9250929050565b6000806000806000608086880312156107e457600080fd5b853567ffffffffffffffff808211156107fc57600080fd5b61080889838a016106f3565b9650602088013591508082111561081e57600080fd5b61082a89838a016106f3565b9550604088013591508082111561084057600080fd5b9087019060e0828a03121561085457600080fd5b9093506060870135908082111561086a57600080fd5b5061087788828901610780565b969995985093965092949392505050565b6000815180845260005b818110156108ae57602081850181015186830182015201610892565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03841681526060602082018190526000906108f290830185610888565b82810360408401526109048185610888565b9695505050505050565b60006020828403121561092057600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600082825180855260208086019550808260051b84010181860160005b8481101561098857601f19868403018952610976838351610888565b9884019892509083019060010161095a565b5090979650505050505050565b6040815260006109a8604083018561093d565b82810360208401526109ba818561093d565b95945050505050565b60018060a01b03851681528360208201526080604082015260006109ea6080830185610888565b905060028310610a0a57634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b8015158114610a2757600080fd5b50565b600060208284031215610a3c57600080fd5b8151610a4781610a19565b9392505050565b6000808335601e19843603018112610a6557600080fd5b83018035915067ffffffffffffffff821115610a8057600080fd5b6020019150368190038213156107c557600080fd5b803563ffffffff81168114610aa957600080fd5b919050565b600060208284031215610ac057600080fd5b610a4782610a95565b80356001600160a01b0381168114610aa957600080fd5b600060208284031215610af257600080fd5b610a4782610ac9565b8035610aa981610a19565b600060208284031215610b1857600080fd5b8135610a4781610a19565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815260e060208201526000610b6660e083018a8c610b23565b63ffffffff891660408401526001600160a01b0388811660608501528716608084015285151560a084015282810360c0840152610ba4818587610b23565b9c9b505050505050505050505050565b6000823560de19833603018112610bca57600080fd5b9190910192915050565b600060e08236031215610be657600080fd5b610bee6106ca565b610bf783610ac9565b8152610c0560208401610a95565b6020820152610c1660408401610ac9565b6040820152606083013567ffffffffffffffff80821115610c3657600080fd5b610c42368387016106f3565b60608401526080850135915080821115610c5b57600080fd5b50610c68368286016106f3565b608083015250610c7a60a08401610afb565b60a0820152610c8b60c08401610ac9565b60c082015292915050565b87815260e060208201526000610caf60e0830189610888565b63ffffffff881660408401526001600160a01b0387811660608501528616608084015284151560a084015282810360c0840152610cec8185610888565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201610d2257610d22610cfa565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082610d4e57610d4e610d29565b500490565b81810381811115610d6657610d66610cfa565b92915050565b600082610d7b57610d7b610d29565b500690565b80820180821115610d6657610d66610cfa56fea26469706673582212200139617055d0039cef8ac3ef9018a7cb919127000138bf66ab566c5e5b5e55ab64736f6c63430008130033", + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1356, + "contract": "contracts/DecentHats.sol:DecentHats", + "label": "hats", + "offset": 0, + "slot": "0", + "type": "t_contract(IHats)1591" + }, + { + "astId": 1358, + "contract": "contracts/DecentHats.sol:DecentHats", + "label": "keyValuePairs", + "offset": 0, + "slot": "1", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IHats)1591": { + "encoding": "inplace", + "label": "contract IHats", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/29ceffef49251ae6baac9879f5f29e05.json b/deployments/sepolia/solcInputs/29ceffef49251ae6baac9879f5f29e05.json new file mode 100644 index 00000000..1ad88ec0 --- /dev/null +++ b/deployments/sepolia/solcInputs/29ceffef49251ae6baac9879f5f29e05.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/common/Enum.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Enum - Collection of enums\n/// @author Richard Meissner - \ncontract Enum {\n enum Operation {Call, DelegateCall}\n}\n" + }, + "@gnosis.pm/zodiac/contracts/core/Module.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../interfaces/IAvatar.sol\";\nimport \"../factory/FactoryFriendly.sol\";\nimport \"../guard/Guardable.sol\";\n\nabstract contract Module is FactoryFriendly, Guardable {\n /// @dev Address that will ultimately execute function calls.\n address public avatar;\n /// @dev Address that this module will pass transactions to.\n address public target;\n\n /// @dev Emitted each time the avatar is set.\n event AvatarSet(address indexed previousAvatar, address indexed newAvatar);\n /// @dev Emitted each time the Target is set.\n event TargetSet(address indexed previousTarget, address indexed newTarget);\n\n /// @dev Sets the avatar to a new avatar (`newAvatar`).\n /// @notice Can only be called by the current owner.\n function setAvatar(address _avatar) public onlyOwner {\n address previousAvatar = avatar;\n avatar = _avatar;\n emit AvatarSet(previousAvatar, _avatar);\n }\n\n /// @dev Sets the target to a new target (`newTarget`).\n /// @notice Can only be called by the current owner.\n function setTarget(address _target) public onlyOwner {\n address previousTarget = target;\n target = _target;\n emit TargetSet(previousTarget, _target);\n }\n\n /// @dev Passes a transaction to be executed by the avatar.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success) {\n /// Check if a transactioon guard is enabled.\n if (guard != address(0)) {\n IGuard(guard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n bytes(\"0x\"),\n msg.sender\n );\n }\n success = IAvatar(target).execTransactionFromModule(\n to,\n value,\n data,\n operation\n );\n if (guard != address(0)) {\n IGuard(guard).checkAfterExecution(bytes32(\"0x\"), success);\n }\n return success;\n }\n\n /// @dev Passes a transaction to be executed by the target and returns data.\n /// @notice Can only be called by this contract.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execAndReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) internal returns (bool success, bytes memory returnData) {\n /// Check if a transactioon guard is enabled.\n if (guard != address(0)) {\n IGuard(guard).checkTransaction(\n /// Transaction info used by module transactions.\n to,\n value,\n data,\n operation,\n /// Zero out the redundant transaction information only used for Safe multisig transctions.\n 0,\n 0,\n 0,\n address(0),\n payable(0),\n bytes(\"0x\"),\n msg.sender\n );\n }\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(to, value, data, operation);\n if (guard != address(0)) {\n IGuard(guard).checkAfterExecution(bytes32(\"0x\"), success);\n }\n return (success, returnData);\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract FactoryFriendly is OwnableUpgradeable {\n function setUp(bytes memory initializeParams) public virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/BaseGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"../interfaces/IGuard.sol\";\n\nabstract contract BaseGuard is IERC165 {\n function supportsInterface(bytes4 interfaceId)\n external\n pure\n override\n returns (bool)\n {\n return\n interfaceId == type(IGuard).interfaceId || // 0xe6d7a83a\n interfaceId == type(IERC165).interfaceId; // 0x01ffc9a7\n }\n\n /// @dev Module transactions only use the first four parameters: to, value, data, and operation.\n /// Module.sol hardcodes the remaining parameters as 0 since they are not used for module transactions.\n /// @notice This interface is used to maintain compatibilty with Gnosis Safe transaction guards.\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external virtual;\n\n function checkAfterExecution(bytes32 txHash, bool success) external virtual;\n}\n" + }, + "@gnosis.pm/zodiac/contracts/guard/Guardable.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"./BaseGuard.sol\";\n\n/// @title Guardable - A contract that manages fallback calls made to this contract\ncontract Guardable is OwnableUpgradeable {\n address public guard;\n\n event ChangedGuard(address guard);\n\n /// `guard_` does not implement IERC165.\n error NotIERC165Compliant(address guard_);\n\n /// @dev Set a guard that checks transactions before execution.\n /// @param _guard The address of the guard to be used or the 0 address to disable the guard.\n function setGuard(address _guard) external onlyOwner {\n if (_guard != address(0)) {\n if (!BaseGuard(_guard).supportsInterface(type(IGuard).interfaceId))\n revert NotIERC165Compliant(_guard);\n }\n guard = _guard;\n emit ChangedGuard(guard);\n }\n\n function getGuard() external view returns (address _guard) {\n return guard;\n }\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\n\n/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IAvatar {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n /// @dev Enables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Modules should be stored as a linked list.\n /// @notice Must emit EnabledModule(address module) if successful.\n /// @param module Module to be enabled.\n function enableModule(address module) external;\n\n /// @dev Disables a module on the avatar.\n /// @notice Can only be called by the avatar.\n /// @notice Must emit DisabledModule(address module) if successful.\n /// @param prevModule Address that pointed to the module to be removed in the linked list\n /// @param module Module to be removed.\n function disableModule(address prevModule, address module) external;\n\n /// @dev Allows a Module to execute a transaction.\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success);\n\n /// @dev Allows a Module to execute a transaction and return data\n /// @notice Can only be called by an enabled module.\n /// @notice Must emit ExecutionFromModuleSuccess(address module) if successful.\n /// @notice Must emit ExecutionFromModuleFailure(address module) if unsuccessful.\n /// @param to Destination address of module transaction.\n /// @param value Ether value of module transaction.\n /// @param data Data payload of module transaction.\n /// @param operation Operation type of module transaction: 0 == call, 1 == delegate call.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) external returns (bool success, bytes memory returnData);\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) external view returns (bool);\n\n /// @dev Returns array of modules.\n /// @param start Start of the page.\n /// @param pageSize Maximum number of modules that should be returned.\n /// @return array Array of modules.\n /// @return next Start of the next page.\n function getModulesPaginated(address start, uint256 pageSize)\n external\n view\n returns (address[] memory array, address next);\n}\n" + }, + "@gnosis.pm/zodiac/contracts/interfaces/IGuard.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\n\ninterface IGuard {\n function checkTransaction(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver,\n bytes memory signatures,\n address msgSender\n ) external;\n\n function checkAfterExecution(bytes32 txHash, bool success) external;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\n * initialization step. This is essential to configure modules that are added through upgrades and that require\n * initialization.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "contracts/DecentHats.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity =0.8.19;\n\nimport {Enum} from \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport {IAvatar} from \"@gnosis.pm/zodiac/contracts/interfaces/IAvatar.sol\";\nimport {IHats} from \"./interfaces/hats/IHats.sol\";\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract DecentHats {\n struct Hat {\n address eligibility;\n uint32 maxSupply;\n address toggle;\n string details;\n string imageURI;\n bool isMutable;\n address wearer;\n }\n\n IHats public hats;\n address public keyValuePairs;\n\n constructor(IHats _hats, address _keyValuePairs) {\n hats = _hats;\n keyValuePairs = _keyValuePairs;\n }\n\n function createAndDeclareTree(\n string memory _topHatDetails,\n string memory _topHatImageURI,\n Hat calldata _adminHat,\n Hat[] calldata _hats\n ) public {\n uint256 topHatId = hats.mintTopHat(\n msg.sender,\n _topHatDetails,\n _topHatImageURI\n );\n\n string[] memory keys = new string[](1);\n keys[0] = \"hatsTreeId\";\n\n string[] memory values = new string[](1);\n values[0] = Strings.toString(topHatId);\n\n IAvatar(msg.sender).execTransactionFromModule(\n keyValuePairs,\n 0,\n abi.encodeWithSignature(\n \"updateValues(string[],string[])\",\n keys,\n values\n ),\n Enum.Operation.Call\n );\n\n uint256 adminHatId = hats.createHat(\n topHatId,\n _adminHat.details,\n _adminHat.maxSupply,\n _adminHat.eligibility,\n _adminHat.toggle,\n _adminHat.isMutable,\n _adminHat.imageURI\n );\n\n if (_adminHat.wearer != address(0)) {\n hats.mintHat(adminHatId, _adminHat.wearer);\n }\n\n for (uint256 i = 0; i < _hats.length; ) {\n Hat memory hat = _hats[i];\n uint256 hatId = hats.createHat(\n adminHatId,\n hat.details,\n hat.maxSupply,\n hat.eligibility,\n hat.toggle,\n hat.isMutable,\n hat.imageURI\n );\n\n if (hat.wearer != address(0)) {\n hats.mintHat(hatId, hat.wearer);\n }\n\n unchecked {\n ++i;\n }\n }\n }\n}\n" + }, + "contracts/interfaces/hats/IHats.sol": { + "content": "// SPDX-License-Identifier: AGPL-3.0\n// Copyright (C) 2023 Haberdasher Labs\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\npragma solidity >=0.8.13;\n\ninterface IHats {\n function mintTopHat(\n address _target,\n string memory _details,\n string memory _imageURI\n ) external returns (uint256 topHatId);\n\n function createHat(\n uint256 _admin,\n string calldata _details,\n uint32 _maxSupply,\n address _eligibility,\n address _toggle,\n bool _mutable,\n string calldata _imageURI\n ) external returns (uint256 newHatId);\n\n function mintHat(\n uint256 _hatId,\n address _wearer\n ) external returns (bool success);\n}\n" + }, + "contracts/mock/MockHats.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity =0.8.19;\n\nimport {IHats} from \"../interfaces/hats/IHats.sol\";\n\ncontract MockHats is IHats {\n uint256 count = 0;\n\n function mintTopHat(\n address,\n string memory,\n string memory\n ) external returns (uint256 topHatId) {\n topHatId = count;\n count++;\n }\n\n function createHat(\n uint256,\n string calldata,\n uint32,\n address,\n address,\n bool,\n string calldata\n ) external returns (uint256 newHatId) {\n newHatId = count;\n count++;\n }\n\n function mintHat(uint256, address) external pure returns (bool success) {\n success = true;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file