diff --git a/deploy/005_deploy_bt_factory.ts b/deploy/005_deploy_bt_factory.ts index be5c0cf..9cc4158 100644 --- a/deploy/005_deploy_bt_factory.ts +++ b/deploy/005_deploy_bt_factory.ts @@ -20,7 +20,7 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { return; } - console.log('\n\nDeploying BaalAdvTokenSummoner factory on network:', network.name); + console.log('\n\nDeploying BaalAdvTokenSummoner(UUPS) factory on network:', network.name); console.log('Deployer address:', `${chainId}:${deployer}`); console.log( 'Deployer balance:', @@ -42,7 +42,7 @@ const deployFn: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { from: deployer, args: [], proxy: { - proxyContract: 'OpenZeppelinTransparentProxy', + proxyContract: 'UUPS', methodName: 'initialize', }, log: true, diff --git a/deployments/optimisticEthereum/BaalAdvTokenSummoner.json b/deployments/optimisticEthereum/BaalAdvTokenSummoner.json index 53e7202..e6380b8 100644 --- a/deployments/optimisticEthereum/BaalAdvTokenSummoner.json +++ b/deployments/optimisticEthereum/BaalAdvTokenSummoner.json @@ -1,5 +1,5 @@ { - "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "address": "0x84561C97156a128662B62952890469214FDC87bf", "abi": [ { "anonymous": false, @@ -50,76 +50,6 @@ "stateMutability": "payable", "type": "fallback" }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, { "stateMutability": "payable", "type": "receive" @@ -309,12 +239,38 @@ "inputs": [ { "internalType": "address", - "name": "_logic", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", "type": "address" }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", - "name": "admin_", + "name": "_logic", "type": "address" }, { @@ -326,5 +282,94 @@ "stateMutability": "payable", "type": "constructor" } - ] + ], + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0x84561C97156a128662B62952890469214FDC87bf", + "transactionIndex": 8, + "gasUsed": "333346", + "logsBloom": "0x02000000000000000000000000000000400000000000001000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800002000001000000000000000000000040000800000000020000000000000000000800000000000000000000000200000000400000000000000000000000000040000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000000000020000000000000000000001000000000000000000000000000000", + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3", + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e95f3d6a163e79cf057375c97175b1e22eaea02f" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a17a42ccf455f9aab21eb6ee9c41fdd28cf4d900" + ], + "data": "0x", + "logIndex": 22, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 23, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + } + ], + "blockNumber": 108683897, + "cumulativeGasUsed": "1383816", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(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\\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\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [] + }, + "implementation": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } } \ No newline at end of file diff --git a/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json b/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json index 92bcfd7..c9d0125 100644 --- a/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json +++ b/deployments/optimisticEthereum/BaalAdvTokenSummoner_Implementation.json @@ -1,6 +1,11 @@ { - "address": "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", + "address": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, { "anonymous": false, "inputs": [ @@ -258,5 +263,193 @@ "stateMutability": "payable", "type": "function" } - ] + ], + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "transactionIndex": 9, + "gasUsed": "2166814", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000200000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000", + "blockHash": "0x234e049b9add01f7fbed73317238d7f45c54ac861392b477095303d3a99ad7c1", + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "logs": [ + { + "transactionIndex": 9, + "blockNumber": 108683894, + "transactionHash": "0x9f2eb0ecf4945d20be7e6268d7648ed9d1e78c5a669e4b7e30ee5e944a7c6424", + "address": "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 54, + "blockHash": "0x234e049b9add01f7fbed73317238d7f45c54ac861392b477095303d3a99ad7c1" + } + ], + "blockNumber": 108683894, + "cumulativeGasUsed": "4411837", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "e59d9182173b42b6940606b788cb65c6", + "metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lootToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sharesToken\",\"type\":\"address\"}],\"name\":\"DeployBaalTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"summoner\",\"type\":\"address\"}],\"name\":\"setSummoner\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_baalSummoner\",\"outputs\":[{\"internalType\":\"contract IBaalSummoner\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baalSummoner\",\"type\":\"address\"}],\"name\":\"setSummonerAddr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_safeAddr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_forwarderAddr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initializationMintParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"initializationTokenParams\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"postInitializationActions\",\"type\":\"bytes[]\"}],\"name\":\"summonBaalFromReferrer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"proxiableUUID()\":{\"details\":\"Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setSummonerAddr(address)\":{\"details\":\"Sets the address of the BaalSummoner contract\",\"params\":{\"baalSummoner\":\"The address of the BaalSummoner contract\"}},\"summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])\":{\"details\":\"Summon a new Baal contract with a new set of tokens\",\"params\":{\"_forwarderAddr\":\"The address of the forwarder to be used, 0x0 if not set\",\"_safeAddr\":\"The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\",\"_saltNonce\":\"The salt nonce to be used for the Safe contract\",\"initializationMintParams\":\"The parameters for minting the tokens\",\"initializationTokenParams\":\"The parameters for deploying the tokens\",\"postInitializationActions\":\"The actions to be performed after the initialization\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":\"BaalAdvTokenSummoner\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./base/ModuleManager.sol\\\";\\nimport \\\"./base/OwnerManager.sol\\\";\\nimport \\\"./base/FallbackManager.sol\\\";\\nimport \\\"./base/GuardManager.sol\\\";\\nimport \\\"./common/EtherPaymentFallback.sol\\\";\\nimport \\\"./common/Singleton.sol\\\";\\nimport \\\"./common/SignatureDecoder.sol\\\";\\nimport \\\"./common/SecuredTokenTransfer.sol\\\";\\nimport \\\"./common/StorageAccessible.sol\\\";\\nimport \\\"./interfaces/ISignatureValidator.sol\\\";\\nimport \\\"./external/GnosisSafeMath.sol\\\";\\n\\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafe is\\n EtherPaymentFallback,\\n Singleton,\\n ModuleManager,\\n OwnerManager,\\n SignatureDecoder,\\n SecuredTokenTransfer,\\n ISignatureValidatorConstants,\\n FallbackManager,\\n StorageAccessible,\\n GuardManager\\n{\\n using GnosisSafeMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n // keccak256(\\n // \\\"EIP712Domain(uint256 chainId,address verifyingContract)\\\"\\n // );\\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\\n\\n // keccak256(\\n // \\\"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\\\"\\n // );\\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\\n\\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\\n event SignMsg(bytes32 indexed msgHash);\\n event ExecutionFailure(bytes32 txHash, uint256 payment);\\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\\n\\n uint256 public nonce;\\n bytes32 private _deprecatedDomainSeparator;\\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\\n mapping(bytes32 => uint256) public signedMessages;\\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\\n\\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\\n constructor() {\\n // By setting the threshold it is not possible to call setup anymore,\\n // so we create a Safe with 0 owners and threshold 1.\\n // This is an unusable Safe, perfect for the singleton\\n threshold = 1;\\n }\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n /// @param to Contract address for optional delegate call.\\n /// @param data Data payload for optional delegate call.\\n /// @param fallbackHandler Handler for fallback calls to this contract\\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\\n /// @param payment Value that should be paid\\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\\n function setup(\\n address[] calldata _owners,\\n uint256 _threshold,\\n address to,\\n bytes calldata data,\\n address fallbackHandler,\\n address paymentToken,\\n uint256 payment,\\n address payable paymentReceiver\\n ) external {\\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\\n setupOwners(_owners, _threshold);\\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\\n setupModules(to, data);\\n\\n if (payment > 0) {\\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\\n }\\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\\n }\\n\\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\\n /// Note: The fees are always transferred, even if the user transaction fails.\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @param safeTxGas Gas that should be used for the Safe transaction.\\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Gas price that should be used for the payment calculation.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\\n function execTransaction(\\n address to,\\n uint256 value,\\n bytes calldata 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 ) public payable virtual returns (bool success) {\\n bytes32 txHash;\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n bytes memory txHashData =\\n encodeTransactionData(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n nonce\\n );\\n // Increase nonce and execute transaction.\\n nonce++;\\n txHash = keccak256(txHashData);\\n checkSignatures(txHash, txHashData, signatures);\\n }\\n address guard = getGuard();\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkTransaction(\\n // Transaction info\\n to,\\n value,\\n data,\\n operation,\\n safeTxGas,\\n // Payment info\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n // Signature info\\n signatures,\\n msg.sender\\n );\\n }\\n }\\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \\\"GS010\\\");\\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\\n {\\n uint256 gasUsed = gasleft();\\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\\n gasUsed = gasUsed.sub(gasleft());\\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\\n require(success || safeTxGas != 0 || gasPrice != 0, \\\"GS013\\\");\\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\\n uint256 payment = 0;\\n if (gasPrice > 0) {\\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\\n }\\n if (success) emit ExecutionSuccess(txHash, payment);\\n else emit ExecutionFailure(txHash, payment);\\n }\\n {\\n if (guard != address(0)) {\\n Guard(guard).checkAfterExecution(txHash, success);\\n }\\n }\\n }\\n\\n function handlePayment(\\n uint256 gasUsed,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address payable refundReceiver\\n ) private returns (uint256 payment) {\\n // solhint-disable-next-line avoid-tx-origin\\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\\n if (gasToken == address(0)) {\\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\\n require(receiver.send(payment), \\\"GS011\\\");\\n } else {\\n payment = gasUsed.add(baseGas).mul(gasPrice);\\n require(transferToken(gasToken, receiver, payment), \\\"GS012\\\");\\n }\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n */\\n function checkSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures\\n ) public view {\\n // Load threshold to avoid multiple storage loads\\n uint256 _threshold = threshold;\\n // Check that a threshold is set\\n require(_threshold > 0, \\\"GS001\\\");\\n checkNSignatures(dataHash, data, signatures, _threshold);\\n }\\n\\n /**\\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\\n * @param data That should be signed (this is passed to an external validator contract)\\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\\n * @param requiredSignatures Amount of required valid signatures.\\n */\\n function checkNSignatures(\\n bytes32 dataHash,\\n bytes memory data,\\n bytes memory signatures,\\n uint256 requiredSignatures\\n ) public view {\\n // Check that the provided signature data is not too short\\n require(signatures.length >= requiredSignatures.mul(65), \\\"GS020\\\");\\n // There cannot be an owner with address 0.\\n address lastOwner = address(0);\\n address currentOwner;\\n uint8 v;\\n bytes32 r;\\n bytes32 s;\\n uint256 i;\\n for (i = 0; i < requiredSignatures; i++) {\\n (v, r, s) = signatureSplit(signatures, i);\\n if (v == 0) {\\n // If v is 0 then it is a contract signature\\n // When handling contract signatures the address of the contract is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n\\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\\n // Here we only check that the pointer is not pointing inside the part that is being processed\\n require(uint256(s) >= requiredSignatures.mul(65), \\\"GS021\\\");\\n\\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\\n require(uint256(s).add(32) <= signatures.length, \\\"GS022\\\");\\n\\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\\n uint256 contractSignatureLen;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\\n }\\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \\\"GS023\\\");\\n\\n // Check signature\\n bytes memory contractSignature;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\\n contractSignature := add(add(signatures, s), 0x20)\\n }\\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \\\"GS024\\\");\\n } else if (v == 1) {\\n // If v is 1 then it is an approved hash\\n // When handling approved hashes the address of the approver is encoded into r\\n currentOwner = address(uint160(uint256(r)));\\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \\\"GS025\\\");\\n } else if (v > 30) {\\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\\n currentOwner = ecrecover(keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", dataHash)), v - 4, r, s);\\n } else {\\n // Default is the ecrecover flow with the provided data hash\\n // Use ecrecover with the messageHash for EOA signatures\\n currentOwner = ecrecover(dataHash, v, r, s);\\n }\\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \\\"GS026\\\");\\n lastOwner = currentOwner;\\n }\\n }\\n\\n /// @dev Allows to estimate a Safe transaction.\\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\\n /// @param to Destination address of Safe transaction.\\n /// @param value Ether value of Safe transaction.\\n /// @param data Data payload of Safe transaction.\\n /// @param operation Operation type of Safe transaction.\\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\\n function requiredTxGas(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation\\n ) external returns (uint256) {\\n uint256 startGas = gasleft();\\n // We don't provide an error message here, as we use it to return the estimate\\n require(execute(to, value, data, operation, gasleft()));\\n uint256 requiredGas = startGas - gasleft();\\n // Convert response to string and return via error message\\n revert(string(abi.encodePacked(requiredGas)));\\n }\\n\\n /**\\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\\n */\\n function approveHash(bytes32 hashToApprove) external {\\n require(owners[msg.sender] != address(0), \\\"GS030\\\");\\n approvedHashes[msg.sender][hashToApprove] = 1;\\n emit ApproveHash(hashToApprove, msg.sender);\\n }\\n\\n /// @dev Returns the chain id used by this contract.\\n function getChainId() public view returns (uint256) {\\n uint256 id;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n id := chainid()\\n }\\n return id;\\n }\\n\\n function domainSeparator() public view returns (bytes32) {\\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\\n }\\n\\n /// @dev Returns the bytes that are hashed to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Gas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash bytes.\\n function encodeTransactionData(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes memory) {\\n bytes32 safeTxHash =\\n keccak256(\\n abi.encode(\\n SAFE_TX_TYPEHASH,\\n to,\\n value,\\n keccak256(data),\\n operation,\\n safeTxGas,\\n baseGas,\\n gasPrice,\\n gasToken,\\n refundReceiver,\\n _nonce\\n )\\n );\\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\\n }\\n\\n /// @dev Returns hash to be signed by owners.\\n /// @param to Destination address.\\n /// @param value Ether value.\\n /// @param data Data payload.\\n /// @param operation Operation type.\\n /// @param safeTxGas Fas that should be used for the safe transaction.\\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\\n /// @param gasPrice Maximum gas price that should be used for this transaction.\\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\\n /// @param _nonce Transaction nonce.\\n /// @return Transaction hash.\\n function getTransactionHash(\\n address to,\\n uint256 value,\\n bytes calldata data,\\n Enum.Operation operation,\\n uint256 safeTxGas,\\n uint256 baseGas,\\n uint256 gasPrice,\\n address gasToken,\\n address refundReceiver,\\n uint256 _nonce\\n ) public view returns (bytes32) {\\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\\n }\\n}\\n\",\"keccak256\":\"0x2ca9e3e053c969b9364f62c50c2c25b92525db7fd0bad3ae1fb0c20dd575367c\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\n\\n/// @title Executor - A contract that can execute transactions\\n/// @author Richard Meissner - \\ncontract Executor {\\n function execute(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation,\\n uint256 txGas\\n ) internal returns (bool success) {\\n if (operation == Enum.Operation.DelegateCall) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\\n }\\n } else {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4d3a900673473466bc27413fdbb11aae60b5580b792c49411f01544e0b24fe08\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract FallbackManager is SelfAuthorized {\\n event ChangedFallbackHandler(address handler);\\n\\n // keccak256(\\\"fallback_manager.handler.address\\\")\\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\\n\\n function internalSetFallbackHandler(address handler) internal {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, handler)\\n }\\n }\\n\\n /// @dev Allows to add a contract to handle fallback calls.\\n /// Only fallback calls without value and with data will be forwarded.\\n /// This can only be done via a Safe transaction.\\n /// @param handler contract to handle fallbacks calls.\\n function setFallbackHandler(address handler) public authorized {\\n internalSetFallbackHandler(handler);\\n emit ChangedFallbackHandler(handler);\\n }\\n\\n // solhint-disable-next-line payable-fallback,no-complex-fallback\\n fallback() external {\\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let handler := sload(slot)\\n if iszero(handler) {\\n return(0, 0)\\n }\\n calldatacopy(0, 0, calldatasize())\\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\\n // Then the address without padding is stored right after the calldata\\n mstore(calldatasize(), shl(96, caller()))\\n // Add 20 bytes for the address appended add the end\\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if iszero(success) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1be9f0f3e80a78134c2e3a026c6a14759785bd35d135e87a4a025aeb6742791f\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\ninterface Guard {\\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\\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\\n/// @author Richard Meissner - \\ncontract GuardManager is SelfAuthorized {\\n event ChangedGuard(address guard);\\n // keccak256(\\\"guard_manager.guard.address\\\")\\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\\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 authorized {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, guard)\\n }\\n emit ChangedGuard(guard);\\n }\\n\\n function getGuard() internal view returns (address guard) {\\n bytes32 slot = GUARD_STORAGE_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n guard := sload(slot)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x53a532a31f9632d5a73ad0df56f05bd2b66a2f781f571eb48d00367d370707f9\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/Enum.sol\\\";\\nimport \\\"../common/SelfAuthorized.sol\\\";\\nimport \\\"./Executor.sol\\\";\\n\\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract ModuleManager is SelfAuthorized, Executor {\\n event EnabledModule(address module);\\n event DisabledModule(address module);\\n event ExecutionFromModuleSuccess(address indexed module);\\n event ExecutionFromModuleFailure(address indexed module);\\n\\n address internal constant SENTINEL_MODULES = address(0x1);\\n\\n mapping(address => address) internal modules;\\n\\n function setupModules(address to, bytes memory data) internal {\\n require(modules[SENTINEL_MODULES] == address(0), \\\"GS100\\\");\\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\\n if (to != address(0))\\n // Setup has to complete successfully or transaction fails.\\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \\\"GS000\\\");\\n }\\n\\n /// @dev Allows to add a module to the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Enables the module `module` for the Safe.\\n /// @param module Module to be whitelisted.\\n function enableModule(address module) public authorized {\\n // Module address cannot be null or sentinel.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n // Module cannot be added twice.\\n require(modules[module] == address(0), \\\"GS102\\\");\\n modules[module] = modules[SENTINEL_MODULES];\\n modules[SENTINEL_MODULES] = module;\\n emit EnabledModule(module);\\n }\\n\\n /// @dev Allows to remove a module from the whitelist.\\n /// This can only be done via a Safe transaction.\\n /// @notice Disables the module `module` for the Safe.\\n /// @param prevModule Module 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) public authorized {\\n // Validate module address and check that it corresponds to module index.\\n require(module != address(0) && module != SENTINEL_MODULES, \\\"GS101\\\");\\n require(modules[prevModule] == module, \\\"GS103\\\");\\n modules[prevModule] = modules[module];\\n modules[module] = address(0);\\n emit DisabledModule(module);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\\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.\\n function execTransactionFromModule(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public virtual returns (bool success) {\\n // Only whitelisted modules are allowed.\\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \\\"GS104\\\");\\n // Execute transaction without further confirmations.\\n success = execute(to, value, data, operation, gasleft());\\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\\n else emit ExecutionFromModuleFailure(msg.sender);\\n }\\n\\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\\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.\\n function execTransactionFromModuleReturnData(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) public returns (bool success, bytes memory returnData) {\\n success = execTransactionFromModule(to, value, data, operation);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // Load free memory location\\n let ptr := mload(0x40)\\n // We allocate memory for the return data by setting the free memory location to\\n // current free memory location + data size + 32 bytes for data size value\\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\\n // Store the size\\n mstore(ptr, returndatasize())\\n // Store the data\\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\\n // Point the return data to the correct memory location\\n returnData := ptr\\n }\\n }\\n\\n /// @dev Returns if an module is enabled\\n /// @return True if the module is enabled\\n function isModuleEnabled(address module) public view returns (bool) {\\n return SENTINEL_MODULES != module && modules[module] != address(0);\\n }\\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) external view returns (address[] memory array, address next) {\\n // Init array with max page size\\n array = new address[](pageSize);\\n\\n // Populate return array\\n uint256 moduleCount = 0;\\n address currentModule = modules[start];\\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\\n array[moduleCount] = currentModule;\\n currentModule = modules[currentModule];\\n moduleCount++;\\n }\\n next = currentModule;\\n // Set correct size of returned array\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n mstore(array, moduleCount)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5512760a0328309f82a71cbe2ac14e0942501b9d44d5fb417bd02174546672e5\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"../common/SelfAuthorized.sol\\\";\\n\\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract OwnerManager is SelfAuthorized {\\n event AddedOwner(address owner);\\n event RemovedOwner(address owner);\\n event ChangedThreshold(uint256 threshold);\\n\\n address internal constant SENTINEL_OWNERS = address(0x1);\\n\\n mapping(address => address) internal owners;\\n uint256 internal ownerCount;\\n uint256 internal threshold;\\n\\n /// @dev Setup function sets initial storage of contract.\\n /// @param _owners List of Safe owners.\\n /// @param _threshold Number of required confirmations for a Safe transaction.\\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\\n // Threshold can only be 0 at initialization.\\n // Check ensures that setup function can only be called once.\\n require(threshold == 0, \\\"GS200\\\");\\n // Validate that threshold is smaller than number of added owners.\\n require(_threshold <= _owners.length, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n // Initializing Safe owners.\\n address currentOwner = SENTINEL_OWNERS;\\n for (uint256 i = 0; i < _owners.length; i++) {\\n // Owner address cannot be null.\\n address owner = _owners[i];\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[currentOwner] = owner;\\n currentOwner = owner;\\n }\\n owners[currentOwner] = SENTINEL_OWNERS;\\n ownerCount = _owners.length;\\n threshold = _threshold;\\n }\\n\\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\\n /// @param owner New owner address.\\n /// @param _threshold New threshold.\\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[owner] == address(0), \\\"GS204\\\");\\n owners[owner] = owners[SENTINEL_OWNERS];\\n owners[SENTINEL_OWNERS] = owner;\\n ownerCount++;\\n emit AddedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\\n /// This can only be done via a Safe transaction.\\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\\n /// @param owner Owner address to be removed.\\n /// @param _threshold New threshold.\\n function removeOwner(\\n address prevOwner,\\n address owner,\\n uint256 _threshold\\n ) public authorized {\\n // Only allow to remove an owner, if threshold can still be reached.\\n require(ownerCount - 1 >= _threshold, \\\"GS201\\\");\\n // Validate owner address and check that it corresponds to owner index.\\n require(owner != address(0) && owner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == owner, \\\"GS205\\\");\\n owners[prevOwner] = owners[owner];\\n owners[owner] = address(0);\\n ownerCount--;\\n emit RemovedOwner(owner);\\n // Change threshold if threshold was changed.\\n if (threshold != _threshold) changeThreshold(_threshold);\\n }\\n\\n /// @dev Allows to swap/replace an owner from the Safe with another address.\\n /// This can only be done via a Safe transaction.\\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\\n /// @param oldOwner Owner address to be replaced.\\n /// @param newOwner New owner address.\\n function swapOwner(\\n address prevOwner,\\n address oldOwner,\\n address newOwner\\n ) public authorized {\\n // Owner address cannot be null, the sentinel or the Safe itself.\\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \\\"GS203\\\");\\n // No duplicate owners allowed.\\n require(owners[newOwner] == address(0), \\\"GS204\\\");\\n // Validate oldOwner address and check that it corresponds to owner index.\\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \\\"GS203\\\");\\n require(owners[prevOwner] == oldOwner, \\\"GS205\\\");\\n owners[newOwner] = owners[oldOwner];\\n owners[prevOwner] = newOwner;\\n owners[oldOwner] = address(0);\\n emit RemovedOwner(oldOwner);\\n emit AddedOwner(newOwner);\\n }\\n\\n /// @dev Allows to update the number of required confirmations by Safe owners.\\n /// This can only be done via a Safe transaction.\\n /// @notice Changes the threshold of the Safe to `_threshold`.\\n /// @param _threshold New threshold.\\n function changeThreshold(uint256 _threshold) public authorized {\\n // Validate that threshold is smaller than number of owners.\\n require(_threshold <= ownerCount, \\\"GS201\\\");\\n // There has to be at least one Safe owner.\\n require(_threshold >= 1, \\\"GS202\\\");\\n threshold = _threshold;\\n emit ChangedThreshold(threshold);\\n }\\n\\n function getThreshold() public view returns (uint256) {\\n return threshold;\\n }\\n\\n function isOwner(address owner) public view returns (bool) {\\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\\n }\\n\\n /// @dev Returns array of owners.\\n /// @return Array of Safe owners.\\n function getOwners() public view returns (address[] memory) {\\n address[] memory array = new address[](ownerCount);\\n\\n // populate return array\\n uint256 index = 0;\\n address currentOwner = owners[SENTINEL_OWNERS];\\n while (currentOwner != SENTINEL_OWNERS) {\\n array[index] = currentOwner;\\n currentOwner = owners[currentOwner];\\n index++;\\n }\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0x01a3d64cc0967f42ae63802409f5404d18352516ea2a6335005003d919ffcf12\",\"license\":\"LGPL-3.0-only\"},\"@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/safe-contracts/contracts/common/EtherPaymentFallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\\n/// @author Richard Meissner - \\ncontract EtherPaymentFallback {\\n event SafeReceived(address indexed sender, uint256 value);\\n\\n /// @dev Fallback function accepts Ether transactions.\\n receive() external payable {\\n emit SafeReceived(msg.sender, msg.value);\\n }\\n}\\n\",\"keccak256\":\"0x1a7928d29877da84a3d0df846d5cd933d48ee095c1bde0aa044e249b12e27a72\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SecuredTokenTransfer - Secure token transfer\\n/// @author Richard Meissner - \\ncontract SecuredTokenTransfer {\\n /// @dev Transfers a token and returns if it was a success\\n /// @param token Token that should be transferred\\n /// @param receiver Receiver to whom the token should be transferred\\n /// @param amount The amount of tokens that should be transferred\\n function transferToken(\\n address token,\\n address receiver,\\n uint256 amount\\n ) internal returns (bool transferred) {\\n // 0xa9059cbb - keccack(\\\"transfer(address,uint256)\\\")\\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n // We write the return value to scratch space.\\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\\n switch returndatasize()\\n case 0 {\\n transferred := success\\n }\\n case 0x20 {\\n transferred := iszero(or(iszero(success), iszero(mload(0))))\\n }\\n default {\\n transferred := 0\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x178682d8477da42936c7e8e24d39094c4ac08ecd8623794b9535d77001b665f1\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SelfAuthorized - authorizes current contract to perform actions\\n/// @author Richard Meissner - \\ncontract SelfAuthorized {\\n function requireSelfCall() private view {\\n require(msg.sender == address(this), \\\"GS031\\\");\\n }\\n\\n modifier authorized() {\\n // This is a function call as it minimized the bytecode size\\n requireSelfCall();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x59d36efca578b75541a776f62a0d0ef03712fc27b6647c3915c14b572106d7bc\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\\n/// @author Richard Meissner - \\ncontract SignatureDecoder {\\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\\n /// @param signatures concatenated rsv signatures\\n function signatureSplit(bytes memory signatures, uint256 pos)\\n internal\\n pure\\n returns (\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n )\\n {\\n // The signature format is a compact form of:\\n // {bytes32 r}{bytes32 s}{uint8 v}\\n // Compact means, uint8 is not padded to 32 bytes.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let signaturePos := mul(0x41, pos)\\n r := mload(add(signatures, add(signaturePos, 0x20)))\\n s := mload(add(signatures, add(signaturePos, 0x40)))\\n // Here we are loading the last 32 bytes, including 31 bytes\\n // of 's'. There is no 'mload8' to do this.\\n //\\n // 'byte' is not working due to the Solidity parser, so lets\\n // use the second best option, 'and'\\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2d37be182472ccfee62a33e9939f9b3d509be4c32e9fdebc2c1746c573655987\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/Singleton.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\\n/// @author Richard Meissner - \\ncontract Singleton {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\\n // It should also always be ensured that the address is stored alone (uses a full word)\\n address private singleton;\\n}\\n\",\"keccak256\":\"0x6e02c18998de8834dd7d69890cb6ede996b6f635d2337081a596d91e35e2c648\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\\ncontract StorageAccessible {\\n /**\\n * @dev Reads `length` bytes of storage in the currents contract\\n * @param offset - the offset in the current contract's storage in words to start reading from\\n * @param length - the number of words (32 bytes) of data to read\\n * @return the bytes that were read.\\n */\\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\\n bytes memory result = new bytes(length * 32);\\n for (uint256 index = 0; index < length; index++) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let word := sload(add(offset, index))\\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Performs a delegetecall on a targetContract in the context of self.\\n * Internally reverts execution to avoid side effects (making it static).\\n *\\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\\n * Specifically, the `returndata` after a call to this method will be:\\n * `success:bool || response.length:uint256 || response:bytes`.\\n *\\n * @param targetContract Address of the contract containing the code to execute.\\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\\n */\\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\\n\\n mstore(0x00, success)\\n mstore(0x20, returndatasize())\\n returndatacopy(0x40, 0, returndatasize())\\n revert(0, add(returndatasize(), 0x40))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x36853adb266c2ab7d3c612aca799441a86bd15d9e1d24fc6c70d63f5c2df3aaf\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/**\\n * @title GnosisSafeMath\\n * @dev Math operations with safety checks that revert on error\\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\\n * TODO: remove once open zeppelin update to solc 0.5.0\\n */\\nlibrary GnosisSafeMath {\\n /**\\n * @dev Multiplies two numbers, reverts on overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c = a * b;\\n require(c / a == b);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n require(b <= a);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Adds two numbers, reverts on overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c = a + b;\\n require(c >= a);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a >= b ? a : b;\\n }\\n}\\n\",\"keccak256\":\"0x2a2b4d74f5834a9437be0cd3254d7a676698fc78aa47941c2009470196998d98\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\ncontract ISignatureValidatorConstants {\\n // bytes4(keccak256(\\\"isValidSignature(bytes,bytes)\\\")\\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\\n}\\n\\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param _data Arbitrary length data signed on the behalf of address(this)\\n * @param _signature Signature byte array associated with _data\\n *\\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\\n * MUST allow external calls\\n */\\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\\n}\\n\",\"keccak256\":\"0x5b6e9bf17f28738ce88e751f420b0559f5151ba7bec2ff3c7bb31e42673d6801\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\\n/// @author Richard Meissner - \\ninterface IProxy {\\n function masterCopy() external view returns (address);\\n}\\n\\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\\n/// @author Stefan George - \\n/// @author Richard Meissner - \\ncontract GnosisSafeProxy {\\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\\n address internal singleton;\\n\\n /// @dev Constructor function sets address of singleton contract.\\n /// @param _singleton Singleton address.\\n constructor(address _singleton) {\\n require(_singleton != address(0), \\\"Invalid singleton address provided\\\");\\n singleton = _singleton;\\n }\\n\\n /// @dev Fallback function forwards all transactions and returns all received return data.\\n fallback() external payable {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\\n // 0xa619486e == keccak(\\\"masterCopy()\\\"). The value is right padded to 32-bytes with 0s\\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\\n mstore(0, _singleton)\\n return(0, 0x20)\\n }\\n calldatacopy(0, 0, calldatasize())\\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\\n returndatacopy(0, 0, returndatasize())\\n if eq(success, 0) {\\n revert(0, returndatasize())\\n }\\n return(0, returndatasize())\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bfdd453d9f896f7029d15bcafd11886957b320ad1764309d9f74fa059715249\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\n\\nimport \\\"./GnosisSafeProxy.sol\\\";\\nimport \\\"./IProxyCreationCallback.sol\\\";\\n\\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n/// @author Stefan George - \\ncontract GnosisSafeProxyFactory {\\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param singleton Address of singleton contract.\\n /// @param data Payload for message call sent to new proxy contract.\\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\\n proxy = new GnosisSafeProxy(singleton);\\n if (data.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, singleton);\\n }\\n\\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\\n function proxyRuntimeCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).runtimeCode;\\n }\\n\\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\\n function proxyCreationCode() public pure returns (bytes memory) {\\n return type(GnosisSafeProxy).creationCode;\\n }\\n\\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\\n /// This method is only meant as an utility to be called from other methods\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function deployProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) internal returns (GnosisSafeProxy proxy) {\\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\\n }\\n require(address(proxy) != address(0), \\\"Create2 call failed\\\");\\n }\\n\\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function createProxyWithNonce(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n if (initializer.length > 0)\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\\n revert(0, 0)\\n }\\n }\\n emit ProxyCreation(proxy, _singleton);\\n }\\n\\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\\n function createProxyWithCallback(\\n address _singleton,\\n bytes memory initializer,\\n uint256 saltNonce,\\n IProxyCreationCallback callback\\n ) public returns (GnosisSafeProxy proxy) {\\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\\n }\\n\\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\\n /// @param _singleton Address of singleton contract.\\n /// @param initializer Payload for message call sent to new proxy contract.\\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\\n function calculateCreateProxyWithNonceAddress(\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external returns (GnosisSafeProxy proxy) {\\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\\n revert(string(abi.encodePacked(proxy)));\\n }\\n}\\n\",\"keccak256\":\"0x187c6f84c71b432da6721c1b81cebfbb9c37c0cc15ebd8de5a14ff7ec6db2d9e\",\"license\":\"LGPL-3.0-only\"},\"@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.7.0 <0.9.0;\\nimport \\\"./GnosisSafeProxy.sol\\\";\\n\\ninterface IProxyCreationCallback {\\n function proxyCreated(\\n GnosisSafeProxy proxy,\\n address _singleton,\\n bytes calldata initializer,\\n uint256 saltNonce\\n ) external;\\n}\\n\",\"keccak256\":\"0x51a9ce914a6a943651c803541e44218a7ed0a2f98a94d55df66b173b5a11e365\",\"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 (success, ) = _exec(to, value, data, operation);\\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 (success, returnData) = _exec(to, value, data, operation);\\n }\\n\\n function _exec(\\n address to,\\n uint256 value,\\n bytes memory data,\\n Enum.Operation operation\\n ) private returns (bool success, bytes memory returnData) {\\n address currentGuard = guard;\\n if (currentGuard != address(0)) {\\n IGuard(currentGuard).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 \\\"\\\",\\n msg.sender\\n );\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n IGuard(currentGuard).checkAfterExecution(\\\"\\\", success);\\n } else {\\n (success, returnData) = IAvatar(target)\\n .execTransactionFromModuleReturnData(\\n to,\\n value,\\n data,\\n operation\\n );\\n }\\n }\\n}\\n\",\"keccak256\":\"0x13da818c34bb4be89081b6155ab9787080a61b7123dc086cfd29f9ea8f50f880\",\"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/factory/ModuleProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: LGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\ncontract ModuleProxyFactory {\\n event ModuleProxyCreation(\\n address indexed proxy,\\n address indexed masterCopy\\n );\\n\\n /// `target` can not be zero.\\n error ZeroAddress(address target);\\n\\n /// `target` has no code deployed.\\n error TargetHasNoCode(address target);\\n\\n /// `address_` is already taken.\\n error TakenAddress(address address_);\\n\\n /// @notice Initialization failed.\\n error FailedInitialization();\\n\\n function createProxy(address target, bytes32 salt)\\n internal\\n returns (address result)\\n {\\n if (address(target) == address(0)) revert ZeroAddress(target);\\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\\n bytes memory deployment = abi.encodePacked(\\n hex\\\"602d8060093d393df3363d3d373d3d3d363d73\\\",\\n target,\\n hex\\\"5af43d82803e903d91602b57fd5bf3\\\"\\n );\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\\n }\\n if (result == address(0)) revert TakenAddress(result);\\n }\\n\\n function deployModule(\\n address masterCopy,\\n bytes memory initializer,\\n uint256 saltNonce\\n ) public returns (address proxy) {\\n proxy = createProxy(\\n masterCopy,\\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\\n );\\n (bool success, ) = proxy.call(initializer);\\n if (!success) revert FailedInitialization();\\n\\n emit ModuleProxyCreation(proxy, masterCopy);\\n }\\n}\\n\",\"keccak256\":\"0x40a3eb64fec76f1f77656a77b4c469b299f2d8b0523ed0f207d3879455c06a70\",\"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\"},\"@opengsn/contracts/src/BaseRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable no-inline-assembly\\npragma solidity >=0.6.9;\\n\\nimport \\\"./interfaces/IRelayRecipient.sol\\\";\\n\\n/**\\n * A base contract to be inherited by any contract that want to receive relayed transactions\\n * A subclass must use \\\"_msgSender()\\\" instead of \\\"msg.sender\\\"\\n */\\nabstract contract BaseRelayRecipient is IRelayRecipient {\\n\\n /*\\n * Forwarder singleton we accept calls from\\n */\\n address private _trustedForwarder;\\n\\n function trustedForwarder() public virtual view returns (address){\\n return _trustedForwarder;\\n }\\n\\n function _setTrustedForwarder(address _forwarder) internal {\\n _trustedForwarder = _forwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, return the original sender.\\n * otherwise, return `msg.sender`.\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal override virtual view returns (address ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n // At this point we know that the sender is a trusted forwarder,\\n // so we trust that the last bytes of msg.data are the verified sender address.\\n // extract sender address from the end of msg.data\\n assembly {\\n ret := shr(96,calldataload(sub(calldatasize(),20)))\\n }\\n } else {\\n ret = msg.sender;\\n }\\n }\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal override virtual view returns (bytes calldata ret) {\\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\\n return msg.data[0:msg.data.length-20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xce3168b37fc87ec34a18b56b4b16a06432119c07fd2e1d864b871dcf40372ebe\",\"license\":\"MIT\"},\"@opengsn/contracts/src/interfaces/IRelayRecipient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.0;\\n\\n/**\\n * a contract must implement this interface in order to support relayed transaction.\\n * It is better to inherit the BaseRelayRecipient as its implementation.\\n */\\nabstract contract IRelayRecipient {\\n\\n /**\\n * return if the forwarder is trusted to forward relayed transactions to us.\\n * the forwarder is required to verify the sender's signature, and verify\\n * the call is not a replay.\\n */\\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\\n\\n /**\\n * return the sender of this call.\\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\\n * of the msg.data.\\n * otherwise, return `msg.sender`\\n * should be used in the contract anywhere instead of msg.sender\\n */\\n function _msgSender() internal virtual view returns (address);\\n\\n /**\\n * return the msg.data of this call.\\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\\n * of the msg.data - so this method will strip those 20 bytes off.\\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\\n * should be used in the contract instead of msg.data, where this difference matters.\\n */\\n function _msgData() internal virtual view returns (bytes calldata);\\n\\n function versionRecipient() external virtual view returns (string memory);\\n}\\n\",\"keccak256\":\"0x199e82e0a2833a97213b5c16ac9b4e2b1814f2e90a4c4916855cbc21e710ad5f\",\"license\":\"MIT\"},\"@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/interfaces/draft-IERC1822Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822ProxiableUpgradeable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x77c89f893e403efc6929ba842b7ccf6534d4ffe03afe31670b4a528c0ad78c0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeaconUpgradeable.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\nimport \\\"../../utils/StorageSlotUpgradeable.sol\\\";\\nimport \\\"../utils/Initializable.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\\n function __ERC1967Upgrade_init() internal onlyInitializing {\\n }\\n\\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\\n }\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(AddressUpgradeable.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(AddressUpgradeable.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\\n }\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\\n require(AddressUpgradeable.isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return AddressUpgradeable.verifyCallResult(success, returndata, \\\"Address: low-level delegate call failed\\\");\\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\":\"0x315887e846f1e5f8d8fa535a229d318bb9290aaa69485117f1ee8a9a6b3be823\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeaconUpgradeable {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0x24b86ac8c005b8c654fbf6ac34a5a4f61580d7273541e83e013e89d66fbf0908\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\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 * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\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 * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\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 * Emits an {Initialized} event the first time it is successfully executed.\\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 /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xe798cadb41e2da274913e4b3183a80f50fb057a42238fe8467e077268100ec27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../interfaces/draft-IERC1822Upgradeable.sol\\\";\\nimport \\\"../ERC1967/ERC1967UpgradeUpgradeable.sol\\\";\\nimport \\\"./Initializable.sol\\\";\\n\\n/**\\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\\n *\\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\\n * `UUPSUpgradeable` with a custom implementation of upgrades.\\n *\\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\\n function __UUPSUpgradeable_init() internal onlyInitializing {\\n }\\n\\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\\n }\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\\n address private immutable __self = address(this);\\n\\n /**\\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\\n * fail.\\n */\\n modifier onlyProxy() {\\n require(address(this) != __self, \\\"Function must be called through delegatecall\\\");\\n require(_getImplementation() == __self, \\\"Function must be called through active proxy\\\");\\n _;\\n }\\n\\n /**\\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\\n * callable on the implementing contract but not through proxies.\\n */\\n modifier notDelegated() {\\n require(address(this) == __self, \\\"UUPSUpgradeable: must not be called through delegatecall\\\");\\n _;\\n }\\n\\n /**\\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\\n */\\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\\n return _IMPLEMENTATION_SLOT;\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeTo(address newImplementation) external virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\\n * encoded in `data`.\\n *\\n * Calls {_authorizeUpgrade}.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\\n _authorizeUpgrade(newImplementation);\\n _upgradeToAndCallUUPS(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\\n * {upgradeTo} and {upgradeToAndCall}.\\n *\\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\\n *\\n * ```solidity\\n * function _authorizeUpgrade(address) internal override onlyOwner {}\\n * ```\\n */\\n function _authorizeUpgrade(address newImplementation) internal virtual;\\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\":\"0x7967d130887c4b40666cd88f8744691d4527039a1b2a38aa0de41481ef646778\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\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\":\"0x2b3005a0064cfc558bdf64b2bae94b565f4574a536aadd61c13838d4f2157790\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, \\\"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 (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, 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 (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or 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 _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\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\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"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-upgradeable/utils/StorageSlotUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlotUpgradeable {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0x09864aea84f01e39313375b5610c73a3c1c68abbdc51e5ccdd25ff977fdadf9a\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/MathUpgradeable.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _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 unchecked {\\n uint256 length = MathUpgradeable.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\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 unchecked {\\n return toHexString(value, MathUpgradeable.log256(value) + 1);\\n }\\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] = _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\":\"0x6b9a5d35b744b25529a2856a8093e7c03fb35a34b1c4fb5499e560f8ade140da\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0x12f297cafe6e2847ae0378502f155654d0764b532a9873c8afe4350950fa7971\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n /* solhint-disable var-name-mixedcase */\\n bytes32 private _HASHED_NAME;\\n bytes32 private _HASHED_VERSION;\\n bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n __EIP712_init_unchained(name, version);\\n }\\n\\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev The hash of the name parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712NameHash() internal virtual view returns (bytes32) {\\n return _HASHED_NAME;\\n }\\n\\n /**\\n * @dev The hash of the version parameter for the EIP712 domain.\\n *\\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n * are a concern.\\n */\\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n return _HASHED_VERSION;\\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\":\"0x3017aded62c4a2b9707f5f06f92934e592c1c9b6f384b91b51340a6d5f841931\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\\n\\nimport \\\"./EIP712Upgradeable.sol\\\";\\n\",\"keccak256\":\"0x31a2e227f5653e4b31e0f680857b8842073d083b33df11b3f3b3bb5ddc10526e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary MathUpgradeable {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1bd5b53319c68f84e3becd75694d941e8f4be94049903232cd8bc7c535aaa5a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\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 functionCallWithValue(target, data, 0, \\\"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 (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, 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 (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or 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 _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\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\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"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/Baal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n/*\\n\\u2588\\u2588\\u2588 \\u2588\\u2588 \\u2588\\u2588 \\u2588\\n\\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\n\\u2588 \\u2580 \\u2584 \\u2588\\u2584\\u2584\\u2588 \\u2588\\u2584\\u2584\\u2588 \\u2588\\n\\u2588 \\u2584\\u2580 \\u2588 \\u2588 \\u2588 \\u2588 \\u2588\\u2588\\u2588\\u2584\\n\\u2588\\u2588\\u2588 \\u2588 \\u2588 \\u2580\\n \\u2588 \\u2588\\n \\u2580 \\u2580*/\\npragma solidity ^0.8.7;\\n\\nimport \\\"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\\\";\\nimport \\\"@gnosis.pm/zodiac/contracts/core/Module.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\\\";\\nimport \\\"@opengsn/contracts/src/BaseRelayRecipient.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\n\\nimport \\\"./interfaces/IBaalToken.sol\\\";\\n\\n/// @title Baal ';_;'.\\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\\n using ECDSAUpgradeable for bytes32;\\n\\n // ERC20 SHARES + LOOT\\n\\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\\n\\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\\n\\n // GOVERNANCE PARAMS\\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\\n uint256 public proposalOffering; /* non-member proposal offering*/\\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\\n\\n // SHAMAN PERMISSIONS\\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\\n /* permissions registry for shamans\\n 0 = no permission\\n 1 = admin only\\n 2 = manager only\\n 4 = governance only\\n 3 = admin + manager\\n 5 = admin + governance\\n 6 = manager + governance\\n 7 = admin + manager + governance */\\n\\n // PROPOSAL TRACKING\\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\\n\\n // MISCELLANEOUS PARAMS\\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\\n address public multisendLibrary; /*address of multisend library*/\\n string public override versionRecipient; /* version recipient for OpenGSN */\\n\\n // SIGNATURE HELPERS\\n bytes32 constant VOTE_TYPEHASH = keccak256(\\\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\\\");\\n\\n // DATA STRUCTURES\\n struct Proposal {\\n /*Baal proposal details*/\\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\\n uint256 baalGas; /* gas needed to process proposal */\\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\\n }\\n\\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n \\\\-> Cancelled \\\\-> Defeated */\\n enum ProposalState {\\n Unborn, /* 0 - can submit */\\n Submitted, /* 1 - can sponsor -> voting */\\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\\n Cancelled, /* 3 - terminal state, counts as processed */\\n Grace, /* 4 - proceeds to ready/defeated */\\n Ready, /* 5 - can be processed */\\n Processed, /* 6 - terminal state */\\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\\n }\\n\\n // MODIFIERS\\n\\n modifier baalOnly() {\\n require(_msgSender() == avatar, \\\"!baal\\\");\\n _;\\n }\\n\\n modifier baalOrAdminOnly() {\\n require(_msgSender() == avatar || isAdmin(_msgSender()), \\\"!baal & !admin\\\"); /*check `shaman` is admin*/\\n _;\\n }\\n\\n modifier baalOrManagerOnly() {\\n require(\\n _msgSender() == avatar || isManager(_msgSender()),\\n \\\"!baal & !manager\\\"\\n ); /*check `shaman` is manager*/\\n _;\\n }\\n\\n modifier baalOrGovernorOnly() {\\n require(\\n _msgSender() == avatar || isGovernor(_msgSender()),\\n \\\"!baal & !governor\\\"\\n ); /*check `shaman` is governor*/\\n _;\\n }\\n\\n // EVENTS\\n event SetupComplete(\\n bool lootPaused,\\n bool sharesPaused,\\n uint32 gracePeriod,\\n uint32 votingPeriod,\\n uint256 proposalOffering,\\n uint256 quorumPercent,\\n uint256 sponsorThreshold,\\n uint256 minRetentionPercent,\\n string name,\\n string symbol,\\n uint256 totalShares,\\n uint256 totalLoot\\n ); /*emits after Baal summoning*/\\n event SubmitProposal(\\n uint256 indexed proposal,\\n bytes32 indexed proposalDataHash,\\n uint256 votingPeriod,\\n bytes proposalData,\\n uint256 expiration,\\n uint256 baalGas,\\n bool selfSponsor,\\n uint256 timestamp,\\n string details\\n ); /*emits after proposal is submitted*/\\n event SponsorProposal(\\n address indexed member,\\n uint256 indexed proposal,\\n uint256 indexed votingStarts\\n ); /*emits after member has sponsored proposal*/\\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\\n event SubmitVote(\\n address indexed member,\\n uint256 balance,\\n uint256 indexed proposal,\\n bool indexed approved\\n ); /*emits after vote is submitted on proposal*/\\n event ProcessProposal(\\n uint256 indexed proposal,\\n bool passed,\\n bool actionFailed\\n ); /*emits when proposal is processed & executed*/\\n event Ragequit(\\n address indexed member,\\n address to,\\n uint256 indexed lootToBurn,\\n uint256 indexed sharesToBurn,\\n address[] tokens\\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 amount\\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\\n\\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\\n event GovernanceConfigSet(\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ); /*emits when gov config changes*/\\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\\n event LockManager(bool managerLock); /*emits when admin is locked*/\\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend)\\n {\\n bytes memory encodedActions;\\n for (uint256 i = 0; i < _calls.length; i++) {\\n encodedActions = abi.encodePacked(\\n encodedActions,\\n uint8(0),\\n _target,\\n uint256(0),\\n uint256(_calls[i].length),\\n bytes(_calls[i])\\n );\\n }\\n encodedMultisend = abi.encodeWithSignature(\\n \\\"multiSend(bytes)\\\",\\n encodedActions\\n );\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\\n /// @param _initializationParams Encoded setup information.\\n function setUp(bytes memory _initializationParams)\\n public\\n override(FactoryFriendly)\\n initializer\\n nonReentrant\\n {\\n (\\n address _lootToken, /*loot ERC20 token*/\\n address _sharesToken, /*shares ERC20 token*/\\n address _multisendLibrary, /*address of multisend library*/\\n address _avatar, /*Safe contract address*/\\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\\n ) = abi.decode(\\n _initializationParams,\\n (address, address, address, address, address, bytes)\\n );\\n\\n require(\\n _multisendLibrary != address(0) &&\\n _avatar != address(0),\\n \\\"0 addr used\\\"\\n );\\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\\n\\n versionRecipient = \\\"2.2.5+opengsn.payablewithbaal.irelayrecipient\\\";\\n __Ownable_init();\\n __ReentrancyGuard_init();\\n __EIP712_init(\\\"Vote\\\", \\\"4\\\");\\n transferOwnership(_avatar);\\n\\n // Set the Gnosis safe address\\n avatar = _avatar;\\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\\n\\n // Set trusted forwarder\\n _setTrustedForwarder(_forwarder);\\n\\n lootToken = IBaalToken(_lootToken);\\n sharesToken = IBaalToken(_sharesToken);\\n\\n /*Set address of Gnosis multisend library to use for all execution*/\\n multisendLibrary = _multisendLibrary;\\n\\n // Execute all setups including but not limited to\\n // * mint shares\\n // * convert shares to loot\\n // * set shamans\\n // * set admin configurations\\n require(\\n exec(\\n multisendLibrary,\\n 0,\\n _initializationMultisendData,\\n Enum.Operation.DelegateCall\\n ),\\n \\\"call failure setup\\\"\\n );\\n\\n emit SetupComplete(\\n lootToken.paused(),\\n sharesToken.paused(),\\n gracePeriod,\\n votingPeriod,\\n proposalOffering,\\n quorumPercent,\\n sponsorThreshold,\\n minRetentionPercent,\\n sharesToken.name(),\\n sharesToken.symbol(),\\n totalShares(),\\n totalLoot()\\n );\\n\\n }\\n\\n /*****************\\n PROPOSAL FUNCTIONS\\n *****************/\\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\\n /// @param proposalData Multisend encoded transactions or proposal data\\n /// @param details Context for proposal.\\n /// @return proposal Count for submitted proposal.\\n function submitProposal(\\n bytes calldata proposalData,\\n uint32 expiration,\\n uint256 baalGas,\\n string calldata details\\n ) external payable nonReentrant returns (uint256) {\\n require(\\n expiration == 0 ||\\n expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n require(baalGas <= 20000000, \\\"baalGas to high\\\"); /* gwei 2/3 eth block limit */\\n\\n bool selfSponsor = false; /*plant sponsor flag*/\\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\\n } else {\\n require(msg.value == proposalOffering, \\\"Baal requires an offering\\\"); /*Optional anti-spam gas token tribute*/\\n (bool _success, ) = target.call{value: msg.value}(\\\"\\\"); /*Send ETH to sink*/\\n require(_success, \\\"could not send\\\");\\n }\\n\\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\\n\\n proposalCount++; /*increment proposal counter*/\\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\\n proposalCount,\\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\\n selfSponsor\\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\\n : 0, /* graceEnds */\\n expiration,\\n baalGas,\\n 0, /* yes votes */\\n 0, /* no votes */\\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\\n selfSponsor ? _msgSender() : address(0),\\n proposalDataHash\\n );\\n\\n if (selfSponsor) {\\n latestSponsoredProposalId = proposalCount;\\n }\\n\\n emit SubmitProposal(\\n proposalCount,\\n proposalDataHash,\\n votingPeriod,\\n proposalData,\\n expiration,\\n baalGas,\\n selfSponsor,\\n block.timestamp,\\n details\\n ); /*emit event reflecting proposal submission*/\\n\\n return proposalCount;\\n }\\n\\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\\n /// @param id Number of proposal in `proposals` mapping to sponsor.\\n function sponsorProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n\\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \\\"!sponsor\\\"); /*check 'votes > threshold - required to sponsor proposal*/\\n require(state(id) == ProposalState.Submitted, \\\"!submitted\\\");\\n require(\\n prop.expiration == 0 ||\\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\\n \\\"expired\\\"\\n );\\n\\n prop.votingStarts = uint32(block.timestamp);\\n\\n unchecked {\\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\\n prop.graceEnds =\\n uint32(block.timestamp) +\\n votingPeriod +\\n gracePeriod;\\n }\\n\\n prop.prevProposalId = latestSponsoredProposalId;\\n prop.sponsor = _msgSender();\\n // snapshot both total supply and total shares\\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\\n latestSponsoredProposalId = id;\\n\\n emit SponsorProposal(_msgSender(), id, block.timestamp);\\n }\\n\\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function submitVote(uint32 id, bool approved) external nonReentrant {\\n _submitVote(_msgSender(), id, approved);\\n }\\n\\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\\n /// @param voter Address of member who submitted vote.\\n /// @param expiry Expiration of signature.\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n /// @param v v in signature\\n /// @param r r in signature\\n /// @param s s in signature\\n function submitVoteWithSig(\\n address voter,\\n uint256 expiry,\\n uint256 nonce,\\n uint32 id,\\n bool approved,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external nonReentrant {\\n require(block.timestamp <= expiry, \\\"ERC20Votes: signature expired\\\");\\n require(nonce == votingNonces[voter], \\\"!nonce\\\");\\n\\n /*calculate EIP-712 struct hash*/\\n bytes32 structHash = keccak256(\\n abi.encode(\\n VOTE_TYPEHASH,\\n keccak256(abi.encodePacked(sharesToken.name())),\\n voter,\\n expiry,\\n nonce,\\n id,\\n approved\\n )\\n );\\n bytes32 hash = _hashTypedDataV4(structHash);\\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n\\n require(signer == voter, \\\"invalid signature\\\");\\n require(signer != address(0), \\\"!signer\\\");\\n votingNonces[voter] += 1;\\n\\n _submitVote(signer, id, approved);\\n }\\n\\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\\n /// @param voter Address of voter\\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\\n function _submitVote(\\n address voter,\\n uint32 id,\\n bool approved\\n ) internal {\\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n\\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\\n\\n require(balance > 0, \\\"!member\\\"); /* check that user has shares*/\\n require(!memberVoted[voter][id], \\\"voted\\\"); /*check vote not already cast*/\\n\\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\\n\\n // get high water mark on all votes\\n uint256 _totalSupply = totalSupply();\\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\\n }\\n\\n unchecked {\\n if (approved) {\\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\\n prop.yesVotes += balance; \\n } else {\\n /*otherwise, cast delegated balance `noVotes` to proposal*/\\n prop.noVotes += balance;\\n }\\n }\\n\\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\\n }\\n\\n /// @notice Process `proposal` & execute internal functions.\\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n function processProposal(uint32 id, bytes calldata proposalData)\\n external\\n nonReentrant\\n {\\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\\n\\n require(prop.sponsor != address(0), \\\"!sponsor\\\"); /*check proposal has been sponsored*/\\n require(state(id) == ProposalState.Ready, \\\"!ready\\\"); /* check proposal is Ready to process */\\n\\n ProposalState prevProposalState = state(prop.prevProposalId);\\n require(\\n prevProposalState == ProposalState.Processed ||\\n prevProposalState == ProposalState.Cancelled ||\\n prevProposalState == ProposalState.Defeated ||\\n prevProposalState == ProposalState.Unborn,\\n \\\"prev!processed\\\"\\n );\\n\\n // check that the proposalData matches the stored hash\\n require(\\n hashOperation(proposalData) == prop.proposalDataHash,\\n \\\"incorrect calldata\\\"\\n );\\n\\n require(\\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\\n \\\"not enough gas\\\"\\n );\\n\\n prop.status[1] = true; /*Set processed flag to true*/\\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\\n\\n // Make proposal fail if after expiration\\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\\n okToExecute = false;\\n\\n // Make proposal fail if it didn't pass quorum\\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\\n okToExecute = false;\\n\\n // Make proposal fail if the minRetentionPercent is exceeded\\n if (\\n okToExecute &&\\n (totalSupply()) <\\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\\n ) {\\n okToExecute = false;\\n }\\n\\n /*check if `proposal` approved by simple majority of members*/\\n if (okToExecute) {\\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\\n bool success = processActionProposal(proposalData); /*execute 'action'*/\\n if (!success) {\\n prop.status[3] = true;\\n }\\n }\\n\\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\\n }\\n\\n /// @notice Internal function to process 'action'[0] proposal.\\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\\n /// @return success Success or failure of execution\\n function processActionProposal(bytes memory proposalData)\\n private\\n returns (bool success)\\n {\\n success = exec(\\n multisendLibrary,\\n 0,\\n proposalData,\\n Enum.Operation.DelegateCall\\n );\\n }\\n\\n /// @notice Cancel proposal prior to execution\\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\\n /// @param id Number of proposal in `proposals` mapping to process for execution.\\n function cancelProposal(uint32 id) external nonReentrant {\\n Proposal storage prop = proposals[id];\\n require(state(id) == ProposalState.Voting, \\\"!voting\\\");\\n require(\\n _msgSender() == prop.sponsor ||\\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\\n sponsorThreshold ||\\n isGovernor(_msgSender()),\\n \\\"!cancellable\\\"\\n );\\n prop.status[0] = true;\\n emit CancelProposal(id);\\n }\\n\\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\\n /// proposal or by a delegated signer on the Safe\\n /// @param _to address to call\\n /// @param _value value to include in wei\\n /// @param _data arbitrary transaction data\\n function executeAsBaal(\\n address _to,\\n uint256 _value,\\n bytes calldata _data\\n ) external baalOnly {\\n (bool success, ) = _to.call{value: _value}(_data);\\n require(success, \\\"call failure execute\\\");\\n }\\n\\n // ****************\\n // MEMBER FUNCTIONS\\n // ****************\\n\\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] calldata tokens\\n ) external nonReentrant {\\n for (uint256 i = 1; i < tokens.length; i++) {\\n require(tokens[i] > tokens[i - 1], \\\"!order\\\");\\n }\\n\\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\\n }\\n\\n /// @notice Internal execution of rage quite\\n /// @param to Account that receives 'fair share'.\\n /// @param lootToBurn Baal pure economic weight to burn.\\n /// @param sharesToBurn Baal voting weight to burn.\\n /// @param tokens Array of tokens to include in rage quit calculation\\n function _ragequit(\\n address to,\\n uint256 sharesToBurn,\\n uint256 lootToBurn,\\n address[] memory tokens\\n ) internal {\\n uint256 _totalSupply = totalSupply();\\n\\n if (lootToBurn != 0) {\\n /*gas optimization*/\\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\\n }\\n\\n if (sharesToBurn != 0) {\\n /*gas optimization*/\\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\\n }\\n\\n for (uint256 i = 0; i < tokens.length; i++) {\\n uint256 balance;\\n if(tokens[i] == ETH) {\\n balance = address(target).balance;\\n } else {\\n (, bytes memory balanceData) = tokens[i].staticcall(\\n abi.encodeWithSelector(0x70a08231, address(target))\\n ); /*get Baal token balances - 'balanceOf(address)'*/\\n balance = abi.decode(balanceData, (uint256));\\n }\\n\\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\\n _totalSupply; /*calculate 'fair shair' claims*/\\n\\n if (amountToRagequit != 0) {\\n /*gas optimization to allow higher maximum token limit*/\\n tokens[i] == ETH\\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\\n }\\n }\\n\\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\\n }\\n\\n /*******************\\n GUILD MGMT FUNCTIONS\\n *******************/\\n /// @notice Baal-only function to set shaman status.\\n /// @param _shamans Addresses of shaman contracts\\n /// @param _permissions Permission level of each shaman in _shamans\\n function setShamans(\\n address[] calldata _shamans,\\n uint256[] calldata _permissions\\n ) external baalOnly {\\n require(_shamans.length == _permissions.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < _shamans.length; i++) {\\n uint256 permission = _permissions[i];\\n if (adminLock)\\n require(\\n permission != 1 &&\\n permission != 3 &&\\n permission != 5 &&\\n permission != 7,\\n \\\"admin lock\\\"\\n );\\n if (managerLock)\\n require(\\n permission != 2 &&\\n permission != 3 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"manager lock\\\"\\n );\\n if (governorLock)\\n require(\\n permission != 4 &&\\n permission != 5 &&\\n permission != 6 &&\\n permission != 7,\\n \\\"governor lock\\\"\\n );\\n shamans[_shamans[i]] = permission;\\n emit ShamanSet(_shamans[i], permission);\\n }\\n }\\n\\n /// @notice Lock admin so setShamans cannot be called with admin changes\\n function lockAdmin() external baalOnly {\\n adminLock = true;\\n\\n emit LockAdmin(adminLock);\\n }\\n\\n /// @notice Lock manager so setShamans cannot be called with manager changes\\n function lockManager() external baalOnly {\\n managerLock = true;\\n\\n emit LockManager(managerLock);\\n }\\n\\n /// @notice Lock governor so setShamans cannot be called with governor changes\\n function lockGovernor() external baalOnly {\\n governorLock = true;\\n\\n emit LockGovernor(governorLock);\\n }\\n\\n // ****************\\n // SHAMAN FUNCTIONS\\n // ****************\\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\\n /// @param pauseShares Turn share transfers on or off\\n /// @param pauseLoot Turn loot transfers on or off\\n function setAdminConfig(bool pauseShares, bool pauseLoot)\\n external\\n baalOrAdminOnly\\n {\\n\\n if(pauseShares && !sharesToken.paused()){\\n sharesToken.pause();\\n emit SharesPaused(true);\\n } else if(!pauseShares && sharesToken.paused()){\\n sharesToken.unpause();\\n emit SharesPaused(false);\\n }\\n\\n if(pauseLoot && !lootToken.paused()){\\n lootToken.pause();\\n emit LootPaused(true);\\n } else if(!pauseLoot && lootToken.paused()){\\n lootToken.unpause();\\n emit LootPaused(false);\\n }\\n }\\n\\n /// @notice Baal-or-manager-only function to mint shares.\\n /// @param to Array of addresses to receive shares\\n /// @param amount Array of amounts to mint\\n function mintShares(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `shares`.\\n /// @param to Address to receive shares\\n /// @param shares Amount to mint\\n function _mintShares(address to, uint256 shares) private {\\n sharesToken.mint(to, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn shares.\\n /// @param from Array of addresses to lose shares\\n /// @param amount Array of amounts to burn\\n function burnShares(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `shares`.\\n /// @param from Address to lose shares\\n /// @param shares Amount to burn\\n function _burnShares(address from, uint256 shares) private {\\n sharesToken.burn(from, shares);\\n }\\n\\n /// @notice Baal-or-manager-only function to mint loot.\\n /// @param to Array of addresses to mint loot\\n /// @param amount Array of amounts to mint\\n function mintLoot(address[] calldata to, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(to.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < to.length; i++) {\\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Minting function for Baal `loot`.\\n /// @param to Address to mint loot\\n /// @param loot Amount to mint\\n function _mintLoot(address to, uint256 loot) private {\\n lootToken.mint(to, loot);\\n }\\n\\n /// @notice Baal-or-manager-only function to burn loot.\\n /// @param from Array of addresses to lose loot\\n /// @param amount Array of amounts to burn\\n function burnLoot(address[] calldata from, uint256[] calldata amount)\\n external\\n baalOrManagerOnly\\n {\\n require(from.length == amount.length, \\\"!array parity\\\"); /*check array lengths match*/\\n for (uint256 i = 0; i < from.length; i++) {\\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\\n }\\n }\\n\\n /// @notice Burn function for Baal `loot`.\\n /// @param from Address to lose loot\\n /// @param loot Amount to burn\\n function _burnLoot(address from, uint256 loot) private {\\n lootToken.burn(from, loot);\\n }\\n\\n /// @notice Baal-or-governance-only function to change periods.\\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\\n function setGovernanceConfig(bytes memory _governanceConfig)\\n external\\n baalOrGovernorOnly\\n {\\n (\\n uint32 voting,\\n uint32 grace,\\n uint256 newOffering,\\n uint256 quorum,\\n uint256 sponsor,\\n uint256 minRetention\\n ) = abi.decode(\\n _governanceConfig,\\n (uint32, uint32, uint256, uint256, uint256, uint256)\\n );\\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\\n\\n // on initialization of governance config, there is no shares token\\n // skip this check on initialization of governance config.\\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\\n }\\n\\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\\n proposalOffering = newOffering; /*set new proposal offering amount */\\n quorumPercent = quorum;\\n sponsorThreshold = sponsor;\\n minRetentionPercent = minRetention;\\n\\n emit GovernanceConfigSet(\\n voting,\\n grace,\\n newOffering,\\n quorum,\\n sponsor,\\n minRetention\\n );\\n }\\n\\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\\n /// @param _trustedForwarderAddress Trusted forwarder's address\\n function setTrustedForwarder(address _trustedForwarderAddress)\\n external\\n baalOrGovernorOnly\\n {\\n _setTrustedForwarder(_trustedForwarderAddress);\\n emit SetTrustedForwarder(_trustedForwarderAddress);\\n }\\n\\n /***************\\n GETTER FUNCTIONS\\n ***************/\\n /// @notice State helper to determine proposal state\\n /// @param id Number of proposal in proposals\\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\\n /// \\\\-> Cancelled \\\\-> Defeated\\n function state(uint32 id) public view returns (ProposalState) {\\n Proposal memory prop = proposals[id];\\n if (prop.id == 0) {\\n /*Uninitialized state*/\\n return ProposalState.Unborn;\\n } else if (\\n prop.status[0] /* cancelled */\\n ) {\\n return ProposalState.Cancelled;\\n } else if (\\n prop.votingStarts == 0 /*Voting has not started*/\\n ) {\\n return ProposalState.Submitted;\\n } else if (\\n block.timestamp <= prop.votingEnds /*Voting in progress*/\\n ) {\\n return ProposalState.Voting;\\n } else if (\\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\\n ) {\\n return ProposalState.Grace;\\n } else if (\\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\\n ) {\\n return ProposalState.Defeated;\\n } else if (\\n prop.status[1] /* processed */\\n ) {\\n return ProposalState.Processed;\\n }\\n /* Proposal is ready to be processed*/\\n else {\\n return ProposalState.Ready;\\n }\\n }\\n\\n /// @notice Helper to get recorded proposal flags\\n /// @param id Number of proposal in proposals\\n /// @return [cancelled, processed, passed, actionFailed]\\n function getProposalStatus(uint32 id)\\n external\\n view\\n returns (bool[4] memory)\\n {\\n return proposals[id].status;\\n }\\n\\n /// @notice Helper to check if shaman permission contains admin capabilities\\n /// @param shaman Address attempting to execute admin permissioned functions\\n function isAdmin(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 1 ||\\n permission == 3 ||\\n permission == 5 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains manager capabilities\\n /// @param shaman Address attempting to execute manager permissioned functions\\n function isManager(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 2 ||\\n permission == 3 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check if shaman permission contains governor capabilities\\n /// @param shaman Address attempting to execute governor permissioned functions\\n function isGovernor(address shaman) public view returns (bool) {\\n uint256 permission = shamans[shaman];\\n return (permission == 4 ||\\n permission == 5 ||\\n permission == 6 ||\\n permission == 7);\\n }\\n\\n /// @notice Helper to check total supply of child loot contract\\n function totalLoot() public view returns (uint256) {\\n return lootToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of child shares contract\\n function totalShares() public view returns (uint256) {\\n return sharesToken.totalSupply();\\n }\\n\\n /// @notice Helper to check total supply of loot and shares\\n function totalSupply() public view returns (uint256) {\\n return totalLoot() + totalShares();\\n }\\n\\n /***************\\n HELPER FUNCTIONS\\n ***************/\\n /// @notice Returns the keccak256 hash of calldata\\n function hashOperation(bytes memory _transactions)\\n public\\n pure\\n virtual\\n returns (bytes32 hash)\\n {\\n return keccak256(abi.encode(_transactions));\\n }\\n\\n /// @notice Provides 'safe' {transfer} for ETH.\\n function _safeTransferETH(address to, uint256 amount) internal {\\n // transfer eth from target\\n (bool success, ) = execAndReturnData(\\n to,\\n amount,\\n \\\"\\\",\\n Enum.Operation.Call\\n );\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\\n function _safeTransfer(\\n address token,\\n address to,\\n uint256 amount\\n ) private {\\n (bool success, bytes memory data) = execAndReturnData(\\n token,\\n 0,\\n abi.encodeWithSelector(0xa9059cbb, to, amount),\\n Enum.Operation.Call\\n ); /*'transfer(address,uint)'*/\\n require(\\n success && (data.length == 0 || abi.decode(data, (bool))),\\n \\\"transfer failed\\\"\\n ); /*checks success & allows non-conforming transfers*/\\n }\\n\\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (address sender) {\\n sender = BaseRelayRecipient._msgSender();\\n }\\n\\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\\n returns (bytes calldata) {\\n return BaseRelayRecipient._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xa74529caeca9e73b0b5920900ede43f35a39a70a502c89bf324ca29ca80979bf\",\"license\":\"MIT\"},\"contracts/higherOrderFactories/BaalAdvTokenSummoner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.7;\\n\\nimport \\\"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\\\";\\nimport \\\"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\\\";\\n\\nimport \\\"../Baal.sol\\\";\\nimport \\\"../interfaces/IBaalSummoner.sol\\\";\\n\\ncontract BaalAdvTokenSummoner is\\n Initializable,\\n OwnableUpgradeable,\\n UUPSUpgradeable\\n{\\n IBaalSummoner public _baalSummoner;\\n\\n event setSummoner(address summoner);\\n\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize() public initializer {\\n __Ownable_init();\\n __UUPSUpgradeable_init();\\n }\\n\\n /**\\n * @dev Sets the address of the BaalSummoner contract\\n * @param baalSummoner The address of the BaalSummoner contract\\n */\\n function setSummonerAddr(address baalSummoner) public onlyOwner {\\n require(baalSummoner != address(0), \\\"zero address\\\");\\n _baalSummoner = IBaalSummoner(baalSummoner);\\n emit setSummoner(baalSummoner);\\n }\\n\\n /**\\n * @dev Summon a new Baal contract with a new set of tokens\\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\\n * @param _saltNonce The salt nonce to be used for the Safe contract\\n * @param initializationMintParams The parameters for minting the tokens\\n * @param initializationTokenParams The parameters for deploying the tokens\\n * @param postInitializationActions The actions to be performed after the initialization\\n */\\n function summonBaalFromReferrer(\\n address _safeAddr,\\n address _forwarderAddr,\\n uint256 _saltNonce,\\n bytes calldata initializationMintParams,\\n bytes calldata initializationTokenParams,\\n bytes[] calldata postInitializationActions\\n ) external {\\n // summon tokens\\n (address _lootToken, address _sharesToken) = deployTokens(\\n initializationTokenParams\\n );\\n\\n // mint shares loot tokens\\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\\n\\n // summon baal with new tokens\\n address _baal = _baalSummoner.summonBaalFromReferrer(\\n abi.encode(\\n IBaalToken(_sharesToken).name(), \\n IBaalToken(_sharesToken).symbol(),\\n _safeAddr,\\n _forwarderAddr,\\n _lootToken,\\n _sharesToken\\n ),\\n postInitializationActions,\\n _saltNonce,\\n bytes32(bytes(\\\"DHAdvTokenSummoner\\\")) // referrer\\n );\\n\\n // change token ownership to baal\\n IBaalToken(_lootToken).transferOwnership(address(_baal));\\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\\n }\\n\\n /**\\n * @dev mintTokens\\n * @param initializationTokens The parameters for minting the tokens\\n * @param _lootToken The loot token address\\n * @param _sharesToken The shares token address\\n */\\n function mintTokens(\\n bytes calldata initializationTokens,\\n address _lootToken,\\n address _sharesToken\\n ) internal {\\n (\\n address[] memory summoners, // The address to mint initial tokens to\\n uint256[] memory summonerShares, // The amount of shares to mint\\n uint256[] memory summonerLoot // The amount of loot to mint\\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\\n\\n require(\\n summoners.length == summonerShares.length &&\\n summoners.length == summonerLoot.length,\\n \\\"!array parity\\\"\\n ); /*check array lengths match*/\\n\\n for (uint256 i = 0; i < summoners.length; i++) {\\n if (summonerLoot[i] > 0) {\\n IBaalToken(_lootToken).mint(\\n summoners[i],\\n summonerLoot[i]\\n ); /*grant `to` `amount` `loot`*/\\n }\\n if (summonerShares[i] > 0) {\\n IBaalToken(_sharesToken).mint(\\n summoners[i],\\n summonerShares[i]\\n ); /*grant `to` `amount` `shares`*/\\n }\\n }\\n }\\n\\n /**\\n * @dev deployTokens\\n * @param initializationParams The parameters for deploying the tokens\\n */\\n function deployTokens(\\n bytes calldata initializationParams\\n ) internal returns (address lootToken, address sharesToken) {\\n (\\n string\\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\\n string\\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\\n string\\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\\n string\\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\\n bool _transferableShares /* if shares is transferable */,\\n bool _transferableLoot /* if loot is transferable */\\n ) = abi.decode(\\n initializationParams,\\n (string, string, string, string, bool, bool)\\n );\\n\\n address lootSingleton = _baalSummoner.lootSingleton();\\n address sharesSingleton = _baalSummoner.sharesSingleton();\\n\\n lootToken = address(\\n new ERC1967Proxy(\\n lootSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(lootSingleton).setUp.selector,\\n _lootName,\\n _lootSymbol\\n )\\n )\\n );\\n\\n sharesToken = address(\\n new ERC1967Proxy(\\n sharesSingleton,\\n abi.encodeWithSelector(\\n IBaalToken(sharesSingleton).setUp.selector,\\n _name,\\n _symbol\\n )\\n )\\n );\\n if (!_transferableShares) {\\n IBaalToken(sharesToken).pause();\\n }\\n if (!_transferableLoot) {\\n IBaalToken(lootToken).pause();\\n }\\n\\n emit DeployBaalTokens(lootToken, sharesToken);\\n }\\n\\n function _authorizeUpgrade(\\n address newImplementation\\n ) internal override onlyOwner {}\\n}\\n\",\"keccak256\":\"0x006b6737392584aee27cae0cad838ca0d07004a77b10600884a3813318775807\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalSummoner.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalSummoner {\\n event AdminChanged(address previousAdmin, address newAdmin);\\n event BeaconUpgraded(address indexed beacon);\\n event DaoReferral(bytes32 referrer, address daoAddress);\\n event DeployBaalSafe(address baalSafe, address moduleAddr);\\n event DeployBaalTokens(address lootToken, address sharesToken);\\n event Initialized(uint8 version);\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n event SetAddrsVersion(uint256 version);\\n event SummonBaal(\\n address indexed baal,\\n address indexed loot,\\n address indexed shares,\\n address safe,\\n address forwarder,\\n uint256 existingAddrs\\n );\\n event Upgraded(address indexed implementation);\\n\\n function setAddrs(\\n address _template,\\n address _gnosisSingleton,\\n address _gnosisFallbackLibrary,\\n address _gnosisMultisendLibrary,\\n address _gnosisSafeProxyFactory,\\n address _moduleProxyFactory,\\n address _lootSingleton,\\n address _sharesSingleton\\n ) external;\\n\\n function initialize() external;\\n\\n function transferOwnership(address newOwner) external;\\n function upgradeTo(address newImplementation) external;\\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\\n function renounceOwnership() external;\\n\\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\\n external\\n returns (address);\\n function summonBaalFromReferrer(\\n bytes memory initializationParams,\\n bytes[] memory initializationActions,\\n uint256 _saltNonce,\\n bytes32 referrer\\n ) external payable returns (address);\\n\\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\\n function deployTokens(string memory _name, string memory _symbol)\\n external\\n returns (address lootToken, address sharesToken);\\n\\n function encodeMultisend(bytes[] memory _calls, address _target)\\n external\\n pure\\n returns (bytes memory encodedMultisend);\\n function addrsVersion() external view returns (uint256);\\n function gnosisFallbackLibrary() external view returns (address);\\n function gnosisMultisendLibrary() external view returns (address);\\n function gnosisSingleton() external view returns (address);\\n function lootSingleton() external view returns (address);\\n function sharesSingleton() external view returns (address);\\n function owner() external view returns (address);\\n function proxiableUUID() external view returns (bytes32);\\n function template() external view returns (address);\\n}\\n\",\"keccak256\":\"0xc5eb34a9c49792956ed8574ce0fae742c3ea655101a890965caf7e7983e1be79\",\"license\":\"MIT\"},\"contracts/interfaces/IBaalToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\ninterface IBaalToken {\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function setUp(string memory _name, string memory _symbol) external;\\n\\n function mint(address recipient, uint256 amount) external;\\n\\n function burn(address account, uint256 amount) external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n function paused() external view returns (bool);\\n \\n function transferOwnership(address newOwner) external;\\n\\n function owner() external view returns (address);\\n\\n function balanceOf(address account) external view returns (uint256);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function snapshot() external returns(uint256);\\n\\n function getCurrentSnapshotId() external returns(uint256);\\n\\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\\n\\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\\n\\n // below is shares token specific\\n struct Checkpoint {\\n uint32 fromTimePoint;\\n uint256 votes;\\n }\\n\\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\\n\\n function numCheckpoints(address) external view returns (uint256);\\n\\n function getCheckpoint(address, uint256)\\n external\\n view\\n returns (Checkpoint memory);\\n\\n function getVotes(address account) external view returns (uint256);\\n\\n function delegates(address account) external view returns (address);\\n\\n function delegationNonces(address account) external view returns (uint256);\\n\\n function delegate(address delegatee) external;\\n\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n}\\n\",\"keccak256\":\"0x0817d09fef6022bf8b963060c7c576b5cc59cd4ac573da23b1ae7224cb272508\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a06040523060601b60805234801561001757600080fd5b50610020610025565b6100e5565b600054610100900460ff16156100915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e3576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6125de61011f600039600081816104ec01528181610538015281816105e10152818161062401526106c001526125de6000f3fe6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106200009d5760003560e01c8063715018a61162000060578063715018a6146200016b5780638129fc1c14620001835780638da5cb5b146200019b578063bb6decc814620001bb578063f2fde38b14620001e057600080fd5b806314b630f914620000a25780631f1bb0ef14620000e15780633659cfe614620001085780634f1ef286146200012d57806352d1902d1462000144575b600080fd5b348015620000af57600080fd5b5060c954620000c4906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ee57600080fd5b50620001066200010036600462001621565b62000205565b005b3480156200011557600080fd5b506200010662000127366004620015e1565b620004e1565b620001066200013e36600462001728565b620005d6565b3480156200015157600080fd5b506200015c620006b3565b604051908152602001620000d8565b3480156200017857600080fd5b506200010662000769565b3480156200019057600080fd5b506200010662000781565b348015620001a857600080fd5b506033546001600160a01b0316620000c4565b348015620001c857600080fd5b5062000106620001da366004620015e1565b620008a5565b348015620001ed57600080fd5b5062000106620001ff366004620015e1565b62000945565b600080620002148686620009c1565b91509150620002268888848462000d1e565b600060c960009054906101000a90046001600160a01b03166001600160a01b031663209f3695836001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b1580156200028657600080fd5b505afa1580156200029b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620002c59190810190620018ab565b846001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200033e9190810190620018ab565b8f8f8888604051602001620003599695949392919062001ba3565b60408051601f198184030181528282019091526012825271222420b23b2a37b5b2b729bab6b6b7b732b960711b602083015290889088908f906200039d9062001d69565b6040518663ffffffff1660e01b8152600401620003bf95949392919062001aa3565b602060405180830381600087803b158015620003da57600080fd5b505af1158015620003ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000415919062001601565b60405163f2fde38b60e01b81526001600160a01b0380831660048301529192509084169063f2fde38b90602401600060405180830381600087803b1580156200045d57600080fd5b505af115801562000472573d6000803e3d6000fd5b505060405163f2fde38b60e01b81526001600160a01b0384811660048301528516925063f2fde38b9150602401600060405180830381600087803b158015620004ba57600080fd5b505af1158015620004cf573d6000803e3d6000fd5b50505050505050505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620005365760405162461bcd60e51b81526004016200052d9062001c00565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200058160008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620005aa5760405162461bcd60e51b81526004016200052d9062001c4c565b620005b58162000f5f565b60408051600080825260208201909252620005d39183919062000f69565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415620006225760405162461bcd60e51b81526004016200052d9062001c00565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166200066d60008051602062002562833981519152546001600160a01b031690565b6001600160a01b031614620006965760405162461bcd60e51b81526004016200052d9062001c4c565b620006a18262000f5f565b620006af8282600162000f69565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620007555760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016200052d565b506000805160206200256283398151915290565b62000773620010f6565b6200077f600062001152565b565b600054610100900460ff1615808015620007a25750600054600160ff909116105b80620007be5750303b158015620007be575060005460ff166001145b620008235760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200052d565b6000805460ff19166001179055801562000847576000805461ff0019166101001790555b62000851620011a4565b6200085b620011d8565b8015620005d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150565b620008af620010f6565b6001600160a01b038116620008f65760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064016200052d565b60c980546001600160a01b0319166001600160a01b0383169081179091556040519081527ff471c7a7115723e1d5e0a3b924bec97596831b94082a24d73c8c3210c6cb3b06906020016200089a565b6200094f620010f6565b6001600160a01b038116620009b65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200052d565b620005d38162001152565b600080808080808080620009d8898b018b62001922565b955095509550955095509550600060c960009054906101000a90046001600160a01b03166001600160a01b031663d9118ce76040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a70919062001601565b9050600060c960009054906101000a90046001600160a01b03166001600160a01b031663a23466186040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ac357600080fd5b505afa15801562000ad8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000afe919062001601565b90508163562d190d60e01b878760405160240162000b1e92919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000b5d9062001497565b62000b6a92919062001a75565b604051809103906000f08015801562000b87573d6000803e3d6000fd5b5099508063562d190d60e01b898960405160240162000ba892919062001b7a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905162000be79062001497565b62000bf492919062001a75565b604051809103906000f08015801562000c11573d6000803e3d6000fd5b5098508362000c7057886001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c5657600080fd5b505af115801562000c6b573d6000803e3d6000fd5b505050505b8262000ccc57896001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cb257600080fd5b505af115801562000cc7573d6000803e3d6000fd5b505050505b604080516001600160a01b03808d1682528b1660208201527ffb5849d45e916a3192059973d782e08b2b3888fa796f536d99af0c7bd01ca16c910160405180910390a150505050505050509250929050565b6000808062000d308688018862001793565b9250925092508151835114801562000d49575080518351145b62000d875760405162461bcd60e51b815260206004820152600d60248201526c2161727261792070617269747960981b60448201526064016200052d565b60005b835181101562000f5557600082828151811062000dab5762000dab62001dea565b6020026020010151111562000e6a57856001600160a01b03166340c10f1985838151811062000dde5762000dde62001dea565b602002602001015184848151811062000dfb5762000dfb62001dea565b60200260200101516040518363ffffffff1660e01b815260040162000e359291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000e5057600080fd5b505af115801562000e65573d6000803e3d6000fd5b505050505b600083828151811062000e815762000e8162001dea565b6020026020010151111562000f4057846001600160a01b03166340c10f1985838151811062000eb45762000eb462001dea565b602002602001015185848151811062000ed15762000ed162001dea565b60200260200101516040518363ffffffff1660e01b815260040162000f0b9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801562000f2657600080fd5b505af115801562000f3b573d6000803e3d6000fd5b505050505b8062000f4c8162001dc0565b91505062000d8a565b5050505050505050565b620005d3620010f6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161562000fa45762000f9f8362001202565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000fde57600080fd5b505afa92505050801562001011575060408051601f3d908101601f191682019092526200100e9181019062001891565b60015b620010765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016200052d565b600080516020620025628339815191528114620010e85760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016200052d565b5062000f9f838383620012a1565b6033546001600160a01b031633146200077f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200052d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620011ce5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f620012d2565b600054610100900460ff166200077f5760405162461bcd60e51b81526004016200052d9062001c98565b6001600160a01b0381163b620012715760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200052d565b6000805160206200256283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620012ac8362001307565b600082511180620012ba5750805b1562000f9f57620012cc838362001349565b50505050565b600054610100900460ff16620012fc5760405162461bcd60e51b81526004016200052d9062001c98565b6200077f3362001152565b620013128162001202565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b620013b35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200052d565b600080846001600160a01b031684604051620013d0919062001a57565b600060405180830381855af49150503d80600081146200140d576040519150601f19603f3d011682016040523d82523d6000602084013e62001412565b606091505b50915091506200143d8282604051806060016040528060278152602001620025826027913962001446565b95945050505050565b606083156200145757508162001463565b6200146383836200146a565b9392505050565b8151156200147b5781518083602001fd5b8060405162461bcd60e51b81526004016200052d919062001b65565b6107358062001e2d83390190565b6000620014bc620014b68462001d3e565b62001ce3565b9050828152838383011115620014d157600080fd5b828260208301376000602084830101529392505050565b600082601f830112620014fa57600080fd5b813560206200150d620014b68362001d17565b80838252828201915082860187848660051b89010111156200152e57600080fd5b60005b858110156200154f5781358452928401929084019060010162001531565b5090979650505050505050565b803580151581146200156d57600080fd5b919050565b60008083601f8401126200158557600080fd5b50813567ffffffffffffffff8111156200159e57600080fd5b602083019150836020828501011115620015b757600080fd5b9250929050565b600082601f830112620015d057600080fd5b6200146383833560208501620014a5565b600060208284031215620015f457600080fd5b8135620014638162001e16565b6000602082840312156200161457600080fd5b8151620014638162001e16565b600080600080600080600080600060c08a8c0312156200164057600080fd5b89356200164d8162001e16565b985060208a01356200165f8162001e16565b975060408a0135965060608a013567ffffffffffffffff808211156200168457600080fd5b620016928d838e0162001572565b909850965060808c0135915080821115620016ac57600080fd5b620016ba8d838e0162001572565b909650945060a08c0135915080821115620016d457600080fd5b818c0191508c601f830112620016e957600080fd5b813581811115620016f957600080fd5b8d60208260051b85010111156200170f57600080fd5b6020830194508093505050509295985092959850929598565b600080604083850312156200173c57600080fd5b8235620017498162001e16565b9150602083013567ffffffffffffffff8111156200176657600080fd5b8301601f810185136200177857600080fd5b6200178985823560208401620014a5565b9150509250929050565b600080600060608486031215620017a957600080fd5b833567ffffffffffffffff80821115620017c257600080fd5b818601915086601f830112620017d757600080fd5b81356020620017ea620014b68362001d17565b8083825282820191508286018b848660051b89010111156200180b57600080fd5b600096505b848710156200183b578035620018268162001e16565b83526001969096019591830191830162001810565b50975050870135925050808211156200185357600080fd5b6200186187838801620014e8565b935060408601359150808211156200187857600080fd5b506200188786828701620014e8565b9150509250925092565b600060208284031215620018a457600080fd5b5051919050565b600060208284031215620018be57600080fd5b815167ffffffffffffffff811115620018d657600080fd5b8201601f81018413620018e857600080fd5b8051620018f9620014b68262001d3e565b8181528560208385010111156200190f57600080fd5b6200143d82602083016020860162001d91565b60008060008060008060c087890312156200193c57600080fd5b863567ffffffffffffffff808211156200195557600080fd5b620019638a838b01620015be565b975060208901359150808211156200197a57600080fd5b620019888a838b01620015be565b965060408901359150808211156200199f57600080fd5b620019ad8a838b01620015be565b95506060890135915080821115620019c457600080fd5b50620019d389828a01620015be565b935050620019e4608088016200155c565b9150620019f460a088016200155c565b90509295509295509295565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845262001a4381602086016020860162001d91565b601f01601f19169290920160200192915050565b6000825162001a6b81846020870162001d91565b9190910192915050565b6001600160a01b038316815260406020820181905260009062001a9b9083018462001a29565b949350505050565b60808152600062001ab8608083018862001a29565b602083820381850152818783528183019050818860051b8401018960005b8a81101562001b4c57858303601f190184528135368d9003601e1901811262001afe57600080fd5b8c01803567ffffffffffffffff81111562001b1857600080fd5b8036038e131562001b2857600080fd5b62001b37858289850162001a00565b95870195945050509084019060010162001ad6565b5050604086019790975250505050606001529392505050565b60208152600062001463602083018462001a29565b60408152600062001b8f604083018562001a29565b82810360208401526200143d818562001a29565b60c08152600062001bb860c083018962001a29565b828103602084015262001bcc818962001a29565b6001600160a01b03978816604085015295871660608401525050918416608083015290921660a09092019190915292915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171562001d0f5762001d0f62001e00565b604052919050565b600067ffffffffffffffff82111562001d345762001d3462001e00565b5060051b60200190565b600067ffffffffffffffff82111562001d5b5762001d5b62001e00565b50601f01601f191660200190565b8051602080830151919081101562001d8b576000198160200360031b1b821691505b50919050565b60005b8381101562001dae57818101518382015260200162001d94565b83811115620012cc5750506000910152565b600060001982141562001de357634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620005d357600080fdfe6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122051cce14dd9337037379bd43ee81331c1b371dbeb3f61c2ba0ccdb3ad0e551a9664736f6c63430008070033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201a5544699208b5bb7a4aa70d601b16889abe1fce4a7597621ea167622388a1aa64736f6c63430008070033", + "devdoc": { + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "proxiableUUID()": { + "details": "Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "setSummonerAddr(address)": { + "details": "Sets the address of the BaalSummoner contract", + "params": { + "baalSummoner": "The address of the BaalSummoner contract" + } + }, + "summonBaalFromReferrer(address,address,uint256,bytes,bytes,bytes[])": { + "details": "Summon a new Baal contract with a new set of tokens", + "params": { + "_forwarderAddr": "The address of the forwarder to be used, 0x0 if not set", + "_safeAddr": "The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe", + "_saltNonce": "The salt nonce to be used for the Safe contract", + "initializationMintParams": "The parameters for minting the tokens", + "initializationTokenParams": "The parameters for deploying the tokens", + "postInitializationActions": "The actions to be performed after the initialization" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 3851, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 3854, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 4547, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 3334, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 3454, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 3833, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 4148, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 9571, + "contract": "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol:BaalAdvTokenSummoner", + "label": "_baalSummoner", + "offset": 0, + "slot": "201", + "type": "t_contract(IBaalSummoner)10150" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBaalSummoner)10150": { + "encoding": "inplace", + "label": "contract IBaalSummoner", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } } \ No newline at end of file diff --git a/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json b/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json index 1fd3615..4e86cb6 100644 --- a/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json +++ b/deployments/optimisticEthereum/BaalAdvTokenSummoner_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + "address": "0x84561C97156a128662B62952890469214FDC87bf", "abi": [ { "inputs": [ @@ -8,11 +8,6 @@ "name": "_logic", "type": "address" }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, { "internalType": "bytes", "name": "_data", @@ -71,79 +66,93 @@ "stateMutability": "payable", "type": "fallback" }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, { "stateMutability": "payable", "type": "receive" } - ] + ], + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "receipt": { + "to": null, + "from": "0xa17a42ccf455f9AAb21Eb6ee9C41FdD28Cf4D900", + "contractAddress": "0x84561C97156a128662B62952890469214FDC87bf", + "transactionIndex": 8, + "gasUsed": "333346", + "logsBloom": "0x02000000000000000000000000000000400000000000001000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800002000001000000000000000000000040000800000000020000000000000000000800000000000000000000000200000000400000000000000000000000000040000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000000000000000000000020000000000000020000000000000000000001000000000000000000000000000000", + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3", + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e95f3d6a163e79cf057375c97175b1e22eaea02f" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a17a42ccf455f9aab21eb6ee9c41fdd28cf4d900" + ], + "data": "0x", + "logIndex": 22, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + }, + { + "transactionIndex": 8, + "blockNumber": 108683897, + "transactionHash": "0x9c5311eb52837384120b2113ca74dcad476218f9b02914077da6dcb753845645", + "address": "0x84561C97156a128662B62952890469214FDC87bf", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 23, + "blockHash": "0xe788eac2b06e5ee54aa9e1240cb77d9974f3811c2f504a243280d57957035ed3" + } + ], + "blockNumber": 108683897, + "cumulativeGasUsed": "1383816", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE95F3D6A163e79cF057375C97175B1e22eAEA02F", + "0x8129fc1c" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":\"ERC1967Proxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(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\\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\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405161084e38038061084e83398101604081905261002291610349565b61004d60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610417565b600080516020610807833981519152146100695761006961043c565b6100758282600061007c565b50506104a1565b610085836100b2565b6000825111806100925750805b156100ad576100ab83836100f260201b6100291760201c565b505b505050565b6100bb8161011e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101178383604051806060016040528060278152602001610827602791396101de565b9392505050565b610131816102bc60201b6100551760201c565b6101985760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101bd60008051602061080783398151915260001b6102cb60201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161018f565b600080856001600160a01b0316856040516102619190610452565b600060405180830381855af49150503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b5090925090506102b28282866102ce565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102dd575081610117565b8251156102ed5782518084602001fd5b8160405162461bcd60e51b815260040161018f919061046e565b634e487b7160e01b600052604160045260246000fd5b60005b83811015610338578181015183820152602001610320565b838111156100ab5750506000910152565b6000806040838503121561035c57600080fd5b82516001600160a01b038116811461037357600080fd5b60208401519092506001600160401b038082111561039057600080fd5b818501915085601f8301126103a457600080fd5b8151818111156103b6576103b6610307565b604051601f8201601f19908116603f011681019083821181831017156103de576103de610307565b816040528281528860208487010111156103f757600080fd5b61040883602083016020880161031d565b80955050505050509250929050565b60008282101561043757634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825161046481846020870161031d565b9190910192915050565b602081526000825180602084015261048d81604085016020870161031d565b601f01601f19169190910160400192915050565b610357806104b06000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102fb602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b606073ffffffffffffffffffffffffffffffffffffffff84163b610188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516101b0919061028d565b600060405180830381855af49150503d80600081146101eb576040519150601f19603f3d011682016040523d82523d6000602084013e6101f0565b606091505b509150915061020082828661020a565b9695505050505050565b6060831561021957508161004e565b8251156102295782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017f91906102a9565b60005b83811015610278578181015183820152602001610260565b83811115610287576000848401525b50505050565b6000825161029f81846020870161025d565b9190910192915050565b60208152600082518060208401526102c881604085016020870161025d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201e3c9348ed6dd2f363e89451207bd8df182bc878dc80d47166301a510c8801e964736f6c634300080a0033", + "devdoc": { + "details": "This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an implementation address that can be changed. This address is stored in storage in the location specified by https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the implementation behind the proxy.", + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } } \ No newline at end of file diff --git a/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 0000000..6eb5ed9 --- /dev/null +++ b/deployments/optimisticEthereum/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,80 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.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 Ownable is Context {\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 constructor (address initialOwner) {\n _transferOwnership(initialOwner);\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 called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\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" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\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 Context {\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" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(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\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" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.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 * 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 initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool 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 Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json b/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json new file mode 100644 index 0000000..e4b3965 --- /dev/null +++ b/deployments/optimisticEthereum/solcInputs/e59d9182173b42b6940606b788cb65c6.json @@ -0,0 +1,194 @@ +{ + "language": "Solidity", + "sources": { + "@gnosis.pm/safe-contracts/contracts/base/Executor.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\n\n/// @title Executor - A contract that can execute transactions\n/// @author Richard Meissner - \ncontract Executor {\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/FallbackManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract FallbackManager is SelfAuthorized {\n event ChangedFallbackHandler(address handler);\n\n // keccak256(\"fallback_manager.handler.address\")\n bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;\n\n function internalSetFallbackHandler(address handler) internal {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, handler)\n }\n }\n\n /// @dev Allows to add a contract to handle fallback calls.\n /// Only fallback calls without value and with data will be forwarded.\n /// This can only be done via a Safe transaction.\n /// @param handler contract to handle fallbacks calls.\n function setFallbackHandler(address handler) public authorized {\n internalSetFallbackHandler(handler);\n emit ChangedFallbackHandler(handler);\n }\n\n // solhint-disable-next-line payable-fallback,no-complex-fallback\n fallback() external {\n bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let handler := sload(slot)\n if iszero(handler) {\n return(0, 0)\n }\n calldatacopy(0, 0, calldatasize())\n // The msg.sender address is shifted to the left by 12 bytes to remove the padding\n // Then the address without padding is stored right after the calldata\n mstore(calldatasize(), shl(96, caller()))\n // Add 20 bytes for the address appended add the end\n let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if iszero(success) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/GuardManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\n\ninterface Guard {\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\n/// @title Fallback Manager - A contract that manages fallback calls made to this contract\n/// @author Richard Meissner - \ncontract GuardManager is SelfAuthorized {\n event ChangedGuard(address guard);\n // keccak256(\"guard_manager.guard.address\")\n bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;\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 authorized {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, guard)\n }\n emit ChangedGuard(guard);\n }\n\n function getGuard() internal view returns (address guard) {\n bytes32 slot = GUARD_STORAGE_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n guard := sload(slot)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/ModuleManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n/// @title Module Manager - A contract that manages modules that can execute transactions via this contract\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract ModuleManager is SelfAuthorized, Executor {\n event EnabledModule(address module);\n event DisabledModule(address module);\n event ExecutionFromModuleSuccess(address indexed module);\n event ExecutionFromModuleFailure(address indexed module);\n\n address internal constant SENTINEL_MODULES = address(0x1);\n\n mapping(address => address) internal modules;\n\n function setupModules(address to, bytes memory data) internal {\n require(modules[SENTINEL_MODULES] == address(0), \"GS100\");\n modules[SENTINEL_MODULES] = SENTINEL_MODULES;\n if (to != address(0))\n // Setup has to complete successfully or transaction fails.\n require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), \"GS000\");\n }\n\n /// @dev Allows to add a module to the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Enables the module `module` for the Safe.\n /// @param module Module to be whitelisted.\n function enableModule(address module) public authorized {\n // Module address cannot be null or sentinel.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n // Module cannot be added twice.\n require(modules[module] == address(0), \"GS102\");\n modules[module] = modules[SENTINEL_MODULES];\n modules[SENTINEL_MODULES] = module;\n emit EnabledModule(module);\n }\n\n /// @dev Allows to remove a module from the whitelist.\n /// This can only be done via a Safe transaction.\n /// @notice Disables the module `module` for the Safe.\n /// @param prevModule Module 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) public authorized {\n // Validate module address and check that it corresponds to module index.\n require(module != address(0) && module != SENTINEL_MODULES, \"GS101\");\n require(modules[prevModule] == module, \"GS103\");\n modules[prevModule] = modules[module];\n modules[module] = address(0);\n emit DisabledModule(module);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations.\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.\n function execTransactionFromModule(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public virtual returns (bool success) {\n // Only whitelisted modules are allowed.\n require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"GS104\");\n // Execute transaction without further confirmations.\n success = execute(to, value, data, operation, gasleft());\n if (success) emit ExecutionFromModuleSuccess(msg.sender);\n else emit ExecutionFromModuleFailure(msg.sender);\n }\n\n /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data\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.\n function execTransactionFromModuleReturnData(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) public returns (bool success, bytes memory returnData) {\n success = execTransactionFromModule(to, value, data, operation);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // Load free memory location\n let ptr := mload(0x40)\n // We allocate memory for the return data by setting the free memory location to\n // current free memory location + data size + 32 bytes for data size value\n mstore(0x40, add(ptr, add(returndatasize(), 0x20)))\n // Store the size\n mstore(ptr, returndatasize())\n // Store the data\n returndatacopy(add(ptr, 0x20), 0, returndatasize())\n // Point the return data to the correct memory location\n returnData := ptr\n }\n }\n\n /// @dev Returns if an module is enabled\n /// @return True if the module is enabled\n function isModuleEnabled(address module) public view returns (bool) {\n return SENTINEL_MODULES != module && modules[module] != address(0);\n }\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) external view returns (address[] memory array, address next) {\n // Init array with max page size\n array = new address[](pageSize);\n\n // Populate return array\n uint256 moduleCount = 0;\n address currentModule = modules[start];\n while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {\n array[moduleCount] = currentModule;\n currentModule = modules[currentModule];\n moduleCount++;\n }\n next = currentModule;\n // Set correct size of returned array\n // solhint-disable-next-line no-inline-assembly\n assembly {\n mstore(array, moduleCount)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/base/OwnerManager.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"../common/SelfAuthorized.sol\";\n\n/// @title OwnerManager - Manages a set of owners and a threshold to perform actions.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract OwnerManager is SelfAuthorized {\n event AddedOwner(address owner);\n event RemovedOwner(address owner);\n event ChangedThreshold(uint256 threshold);\n\n address internal constant SENTINEL_OWNERS = address(0x1);\n\n mapping(address => address) internal owners;\n uint256 internal ownerCount;\n uint256 internal threshold;\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n function setupOwners(address[] memory _owners, uint256 _threshold) internal {\n // Threshold can only be 0 at initialization.\n // Check ensures that setup function can only be called once.\n require(threshold == 0, \"GS200\");\n // Validate that threshold is smaller than number of added owners.\n require(_threshold <= _owners.length, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n // Initializing Safe owners.\n address currentOwner = SENTINEL_OWNERS;\n for (uint256 i = 0; i < _owners.length; i++) {\n // Owner address cannot be null.\n address owner = _owners[i];\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[currentOwner] = owner;\n currentOwner = owner;\n }\n owners[currentOwner] = SENTINEL_OWNERS;\n ownerCount = _owners.length;\n threshold = _threshold;\n }\n\n /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.\n /// @param owner New owner address.\n /// @param _threshold New threshold.\n function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[owner] == address(0), \"GS204\");\n owners[owner] = owners[SENTINEL_OWNERS];\n owners[SENTINEL_OWNERS] = owner;\n ownerCount++;\n emit AddedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.\n /// This can only be done via a Safe transaction.\n /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.\n /// @param prevOwner Owner that pointed to the owner to be removed in the linked list\n /// @param owner Owner address to be removed.\n /// @param _threshold New threshold.\n function removeOwner(\n address prevOwner,\n address owner,\n uint256 _threshold\n ) public authorized {\n // Only allow to remove an owner, if threshold can still be reached.\n require(ownerCount - 1 >= _threshold, \"GS201\");\n // Validate owner address and check that it corresponds to owner index.\n require(owner != address(0) && owner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == owner, \"GS205\");\n owners[prevOwner] = owners[owner];\n owners[owner] = address(0);\n ownerCount--;\n emit RemovedOwner(owner);\n // Change threshold if threshold was changed.\n if (threshold != _threshold) changeThreshold(_threshold);\n }\n\n /// @dev Allows to swap/replace an owner from the Safe with another address.\n /// This can only be done via a Safe transaction.\n /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.\n /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list\n /// @param oldOwner Owner address to be replaced.\n /// @param newOwner New owner address.\n function swapOwner(\n address prevOwner,\n address oldOwner,\n address newOwner\n ) public authorized {\n // Owner address cannot be null, the sentinel or the Safe itself.\n require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), \"GS203\");\n // No duplicate owners allowed.\n require(owners[newOwner] == address(0), \"GS204\");\n // Validate oldOwner address and check that it corresponds to owner index.\n require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, \"GS203\");\n require(owners[prevOwner] == oldOwner, \"GS205\");\n owners[newOwner] = owners[oldOwner];\n owners[prevOwner] = newOwner;\n owners[oldOwner] = address(0);\n emit RemovedOwner(oldOwner);\n emit AddedOwner(newOwner);\n }\n\n /// @dev Allows to update the number of required confirmations by Safe owners.\n /// This can only be done via a Safe transaction.\n /// @notice Changes the threshold of the Safe to `_threshold`.\n /// @param _threshold New threshold.\n function changeThreshold(uint256 _threshold) public authorized {\n // Validate that threshold is smaller than number of owners.\n require(_threshold <= ownerCount, \"GS201\");\n // There has to be at least one Safe owner.\n require(_threshold >= 1, \"GS202\");\n threshold = _threshold;\n emit ChangedThreshold(threshold);\n }\n\n function getThreshold() public view returns (uint256) {\n return threshold;\n }\n\n function isOwner(address owner) public view returns (bool) {\n return owner != SENTINEL_OWNERS && owners[owner] != address(0);\n }\n\n /// @dev Returns array of owners.\n /// @return Array of Safe owners.\n function getOwners() public view returns (address[] memory) {\n address[] memory array = new address[](ownerCount);\n\n // populate return array\n uint256 index = 0;\n address currentOwner = owners[SENTINEL_OWNERS];\n while (currentOwner != SENTINEL_OWNERS) {\n array[index] = currentOwner;\n currentOwner = owners[currentOwner];\n index++;\n }\n return array;\n }\n}\n" + }, + "@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/safe-contracts/contracts/common/EtherPaymentFallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments\n/// @author Richard Meissner - \ncontract EtherPaymentFallback {\n event SafeReceived(address indexed sender, uint256 value);\n\n /// @dev Fallback function accepts Ether transactions.\n receive() external payable {\n emit SafeReceived(msg.sender, msg.value);\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SecuredTokenTransfer.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SecuredTokenTransfer - Secure token transfer\n/// @author Richard Meissner - \ncontract SecuredTokenTransfer {\n /// @dev Transfers a token and returns if it was a success\n /// @param token Token that should be transferred\n /// @param receiver Receiver to whom the token should be transferred\n /// @param amount The amount of tokens that should be transferred\n function transferToken(\n address token,\n address receiver,\n uint256 amount\n ) internal returns (bool transferred) {\n // 0xa9059cbb - keccack(\"transfer(address,uint256)\")\n bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n switch returndatasize()\n case 0 {\n transferred := success\n }\n case 0x20 {\n transferred := iszero(or(iszero(success), iszero(mload(0))))\n }\n default {\n transferred := 0\n }\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SelfAuthorized.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SelfAuthorized - authorizes current contract to perform actions\n/// @author Richard Meissner - \ncontract SelfAuthorized {\n function requireSelfCall() private view {\n require(msg.sender == address(this), \"GS031\");\n }\n\n modifier authorized() {\n // This is a function call as it minimized the bytecode size\n requireSelfCall();\n _;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/SignatureDecoder.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title SignatureDecoder - Decodes signatures that a encoded as bytes\n/// @author Richard Meissner - \ncontract SignatureDecoder {\n /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.\n /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures\n /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access\n /// @param signatures concatenated rsv signatures\n function signatureSplit(bytes memory signatures, uint256 pos)\n internal\n pure\n returns (\n uint8 v,\n bytes32 r,\n bytes32 s\n )\n {\n // The signature format is a compact form of:\n // {bytes32 r}{bytes32 s}{uint8 v}\n // Compact means, uint8 is not padded to 32 bytes.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let signaturePos := mul(0x41, pos)\n r := mload(add(signatures, add(signaturePos, 0x20)))\n s := mload(add(signatures, add(signaturePos, 0x40)))\n // Here we are loading the last 32 bytes, including 31 bytes\n // of 's'. There is no 'mload8' to do this.\n //\n // 'byte' is not working due to the Solidity parser, so lets\n // use the second best option, 'and'\n v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/Singleton.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title Singleton - Base for singleton contracts (should always be first super contract)\n/// This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)\n/// @author Richard Meissner - \ncontract Singleton {\n // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.\n // It should also always be ensured that the address is stored alone (uses a full word)\n address private singleton;\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/common/StorageAccessible.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title StorageAccessible - generic base contract that allows callers to access all internal storage.\n/// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol\ncontract StorageAccessible {\n /**\n * @dev Reads `length` bytes of storage in the currents contract\n * @param offset - the offset in the current contract's storage in words to start reading from\n * @param length - the number of words (32 bytes) of data to read\n * @return the bytes that were read.\n */\n function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {\n bytes memory result = new bytes(length * 32);\n for (uint256 index = 0; index < length; index++) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let word := sload(add(offset, index))\n mstore(add(add(result, 0x20), mul(index, 0x20)), word)\n }\n }\n return result;\n }\n\n /**\n * @dev Performs a delegetecall on a targetContract in the context of self.\n * Internally reverts execution to avoid side effects (making it static).\n *\n * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.\n * Specifically, the `returndata` after a call to this method will be:\n * `success:bool || response.length:uint256 || response:bytes`.\n *\n * @param targetContract Address of the contract containing the code to execute.\n * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).\n */\n function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)\n\n mstore(0x00, success)\n mstore(0x20, returndatasize())\n returndatacopy(0x40, 0, returndatasize())\n revert(0, add(returndatasize(), 0x40))\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/external/GnosisSafeMath.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/**\n * @title GnosisSafeMath\n * @dev Math operations with safety checks that revert on error\n * Renamed from SafeMath to GnosisSafeMath to avoid conflicts\n * TODO: remove once open zeppelin update to solc 0.5.0\n */\nlibrary GnosisSafeMath {\n /**\n * @dev Multiplies two numbers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b);\n\n return c;\n }\n\n /**\n * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a);\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two numbers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a);\n\n return c;\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a >= b ? a : b;\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./base/ModuleManager.sol\";\nimport \"./base/OwnerManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./base/GuardManager.sol\";\nimport \"./common/EtherPaymentFallback.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./common/StorageAccessible.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./external/GnosisSafeMath.sol\";\n\n/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafe is\n EtherPaymentFallback,\n Singleton,\n ModuleManager,\n OwnerManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n StorageAccessible,\n GuardManager\n{\n using GnosisSafeMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n // keccak256(\n // \"EIP712Domain(uint256 chainId,address verifyingContract)\"\n // );\n bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;\n\n // keccak256(\n // \"SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)\"\n // );\n bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;\n\n event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);\n event ApproveHash(bytes32 indexed approvedHash, address indexed owner);\n event SignMsg(bytes32 indexed msgHash);\n event ExecutionFailure(bytes32 txHash, uint256 payment);\n event ExecutionSuccess(bytes32 txHash, uint256 payment);\n\n uint256 public nonce;\n bytes32 private _deprecatedDomainSeparator;\n // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners\n mapping(bytes32 => uint256) public signedMessages;\n // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners\n mapping(address => mapping(bytes32 => uint256)) public approvedHashes;\n\n // This constructor ensures that this contract can only be used as a master copy for Proxy contracts\n constructor() {\n // By setting the threshold it is not possible to call setup anymore,\n // so we create a Safe with 0 owners and threshold 1.\n // This is an unusable Safe, perfect for the singleton\n threshold = 1;\n }\n\n /// @dev Setup function sets initial storage of contract.\n /// @param _owners List of Safe owners.\n /// @param _threshold Number of required confirmations for a Safe transaction.\n /// @param to Contract address for optional delegate call.\n /// @param data Data payload for optional delegate call.\n /// @param fallbackHandler Handler for fallback calls to this contract\n /// @param paymentToken Token that should be used for the payment (0 is ETH)\n /// @param payment Value that should be paid\n /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)\n function setup(\n address[] calldata _owners,\n uint256 _threshold,\n address to,\n bytes calldata data,\n address fallbackHandler,\n address paymentToken,\n uint256 payment,\n address payable paymentReceiver\n ) external {\n // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice\n setupOwners(_owners, _threshold);\n if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);\n // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules\n setupModules(to, data);\n\n if (payment > 0) {\n // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)\n // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment\n handlePayment(payment, 0, 1, paymentToken, paymentReceiver);\n }\n emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);\n }\n\n /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.\n /// Note: The fees are always transferred, even if the user transaction fails.\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @param safeTxGas Gas that should be used for the Safe transaction.\n /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Gas price that should be used for the payment calculation.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})\n function execTransaction(\n address to,\n uint256 value,\n bytes calldata 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 ) public payable virtual returns (bool success) {\n bytes32 txHash;\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n bytes memory txHashData =\n encodeTransactionData(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n nonce\n );\n // Increase nonce and execute transaction.\n nonce++;\n txHash = keccak256(txHashData);\n checkSignatures(txHash, txHashData, signatures);\n }\n address guard = getGuard();\n {\n if (guard != address(0)) {\n Guard(guard).checkTransaction(\n // Transaction info\n to,\n value,\n data,\n operation,\n safeTxGas,\n // Payment info\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n // Signature info\n signatures,\n msg.sender\n );\n }\n }\n // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)\n // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150\n require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, \"GS010\");\n // Use scope here to limit variable lifetime and prevent `stack too deep` errors\n {\n uint256 gasUsed = gasleft();\n // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)\n // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas\n success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);\n gasUsed = gasUsed.sub(gasleft());\n // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful\n // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert\n require(success || safeTxGas != 0 || gasPrice != 0, \"GS013\");\n // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls\n uint256 payment = 0;\n if (gasPrice > 0) {\n payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);\n }\n if (success) emit ExecutionSuccess(txHash, payment);\n else emit ExecutionFailure(txHash, payment);\n }\n {\n if (guard != address(0)) {\n Guard(guard).checkAfterExecution(txHash, success);\n }\n }\n }\n\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address payable refundReceiver\n ) private returns (uint256 payment) {\n // solhint-disable-next-line avoid-tx-origin\n address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n if (gasToken == address(0)) {\n // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n require(receiver.send(payment), \"GS011\");\n } else {\n payment = gasUsed.add(baseGas).mul(gasPrice);\n require(transferToken(gasToken, receiver, payment), \"GS012\");\n }\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n */\n function checkSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures\n ) public view {\n // Load threshold to avoid multiple storage loads\n uint256 _threshold = threshold;\n // Check that a threshold is set\n require(_threshold > 0, \"GS001\");\n checkNSignatures(dataHash, data, signatures, _threshold);\n }\n\n /**\n * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.\n * @param dataHash Hash of the data (could be either a message hash or transaction hash)\n * @param data That should be signed (this is passed to an external validator contract)\n * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.\n * @param requiredSignatures Amount of required valid signatures.\n */\n function checkNSignatures(\n bytes32 dataHash,\n bytes memory data,\n bytes memory signatures,\n uint256 requiredSignatures\n ) public view {\n // Check that the provided signature data is not too short\n require(signatures.length >= requiredSignatures.mul(65), \"GS020\");\n // There cannot be an owner with address 0.\n address lastOwner = address(0);\n address currentOwner;\n uint8 v;\n bytes32 r;\n bytes32 s;\n uint256 i;\n for (i = 0; i < requiredSignatures; i++) {\n (v, r, s) = signatureSplit(signatures, i);\n if (v == 0) {\n // If v is 0 then it is a contract signature\n // When handling contract signatures the address of the contract is encoded into r\n currentOwner = address(uint160(uint256(r)));\n\n // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes\n // This check is not completely accurate, since it is possible that more signatures than the threshold are send.\n // Here we only check that the pointer is not pointing inside the part that is being processed\n require(uint256(s) >= requiredSignatures.mul(65), \"GS021\");\n\n // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n require(uint256(s).add(32) <= signatures.length, \"GS022\");\n\n // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n uint256 contractSignatureLen;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n contractSignatureLen := mload(add(add(signatures, s), 0x20))\n }\n require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, \"GS023\");\n\n // Check signature\n bytes memory contractSignature;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s\n contractSignature := add(add(signatures, s), 0x20)\n }\n require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, \"GS024\");\n } else if (v == 1) {\n // If v is 1 then it is an approved hash\n // When handling approved hashes the address of the approver is encoded into r\n currentOwner = address(uint160(uint256(r)));\n // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction\n require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, \"GS025\");\n } else if (v > 30) {\n // If v > 30 then default va (27,28) has been adjusted for eth_sign flow\n // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover\n currentOwner = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n } else {\n // Default is the ecrecover flow with the provided data hash\n // Use ecrecover with the messageHash for EOA signatures\n currentOwner = ecrecover(dataHash, v, r, s);\n }\n require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, \"GS026\");\n lastOwner = currentOwner;\n }\n }\n\n /// @dev Allows to estimate a Safe transaction.\n /// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.\n /// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`\n /// @param to Destination address of Safe transaction.\n /// @param value Ether value of Safe transaction.\n /// @param data Data payload of Safe transaction.\n /// @param operation Operation type of Safe transaction.\n /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).\n /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.\n function requiredTxGas(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation\n ) external returns (uint256) {\n uint256 startGas = gasleft();\n // We don't provide an error message here, as we use it to return the estimate\n require(execute(to, value, data, operation, gasleft()));\n uint256 requiredGas = startGas - gasleft();\n // Convert response to string and return via error message\n revert(string(abi.encodePacked(requiredGas)));\n }\n\n /**\n * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.\n * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.\n */\n function approveHash(bytes32 hashToApprove) external {\n require(owners[msg.sender] != address(0), \"GS030\");\n approvedHashes[msg.sender][hashToApprove] = 1;\n emit ApproveHash(hashToApprove, msg.sender);\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the bytes that are hashed to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Gas that should be used for the safe transaction.\n /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash bytes.\n function encodeTransactionData(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes memory) {\n bytes32 safeTxHash =\n keccak256(\n abi.encode(\n SAFE_TX_TYPEHASH,\n to,\n value,\n keccak256(data),\n operation,\n safeTxGas,\n baseGas,\n gasPrice,\n gasToken,\n refundReceiver,\n _nonce\n )\n );\n return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);\n }\n\n /// @dev Returns hash to be signed by owners.\n /// @param to Destination address.\n /// @param value Ether value.\n /// @param data Data payload.\n /// @param operation Operation type.\n /// @param safeTxGas Fas that should be used for the safe transaction.\n /// @param baseGas Gas costs for data used to trigger the safe transaction.\n /// @param gasPrice Maximum gas price that should be used for this transaction.\n /// @param gasToken Token address (or 0 if ETH) that is used for the payment.\n /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).\n /// @param _nonce Transaction nonce.\n /// @return Transaction hash.\n function getTransactionHash(\n address to,\n uint256 value,\n bytes calldata data,\n Enum.Operation operation,\n uint256 safeTxGas,\n uint256 baseGas,\n uint256 gasPrice,\n address gasToken,\n address refundReceiver,\n uint256 _nonce\n ) public view returns (bytes32) {\n return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/interfaces/ISignatureValidator.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\ncontract ISignatureValidatorConstants {\n // bytes4(keccak256(\"isValidSignature(bytes,bytes)\")\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n}\n\nabstract contract ISignatureValidator is ISignatureValidatorConstants {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param _data Arbitrary length data signed on the behalf of address(this)\n * @param _signature Signature byte array associated with _data\n *\n * MUST return the bytes4 magic value 0x20c13b0b when function passes.\n * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)\n * MUST allow external calls\n */\n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxy.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\n/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain\n/// @author Richard Meissner - \ninterface IProxy {\n function masterCopy() external view returns (address);\n}\n\n/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.\n/// @author Stefan George - \n/// @author Richard Meissner - \ncontract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\n\nimport \"./GnosisSafeProxy.sol\";\nimport \"./IProxyCreationCallback.sol\";\n\n/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n/// @author Stefan George - \ncontract GnosisSafeProxyFactory {\n event ProxyCreation(GnosisSafeProxy proxy, address singleton);\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param singleton Address of singleton contract.\n /// @param data Payload for message call sent to new proxy contract.\n function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {\n proxy = new GnosisSafeProxy(singleton);\n if (data.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, singleton);\n }\n\n /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.\n function proxyRuntimeCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).runtimeCode;\n }\n\n /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.\n function proxyCreationCode() public pure returns (bytes memory) {\n return type(GnosisSafeProxy).creationCode;\n }\n\n /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.\n /// This method is only meant as an utility to be called from other methods\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function deployProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) internal returns (GnosisSafeProxy proxy) {\n // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it\n bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));\n bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n }\n\n /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function createProxyWithNonce(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n if (initializer.length > 0)\n // solhint-disable-next-line no-inline-assembly\n assembly {\n if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {\n revert(0, 0)\n }\n }\n emit ProxyCreation(proxy, _singleton);\n }\n\n /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.\n function createProxyWithCallback(\n address _singleton,\n bytes memory initializer,\n uint256 saltNonce,\n IProxyCreationCallback callback\n ) public returns (GnosisSafeProxy proxy) {\n uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));\n proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);\n if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);\n }\n\n /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`\n /// This method is only meant for address calculation purpose when you use an initializer that would revert,\n /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.\n /// @param _singleton Address of singleton contract.\n /// @param initializer Payload for message call sent to new proxy contract.\n /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.\n function calculateCreateProxyWithNonceAddress(\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external returns (GnosisSafeProxy proxy) {\n proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);\n revert(string(abi.encodePacked(proxy)));\n }\n}\n" + }, + "@gnosis.pm/safe-contracts/contracts/proxies/IProxyCreationCallback.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.7.0 <0.9.0;\nimport \"./GnosisSafeProxy.sol\";\n\ninterface IProxyCreationCallback {\n function proxyCreated(\n GnosisSafeProxy proxy,\n address _singleton,\n bytes calldata initializer,\n uint256 saltNonce\n ) external;\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 (success, ) = _exec(to, value, data, operation);\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 (success, returnData) = _exec(to, value, data, operation);\n }\n\n function _exec(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation\n ) private returns (bool success, bytes memory returnData) {\n address currentGuard = guard;\n if (currentGuard != address(0)) {\n IGuard(currentGuard).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 \"\",\n msg.sender\n );\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n IGuard(currentGuard).checkAfterExecution(\"\", success);\n } else {\n (success, returnData) = IAvatar(target)\n .execTransactionFromModuleReturnData(\n to,\n value,\n data,\n operation\n );\n }\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/factory/ModuleProxyFactory.sol": { + "content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\ncontract ModuleProxyFactory {\n event ModuleProxyCreation(\n address indexed proxy,\n address indexed masterCopy\n );\n\n /// `target` can not be zero.\n error ZeroAddress(address target);\n\n /// `target` has no code deployed.\n error TargetHasNoCode(address target);\n\n /// `address_` is already taken.\n error TakenAddress(address address_);\n\n /// @notice Initialization failed.\n error FailedInitialization();\n\n function createProxy(address target, bytes32 salt)\n internal\n returns (address result)\n {\n if (address(target) == address(0)) revert ZeroAddress(target);\n if (address(target).code.length == 0) revert TargetHasNoCode(target);\n bytes memory deployment = abi.encodePacked(\n hex\"602d8060093d393df3363d3d373d3d3d363d73\",\n target,\n hex\"5af43d82803e903d91602b57fd5bf3\"\n );\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := create2(0, add(deployment, 0x20), mload(deployment), salt)\n }\n if (result == address(0)) revert TakenAddress(result);\n }\n\n function deployModule(\n address masterCopy,\n bytes memory initializer,\n uint256 saltNonce\n ) public returns (address proxy) {\n proxy = createProxy(\n masterCopy,\n keccak256(abi.encodePacked(keccak256(initializer), saltNonce))\n );\n (bool success, ) = proxy.call(initializer);\n if (!success) revert FailedInitialization();\n\n emit ModuleProxyCreation(proxy, masterCopy);\n }\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" + }, + "@opengsn/contracts/src/BaseRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable no-inline-assembly\npragma solidity >=0.6.9;\n\nimport \"./interfaces/IRelayRecipient.sol\";\n\n/**\n * A base contract to be inherited by any contract that want to receive relayed transactions\n * A subclass must use \"_msgSender()\" instead of \"msg.sender\"\n */\nabstract contract BaseRelayRecipient is IRelayRecipient {\n\n /*\n * Forwarder singleton we accept calls from\n */\n address private _trustedForwarder;\n\n function trustedForwarder() public virtual view returns (address){\n return _trustedForwarder;\n }\n\n function _setTrustedForwarder(address _forwarder) internal {\n _trustedForwarder = _forwarder;\n }\n\n function isTrustedForwarder(address forwarder) public virtual override view returns(bool) {\n return forwarder == _trustedForwarder;\n }\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, return the original sender.\n * otherwise, return `msg.sender`.\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal override virtual view returns (address ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n // At this point we know that the sender is a trusted forwarder,\n // so we trust that the last bytes of msg.data are the verified sender address.\n // extract sender address from the end of msg.data\n assembly {\n ret := shr(96,calldataload(sub(calldatasize(),20)))\n }\n } else {\n ret = msg.sender;\n }\n }\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal override virtual view returns (bytes calldata ret) {\n if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {\n return msg.data[0:msg.data.length-20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@opengsn/contracts/src/interfaces/IRelayRecipient.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.6.0;\n\n/**\n * a contract must implement this interface in order to support relayed transaction.\n * It is better to inherit the BaseRelayRecipient as its implementation.\n */\nabstract contract IRelayRecipient {\n\n /**\n * return if the forwarder is trusted to forward relayed transactions to us.\n * the forwarder is required to verify the sender's signature, and verify\n * the call is not a replay.\n */\n function isTrustedForwarder(address forwarder) public virtual view returns(bool);\n\n /**\n * return the sender of this call.\n * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes\n * of the msg.data.\n * otherwise, return `msg.sender`\n * should be used in the contract anywhere instead of msg.sender\n */\n function _msgSender() internal virtual view returns (address);\n\n /**\n * return the msg.data of this call.\n * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes\n * of the msg.data - so this method will strip those 20 bytes off.\n * otherwise (if the call was made directly and not through the forwarder), return `msg.data`\n * should be used in the contract instead of msg.data, where this difference matters.\n */\n function _msgData() internal virtual view returns (bytes calldata);\n\n function versionRecipient() external virtual view returns (string memory);\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/interfaces/draft-IERC1822Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {\n require(AddressUpgradeable.isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return AddressUpgradeable.verifyCallResult(success, returndata, \"Address: low-level delegate call failed\");\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-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\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 * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\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 * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\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 * Emits an {Initialized} event the first time it is successfully executed.\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 /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\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-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\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/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, \"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 (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, 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 (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or 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 _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\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" + }, + "@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-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol)\n\npragma solidity ^0.8.0;\n\n// EIP-712 is Final as of 2022-08-11. This file is deprecated.\n\nimport \"./EIP712Upgradeable.sol\";\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSAUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n *\n * @custom:storage-size 52\n */\nabstract contract EIP712Upgradeable is Initializable {\n /* solhint-disable var-name-mixedcase */\n bytes32 private _HASHED_NAME;\n bytes32 private _HASHED_VERSION;\n bytes32 private constant _TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n __EIP712_init_unchained(name, version);\n }\n\n function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev The hash of the name parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712NameHash() internal virtual view returns (bytes32) {\n return _HASHED_NAME;\n }\n\n /**\n * @dev The hash of the version parameter for the EIP712 domain.\n *\n * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n * are a concern.\n */\n function _EIP712VersionHash() internal virtual view returns (bytes32) {\n return _HASHED_VERSION;\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-upgradeable/utils/math/MathUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _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 unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\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 unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\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] = _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" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\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 functionCallWithValue(target, data, 0, \"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 (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, 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 (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or 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 _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\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" + }, + "@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/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "contracts/Baal.sol": { + "content": "// SPDX-License-Identifier: MIT\n/*\n███ ██ ██ █\n█ █ █ █ █ █ █\n█ ▀ ▄ █▄▄█ █▄▄█ █\n█ ▄▀ █ █ █ █ ███▄\n███ █ █ ▀\n █ █\n ▀ ▀*/\npragma solidity ^0.8.7;\n\nimport \"@gnosis.pm/safe-contracts/contracts/base/Executor.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/GnosisSafe.sol\";\nimport \"@gnosis.pm/zodiac/contracts/core/Module.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/common/Enum.sol\";\nimport \"@opengsn/contracts/src/BaseRelayRecipient.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport \"./interfaces/IBaalToken.sol\";\n\n/// @title Baal ';_;'.\n/// @notice Flexible guild contract inspired by Moloch DAO framework.\ncontract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRelayRecipient {\n using ECDSAUpgradeable for bytes32;\n\n // ERC20 SHARES + LOOT\n\n IBaalToken public lootToken; /*Sub ERC20 for loot mgmt*/\n IBaalToken public sharesToken; /*Sub ERC20 for loot mgmt*/\n\n address private constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; /*ETH reference for redemptions*/\n\n // GOVERNANCE PARAMS\n uint32 public votingPeriod; /* voting period in seconds - amendable through 'period'[2] proposal*/\n uint32 public gracePeriod; /*time delay after proposal voting period for processing*/\n uint32 public proposalCount; /*counter for total `proposals` submitted*/\n uint256 public proposalOffering; /* non-member proposal offering*/\n uint256 public quorumPercent; /* minimum % of shares that must vote yes for it to pass*/\n uint256 public sponsorThreshold; /* minimum number of shares to sponsor a proposal (not %)*/\n uint256 public minRetentionPercent; /* auto-fails a proposal if more than (1- minRetentionPercent) * total shares exit before processing*/\n\n // SHAMAN PERMISSIONS\n bool public adminLock; /* once set to true, no new admin roles can be assigned to shaman */\n bool public managerLock; /* once set to true, no new manager roles can be assigned to shaman */\n bool public governorLock; /* once set to true, no new governor roles can be assigned to shaman */\n mapping(address => uint256) public shamans; /*maps shaman addresses to their permission level*/\n /* permissions registry for shamans\n 0 = no permission\n 1 = admin only\n 2 = manager only\n 4 = governance only\n 3 = admin + manager\n 5 = admin + governance\n 6 = manager + governance\n 7 = admin + manager + governance */\n\n // PROPOSAL TRACKING\n mapping(address => mapping(uint32 => bool)) public memberVoted; /*maps members to their proposal votes (true = voted) */\n mapping(address => uint256) public votingNonces; /*maps members to their voting nonce*/\n mapping(uint256 => Proposal) public proposals; /*maps `proposal id` to struct details*/\n\n // MISCELLANEOUS PARAMS\n uint32 public latestSponsoredProposalId; /* the id of the last proposal to be sponsored */\n address public multisendLibrary; /*address of multisend library*/\n string public override versionRecipient; /* version recipient for OpenGSN */\n\n // SIGNATURE HELPERS\n bytes32 constant VOTE_TYPEHASH = keccak256(\"Vote(string name,address voter,uint256 expiry,uint256 nonce,uint32 proposalId,bool support)\");\n\n // DATA STRUCTURES\n struct Proposal {\n /*Baal proposal details*/\n uint32 id; /*id of this proposal, used in existence checks (increments from 1)*/\n uint32 prevProposalId; /* id of the previous proposal - set at sponsorship from latestSponsoredProposalId */\n uint32 votingStarts; /*starting time for proposal in seconds since unix epoch*/\n uint32 votingEnds; /*termination date for proposal in seconds since unix epoch - derived from `votingPeriod` set on proposal*/\n uint32 graceEnds; /*termination date for proposal in seconds since unix epoch - derived from `gracePeriod` set on proposal*/\n uint32 expiration; /*timestamp after which proposal should be considered invalid and skipped. */\n uint256 baalGas; /* gas needed to process proposal */\n uint256 yesVotes; /*counter for `members` `approved` 'votes' to calculate approval on processing*/\n uint256 noVotes; /*counter for `members` 'dis-approved' 'votes' to calculate approval on processing*/\n uint256 maxTotalSharesAndLootAtVote; /* highest share+loot count during any individual yes vote*/\n uint256 maxTotalSharesAtSponsor; /* highest share+loot count during any individual yes vote*/\n bool[4] status; /* [cancelled, processed, passed, actionFailed] */\n address sponsor; /* address of the sponsor - set at sponsor proposal - relevant for cancellation */\n bytes32 proposalDataHash; /*hash of raw data associated with state updates*/\n }\n\n /* Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n \\-> Cancelled \\-> Defeated */\n enum ProposalState {\n Unborn, /* 0 - can submit */\n Submitted, /* 1 - can sponsor -> voting */\n Voting, /* 2 - can be cancelled, otherwise proceeds to grace */\n Cancelled, /* 3 - terminal state, counts as processed */\n Grace, /* 4 - proceeds to ready/defeated */\n Ready, /* 5 - can be processed */\n Processed, /* 6 - terminal state */\n Defeated /* 7 - terminal state, yes votes <= no votes, counts as processed */\n }\n\n // MODIFIERS\n\n modifier baalOnly() {\n require(_msgSender() == avatar, \"!baal\");\n _;\n }\n\n modifier baalOrAdminOnly() {\n require(_msgSender() == avatar || isAdmin(_msgSender()), \"!baal & !admin\"); /*check `shaman` is admin*/\n _;\n }\n\n modifier baalOrManagerOnly() {\n require(\n _msgSender() == avatar || isManager(_msgSender()),\n \"!baal & !manager\"\n ); /*check `shaman` is manager*/\n _;\n }\n\n modifier baalOrGovernorOnly() {\n require(\n _msgSender() == avatar || isGovernor(_msgSender()),\n \"!baal & !governor\"\n ); /*check `shaman` is governor*/\n _;\n }\n\n // EVENTS\n event SetupComplete(\n bool lootPaused,\n bool sharesPaused,\n uint32 gracePeriod,\n uint32 votingPeriod,\n uint256 proposalOffering,\n uint256 quorumPercent,\n uint256 sponsorThreshold,\n uint256 minRetentionPercent,\n string name,\n string symbol,\n uint256 totalShares,\n uint256 totalLoot\n ); /*emits after Baal summoning*/\n event SubmitProposal(\n uint256 indexed proposal,\n bytes32 indexed proposalDataHash,\n uint256 votingPeriod,\n bytes proposalData,\n uint256 expiration,\n uint256 baalGas,\n bool selfSponsor,\n uint256 timestamp,\n string details\n ); /*emits after proposal is submitted*/\n event SponsorProposal(\n address indexed member,\n uint256 indexed proposal,\n uint256 indexed votingStarts\n ); /*emits after member has sponsored proposal*/\n event CancelProposal(uint256 indexed proposal); /*emits when proposal is cancelled*/\n event SubmitVote(\n address indexed member,\n uint256 balance,\n uint256 indexed proposal,\n bool indexed approved\n ); /*emits after vote is submitted on proposal*/\n event ProcessProposal(\n uint256 indexed proposal,\n bool passed,\n bool actionFailed\n ); /*emits when proposal is processed & executed*/\n event Ragequit(\n address indexed member,\n address to,\n uint256 indexed lootToBurn,\n uint256 indexed sharesToBurn,\n address[] tokens\n ); /*emits when users burn Baal `shares` and/or `loot` for given `to` account*/\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 amount\n ); /*emits when Baal `shares` are approved for pulls with erc20 accounting*/\n\n event ShamanSet(address indexed shaman, uint256 permission); /*emits when a shaman permission changes*/\n event SetTrustedForwarder(address indexed forwarder); /*emits when a trusted forwarder changes*/\n event GovernanceConfigSet(\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ); /*emits when gov config changes*/\n event SharesPaused(bool paused); /*emits when shares are paused or unpaused*/\n event LootPaused(bool paused); /*emits when loot is paused or unpaused*/\n event LockAdmin(bool adminLock); /*emits when admin is locked*/\n event LockManager(bool managerLock); /*emits when admin is locked*/\n event LockGovernor(bool governorLock); /*emits when admin is locked*/\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend)\n {\n bytes memory encodedActions;\n for (uint256 i = 0; i < _calls.length; i++) {\n encodedActions = abi.encodePacked(\n encodedActions,\n uint8(0),\n _target,\n uint256(0),\n uint256(_calls[i].length),\n bytes(_calls[i])\n );\n }\n encodedMultisend = abi.encodeWithSignature(\n \"multiSend(bytes)\",\n encodedActions\n );\n }\n\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Summon Baal with voting configuration & initial array of `members` accounts with `shares` & `loot` weights.\n /// @param _initializationParams Encoded setup information.\n function setUp(bytes memory _initializationParams)\n public\n override(FactoryFriendly)\n initializer\n nonReentrant\n {\n (\n address _lootToken, /*loot ERC20 token*/\n address _sharesToken, /*shares ERC20 token*/\n address _multisendLibrary, /*address of multisend library*/\n address _avatar, /*Safe contract address*/\n address _forwarder, /*Trusted forwarder address for meta-transactions (EIP 2771)*/\n bytes memory _initializationMultisendData /*here you call BaalOnly functions to set up initial shares, loot, shamans, periods, etc.*/\n ) = abi.decode(\n _initializationParams,\n (address, address, address, address, address, bytes)\n );\n\n require(\n _multisendLibrary != address(0) &&\n _avatar != address(0),\n \"0 addr used\"\n );\n // no need to check _forwarder address exists, the default is address(0) for no forwarder\n\n versionRecipient = \"2.2.5+opengsn.payablewithbaal.irelayrecipient\";\n __Ownable_init();\n __ReentrancyGuard_init();\n __EIP712_init(\"Vote\", \"4\");\n transferOwnership(_avatar);\n\n // Set the Gnosis safe address\n avatar = _avatar;\n target = _avatar; /*Set target to same address as avatar on setup - can be changed later via setTarget, though probably not a good idea*/\n\n // Set trusted forwarder\n _setTrustedForwarder(_forwarder);\n\n lootToken = IBaalToken(_lootToken);\n sharesToken = IBaalToken(_sharesToken);\n\n /*Set address of Gnosis multisend library to use for all execution*/\n multisendLibrary = _multisendLibrary;\n\n // Execute all setups including but not limited to\n // * mint shares\n // * convert shares to loot\n // * set shamans\n // * set admin configurations\n require(\n exec(\n multisendLibrary,\n 0,\n _initializationMultisendData,\n Enum.Operation.DelegateCall\n ),\n \"call failure setup\"\n );\n\n emit SetupComplete(\n lootToken.paused(),\n sharesToken.paused(),\n gracePeriod,\n votingPeriod,\n proposalOffering,\n quorumPercent,\n sponsorThreshold,\n minRetentionPercent,\n sharesToken.name(),\n sharesToken.symbol(),\n totalShares(),\n totalLoot()\n );\n\n }\n\n /*****************\n PROPOSAL FUNCTIONS\n *****************/\n /// @notice Submit proposal to Baal `members` for approval within given voting period.\n /// @param proposalData Multisend encoded transactions or proposal data\n /// @param details Context for proposal.\n /// @return proposal Count for submitted proposal.\n function submitProposal(\n bytes calldata proposalData,\n uint32 expiration,\n uint256 baalGas,\n string calldata details\n ) external payable nonReentrant returns (uint256) {\n require(\n expiration == 0 ||\n expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n require(baalGas <= 20000000, \"baalGas to high\"); /* gwei 2/3 eth block limit */\n\n bool selfSponsor = false; /*plant sponsor flag*/\n if (sharesToken.getVotes(_msgSender()) >= sponsorThreshold ) {\n selfSponsor = true; /*if above sponsor threshold, self-sponsor*/\n } else {\n require(msg.value == proposalOffering, \"Baal requires an offering\"); /*Optional anti-spam gas token tribute*/\n (bool _success, ) = target.call{value: msg.value}(\"\"); /*Send ETH to sink*/\n require(_success, \"could not send\");\n }\n\n bytes32 proposalDataHash = hashOperation(proposalData); /*Store only hash of proposal data*/\n\n proposalCount++; /*increment proposal counter*/\n proposals[proposalCount] = Proposal( /*push params into proposal struct - start voting period timer if member submission*/\n proposalCount,\n selfSponsor ? latestSponsoredProposalId : 0, /* prevProposalId */\n selfSponsor ? uint32(block.timestamp) : 0, /* votingStarts */\n selfSponsor ? uint32(block.timestamp) + votingPeriod : 0, /* votingEnds */\n selfSponsor\n ? uint32(block.timestamp) + votingPeriod + gracePeriod\n : 0, /* graceEnds */\n expiration,\n baalGas,\n 0, /* yes votes */\n 0, /* no votes */\n selfSponsor ? totalSupply() : 0, /* maxTotalSharesAndLootAtVote */\n selfSponsor ? totalShares() : 0, /* maxTotalSharesAtSponsor */\n [false, false, false, false], /* [cancelled, processed, passed, actionFailed] */\n selfSponsor ? _msgSender() : address(0),\n proposalDataHash\n );\n\n if (selfSponsor) {\n latestSponsoredProposalId = proposalCount;\n }\n\n emit SubmitProposal(\n proposalCount,\n proposalDataHash,\n votingPeriod,\n proposalData,\n expiration,\n baalGas,\n selfSponsor,\n block.timestamp,\n details\n ); /*emit event reflecting proposal submission*/\n\n return proposalCount;\n }\n\n /// @notice Sponsor proposal to Baal `members` for approval within voting period.\n /// @param id Number of proposal in `proposals` mapping to sponsor.\n function sponsorProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n\n require(sharesToken.getVotes(_msgSender()) >= sponsorThreshold, \"!sponsor\"); /*check 'votes > threshold - required to sponsor proposal*/\n require(state(id) == ProposalState.Submitted, \"!submitted\");\n require(\n prop.expiration == 0 ||\n prop.expiration > block.timestamp + votingPeriod + gracePeriod,\n \"expired\"\n );\n\n prop.votingStarts = uint32(block.timestamp);\n\n unchecked {\n prop.votingEnds = uint32(block.timestamp) + votingPeriod;\n prop.graceEnds =\n uint32(block.timestamp) +\n votingPeriod +\n gracePeriod;\n }\n\n prop.prevProposalId = latestSponsoredProposalId;\n prop.sponsor = _msgSender();\n // snapshot both total supply and total shares\n prop.maxTotalSharesAndLootAtVote = totalSupply(); // updaed in votes for min retention\n prop.maxTotalSharesAtSponsor = totalShares(); // for yes vote quorum\n latestSponsoredProposalId = id;\n\n emit SponsorProposal(_msgSender(), id, block.timestamp);\n }\n\n /// @notice Submit vote - proposal must exist & voting period must not have ended.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function submitVote(uint32 id, bool approved) external nonReentrant {\n _submitVote(_msgSender(), id, approved);\n }\n\n /// @notice Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.\n /// @param voter Address of member who submitted vote.\n /// @param expiry Expiration of signature.\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n /// @param v v in signature\n /// @param r r in signature\n /// @param s s in signature\n function submitVoteWithSig(\n address voter,\n uint256 expiry,\n uint256 nonce,\n uint32 id,\n bool approved,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external nonReentrant {\n require(block.timestamp <= expiry, \"ERC20Votes: signature expired\");\n require(nonce == votingNonces[voter], \"!nonce\");\n\n /*calculate EIP-712 struct hash*/\n bytes32 structHash = keccak256(\n abi.encode(\n VOTE_TYPEHASH,\n keccak256(abi.encodePacked(sharesToken.name())),\n voter,\n expiry,\n nonce,\n id,\n approved\n )\n );\n bytes32 hash = _hashTypedDataV4(structHash);\n address signer = ECDSAUpgradeable.recover(hash, v, r, s);\n\n require(signer == voter, \"invalid signature\");\n require(signer != address(0), \"!signer\");\n votingNonces[voter] += 1;\n\n _submitVote(signer, id, approved);\n }\n\n /// @notice Execute vote submission internally - callable by submit vote or submit vote with signature\n /// @param voter Address of voter\n /// @param id Number of proposal in `proposals` mapping to cast vote on.\n /// @param approved If 'true', member will cast `yesVotes` onto proposal - if 'false', `noVotes` will be counted.\n function _submitVote(\n address voter,\n uint32 id,\n bool approved\n ) internal {\n Proposal storage prop = proposals[id]; /*alias proposal storage pointers*/\n require(state(id) == ProposalState.Voting, \"!voting\");\n\n uint256 balance = sharesToken.getPastVotes(voter, prop.votingStarts); /*fetch & gas-optimize voting weight at proposal creation time*/\n\n require(balance > 0, \"!member\"); /* check that user has shares*/\n require(!memberVoted[voter][id], \"voted\"); /*check vote not already cast*/\n\n memberVoted[voter][id] = true; /*record voting action to `members` struct per user account*/\n\n // get high water mark on all votes\n uint256 _totalSupply = totalSupply();\n if (_totalSupply > prop.maxTotalSharesAndLootAtVote) {\n prop.maxTotalSharesAndLootAtVote = _totalSupply;\n }\n\n unchecked {\n if (approved) {\n /*if `approved`, cast delegated balance `yesVotes` to proposal*/\n prop.yesVotes += balance; \n } else {\n /*otherwise, cast delegated balance `noVotes` to proposal*/\n prop.noVotes += balance;\n }\n }\n\n emit SubmitVote(voter, balance, id, approved); /*emit event reflecting vote*/\n }\n\n /// @notice Process `proposal` & execute internal functions.\n /// @dev Proposal must have succeeded, not been processed, not expired, retention threshold must be met\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n function processProposal(uint32 id, bytes calldata proposalData)\n external\n nonReentrant\n {\n Proposal storage prop = proposals[id]; /*alias `proposal` storage pointers*/\n\n require(prop.sponsor != address(0), \"!sponsor\"); /*check proposal has been sponsored*/\n require(state(id) == ProposalState.Ready, \"!ready\"); /* check proposal is Ready to process */\n\n ProposalState prevProposalState = state(prop.prevProposalId);\n require(\n prevProposalState == ProposalState.Processed ||\n prevProposalState == ProposalState.Cancelled ||\n prevProposalState == ProposalState.Defeated ||\n prevProposalState == ProposalState.Unborn,\n \"prev!processed\"\n );\n\n // check that the proposalData matches the stored hash\n require(\n hashOperation(proposalData) == prop.proposalDataHash,\n \"incorrect calldata\"\n );\n\n require(\n prop.baalGas == 0 || gasleft() >= prop.baalGas,\n \"not enough gas\"\n );\n\n prop.status[1] = true; /*Set processed flag to true*/\n bool okToExecute = true; /*Initialize and invalidate if conditions are not met below*/\n\n // Make proposal fail if after expiration\n if (prop.expiration != 0 && prop.expiration < block.timestamp)\n okToExecute = false;\n\n // Make proposal fail if it didn't pass quorum\n if (okToExecute && prop.yesVotes * 100 < quorumPercent * prop.maxTotalSharesAtSponsor)\n okToExecute = false;\n\n // Make proposal fail if the minRetentionPercent is exceeded\n if (\n okToExecute &&\n (totalSupply()) <\n (prop.maxTotalSharesAndLootAtVote * minRetentionPercent) / 100 /*Check for dilution since high water mark during voting*/\n ) {\n okToExecute = false;\n }\n\n /*check if `proposal` approved by simple majority of members*/\n if (okToExecute) {\n prop.status[2] = true; /*flag that proposal passed - allows baal-like extensions*/\n bool success = processActionProposal(proposalData); /*execute 'action'*/\n if (!success) {\n prop.status[3] = true;\n }\n }\n\n emit ProcessProposal(id, prop.status[2], prop.status[3]); /*emit event reflecting that given proposal processed*/\n }\n\n /// @notice Internal function to process 'action'[0] proposal.\n /// @param proposalData Packed multisend data to execute via Gnosis multisend library\n /// @return success Success or failure of execution\n function processActionProposal(bytes memory proposalData)\n private\n returns (bool success)\n {\n success = exec(\n multisendLibrary,\n 0,\n proposalData,\n Enum.Operation.DelegateCall\n );\n }\n\n /// @notice Cancel proposal prior to execution\n /// @dev Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold\n /// @param id Number of proposal in `proposals` mapping to process for execution.\n function cancelProposal(uint32 id) external nonReentrant {\n Proposal storage prop = proposals[id];\n require(state(id) == ProposalState.Voting, \"!voting\");\n require(\n _msgSender() == prop.sponsor ||\n sharesToken.getPastVotes(prop.sponsor, block.timestamp - 1) <\n sponsorThreshold ||\n isGovernor(_msgSender()),\n \"!cancellable\"\n );\n prop.status[0] = true;\n emit CancelProposal(id);\n }\n\n /// @dev Function to Execute arbitrary code as baal - useful if funds are accidentally sent here\n /// @notice Can only be called by the avatar which means this can only be called if passed by another\n /// proposal or by a delegated signer on the Safe\n /// @param _to address to call\n /// @param _value value to include in wei\n /// @param _data arbitrary transaction data\n function executeAsBaal(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external baalOnly {\n (bool success, ) = _to.call{value: _value}(_data);\n require(success, \"call failure execute\");\n }\n\n // ****************\n // MEMBER FUNCTIONS\n // ****************\n\n /// @notice Process member burn of `shares` and/or `loot` to claim 'fair share' of specified `tokens`\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] calldata tokens\n ) external nonReentrant {\n for (uint256 i = 1; i < tokens.length; i++) {\n require(tokens[i] > tokens[i - 1], \"!order\");\n }\n\n _ragequit(to, sharesToBurn, lootToBurn, tokens);\n }\n\n /// @notice Internal execution of rage quite\n /// @param to Account that receives 'fair share'.\n /// @param lootToBurn Baal pure economic weight to burn.\n /// @param sharesToBurn Baal voting weight to burn.\n /// @param tokens Array of tokens to include in rage quit calculation\n function _ragequit(\n address to,\n uint256 sharesToBurn,\n uint256 lootToBurn,\n address[] memory tokens\n ) internal {\n uint256 _totalSupply = totalSupply();\n\n if (lootToBurn != 0) {\n /*gas optimization*/\n _burnLoot(_msgSender(), lootToBurn); /*subtract `loot` from user account & Baal totals*/\n }\n\n if (sharesToBurn != 0) {\n /*gas optimization*/\n _burnShares(_msgSender(), sharesToBurn); /*subtract `shares` from user account & Baal totals with erc20 accounting*/\n }\n\n for (uint256 i = 0; i < tokens.length; i++) {\n uint256 balance;\n if(tokens[i] == ETH) {\n balance = address(target).balance;\n } else {\n (, bytes memory balanceData) = tokens[i].staticcall(\n abi.encodeWithSelector(0x70a08231, address(target))\n ); /*get Baal token balances - 'balanceOf(address)'*/\n balance = abi.decode(balanceData, (uint256));\n }\n\n uint256 amountToRagequit = ((lootToBurn + sharesToBurn) * balance) /\n _totalSupply; /*calculate 'fair shair' claims*/\n\n if (amountToRagequit != 0) {\n /*gas optimization to allow higher maximum token limit*/\n tokens[i] == ETH\n ? _safeTransferETH(to, amountToRagequit) /*execute 'safe' ETH transfer*/\n : _safeTransfer(tokens[i], to, amountToRagequit); /*execute 'safe' token transfer*/\n }\n }\n\n emit Ragequit(_msgSender(), to, lootToBurn, sharesToBurn, tokens); /*event reflects claims made against Baal*/\n }\n\n /*******************\n GUILD MGMT FUNCTIONS\n *******************/\n /// @notice Baal-only function to set shaman status.\n /// @param _shamans Addresses of shaman contracts\n /// @param _permissions Permission level of each shaman in _shamans\n function setShamans(\n address[] calldata _shamans,\n uint256[] calldata _permissions\n ) external baalOnly {\n require(_shamans.length == _permissions.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < _shamans.length; i++) {\n uint256 permission = _permissions[i];\n if (adminLock)\n require(\n permission != 1 &&\n permission != 3 &&\n permission != 5 &&\n permission != 7,\n \"admin lock\"\n );\n if (managerLock)\n require(\n permission != 2 &&\n permission != 3 &&\n permission != 6 &&\n permission != 7,\n \"manager lock\"\n );\n if (governorLock)\n require(\n permission != 4 &&\n permission != 5 &&\n permission != 6 &&\n permission != 7,\n \"governor lock\"\n );\n shamans[_shamans[i]] = permission;\n emit ShamanSet(_shamans[i], permission);\n }\n }\n\n /// @notice Lock admin so setShamans cannot be called with admin changes\n function lockAdmin() external baalOnly {\n adminLock = true;\n\n emit LockAdmin(adminLock);\n }\n\n /// @notice Lock manager so setShamans cannot be called with manager changes\n function lockManager() external baalOnly {\n managerLock = true;\n\n emit LockManager(managerLock);\n }\n\n /// @notice Lock governor so setShamans cannot be called with governor changes\n function lockGovernor() external baalOnly {\n governorLock = true;\n\n emit LockGovernor(governorLock);\n }\n\n // ****************\n // SHAMAN FUNCTIONS\n // ****************\n /// @notice Baal-or-admin-only function to set admin config (pause/unpause shares/loot) and call function on token\n /// @param pauseShares Turn share transfers on or off\n /// @param pauseLoot Turn loot transfers on or off\n function setAdminConfig(bool pauseShares, bool pauseLoot)\n external\n baalOrAdminOnly\n {\n\n if(pauseShares && !sharesToken.paused()){\n sharesToken.pause();\n emit SharesPaused(true);\n } else if(!pauseShares && sharesToken.paused()){\n sharesToken.unpause();\n emit SharesPaused(false);\n }\n\n if(pauseLoot && !lootToken.paused()){\n lootToken.pause();\n emit LootPaused(true);\n } else if(!pauseLoot && lootToken.paused()){\n lootToken.unpause();\n emit LootPaused(false);\n }\n }\n\n /// @notice Baal-or-manager-only function to mint shares.\n /// @param to Array of addresses to receive shares\n /// @param amount Array of amounts to mint\n function mintShares(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintShares(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `shares`.\n /// @param to Address to receive shares\n /// @param shares Amount to mint\n function _mintShares(address to, uint256 shares) private {\n sharesToken.mint(to, shares);\n }\n\n /// @notice Baal-or-manager-only function to burn shares.\n /// @param from Array of addresses to lose shares\n /// @param amount Array of amounts to burn\n function burnShares(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnShares(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `shares`.\n /// @param from Address to lose shares\n /// @param shares Amount to burn\n function _burnShares(address from, uint256 shares) private {\n sharesToken.burn(from, shares);\n }\n\n /// @notice Baal-or-manager-only function to mint loot.\n /// @param to Array of addresses to mint loot\n /// @param amount Array of amounts to mint\n function mintLoot(address[] calldata to, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(to.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < to.length; i++) {\n _mintLoot(to[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Minting function for Baal `loot`.\n /// @param to Address to mint loot\n /// @param loot Amount to mint\n function _mintLoot(address to, uint256 loot) private {\n lootToken.mint(to, loot);\n }\n\n /// @notice Baal-or-manager-only function to burn loot.\n /// @param from Array of addresses to lose loot\n /// @param amount Array of amounts to burn\n function burnLoot(address[] calldata from, uint256[] calldata amount)\n external\n baalOrManagerOnly\n {\n require(from.length == amount.length, \"!array parity\"); /*check array lengths match*/\n for (uint256 i = 0; i < from.length; i++) {\n _burnLoot(from[i], amount[i]); /*grant `to` `amount` `shares`*/\n }\n }\n\n /// @notice Burn function for Baal `loot`.\n /// @param from Address to lose loot\n /// @param loot Amount to burn\n function _burnLoot(address from, uint256 loot) private {\n lootToken.burn(from, loot);\n }\n\n /// @notice Baal-or-governance-only function to change periods.\n /// @param _governanceConfig Encoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound\n function setGovernanceConfig(bytes memory _governanceConfig)\n external\n baalOrGovernorOnly\n {\n (\n uint32 voting,\n uint32 grace,\n uint256 newOffering,\n uint256 quorum,\n uint256 sponsor,\n uint256 minRetention\n ) = abi.decode(\n _governanceConfig,\n (uint32, uint32, uint256, uint256, uint256, uint256)\n );\n require(quorum >= 0 && minRetention <= 100, 'bad quorum');\n require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');\n\n // on initialization of governance config, there is no shares token\n // skip this check on initialization of governance config.\n if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {\n require(sponsor <= totalShares(), 'sponsor > sharesSupply');\n }\n\n if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/\n if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/\n proposalOffering = newOffering; /*set new proposal offering amount */\n quorumPercent = quorum;\n sponsorThreshold = sponsor;\n minRetentionPercent = minRetention;\n\n emit GovernanceConfigSet(\n voting,\n grace,\n newOffering,\n quorum,\n sponsor,\n minRetention\n );\n }\n\n /// @notice Baal-or-governance only function to set trusted forwarder for meta-transactions.\n /// @param _trustedForwarderAddress Trusted forwarder's address\n function setTrustedForwarder(address _trustedForwarderAddress)\n external\n baalOrGovernorOnly\n {\n _setTrustedForwarder(_trustedForwarderAddress);\n emit SetTrustedForwarder(_trustedForwarderAddress);\n }\n\n /***************\n GETTER FUNCTIONS\n ***************/\n /// @notice State helper to determine proposal state\n /// @param id Number of proposal in proposals\n /// @return Unborn -> Submitted -> Voting -> Grace -> Ready -> Processed\n /// \\-> Cancelled \\-> Defeated\n function state(uint32 id) public view returns (ProposalState) {\n Proposal memory prop = proposals[id];\n if (prop.id == 0) {\n /*Uninitialized state*/\n return ProposalState.Unborn;\n } else if (\n prop.status[0] /* cancelled */\n ) {\n return ProposalState.Cancelled;\n } else if (\n prop.votingStarts == 0 /*Voting has not started*/\n ) {\n return ProposalState.Submitted;\n } else if (\n block.timestamp <= prop.votingEnds /*Voting in progress*/\n ) {\n return ProposalState.Voting;\n } else if (\n block.timestamp <= prop.graceEnds /*Proposal in grace period*/\n ) {\n return ProposalState.Grace;\n } else if (\n prop.noVotes >= prop.yesVotes /*Voting has concluded and failed to pass*/\n ) {\n return ProposalState.Defeated;\n } else if (\n prop.status[1] /* processed */\n ) {\n return ProposalState.Processed;\n }\n /* Proposal is ready to be processed*/\n else {\n return ProposalState.Ready;\n }\n }\n\n /// @notice Helper to get recorded proposal flags\n /// @param id Number of proposal in proposals\n /// @return [cancelled, processed, passed, actionFailed]\n function getProposalStatus(uint32 id)\n external\n view\n returns (bool[4] memory)\n {\n return proposals[id].status;\n }\n\n /// @notice Helper to check if shaman permission contains admin capabilities\n /// @param shaman Address attempting to execute admin permissioned functions\n function isAdmin(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 1 ||\n permission == 3 ||\n permission == 5 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains manager capabilities\n /// @param shaman Address attempting to execute manager permissioned functions\n function isManager(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 2 ||\n permission == 3 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check if shaman permission contains governor capabilities\n /// @param shaman Address attempting to execute governor permissioned functions\n function isGovernor(address shaman) public view returns (bool) {\n uint256 permission = shamans[shaman];\n return (permission == 4 ||\n permission == 5 ||\n permission == 6 ||\n permission == 7);\n }\n\n /// @notice Helper to check total supply of child loot contract\n function totalLoot() public view returns (uint256) {\n return lootToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of child shares contract\n function totalShares() public view returns (uint256) {\n return sharesToken.totalSupply();\n }\n\n /// @notice Helper to check total supply of loot and shares\n function totalSupply() public view returns (uint256) {\n return totalLoot() + totalShares();\n }\n\n /***************\n HELPER FUNCTIONS\n ***************/\n /// @notice Returns the keccak256 hash of calldata\n function hashOperation(bytes memory _transactions)\n public\n pure\n virtual\n returns (bytes32 hash)\n {\n return keccak256(abi.encode(_transactions));\n }\n\n /// @notice Provides 'safe' {transfer} for ETH.\n function _safeTransferETH(address to, uint256 amount) internal {\n // transfer eth from target\n (bool success, ) = execAndReturnData(\n to,\n amount,\n \"\",\n Enum.Operation.Call\n );\n\n require(success, \"ETH_TRANSFER_FAILED\");\n }\n\n /// @notice Provides 'safe' {transfer} for tokens that do not consistently return 'true/false'.\n function _safeTransfer(\n address token,\n address to,\n uint256 amount\n ) private {\n (bool success, bytes memory data) = execAndReturnData(\n token,\n 0,\n abi.encodeWithSelector(0xa9059cbb, to, amount),\n Enum.Operation.Call\n ); /*'transfer(address,uint)'*/\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n \"transfer failed\"\n ); /*checks success & allows non-conforming transfers*/\n }\n\n /// @notice Provides access to message sender of a meta transaction (EIP-2771)\n function _msgSender() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (address sender) {\n sender = BaseRelayRecipient._msgSender();\n }\n\n /// @notice Provides access to message data of a meta transaction (EIP-2771)\n function _msgData() internal view override(ContextUpgradeable, BaseRelayRecipient)\n returns (bytes calldata) {\n return BaseRelayRecipient._msgData();\n }\n}\n" + }, + "contracts/higherOrderFactories/BaalAdvTokenSummoner.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.7;\n\nimport \"@gnosis.pm/zodiac/contracts/factory/ModuleProxyFactory.sol\";\nimport \"@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\n\nimport \"../Baal.sol\";\nimport \"../interfaces/IBaalSummoner.sol\";\n\ncontract BaalAdvTokenSummoner is\n Initializable,\n OwnableUpgradeable,\n UUPSUpgradeable\n{\n IBaalSummoner public _baalSummoner;\n\n event setSummoner(address summoner);\n\n event DeployBaalTokens(address lootToken, address sharesToken);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize() public initializer {\n __Ownable_init();\n __UUPSUpgradeable_init();\n }\n\n /**\n * @dev Sets the address of the BaalSummoner contract\n * @param baalSummoner The address of the BaalSummoner contract\n */\n function setSummonerAddr(address baalSummoner) public onlyOwner {\n require(baalSummoner != address(0), \"zero address\");\n _baalSummoner = IBaalSummoner(baalSummoner);\n emit setSummoner(baalSummoner);\n }\n\n /**\n * @dev Summon a new Baal contract with a new set of tokens\n * @param _safeAddr The address of the Gnosis Safe to be used as the treausry, 0x0 if new Safe\n * @param _forwarderAddr The address of the forwarder to be used, 0x0 if not set\n * @param _saltNonce The salt nonce to be used for the Safe contract\n * @param initializationMintParams The parameters for minting the tokens\n * @param initializationTokenParams The parameters for deploying the tokens\n * @param postInitializationActions The actions to be performed after the initialization\n */\n function summonBaalFromReferrer(\n address _safeAddr,\n address _forwarderAddr,\n uint256 _saltNonce,\n bytes calldata initializationMintParams,\n bytes calldata initializationTokenParams,\n bytes[] calldata postInitializationActions\n ) external {\n // summon tokens\n (address _lootToken, address _sharesToken) = deployTokens(\n initializationTokenParams\n );\n\n // mint shares loot tokens\n mintTokens(initializationMintParams, _lootToken, _sharesToken);\n\n // summon baal with new tokens\n address _baal = _baalSummoner.summonBaalFromReferrer(\n abi.encode(\n IBaalToken(_sharesToken).name(), \n IBaalToken(_sharesToken).symbol(),\n _safeAddr,\n _forwarderAddr,\n _lootToken,\n _sharesToken\n ),\n postInitializationActions,\n _saltNonce,\n bytes32(bytes(\"DHAdvTokenSummoner\")) // referrer\n );\n\n // change token ownership to baal\n IBaalToken(_lootToken).transferOwnership(address(_baal));\n IBaalToken(_sharesToken).transferOwnership(address(_baal));\n }\n\n /**\n * @dev mintTokens\n * @param initializationTokens The parameters for minting the tokens\n * @param _lootToken The loot token address\n * @param _sharesToken The shares token address\n */\n function mintTokens(\n bytes calldata initializationTokens,\n address _lootToken,\n address _sharesToken\n ) internal {\n (\n address[] memory summoners, // The address to mint initial tokens to\n uint256[] memory summonerShares, // The amount of shares to mint\n uint256[] memory summonerLoot // The amount of loot to mint\n ) = abi.decode(initializationTokens, (address[], uint256[], uint256[]));\n\n require(\n summoners.length == summonerShares.length &&\n summoners.length == summonerLoot.length,\n \"!array parity\"\n ); /*check array lengths match*/\n\n for (uint256 i = 0; i < summoners.length; i++) {\n if (summonerLoot[i] > 0) {\n IBaalToken(_lootToken).mint(\n summoners[i],\n summonerLoot[i]\n ); /*grant `to` `amount` `loot`*/\n }\n if (summonerShares[i] > 0) {\n IBaalToken(_sharesToken).mint(\n summoners[i],\n summonerShares[i]\n ); /*grant `to` `amount` `shares`*/\n }\n }\n }\n\n /**\n * @dev deployTokens\n * @param initializationParams The parameters for deploying the tokens\n */\n function deployTokens(\n bytes calldata initializationParams\n ) internal returns (address lootToken, address sharesToken) {\n (\n string\n memory _name /*_name Name for erc20 `shares` accounting, empty if token */,\n string\n memory _symbol /*_symbol Symbol for erc20 `shares` accounting, empty if token*/,\n string\n memory _lootName /* name for erc20 `loot` accounting, empty if token */,\n string\n memory _lootSymbol /* symbol for erc20 `loot` accounting, empty if token*/,\n bool _transferableShares /* if shares is transferable */,\n bool _transferableLoot /* if loot is transferable */\n ) = abi.decode(\n initializationParams,\n (string, string, string, string, bool, bool)\n );\n\n address lootSingleton = _baalSummoner.lootSingleton();\n address sharesSingleton = _baalSummoner.sharesSingleton();\n\n lootToken = address(\n new ERC1967Proxy(\n lootSingleton,\n abi.encodeWithSelector(\n IBaalToken(lootSingleton).setUp.selector,\n _lootName,\n _lootSymbol\n )\n )\n );\n\n sharesToken = address(\n new ERC1967Proxy(\n sharesSingleton,\n abi.encodeWithSelector(\n IBaalToken(sharesSingleton).setUp.selector,\n _name,\n _symbol\n )\n )\n );\n if (!_transferableShares) {\n IBaalToken(sharesToken).pause();\n }\n if (!_transferableLoot) {\n IBaalToken(lootToken).pause();\n }\n\n emit DeployBaalTokens(lootToken, sharesToken);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n}\n" + }, + "contracts/interfaces/IBaalSummoner.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalSummoner {\n event AdminChanged(address previousAdmin, address newAdmin);\n event BeaconUpgraded(address indexed beacon);\n event DaoReferral(bytes32 referrer, address daoAddress);\n event DeployBaalSafe(address baalSafe, address moduleAddr);\n event DeployBaalTokens(address lootToken, address sharesToken);\n event Initialized(uint8 version);\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n event SetAddrsVersion(uint256 version);\n event SummonBaal(\n address indexed baal,\n address indexed loot,\n address indexed shares,\n address safe,\n address forwarder,\n uint256 existingAddrs\n );\n event Upgraded(address indexed implementation);\n\n function setAddrs(\n address _template,\n address _gnosisSingleton,\n address _gnosisFallbackLibrary,\n address _gnosisMultisendLibrary,\n address _gnosisSafeProxyFactory,\n address _moduleProxyFactory,\n address _lootSingleton,\n address _sharesSingleton\n ) external;\n\n function initialize() external;\n\n function transferOwnership(address newOwner) external;\n function upgradeTo(address newImplementation) external;\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable;\n function renounceOwnership() external;\n\n function summonBaal(bytes memory initializationParams, bytes[] memory initializationActions, uint256 _saltNonce)\n external\n returns (address);\n function summonBaalFromReferrer(\n bytes memory initializationParams,\n bytes[] memory initializationActions,\n uint256 _saltNonce,\n bytes32 referrer\n ) external payable returns (address);\n\n function deployAndSetupSafe(address _moduleAddr) external returns (address);\n function deployTokens(string memory _name, string memory _symbol)\n external\n returns (address lootToken, address sharesToken);\n\n function encodeMultisend(bytes[] memory _calls, address _target)\n external\n pure\n returns (bytes memory encodedMultisend);\n function addrsVersion() external view returns (uint256);\n function gnosisFallbackLibrary() external view returns (address);\n function gnosisMultisendLibrary() external view returns (address);\n function gnosisSingleton() external view returns (address);\n function lootSingleton() external view returns (address);\n function sharesSingleton() external view returns (address);\n function owner() external view returns (address);\n function proxiableUUID() external view returns (bytes32);\n function template() external view returns (address);\n}\n" + }, + "contracts/interfaces/IBaalToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\ninterface IBaalToken {\n function name() external view returns (string memory);\n\n function symbol() external view returns (string memory);\n\n function setUp(string memory _name, string memory _symbol) external;\n\n function mint(address recipient, uint256 amount) external;\n\n function burn(address account, uint256 amount) external;\n\n function pause() external;\n\n function unpause() external;\n\n function paused() external view returns (bool);\n \n function transferOwnership(address newOwner) external;\n\n function owner() external view returns (address);\n\n function balanceOf(address account) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n\n function snapshot() external returns(uint256);\n\n function getCurrentSnapshotId() external returns(uint256);\n\n function balanceOfAt(address account, uint256 snapshotId) external view returns (uint256);\n\n function totalSupplyAt(uint256 snapshotId) external view returns (uint256);\n\n // below is shares token specific\n struct Checkpoint {\n uint32 fromTimePoint;\n uint256 votes;\n }\n\n function getPastVotes(address account, uint256 timePoint) external view returns (uint256);\n\n function numCheckpoints(address) external view returns (uint256);\n\n function getCheckpoint(address, uint256)\n external\n view\n returns (Checkpoint memory);\n\n function getVotes(address account) external view returns (uint256);\n\n function delegates(address account) external view returns (address);\n\n function delegationNonces(address account) external view returns (uint256);\n\n function delegate(address delegatee) external;\n\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\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 diff --git a/hardhat.config.ts b/hardhat.config.ts index cac7acf..7f696ad 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -222,6 +222,19 @@ const config: HardhatUserConfig = { // }, }, }, + }, + { + version: "0.8.10", + settings: { + optimizer: { + enabled: true, + runs: 200, + // coverage only + // details: { + // yul: true + // }, + }, + }, } ], }, diff --git a/src/addresses/deployed.ts b/src/addresses/deployed.ts index d946afd..e3fa2a8 100644 --- a/src/addresses/deployed.ts +++ b/src/addresses/deployed.ts @@ -10,6 +10,7 @@ export const deployments = [ vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, goerli: { @@ -21,6 +22,7 @@ export const deployments = [ vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", advTokenFactory: "0x0858CB45cE9300133FEbf2Ee2179441c6BadFcdD", tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, gnosis: { @@ -32,6 +34,7 @@ export const deployments = [ vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", tributeMinion: "0x5c17BFBaB751C5ddF1Ff267acF8fF919537F39Cf", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, polygon: { @@ -43,6 +46,7 @@ export const deployments = [ vaultFactory: "0x594E630efbe8dbd810c168e3878817a4094bB312", advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", tributeMinion: "0x51498dDdd2A8cdeC82932E08A37eBaF346C38EFd", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, polygonMumbai: { @@ -54,6 +58,7 @@ export const deployments = [ vaultFactory: "0xbB907b1a769bD338c9d09Fb20C2997ECE5E715a3", advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", tributeMinion: "0x898fc00771c148257a7edbdAD33c1469F4420740", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, arbitrumOne: { @@ -65,6 +70,7 @@ export const deployments = [ vaultFactory: "0xC39E8D4DE75c6aC025a0C07dCd8Aeb0728C5DBF1", advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", tributeMinion: "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + DAO:"0x4A9a27d614a74Ee5524909cA27bdBcBB7eD3b315", }, }, optimisticEthereum: { @@ -74,8 +80,9 @@ export const deployments = [ baalSingleton: "0x17234C0Ae25AF09fAf57B9D5ea2B93C1f220E800", factory: "0x3E0eAdE343Ddc556a6Cf0f858e4f685ba303ce71", vaultFactory: "0xb04111e7b4576164145EF97EB81fd43DA0F2D675", - advTokenFactory: "0x8a4A9E36106Ee290811B89e06e2faFE913507965", + advTokenFactory: "0x84561C97156a128662B62952890469214FDC87bf", tributeMinion: "0x7707964B4C24A6b8b7B747F7507F56818857A7C2", + DAO:"0x1aCFF11474B9C6D15966Da7A08eD23438CDE23D4", }, }, },