diff --git a/QuestBudget.json b/QuestBudget.json index c3e43cd2..e5184f48 100644 --- a/QuestBudget.json +++ b/QuestBudget.json @@ -1 +1 @@ -{"language":"Solidity","sources":{"contracts/QuestBudget.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {IQuestFactory} from \"contracts/interfaces/IQuestFactory.sol\";\n\nimport {IERC1155Receiver} from \"openzeppelin-contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport {IERC1155} from \"openzeppelin-contracts/token/ERC1155/IERC1155.sol\";\nimport {IERC165} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\n\nimport {SafeTransferLib} from \"solady/utils/SafeTransferLib.sol\";\nimport {ReentrancyGuard} from \"solady/utils/ReentrancyGuard.sol\";\n\nimport {Budget} from \"contracts/references/Budget.sol\";\nimport {Cloneable} from \"contracts/references/Cloneable.sol\";\n\n/// @title Simple Budget\n/// @notice A minimal budget implementation that simply holds and distributes tokens (ERC20-like and native)\n/// @dev This type of budget supports ETH, ERC20, and ERC1155 assets only\ncontract QuestBudget is Budget, IERC1155Receiver, ReentrancyGuard {\n using SafeTransferLib for address;\n\n /// @notice The payload for initializing a SimpleBudget\n struct InitPayload {\n address owner;\n address questFactory;\n address[] authorized;\n }\n\n // @dev The address of the QuestFactory contract\n address public questFactory;\n\n bool public disburseEnabled;\n\n /// @dev The total amount of each fungible asset distributed from the budget\n mapping(address => uint256) private _distributedFungible;\n\n /// @dev The total amount of each ERC1155 asset and token ID distributed from the budget\n mapping(address => mapping(uint256 => uint256)) private _distributedERC1155;\n\n /// @dev The mapping of authorized addresses\n mapping(address => bool) private _isAuthorized;\n\n /// @notice A modifier that allows only authorized addresses to call the function\n modifier onlyAuthorized() {\n if (!isAuthorized(msg.sender)) revert Unauthorized();\n _;\n }\n\n /// @notice Construct a new SimpleBudget\n /// @dev Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {initialize} function.\n constructor() {\n _disableInitializers();\n }\n\n /// @inheritdoc Cloneable\n /// @param data_ The packed init data for the budget `(address owner, address[] authorized)`\n function initialize(bytes calldata data_) public virtual override initializer {\n InitPayload memory init_ = abi.decode(data_, (InitPayload));\n _initializeOwner(init_.owner);\n questFactory = init_.questFactory;\n for (uint256 i = 0; i < init_.authorized.length; i++) {\n _isAuthorized[init_.authorized[i]] = true;\n }\n }\n\n /// @inheritdoc Budget\n /// @notice Allocates assets to the budget\n /// @param data_ The packed data for the {Transfer} request\n /// @return True if the allocation was successful\n /// @dev The caller must have already approved the contract to transfer the asset\n /// @dev If the asset transfer fails, the allocation will revert\n function allocate(bytes calldata data_) external payable virtual override returns (bool) {\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ETH) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n // Ensure the value received is equal to the `payload.amount`\n if (msg.value != payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else if (request.assetType == AssetType.ERC20) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n // Transfer `payload.amount` of the token to this contract\n request.asset.safeTransferFrom(request.target, address(this), payload.amount);\n if (request.asset.balanceOf(address(this)) < payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n\n // Transfer `payload.amount` of `payload.tokenId` to this contract\n IERC1155(request.asset).safeTransferFrom(\n request.target, address(this), payload.tokenId, payload.amount, payload.data\n );\n if (IERC1155(request.asset).balanceOf(address(this), payload.tokenId) < payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else {\n // Unsupported asset type\n return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n /// @notice Reclaims assets from the budget\n /// @param data_ The packed {Transfer} request\n /// @return True if the request was successful\n /// @dev Only the owner can directly reclaim assets from the budget\n /// @dev If the amount is zero, the entire balance of the asset will be transferred to the receiver\n /// @dev If the asset transfer fails, the reclamation will revert\n function reclaim(bytes calldata data_) external virtual override onlyOwner returns (bool) {\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ETH || request.assetType == AssetType.ERC20) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n _transferFungible(\n request.asset, request.target, payload.amount == 0 ? available(request.asset) : payload.amount\n );\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n _transferERC1155(\n request.asset,\n request.target,\n payload.tokenId,\n payload.amount == 0 ? IERC1155(request.asset).balanceOf(address(this), payload.tokenId) : payload.amount,\n payload.data\n );\n } else {\n return false;\n }\n\n return true;\n }\n\n /// @notice Create an erc20 quest and start it at the same time. The function will transfer the reward amount to the quest contract\n /// @param txHashChainId_ The chain id of the chain the txHash is on\n /// @param rewardTokenAddress_ The contract address of the reward token\n /// @param endTime_ The end time of the quest\n /// @param startTime_ The start time of the quest\n /// @param totalParticipants_ The total amount of participants (accounts) the quest will have\n /// @param rewardAmount_ The reward amount for an erc20 quest\n /// @param questId_ The id of the quest\n /// @param actionType_ The action type for the quest\n /// @param questName_ The name of the quest\n /// @param projectName_ The name of the project/protocol used for the quest\n /// @param referralRewardFee_ The fee amount for referrals. The value is counted against the `rewardAmount`\n /// @return address the quest contract address\n function createERC20Quest(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_,\n uint256 referralRewardFee_\n ) public virtual onlyAuthorized returns (address) {\n uint256 maxTotalRewards = totalParticipants_ * rewardAmount_;\n uint256 questFee = uint256(IQuestFactory(questFactory).questFee());\n uint256 referralRewardFee = uint256(IQuestFactory(questFactory).referralRewardFee());\n uint256 maxProtocolReward = (maxTotalRewards * questFee) / 10_000;\n uint256 maxReferralReward = (maxTotalRewards * referralRewardFee) / 10_000;\n uint256 approvalAmount = maxTotalRewards + maxProtocolReward + maxReferralReward;\n rewardTokenAddress_.safeApprove(address(questFactory), approvalAmount);\n return IQuestFactory(questFactory).createERC20Quest(\n txHashChainId_,\n rewardTokenAddress_,\n endTime_,\n startTime_,\n totalParticipants_,\n rewardAmount_,\n questId_,\n actionType_,\n questName_,\n projectName_,\n referralRewardFee_\n );\n }\n\n /// @notice Cancel a quest\n /// @param questId_ The uuid of the quest\n function cancelQuest(string calldata questId_) public virtual onlyOwner() {\n IQuestFactory(questFactory).cancelQuest(questId_);\n }\n \n /// @inheritdoc Budget\n /// @notice Disburses assets from the budget to a single recipient\n /// @param data_ The packed {Transfer} request\n /// @return True if the disbursement was successful\n /// @dev If the asset transfer fails, the disbursement will revert\n function disburse(bytes calldata data_) public virtual override onlyAuthorized returns (bool) {\n if(!disburseEnabled) {\n revert Unauthorized();\n }\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ERC20 || request.assetType == AssetType.ETH) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n uint256 avail = available(request.asset);\n if (payload.amount > avail) {\n revert InsufficientFunds(request.asset, avail, payload.amount);\n }\n\n _transferFungible(request.asset, request.target, payload.amount);\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n\n uint256 avail = IERC1155(request.asset).balanceOf(address(this), payload.tokenId);\n if (payload.amount > avail) {\n revert InsufficientFunds(request.asset, avail, payload.amount);\n }\n\n _transferERC1155(request.asset, request.target, payload.tokenId, payload.amount, payload.data);\n } else {\n return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n /// @notice Disburses assets from the budget to multiple recipients\n /// @param data_ The packed array of {Transfer} requests\n /// @return True if all disbursements were successful\n function disburseBatch(bytes[] calldata data_) external virtual override returns (bool) {\n for (uint256 i = 0; i < data_.length; i++) {\n if (!disburse(data_[i])) return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n function setAuthorized(address[] calldata account_, bool[] calldata authorized_)\n external\n virtual\n override\n onlyOwner\n {\n if (account_.length != authorized_.length) revert LengthMismatch();\n for (uint256 i = 0; i < account_.length; i++) {\n _isAuthorized[account_[i]] = authorized_[i];\n }\n }\n\n /// @inheritdoc Budget\n function isAuthorized(address account_) public view virtual override returns (bool) {\n return _isAuthorized[account_] || account_ == owner();\n }\n\n /// @notice Set the QuestFactory contract address\n /// @param questFactory_ The address of the QuestFactory contract\n function setQuestFactory(address questFactory_) external virtual onlyOwner {\n questFactory = questFactory_;\n }\n\n /// @notice Set the DisburseEnabled flag\n /// @param enabled_ The flag to enable or disable disburse\n function setDisburseEnabled(bool enabled_) external virtual onlyOwner {\n disburseEnabled = enabled_;\n }\n\n /// @inheritdoc Budget\n /// @notice Get the total amount of assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @return The total amount of assets\n /// @dev This is simply the sum of the current balance and the distributed amount\n function total(address asset_) external view virtual override returns (uint256) {\n return available(asset_) + _distributedFungible[asset_];\n }\n\n /// @notice Get the total amount of ERC1155 assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The total amount of assets\n function total(address asset_, uint256 tokenId_) external view virtual returns (uint256) {\n return IERC1155(asset_).balanceOf(address(this), tokenId_) + _distributedERC1155[asset_][tokenId_];\n }\n\n /// @inheritdoc Budget\n /// @notice Get the amount of assets available for distribution from the budget\n /// @param asset_ The address of the asset (or the zero address for native assets)\n /// @return The amount of assets available\n /// @dev This is simply the current balance held by the budget\n /// @dev If the zero address is passed, this function will return the native balance\n function available(address asset_) public view virtual override returns (uint256) {\n return asset_ == address(0) ? address(this).balance : asset_.balanceOf(address(this));\n }\n\n /// @notice Get the amount of ERC1155 assets available for distribution from the budget\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The amount of assets available\n function available(address asset_, uint256 tokenId_) public view virtual returns (uint256) {\n return IERC1155(asset_).balanceOf(address(this), tokenId_);\n }\n\n /// @inheritdoc Budget\n /// @notice Get the amount of assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets distributed\n function distributed(address asset_) external view virtual override returns (uint256) {\n return _distributedFungible[asset_];\n }\n\n /// @notice Get the amount of ERC1155 assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The amount of assets distributed\n function distributed(address asset_, uint256 tokenId_) external view virtual returns (uint256) {\n return _distributedERC1155[asset_][tokenId_];\n }\n\n /// @inheritdoc Budget\n /// @dev This is a no-op as there is no local balance to reconcile\n function reconcile(bytes calldata) external virtual override returns (uint256) {\n return 0;\n }\n\n /// @notice Transfer assets to the recipient\n /// @param asset_ The address of the asset\n /// @param to_ The address of the recipient\n /// @param amount_ The amount of the asset to transfer\n /// @dev This function is used to transfer assets from the budget to a given recipient (typically an incentive contract)\n /// @dev If the destination address is the zero address, or the transfer fails for any reason, this function will revert\n function _transferFungible(address asset_, address to_, uint256 amount_) internal virtual nonReentrant {\n // Increment the total amount of the asset distributed from the budget\n if (to_ == address(0)) revert TransferFailed(asset_, to_, amount_);\n if (amount_ > available(asset_)) {\n revert InsufficientFunds(asset_, available(asset_), amount_);\n }\n\n _distributedFungible[asset_] += amount_;\n\n // Transfer the asset to the recipient\n if (asset_ == address(0)) {\n SafeTransferLib.safeTransferETH(to_, amount_);\n } else {\n asset_.safeTransfer(to_, amount_);\n }\n\n emit Distributed(asset_, to_, amount_);\n }\n\n function _transferERC1155(address asset_, address to_, uint256 tokenId_, uint256 amount_, bytes memory data_)\n internal\n virtual\n nonReentrant\n {\n // Increment the total amount of the asset distributed from the budget\n if (to_ == address(0)) revert TransferFailed(asset_, to_, amount_);\n if (amount_ > available(asset_, tokenId_)) {\n revert InsufficientFunds(asset_, available(asset_, tokenId_), amount_);\n }\n\n _distributedERC1155[asset_][tokenId_] += amount_;\n\n // Transfer the asset to the recipient\n // wake-disable-next-line reentrancy (`nonReentrant` modifier is applied to the function)\n IERC1155(asset_).safeTransferFrom(address(this), to_, tokenId_, amount_, data_);\n\n emit Distributed(asset_, to_, amount_);\n }\n\n /// @inheritdoc IERC1155Receiver\n /// @dev This contract does not care about the specifics of the inbound token, so we simply return the magic value (i.e. the selector for `onERC1155Received`)\n function onERC1155Received(address, address, uint256, uint256, bytes calldata)\n external\n pure\n override\n returns (bytes4)\n {\n // We don't need to do anything here\n return IERC1155Receiver.onERC1155Received.selector;\n }\n\n /// @inheritdoc IERC1155Receiver\n /// @dev This contract does not care about the specifics of the inbound token, so we simply return the magic value (i.e. the selector for `onERC1155Received`)\n function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata)\n external\n pure\n override\n returns (bytes4)\n {\n // We don't need to do anything here\n return IERC1155Receiver.onERC1155BatchReceived.selector;\n }\n\n /// @inheritdoc Cloneable\n function supportsInterface(bytes4 interfaceId) public view virtual override(Budget, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}"},"contracts/interfaces/IQuestFactory.sol":{"content":"// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.19;\n\ninterface IQuestFactory {\n // Errors\n error AddressAlreadyMinted();\n error AddressNotSigned();\n error AddressZeroNotAllowed();\n error AuthOwnerDiscountToken();\n error Deprecated();\n error Erc20QuestAddressNotSet();\n error InvalidMintFee();\n error MsgValueLessThanQuestNFTFee();\n error OverMaxAllowedToMint();\n error QuestFeeTooHigh();\n error QuestIdUsed();\n error QuestNotQueued();\n error QuestNotStarted();\n error QuestEnded();\n error QuestTypeNotSupported();\n error Reentrancy();\n error ReferralFeeTooHigh();\n error ZeroAddressNotAllowed();\n error QuestAddressMismatch();\n error ClaimFailed();\n error txOriginMismatch();\n\n // Structs\n\n // This struct is used in a mapping - only add new fields to the end\n struct NftQuestFees {\n uint256 fee;\n bool exists;\n }\n\n // This struct is used in a mapping - only add new fields to the end\n struct Quest {\n mapping(address => bool) addressMinted;\n address questAddress;\n uint256 totalParticipants;\n uint256 numberMinted;\n string questType;\n uint40 durationTotal;\n address questCreator;\n address mintFeeRecipient;\n string actionType;\n string questName;\n uint32 txHashChainId;\n uint16 referralRewardFee;\n }\n\n struct QuestData {\n address questAddress;\n address rewardToken;\n bool queued;\n uint16 questFee;\n uint256 startTime;\n uint256 endTime;\n uint256 totalParticipants;\n uint256 numberMinted;\n uint256 redeemedTokens;\n uint256 rewardAmountOrTokenId;\n bool hasWithdrawn;\n }\n\n struct QuestJsonData {\n string actionType;\n string questName;\n uint32 txHashChainId;\n }\n\n struct ClaimData {\n string questId;\n bytes32 hashBytes;\n bytes signature;\n address ref;\n address claimer;\n string extraData;\n }\n\n struct ERC20QuestData {\n uint32 txHashChainId;\n address rewardTokenAddress;\n uint256 endTime;\n uint256 startTime;\n uint256 totalParticipants;\n uint256 rewardAmount;\n string questId;\n string actionType;\n string questName;\n string questType;\n string projectName;\n uint16 referralRewardFee;\n }\n\n struct ERC1155QuestData {\n uint32 txHashChainId;\n address rewardTokenAddress;\n uint256 endTime;\n uint256 startTime;\n uint256 totalParticipants;\n uint256 tokenId;\n string questId;\n string actionType;\n string questName;\n string projectName;\n }\n\n // Events\n event ExtraMintFeeReturned(address indexed recipient, uint256 amount);\n event MintFeeSet(uint256 mintFee);\n event NftQuestFeeListSet(address[] addresses, uint256[] fees);\n event NftQuestFeeSet(uint256 nftQuestFee);\n\n event QuestCancelled(address indexed questAddress, string questId, uint256 endsAt);\n\n event QuestClaimedData(\n address indexed recipient,\n address indexed questAddress,\n string extraData\n );\n event Quest1155Claimed(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 tokenId\n );\n event QuestClaimed(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWei\n );\n event QuestClaimedReferred(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWeiOrTokenId,\n address referrer,\n uint16 referralFee,\n uint256 mintFeeEthWei\n );\n event QuestClaimReferred(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWeiOrTokenId,\n address referrer,\n uint16 referralFee,\n uint256 mintFeeEthWei,\n uint256 tokenReferralFee,\n uint256 referralClaimAmount\n );\n event MintFeePaid(\n string questId,\n address rabbitHoleAddress,\n uint256 rabbitHoleAmountWei,\n address questCreatorAddress,\n uint256 questCreatorAmountWei,\n address referrerAddress,\n uint256 referrerAmountWei\n );\n event QuestCreated(\n address indexed creator,\n address indexed contractAddress,\n string projectName,\n string questName,\n string questId,\n string questType,\n string actionType,\n uint32 chainId,\n address rewardToken,\n uint256 endTime,\n uint256 startTime,\n uint256 totalParticipants,\n uint256 rewardAmountOrTokenId\n );\n event ReferralFeeSet(uint16 percent);\n\n // Read Functions\n function getAddressMinted(string memory questId_, address address_) external view returns (bool);\n function getNumberMinted(string memory questId_) external view returns (uint256);\n function questData(string memory questId_) external view returns (QuestData memory);\n function questInfo(string memory questId_) external view returns (address, uint256, uint256);\n function recoverSigner(bytes32 hash_, bytes memory signature_) external view returns (address);\n function mintFee() external view returns (uint256);\n function questJsonData(string memory questId_) external view returns (QuestJsonData memory);\n function buildJsonString(\n bytes32 txHash,\n uint32 txHashChainId,\n string memory actionType,\n string memory questName\n ) external pure returns (string memory);\n function questFee() external view returns (uint16);\n function referralRewardFee() external view returns (uint16);\n \n // Create\n function createERC20Boost(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_\n ) external returns (address);\n function createERC20Quest(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_,\n uint256 referralRewardFee_\n ) external returns (address);\n\n function create1155QuestAndQueue(\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 tokenId_,\n string memory questId_,\n string memory\n ) external payable returns (address);\n\n function claimOptimized(bytes calldata signature_, bytes calldata data_) external payable;\n\n function cancelQuest(string calldata questId_) external;\n\n // Set\n function setClaimSignerAddress(address claimSignerAddress_) external;\n function setErc1155QuestAddress(address erc1155QuestAddress_) external;\n function setErc20QuestAddress(address erc20QuestAddress_) external;\n function setMintFee(uint256 mintFee_) external;\n function setDefaultMintFeeRecipient(address mintFeeRecipient_) external;\n function setProtocolFeeRecipient(address protocolFeeRecipient_) external;\n function setQuestFee(uint16 questFee_) external;\n\n // Callbacks\n function withdrawCallback(string calldata questId_, address protocolFeeRecipient_, uint protocolPayout_, address mintFeeRecipient_, uint mintPayout) external;\n}"},"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] calldata accounts,\n uint256[] calldata ids\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"},"lib/openzeppelin-contracts/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"},"lib/solady/src/utils/SafeTransferLib.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\n/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)\n///\n/// @dev Note:\n/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.\n/// - For ERC20s, this implementation won't check that a token has code,\n/// responsibility is delegated to the caller.\nlibrary SafeTransferLib {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ETH transfer has failed.\n error ETHTransferFailed();\n\n /// @dev The ERC20 `transferFrom` has failed.\n error TransferFromFailed();\n\n /// @dev The ERC20 `transfer` has failed.\n error TransferFailed();\n\n /// @dev The ERC20 `approve` has failed.\n error ApproveFailed();\n\n /// @dev The Permit2 operation has failed.\n error Permit2Failed();\n\n /// @dev The Permit2 amount must be less than `2**160 - 1`.\n error Permit2AmountOverflow();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.\n uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;\n\n /// @dev Suggested gas stipend for contract receiving ETH to perform a few\n /// storage reads and writes, but low enough to prevent griefing.\n uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;\n\n /// @dev The unique EIP-712 domain domain separator for the DAI token contract.\n bytes32 internal constant DAI_DOMAIN_SEPARATOR =\n 0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;\n\n /// @dev The address for the WETH9 contract on Ethereum mainnet.\n address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n /// @dev The canonical Permit2 address.\n /// [Github](https://github.com/Uniswap/permit2)\n /// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)\n address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ETH OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.\n //\n // The regular variants:\n // - Forwards all remaining gas to the target.\n // - Reverts if the target reverts.\n // - Reverts if the current contract has insufficient balance.\n //\n // The force variants:\n // - Forwards with an optional gas stipend\n // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).\n // - If the target reverts, or if the gas stipend is exhausted,\n // creates a temporary contract to force send the ETH via `SELFDESTRUCT`.\n // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.\n // - Reverts if the current contract has insufficient balance.\n //\n // The try variants:\n // - Forwards with a mandatory gas stipend.\n // - Instead of reverting, returns whether the transfer succeeded.\n\n /// @dev Sends `amount` (in wei) ETH to `to`.\n function safeTransferETH(address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Sends all the ETH in the current contract to `to`.\n function safeTransferAllETH(address to) internal {\n /// @solidity memory-safe-assembly\n assembly {\n // Transfer all the ETH and check if it succeeded or not.\n if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if lt(selfbalance(), amount) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.\n function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.\n function forceSafeTransferETH(address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if lt(selfbalance(), amount) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.\n function forceSafeTransferAllETH(address to) internal {\n /// @solidity memory-safe-assembly\n assembly {\n // forgefmt: disable-next-item\n if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)\n }\n }\n\n /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.\n function trySafeTransferAllETH(address to, uint256 gasStipend)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC20 OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n /// Reverts upon failure.\n ///\n /// The `from` account must have at least `amount` approved for\n /// the current contract to manage.\n function safeTransferFrom(address token, address from, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x60, amount) // Store the `amount` argument.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n ///\n /// The `from` account must have at least `amount` approved for the current contract to manage.\n function trySafeTransferFrom(address token, address from, address to, uint256 amount)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x60, amount) // Store the `amount` argument.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n success :=\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends all of ERC20 `token` from `from` to `to`.\n /// Reverts upon failure.\n ///\n /// The `from` account must have their entire balance approved for the current contract to manage.\n function safeTransferAllFrom(address token, address from, address to)\n internal\n returns (uint256 amount)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\n // Read the balance, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.\n amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.\n /// Reverts upon failure.\n function safeTransfer(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sends all of ERC20 `token` from the current contract to `to`.\n /// Reverts upon failure.\n function safeTransferAll(address token, address to) internal returns (uint256 amount) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.\n mstore(0x20, address()) // Store the address of the current contract.\n // Read the balance, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x14, to) // Store the `to` argument.\n amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.\n mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n /// Reverts upon failure.\n function safeApprove(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n // Perform the approval, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n /// If the initial attempt to approve fails, attempts to reset the approved amount to zero,\n /// then retries the approval again (some tokens, e.g. USDT, requires this).\n /// Reverts upon failure.\n function safeApproveWithRetry(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n // Perform the approval, retrying upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x34, 0) // Store 0 for the `amount`.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.\n mstore(0x34, amount) // Store back the original `amount`.\n // Retry the approval, reverting upon failure.\n if iszero(\n and(\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n revert(0x1c, 0x04)\n }\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Returns the amount of ERC20 `token` owned by `account`.\n /// Returns zero if the `token` does not exist.\n function balanceOf(address token, address account) internal view returns (uint256 amount) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, account) // Store the `account` argument.\n mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\n amount :=\n mul( // The arguments of `mul` are evaluated from right to left.\n mload(0x20),\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)\n )\n )\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n /// If the initial attempt fails, try to use Permit2 to transfer the token.\n /// Reverts upon failure.\n ///\n /// The `from` account must have at least `amount` approved for the current contract to manage.\n function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {\n if (!trySafeTransferFrom(token, from, to, amount)) {\n permit2TransferFrom(token, from, to, amount);\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.\n /// Reverts upon failure.\n function permit2TransferFrom(address token, address from, address to, uint256 amount)\n internal\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40)\n mstore(add(m, 0x74), shr(96, shl(96, token)))\n mstore(add(m, 0x54), amount)\n mstore(add(m, 0x34), to)\n mstore(add(m, 0x20), shl(96, from))\n // `transferFrom(address,address,uint160,address)`.\n mstore(m, 0x36c78516000000000000000000000000)\n let p := PERMIT2\n let exists := eq(chainid(), 1)\n if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }\n if iszero(and(call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00), exists)) {\n mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.\n revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)\n }\n }\n }\n\n /// @dev Permit a user to spend a given amount of\n /// another user's tokens via native EIP-2612 permit if possible, falling\n /// back to Permit2 if native permit fails or is not implemented on the token.\n function permit2(\n address token,\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n bool success;\n /// @solidity memory-safe-assembly\n assembly {\n for {} shl(96, xor(token, WETH9)) {} {\n mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.\n // Gas stipend to limit gas burn for tokens that don't refund gas when\n // an non-existing function is called. 5K should be enough for a SLOAD.\n staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)\n )\n ) { break }\n // After here, we can be sure that token is a contract.\n let m := mload(0x40)\n mstore(add(m, 0x34), spender)\n mstore(add(m, 0x20), shl(96, owner))\n mstore(add(m, 0x74), deadline)\n if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {\n mstore(0x14, owner)\n mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.\n mstore(add(m, 0x94), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))\n mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.\n // `nonces` is already at `add(m, 0x54)`.\n // `1` is already stored at `add(m, 0x94)`.\n mstore(add(m, 0xb4), and(0xff, v))\n mstore(add(m, 0xd4), r)\n mstore(add(m, 0xf4), s)\n success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)\n break\n }\n mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.\n mstore(add(m, 0x54), amount)\n mstore(add(m, 0x94), and(0xff, v))\n mstore(add(m, 0xb4), r)\n mstore(add(m, 0xd4), s)\n success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)\n break\n }\n }\n if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);\n }\n\n /// @dev Simple permit on the Permit2 contract.\n function simplePermit2(\n address token,\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40)\n mstore(m, 0x927da105) // `allowance(address,address,address)`.\n {\n let addressMask := shr(96, not(0))\n mstore(add(m, 0x20), and(addressMask, owner))\n mstore(add(m, 0x40), and(addressMask, token))\n mstore(add(m, 0x60), and(addressMask, spender))\n mstore(add(m, 0xc0), and(addressMask, spender))\n }\n let p := mul(PERMIT2, iszero(shr(160, amount)))\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.\n staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)\n )\n ) {\n mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.\n revert(add(0x18, shl(2, iszero(p))), 0x04)\n }\n mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).\n // `owner` is already `add(m, 0x20)`.\n // `token` is already at `add(m, 0x40)`.\n mstore(add(m, 0x60), amount)\n mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.\n // `nonce` is already at `add(m, 0xa0)`.\n // `spender` is already at `add(m, 0xc0)`.\n mstore(add(m, 0xe0), deadline)\n mstore(add(m, 0x100), 0x100) // `signature` offset.\n mstore(add(m, 0x120), 0x41) // `signature` length.\n mstore(add(m, 0x140), r)\n mstore(add(m, 0x160), s)\n mstore(add(m, 0x180), shl(248, v))\n if iszero(call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00)) {\n mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n}\n"},"lib/solady/src/utils/ReentrancyGuard.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Reentrancy guard mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ReentrancyGuard.sol)\nabstract contract ReentrancyGuard {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Unauthorized reentrant call.\n error Reentrancy();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to: `uint72(bytes9(keccak256(\"_REENTRANCY_GUARD_SLOT\")))`.\n /// 9 bytes is large enough to avoid collisions with lower slots,\n /// but not too large to result in excessive bytecode bloat.\n uint256 private constant _REENTRANCY_GUARD_SLOT = 0x929eee149b4bd21268;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* REENTRANCY GUARD */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Guards a function from reentrancy.\n modifier nonReentrant() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n if eq(sload(_REENTRANCY_GUARD_SLOT), address()) {\n mstore(0x00, 0xab143c06) // `Reentrancy()`.\n revert(0x1c, 0x04)\n }\n sstore(_REENTRANCY_GUARD_SLOT, address())\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n sstore(_REENTRANCY_GUARD_SLOT, codesize())\n }\n }\n\n /// @dev Guards a view function from read-only reentrancy.\n modifier nonReadReentrant() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n if eq(sload(_REENTRANCY_GUARD_SLOT), address()) {\n mstore(0x00, 0xab143c06) // `Reentrancy()`.\n revert(0x1c, 0x04)\n }\n }\n _;\n }\n}\n"},"contracts/references/Budget.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {Ownable} from \"solady/auth/Ownable.sol\";\nimport {Receiver} from \"solady/accounts/Receiver.sol\";\nimport {SafeTransferLib} from \"solady/utils/SafeTransferLib.sol\";\n\nimport {BoostError} from \"contracts/references/BoostError.sol\";\nimport {Cloneable} from \"contracts/references/Cloneable.sol\";\n\n/// @title Boost Budget\n/// @notice Abstract contract for a generic Budget within the Boost protocol\n/// @dev Budget classes are expected to implement the allocation, reclamation, and disbursement of assets.\n/// @dev WARNING: Budgets currently support only ETH, ERC20, and ERC1155 assets. Other asset types may be added in the future.\nabstract contract Budget is Ownable, Cloneable, Receiver {\n using SafeTransferLib for address;\n\n enum AssetType {\n ETH,\n ERC20,\n ERC1155\n }\n\n /// @notice A struct representing the inputs for an allocation\n /// @param assetType The type of asset to allocate\n /// @param asset The address of the asset to allocate\n /// @param target The address of the payee or payer (from or to, depending on the operation)\n /// @param data The implementation-specific data for the allocation (amount, token ID, etc.)\n struct Transfer {\n AssetType assetType;\n address asset;\n address target;\n bytes data;\n }\n\n /// @notice The payload for an ETH or ERC20 transfer\n /// @param amount The amount of the asset to transfer\n struct FungiblePayload {\n uint256 amount;\n }\n\n /// @notice The payload for an ERC1155 transfer\n /// @param tokenId The ID of the token to transfer\n /// @param amount The amount of the token to transfer\n /// @param data Any additional data to forward to the ERC1155 contract\n struct ERC1155Payload {\n uint256 tokenId;\n uint256 amount;\n bytes data;\n }\n\n /// @notice Emitted when an address's authorization status changes\n event Authorized(address indexed account, bool isAuthorized);\n\n /// @notice Emitted when assets are distributed from the budget\n event Distributed(address indexed asset, address to, uint256 amount);\n\n /// @notice Thrown when the allocation is invalid\n error InvalidAllocation(address asset, uint256 amount);\n\n /// @notice Thrown when there are insufficient funds for an operation\n error InsufficientFunds(address asset, uint256 available, uint256 required);\n\n /// @notice Thrown when the length of two arrays are not equal\n error LengthMismatch();\n\n /// @notice Thrown when a transfer fails for an unknown reason\n error TransferFailed(address asset, address to, uint256 amount);\n\n /// @notice Initialize the budget and set the owner\n /// @dev The owner is set to the contract deployer\n constructor() {\n _initializeOwner(msg.sender);\n }\n\n /// @notice Allocate assets to the budget\n /// @param data_ The compressed data for the allocation (amount, token address, token ID, etc.)\n /// @return True if the allocation was successful\n function allocate(bytes calldata data_) external payable virtual returns (bool);\n\n /// @notice Reclaim assets from the budget\n /// @param data_ The compressed data for the reclamation (amount, token address, token ID, etc.)\n /// @return True if the reclamation was successful\n function reclaim(bytes calldata data_) external virtual returns (bool);\n\n /// @notice Disburse assets from the budget to a single recipient\n /// @param data_ The compressed {Transfer} request\n /// @return True if the disbursement was successful\n function disburse(bytes calldata data_) external virtual returns (bool);\n\n /// @notice Disburse assets from the budget to multiple recipients\n /// @param data_ The array of compressed {Transfer} requests\n /// @return True if all disbursements were successful\n function disburseBatch(bytes[] calldata data_) external virtual returns (bool);\n\n /// @notice Get the total amount of assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @return The total amount of assets\n function total(address asset_) external view virtual returns (uint256);\n\n /// @notice Get the amount of assets available for distribution from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets available\n function available(address asset_) external view virtual returns (uint256);\n\n /// @notice Get the amount of assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets distributed\n function distributed(address asset_) external view virtual returns (uint256);\n\n /// @notice Reconcile the budget to ensure the known state matches the actual state\n /// @param data_ The compressed data for the reconciliation (amount, token address, token ID, etc.)\n /// @return The amount of assets reconciled\n function reconcile(bytes calldata data_) external virtual returns (uint256);\n\n /// @inheritdoc Cloneable\n function supportsInterface(bytes4 interfaceId) public view virtual override(Cloneable) returns (bool) {\n return interfaceId == type(Budget).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /// @notice Set the authorized status of the given accounts\n /// @param accounts_ The accounts to authorize or deauthorize\n /// @param isAuthorized_ The authorization status for the given accounts\n /// @dev The mechanism for managing authorization is left to the implementing contract\n function setAuthorized(address[] calldata accounts_, bool[] calldata isAuthorized_) external virtual;\n\n /// @notice Check if the given account is authorized to use the budget\n /// @param account_ The account to check\n /// @return True if the account is authorized\n /// @dev The mechanism for checking authorization is left to the implementing contract\n function isAuthorized(address account_) external view virtual returns (bool);\n\n /// @inheritdoc Receiver\n receive() external payable virtual override {\n return;\n }\n\n /// @inheritdoc Receiver\n fallback() external payable virtual override {\n return;\n }\n}"},"contracts/references/Cloneable.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {Initializable} from \"solady/utils/Initializable.sol\";\nimport {ERC165} from \"openzeppelin-contracts/utils/introspection/ERC165.sol\";\n\n/// @title Cloneable\n/// @notice A contract that can be cloned and initialized only once\nabstract contract Cloneable is Initializable, ERC165 {\n /// @notice Thrown when an inheriting contract does not implement the initializer function\n error InitializerNotImplemented();\n\n /// @notice Thrown when the provided initialization data is invalid\n /// @dev This error indicates that the given data is not valid for the implementation (i.e. does not decode to the expected types)\n error InvalidInitializationData();\n\n /// @notice Thrown when the contract has already been initialized\n error CloneAlreadyInitialized();\n\n /// @notice A modifier to restrict a function to only be called before initialization\n /// @dev This is intended to enforce that a function can only be called before the contract has been initialized\n modifier onlyBeforeInitialization() {\n if (_getInitializedVersion() != 0) revert CloneAlreadyInitialized();\n _;\n }\n\n /// @notice Initialize the clone with the given arbitrary data\n /// @param - The compressed initialization data (if required)\n /// @dev The data is expected to be ABI encoded bytes compressed using {LibZip-cdCompress}\n /// @dev All implementations must override this function to initialize the contract\n function initialize(bytes calldata) public virtual initializer {\n revert InitializerNotImplemented();\n }\n\n /// @inheritdoc ERC165\n /// @notice Check if the contract supports the given interface\n /// @param interfaceId The interface identifier\n /// @return True if the contract supports the interface\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(Cloneable).interfaceId || super.supportsInterface(interfaceId);\n }\n}"},"lib/solady/src/auth/Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)\n///\n/// @dev Note:\n/// This implementation does NOT auto-initialize the owner to `msg.sender`.\n/// You MUST call the `_initializeOwner` in the constructor / initializer.\n///\n/// While the ownable portion follows\n/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,\n/// the nomenclature for the 2-step ownership handover may be unique to this codebase.\nabstract contract Ownable {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The caller is not authorized to call the function.\n error Unauthorized();\n\n /// @dev The `newOwner` cannot be the zero address.\n error NewOwnerIsZeroAddress();\n\n /// @dev The `pendingOwner` does not have a valid handover request.\n error NoHandoverRequest();\n\n /// @dev Cannot double-initialize.\n error AlreadyInitialized();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ownership is transferred from `oldOwner` to `newOwner`.\n /// This event is intentionally kept the same as OpenZeppelin's Ownable to be\n /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),\n /// despite it not being as lightweight as a single argument event.\n event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);\n\n /// @dev An ownership handover to `pendingOwner` has been requested.\n event OwnershipHandoverRequested(address indexed pendingOwner);\n\n /// @dev The ownership handover to `pendingOwner` has been canceled.\n event OwnershipHandoverCanceled(address indexed pendingOwner);\n\n /// @dev `keccak256(bytes(\"OwnershipTransferred(address,address)\"))`.\n uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =\n 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverRequested(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =\n 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverCanceled(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =\n 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The owner slot is given by:\n /// `bytes32(~uint256(uint32(bytes4(keccak256(\"_OWNER_SLOT_NOT\")))))`.\n /// It is intentionally chosen to be a high value\n /// to avoid collision with lower slots.\n /// The choice of manual storage layout is to enable compatibility\n /// with both regular and upgradeable contracts.\n bytes32 internal constant _OWNER_SLOT =\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;\n\n /// The ownership handover slot of `newOwner` is given by:\n /// ```\n /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))\n /// let handoverSlot := keccak256(0x00, 0x20)\n /// ```\n /// It stores the expiry timestamp of the two-step ownership handover.\n uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.\n function _guardInitializeOwner() internal pure virtual returns (bool guard) {}\n\n /// @dev Initializes the owner directly without authorization guard.\n /// This function must be called upon initialization,\n /// regardless of whether the contract is upgradeable or not.\n /// This is to enable generalization to both regular and upgradeable contracts,\n /// and to save gas in case the initial owner is not the caller.\n /// For performance reasons, this function will not check if there\n /// is an existing owner.\n function _initializeOwner(address newOwner) internal virtual {\n if (_guardInitializeOwner()) {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n if sload(ownerSlot) {\n mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.\n revert(0x1c, 0x04)\n }\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Store the new value.\n sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n }\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Store the new value.\n sstore(_OWNER_SLOT, newOwner)\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n }\n }\n }\n\n /// @dev Sets the owner directly without authorization guard.\n function _setOwner(address newOwner) internal virtual {\n if (_guardInitializeOwner()) {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n // Store the new value.\n sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))\n }\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n // Store the new value.\n sstore(ownerSlot, newOwner)\n }\n }\n }\n\n /// @dev Throws if the sender is not the owner.\n function _checkOwner() internal view virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // If the caller is not the stored owner, revert.\n if iszero(eq(caller(), sload(_OWNER_SLOT))) {\n mstore(0x00, 0x82b42900) // `Unauthorized()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Returns how long a two-step ownership handover is valid for in seconds.\n /// Override to return a different value if needed.\n /// Made internal to conserve bytecode. Wrap it in a public function if needed.\n function _ownershipHandoverValidFor() internal view virtual returns (uint64) {\n return 48 * 3600;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC UPDATE FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Allows the owner to transfer the ownership to `newOwner`.\n function transferOwnership(address newOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(shl(96, newOwner)) {\n mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.\n revert(0x1c, 0x04)\n }\n }\n _setOwner(newOwner);\n }\n\n /// @dev Allows the owner to renounce their ownership.\n function renounceOwnership() public payable virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /// @dev Request a two-step ownership handover to the caller.\n /// The request will automatically expire in 48 hours (172800 seconds) by default.\n function requestOwnershipHandover() public payable virtual {\n unchecked {\n uint256 expires = block.timestamp + _ownershipHandoverValidFor();\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to `expires`.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), expires)\n // Emit the {OwnershipHandoverRequested} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())\n }\n }\n }\n\n /// @dev Cancels the two-step ownership handover to the caller, if any.\n function cancelOwnershipHandover() public payable virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), 0)\n // Emit the {OwnershipHandoverCanceled} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())\n }\n }\n\n /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.\n /// Reverts if there is no existing ownership handover requested by `pendingOwner`.\n function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n let handoverSlot := keccak256(0x0c, 0x20)\n // If the handover does not exist, or has expired.\n if gt(timestamp(), sload(handoverSlot)) {\n mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.\n revert(0x1c, 0x04)\n }\n // Set the handover slot to 0.\n sstore(handoverSlot, 0)\n }\n _setOwner(pendingOwner);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC READ FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the owner of the contract.\n function owner() public view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := sload(_OWNER_SLOT)\n }\n }\n\n /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.\n function ownershipHandoverExpiresAt(address pendingOwner)\n public\n view\n virtual\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute the handover slot.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n // Load the handover slot.\n result := sload(keccak256(0x0c, 0x20))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* MODIFIERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Marks a function as only callable by the owner.\n modifier onlyOwner() virtual {\n _checkOwner();\n _;\n }\n}\n"},"lib/solady/src/accounts/Receiver.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Receiver mixin for ETH and safe-transferred ERC721 and ERC1155 tokens.\n/// @author Solady (https://github.com/Vectorized/solady/blob/main/src/accounts/Receiver.sol)\n///\n/// @dev Note:\n/// - Handles all ERC721 and ERC1155 token safety callbacks.\n/// - Collapses function table gas overhead and code size.\n/// - Utilizes fallback so unknown calldata will pass on.\nabstract contract Receiver {\n /// @dev For receiving ETH.\n receive() external payable virtual {}\n\n /// @dev Fallback function with the `receiverFallback` modifier.\n fallback() external payable virtual receiverFallback {}\n\n /// @dev Modifier for the fallback function to handle token callbacks.\n modifier receiverFallback() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, calldataload(0))\n // 0x150b7a02: `onERC721Received(address,address,uint256,bytes)`.\n // 0xf23a6e61: `onERC1155Received(address,address,uint256,uint256,bytes)`.\n // 0xbc197c81: `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n if or(eq(s, 0x150b7a02), or(eq(s, 0xf23a6e61), eq(s, 0xbc197c81))) {\n mstore(0x20, s) // Store `msg.sig`.\n return(0x3c, 0x20) // Return `msg.sig`.\n }\n }\n _;\n }\n}\n"},"contracts/references/BoostError.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\n/// @title BoostError\n/// @notice Standardized errors for the Boost protocol\n/// @dev Some of these errors are introduced by third-party libraries, rather than Boost contracts directly, and are copied here for clarity and ease of testing.\nlibrary BoostError {\n /// @notice Thrown when a claim attempt fails\n error ClaimFailed(address caller, bytes data);\n\n /// @notice Thrown when there are insufficient funds for an operation\n error InsufficientFunds(address asset, uint256 available, uint256 required);\n\n /// @notice Thrown when a non-conforming instance for a given type is encountered\n error InvalidInstance(bytes4 expectedInterface, address instance);\n\n /// @notice Thrown when an invalid initialization is attempted\n error InvalidInitialization();\n\n /// @notice Thrown when the length of two arrays are not equal\n error LengthMismatch();\n\n /// @notice Thrown when a method is not implemented\n error NotImplemented();\n\n /// @notice Thrown when a previously used signature is replayed\n error Replayed(address signer, bytes32 hash, bytes signature);\n\n /// @notice Thrown when a transfer fails for an unknown reason\n error TransferFailed(address asset, address to, uint256 amount);\n\n /// @notice Thrown when the requested action is unauthorized\n error Unauthorized();\n}"},"lib/solady/src/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Initializable mixin for the upgradeable contracts.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Initializable.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/proxy/utils/Initializable.sol)\nabstract contract Initializable {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The contract is already initialized.\n error InvalidInitialization();\n\n /// @dev The contract is not initializing.\n error NotInitializing();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Triggered when the contract has been initialized.\n event Initialized(uint64 version);\n\n /// @dev `keccak256(bytes(\"Initialized(uint64)\"))`.\n bytes32 private constant _INTIALIZED_EVENT_SIGNATURE =\n 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The default initializable slot is given by:\n /// `bytes32(~uint256(uint32(bytes4(keccak256(\"_INITIALIZABLE_SLOT\")))))`.\n ///\n /// Bits Layout:\n /// - [0] `initializing`\n /// - [1..64] `initializedVersion`\n bytes32 private constant _INITIALIZABLE_SLOT =\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf601132;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override to return a custom storage slot if required.\n function _initializableSlot() internal pure virtual returns (bytes32) {\n return _INITIALIZABLE_SLOT;\n }\n\n /// @dev Guards an initializer function so that it can be invoked at most once.\n ///\n /// You can guard a function with `onlyInitializing` such that it can be called\n /// through a function guarded with `initializer`.\n ///\n /// This is similar to `reinitializer(1)`, except that in the context of a constructor,\n /// an `initializer` guarded function can be invoked multiple times.\n /// This can be useful during testing and is not expected to be used in production.\n ///\n /// Emits an {Initialized} event.\n modifier initializer() virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n let i := sload(s)\n // Set `initializing` to 1, `initializedVersion` to 1.\n sstore(s, 3)\n // If `!(initializing == 0 && initializedVersion == 0)`.\n if i {\n // If `!(address(this).code.length == 0 && initializedVersion == 1)`.\n if iszero(lt(extcodesize(address()), eq(shr(1, i), 1))) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n s := shl(shl(255, i), s) // Skip initializing if `initializing == 1`.\n }\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n if s {\n // Set `initializing` to 0, `initializedVersion` to 1.\n sstore(s, 2)\n // Emit the {Initialized} event.\n mstore(0x20, 1)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n }\n\n /// @dev Guards an reinitialzer function so that it can be invoked at most once.\n ///\n /// You can guard a function with `onlyInitializing` such that it can be called\n /// through a function guarded with `reinitializer`.\n ///\n /// Emits an {Initialized} event.\n modifier reinitializer(uint64 version) virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n version := and(version, 0xffffffffffffffff) // Clean upper bits.\n let i := sload(s)\n // If `initializing == 1 || initializedVersion >= version`.\n if iszero(lt(and(i, 1), lt(shr(1, i), version))) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n // Set `initializing` to 1, `initializedVersion` to `version`.\n sstore(s, or(1, shl(1, version)))\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n // Set `initializing` to 0, `initializedVersion` to `version`.\n sstore(s, shl(1, version))\n // Emit the {Initialized} event.\n mstore(0x20, version)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n\n /// @dev Guards a function such that it can only be called in the scope\n /// of a function guarded with `initializer` or `reinitializer`.\n modifier onlyInitializing() virtual {\n _checkInitializing();\n _;\n }\n\n /// @dev Reverts if the contract is not initializing.\n function _checkInitializing() internal view virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(and(1, sload(s))) {\n mstore(0x00, 0xd7e6bcf8) // `NotInitializing()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Locks any future initializations by setting the initialized version to `2**64 - 1`.\n ///\n /// Calling this in the constructor will prevent the contract from being initialized\n /// or reinitialized. It is recommended to use this to lock implementation contracts\n /// that are designed to be called through proxies.\n ///\n /// Emits an {Initialized} event the first time it is successfully called.\n function _disableInitializers() internal virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n let i := sload(s)\n if and(i, 1) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n let uint64max := shr(192, s) // Computed to save bytecode.\n if iszero(eq(shr(1, i), uint64max)) {\n // Set `initializing` to 0, `initializedVersion` to `2**64 - 1`.\n sstore(s, shl(1, uint64max))\n // Emit the {Initialized} event.\n mstore(0x20, uint64max)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n }\n\n /// @dev Returns the highest version that has been initialized.\n function _getInitializedVersion() internal view virtual returns (uint64 version) {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n version := shr(1, sload(s))\n }\n }\n\n /// @dev Returns whether the contract is currently initializing.\n function _isInitializing() internal view virtual returns (bool result) {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n result := and(1, sload(s))\n }\n }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"}},"settings":{"remappings":["forge-std/=lib/forge-std/src/","solady/=lib/solady/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/=node_modules/@openzeppelin/","@openzeppelin/contracts/=lib/v2-core/lib/openzeppelin-contracts/contracts/","@prb/=node_modules/@prb/","@prb/math/=lib/v2-core/lib/prb-math/","@prb/test/=lib/v2-core/lib/prb-test/src/","@sablier/=node_modules/@sablier/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","eth-gas-reporter/=node_modules/eth-gas-reporter/","hardhat-deploy/=node_modules/hardhat-deploy/","hardhat/=node_modules/hardhat/","openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/","prb-math/=lib/v2-core/lib/prb-math/src/","prb-test/=lib/v2-core/lib/prb-test/src/","solarray/=lib/v2-core/lib/solarray/src/","v2-core/=lib/v2-core/"],"optimizer":{"enabled":true,"runs":1000},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"":["ast"],"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"]}},"evmVersion":"paris","viaIR":true,"libraries":{}}} +{"language":"Solidity","sources":{"contracts/QuestBudget.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {IQuestFactory} from \"contracts/interfaces/IQuestFactory.sol\";\n\nimport {IERC1155Receiver} from \"openzeppelin-contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport {IERC1155} from \"openzeppelin-contracts/token/ERC1155/IERC1155.sol\";\nimport {IERC165} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\nimport {IERC20} from \"openzeppelin-contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"openzeppelin-contracts/token/ERC20/utils/SafeERC20.sol\";\n\nimport {SafeTransferLib} from \"solady/utils/SafeTransferLib.sol\";\nimport {ReentrancyGuard} from \"solady/utils/ReentrancyGuard.sol\";\n\nimport {Budget} from \"contracts/references/Budget.sol\";\nimport {Cloneable} from \"contracts/references/Cloneable.sol\";\n\n/// @title Simple Budget\n/// @notice A minimal budget implementation that simply holds and distributes tokens (ERC20-like and native)\n/// @dev This type of budget supports ETH, ERC20, and ERC1155 assets only\ncontract QuestBudget is Budget, IERC1155Receiver, ReentrancyGuard {\n using SafeTransferLib for address;\n using SafeERC20 for IERC20;\n\n /// @notice The payload for initializing a SimpleBudget\n struct InitPayload {\n address owner;\n address questFactory;\n address[] authorized;\n }\n\n // @dev The address of the QuestFactory contract\n address public questFactory;\n\n bool public disburseEnabled;\n\n /// @dev The total amount of each fungible asset distributed from the budget\n mapping(address => uint256) private _distributedFungible;\n\n /// @dev The total amount of each ERC1155 asset and token ID distributed from the budget\n mapping(address => mapping(uint256 => uint256)) private _distributedERC1155;\n\n /// @dev The mapping of authorized addresses\n mapping(address => bool) private _isAuthorized;\n\n /// @dev The management fee percentage (in basis points, i.e., 100 = 1%)\n uint256 public managementFee;\n\n /// @dev Mapping of quest IDs to their respective managers' addresses\n mapping(string => address) public questManagers;\n\n /// @dev Total amount of funds reserved for management fees\n uint256 public reservedFunds;\n\n /// @dev Emitted when the management fee is set or updated\n event ManagementFeeSet(uint256 newFee);\n\n /// @dev Emitted when management fee is paid\n event ManagementFeePaid(string indexed questId, address indexed manager, uint256 amount);\n\n /// @notice A modifier that allows only authorized addresses to call the function\n modifier onlyAuthorized() {\n if (!isAuthorized(msg.sender)) revert Unauthorized();\n _;\n }\n\n /// @notice Construct a new SimpleBudget\n /// @dev Because this contract is a base implementation, it should not be initialized through the constructor. Instead, it should be cloned and initialized using the {initialize} function.\n constructor() {\n _disableInitializers();\n }\n\n /// @inheritdoc Cloneable\n /// @param data_ The packed init data for the budget `(address owner, address[] authorized)`\n function initialize(bytes calldata data_) public virtual override initializer {\n InitPayload memory init_ = abi.decode(data_, (InitPayload));\n _initializeOwner(init_.owner);\n questFactory = init_.questFactory;\n for (uint256 i = 0; i < init_.authorized.length; i++) {\n _isAuthorized[init_.authorized[i]] = true;\n }\n }\n\n /// @inheritdoc Budget\n /// @notice Allocates assets to the budget\n /// @param data_ The packed data for the {Transfer} request\n /// @return True if the allocation was successful\n /// @dev The caller must have already approved the contract to transfer the asset\n /// @dev If the asset transfer fails, the allocation will revert\n function allocate(bytes calldata data_) external payable virtual override returns (bool) {\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ETH) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n // Ensure the value received is equal to the `payload.amount`\n if (msg.value != payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else if (request.assetType == AssetType.ERC20) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n // Transfer `payload.amount` of the token to this contract\n request.asset.safeTransferFrom(request.target, address(this), payload.amount);\n if (request.asset.balanceOf(address(this)) < payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n\n // Transfer `payload.amount` of `payload.tokenId` to this contract\n IERC1155(request.asset).safeTransferFrom(\n request.target, address(this), payload.tokenId, payload.amount, payload.data\n );\n if (IERC1155(request.asset).balanceOf(address(this), payload.tokenId) < payload.amount) {\n revert InvalidAllocation(request.asset, payload.amount);\n }\n } else {\n // Unsupported asset type\n return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n /// @notice Reclaims assets from the budget\n /// @param data_ The packed {Transfer} request\n /// @return True if the request was successful\n /// @dev Only the owner can directly reclaim assets from the budget\n /// @dev If the amount is zero, the entire balance of the asset will be transferred to the receiver\n /// @dev If the asset transfer fails, the reclamation will revert\n function reclaim(bytes calldata data_) external virtual override onlyOwner returns (bool) {\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ETH || request.assetType == AssetType.ERC20) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n _transferFungible(\n request.asset, request.target, payload.amount == 0 ? available(request.asset) : payload.amount\n );\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n _transferERC1155(\n request.asset,\n request.target,\n payload.tokenId,\n payload.amount == 0 ? IERC1155(request.asset).balanceOf(address(this), payload.tokenId) : payload.amount,\n payload.data\n );\n } else {\n return false;\n }\n\n return true;\n }\n\n /// @notice Create an erc20 quest and start it at the same time. The function will transfer the reward amount to the quest contract\n /// @param txHashChainId_ The chain id of the chain the txHash is on\n /// @param rewardTokenAddress_ The contract address of the reward token\n /// @param endTime_ The end time of the quest\n /// @param startTime_ The start time of the quest\n /// @param totalParticipants_ The total amount of participants (accounts) the quest will have\n /// @param rewardAmount_ The reward amount for an erc20 quest\n /// @param questId_ The id of the quest\n /// @param actionType_ The action type for the quest\n /// @param questName_ The name of the quest\n /// @param projectName_ The name of the project/protocol used for the quest\n /// @param referralRewardFee_ The fee amount for referrals. The value is counted against the `rewardAmount`\n /// @return address the quest contract address\n function createERC20Quest(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_,\n uint256 referralRewardFee_\n ) public virtual onlyAuthorized returns (address) {\n uint256 maxTotalRewards = totalParticipants_ * rewardAmount_;\n uint256 questFee = uint256(IQuestFactory(questFactory).questFee());\n uint256 referralRewardFee = uint256(IQuestFactory(questFactory).referralRewardFee());\n uint256 maxProtocolReward = (maxTotalRewards * questFee) / 10_000;\n uint256 maxReferralReward = (maxTotalRewards * referralRewardFee) / 10_000;\n uint256 maxManagementFee = (maxTotalRewards * managementFee) / 10_000;\n uint256 approvalAmount = maxTotalRewards + maxProtocolReward + maxReferralReward;\n\n // Ensure the available balance in the budget can cover the required approval amount plus the reserved management fee\n require(\n this.available(rewardTokenAddress_) >= approvalAmount + maxManagementFee,\n \"Insufficient funds for quest creation\"\n );\n\n // Reserve the management fee so that the manager can be paid later\n reservedFunds += maxManagementFee;\n\n // Approve the QuestFactory contract to transfer the necessary tokens for this quest\n rewardTokenAddress_.safeApprove(address(questFactory), approvalAmount);\n\n // Store the manager address (msg.sender) associated with the questId\n questManagers[questId_] = msg.sender;\n\n return IQuestFactory(questFactory).createERC20Quest(\n txHashChainId_,\n rewardTokenAddress_,\n endTime_,\n startTime_,\n totalParticipants_,\n rewardAmount_,\n questId_,\n actionType_,\n questName_,\n projectName_,\n referralRewardFee_\n );\n }\n\n /// @notice Cancel a quest\n /// @param questId_ The uuid of the quest\n function cancelQuest(string calldata questId_) public virtual onlyOwner() {\n IQuestFactory(questFactory).cancelQuest(questId_);\n }\n\n /// @notice Sets the management fee percentage\n /// @dev Only the owner can call this function. The fee is in basis points (100 = 1%)\n /// @param fee_ The new management fee percentage in basis points\n function setManagementFee(uint256 fee_) external onlyOwner {\n require(fee_ <= 10000, \"Fee cannot exceed 100%\");\n managementFee = fee_;\n emit ManagementFeeSet(fee_);\n }\n\n /// @notice Allows the quest manager to claim the management fee for a completed quest\n /// @dev This function can only be called by the authorized quest manager after the quest rewards have been withdrawn\n /// @param questId_ The unique identifier of the quest for which the management fee is being claimed\n function payManagementFee(string memory questId_) public onlyAuthorized {\n // Retrieve the quest data by calling the questData function and decoding the result\n IQuestFactory.QuestData memory quest = IQuestFactory(questFactory).questData(questId_);\n\n // Ensure the caller is the manager who created the quest\n require(questManagers[questId_] == msg.sender, \"Only the quest creator can claim the management fee\");\n\n // Ensure the quest has been marked as withdrawn\n require(quest.hasWithdrawn, \"Management fee cannot be claimed until the quest rewards are withdrawn\");\n\n // Extract relevant data from the QuestData struct\n uint256 totalParticipants = quest.totalParticipants;\n uint256 rewardAmount = quest.rewardAmountOrTokenId;\n uint256 numberMinted = quest.numberMinted;\n\n // Calculate the maximum possible management fee based on total participants\n uint256 totalPossibleFee = (totalParticipants * rewardAmount * managementFee) / 10_000;\n\n // Calculate the actual management fee to be paid based on the number of claims (numberMinted)\n uint256 feeToPay = (numberMinted * rewardAmount * managementFee) / 10_000;\n\n // Get the balance of reward tokens available in this contract\n uint256 availableFunds = IERC20(quest.rewardToken).balanceOf(address(this));\n\n // Ensure the contract has enough funds to pay out the management fee; they should be reserved and not available\n require(availableFunds >= feeToPay, \"Insufficient funds to pay management fee\");\n\n // Transfer the management fee to the manager\n IERC20(quest.rewardToken).safeTransfer(msg.sender, feeToPay);\n\n // Subtract the total possible management fee since we reserved the total amount to begin with\n reservedFunds = reservedFunds - totalPossibleFee;\n\n // Emit an event for logging purposes\n emit ManagementFeePaid(questId_, msg.sender, feeToPay);\n }\n \n /// @inheritdoc Budget\n /// @notice Disburses assets from the budget to a single recipient\n /// @param data_ The packed {Transfer} request\n /// @return True if the disbursement was successful\n /// @dev If the asset transfer fails, the disbursement will revert\n function disburse(bytes calldata data_) public virtual override onlyAuthorized returns (bool) {\n if(!disburseEnabled) {\n revert Unauthorized();\n }\n Transfer memory request = abi.decode(data_, (Transfer));\n if (request.assetType == AssetType.ERC20 || request.assetType == AssetType.ETH) {\n FungiblePayload memory payload = abi.decode(request.data, (FungiblePayload));\n\n uint256 avail = available(request.asset);\n if (payload.amount > avail) {\n revert InsufficientFunds(request.asset, avail, payload.amount);\n }\n\n _transferFungible(request.asset, request.target, payload.amount);\n } else if (request.assetType == AssetType.ERC1155) {\n ERC1155Payload memory payload = abi.decode(request.data, (ERC1155Payload));\n\n uint256 avail = IERC1155(request.asset).balanceOf(address(this), payload.tokenId);\n if (payload.amount > avail) {\n revert InsufficientFunds(request.asset, avail, payload.amount);\n }\n\n _transferERC1155(request.asset, request.target, payload.tokenId, payload.amount, payload.data);\n } else {\n return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n /// @notice Disburses assets from the budget to multiple recipients\n /// @param data_ The packed array of {Transfer} requests\n /// @return True if all disbursements were successful\n function disburseBatch(bytes[] calldata data_) external virtual override returns (bool) {\n for (uint256 i = 0; i < data_.length; i++) {\n if (!disburse(data_[i])) return false;\n }\n\n return true;\n }\n\n /// @inheritdoc Budget\n function setAuthorized(address[] calldata account_, bool[] calldata authorized_)\n external\n virtual\n override\n onlyOwner\n {\n if (account_.length != authorized_.length) revert LengthMismatch();\n for (uint256 i = 0; i < account_.length; i++) {\n _isAuthorized[account_[i]] = authorized_[i];\n }\n }\n\n /// @inheritdoc Budget\n function isAuthorized(address account_) public view virtual override returns (bool) {\n return _isAuthorized[account_] || account_ == owner();\n }\n\n /// @notice Set the QuestFactory contract address\n /// @param questFactory_ The address of the QuestFactory contract\n function setQuestFactory(address questFactory_) external virtual onlyOwner {\n questFactory = questFactory_;\n }\n\n /// @notice Set the DisburseEnabled flag\n /// @param enabled_ The flag to enable or disable disburse\n function setDisburseEnabled(bool enabled_) external virtual onlyOwner {\n disburseEnabled = enabled_;\n }\n\n /// @inheritdoc Budget\n /// @notice Get the total amount of assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @return The total amount of assets\n /// @dev This is simply the sum of the current balance and the distributed amount\n function total(address asset_) external view virtual override returns (uint256) {\n return available(asset_) + _distributedFungible[asset_];\n }\n\n /// @notice Get the total amount of ERC1155 assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The total amount of assets\n function total(address asset_, uint256 tokenId_) external view virtual returns (uint256) {\n return IERC1155(asset_).balanceOf(address(this), tokenId_) + _distributedERC1155[asset_][tokenId_];\n }\n\n /// @inheritdoc Budget\n /// @notice Get the amount of assets available for distribution from the budget\n /// @param asset_ The address of the asset (or the zero address for native assets)\n /// @return The amount of assets available\n /// @dev This returns the current balance held by the budget minus reserved funds\n /// @dev If the zero address is passed, this function will return the native balance\n function available(address asset_) public view virtual override returns (uint256) {\n uint256 totalBalance = asset_ == address(0) ? address(this).balance : IERC20(asset_).balanceOf(address(this));\n return totalBalance > reservedFunds ? totalBalance - reservedFunds : 0;\n }\n\n /// @notice Get the amount of ERC1155 assets available for distribution from the budget\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The amount of assets available\n function available(address asset_, uint256 tokenId_) public view virtual returns (uint256) {\n return IERC1155(asset_).balanceOf(address(this), tokenId_);\n }\n\n /// @inheritdoc Budget\n /// @notice Get the amount of assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets distributed\n function distributed(address asset_) external view virtual override returns (uint256) {\n return _distributedFungible[asset_];\n }\n\n /// @notice Get the amount of ERC1155 assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @param tokenId_ The ID of the token\n /// @return The amount of assets distributed\n function distributed(address asset_, uint256 tokenId_) external view virtual returns (uint256) {\n return _distributedERC1155[asset_][tokenId_];\n }\n\n /// @inheritdoc Budget\n /// @dev This is a no-op as there is no local balance to reconcile\n function reconcile(bytes calldata) external virtual override returns (uint256) {\n return 0;\n }\n\n /// @notice Transfer assets to the recipient\n /// @param asset_ The address of the asset\n /// @param to_ The address of the recipient\n /// @param amount_ The amount of the asset to transfer\n /// @dev This function is used to transfer assets from the budget to a given recipient (typically an incentive contract)\n /// @dev If the destination address is the zero address, or the transfer fails for any reason, this function will revert\n function _transferFungible(address asset_, address to_, uint256 amount_) internal virtual nonReentrant {\n // Increment the total amount of the asset distributed from the budget\n if (to_ == address(0)) revert TransferFailed(asset_, to_, amount_);\n if (amount_ > available(asset_)) {\n revert InsufficientFunds(asset_, available(asset_), amount_);\n }\n\n _distributedFungible[asset_] += amount_;\n\n // Transfer the asset to the recipient\n if (asset_ == address(0)) {\n SafeTransferLib.safeTransferETH(to_, amount_);\n } else {\n asset_.safeTransfer(to_, amount_);\n }\n\n emit Distributed(asset_, to_, amount_);\n }\n\n function _transferERC1155(address asset_, address to_, uint256 tokenId_, uint256 amount_, bytes memory data_)\n internal\n virtual\n nonReentrant\n {\n // Increment the total amount of the asset distributed from the budget\n if (to_ == address(0)) revert TransferFailed(asset_, to_, amount_);\n if (amount_ > available(asset_, tokenId_)) {\n revert InsufficientFunds(asset_, available(asset_, tokenId_), amount_);\n }\n\n _distributedERC1155[asset_][tokenId_] += amount_;\n\n // Transfer the asset to the recipient\n // wake-disable-next-line reentrancy (`nonReentrant` modifier is applied to the function)\n IERC1155(asset_).safeTransferFrom(address(this), to_, tokenId_, amount_, data_);\n\n emit Distributed(asset_, to_, amount_);\n }\n\n /// @inheritdoc IERC1155Receiver\n /// @dev This contract does not care about the specifics of the inbound token, so we simply return the magic value (i.e. the selector for `onERC1155Received`)\n function onERC1155Received(address, address, uint256, uint256, bytes calldata)\n external\n pure\n override\n returns (bytes4)\n {\n // We don't need to do anything here\n return IERC1155Receiver.onERC1155Received.selector;\n }\n\n /// @inheritdoc IERC1155Receiver\n /// @dev This contract does not care about the specifics of the inbound token, so we simply return the magic value (i.e. the selector for `onERC1155Received`)\n function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata)\n external\n pure\n override\n returns (bytes4)\n {\n // We don't need to do anything here\n return IERC1155Receiver.onERC1155BatchReceived.selector;\n }\n\n /// @inheritdoc Cloneable\n function supportsInterface(bytes4 interfaceId) public view virtual override(Budget, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}"},"contracts/interfaces/IQuestFactory.sol":{"content":"// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.19;\n\ninterface IQuestFactory {\n // Errors\n error AddressAlreadyMinted();\n error AddressNotSigned();\n error AddressZeroNotAllowed();\n error AuthOwnerDiscountToken();\n error Deprecated();\n error Erc20QuestAddressNotSet();\n error InvalidMintFee();\n error MsgValueLessThanQuestNFTFee();\n error OverMaxAllowedToMint();\n error QuestFeeTooHigh();\n error QuestIdUsed();\n error QuestNotQueued();\n error QuestNotStarted();\n error QuestEnded();\n error QuestTypeNotSupported();\n error Reentrancy();\n error ReferralFeeTooHigh();\n error ZeroAddressNotAllowed();\n error QuestAddressMismatch();\n error ClaimFailed();\n error txOriginMismatch();\n\n // Structs\n\n // This struct is used in a mapping - only add new fields to the end\n struct NftQuestFees {\n uint256 fee;\n bool exists;\n }\n\n // This struct is used in a mapping - only add new fields to the end\n struct Quest {\n mapping(address => bool) addressMinted;\n address questAddress;\n uint256 totalParticipants;\n uint256 numberMinted;\n string questType;\n uint40 durationTotal;\n address questCreator;\n address mintFeeRecipient;\n string actionType;\n string questName;\n uint32 txHashChainId;\n uint16 referralRewardFee;\n }\n\n struct QuestData {\n address questAddress;\n address rewardToken;\n bool queued;\n uint16 questFee;\n uint256 startTime;\n uint256 endTime;\n uint256 totalParticipants;\n uint256 numberMinted;\n uint256 redeemedTokens;\n uint256 rewardAmountOrTokenId;\n bool hasWithdrawn;\n }\n\n struct QuestJsonData {\n string actionType;\n string questName;\n uint32 txHashChainId;\n }\n\n struct ClaimData {\n string questId;\n bytes32 hashBytes;\n bytes signature;\n address ref;\n address claimer;\n string extraData;\n }\n\n struct ERC20QuestData {\n uint32 txHashChainId;\n address rewardTokenAddress;\n uint256 endTime;\n uint256 startTime;\n uint256 totalParticipants;\n uint256 rewardAmount;\n string questId;\n string actionType;\n string questName;\n string questType;\n string projectName;\n uint16 referralRewardFee;\n }\n\n struct ERC1155QuestData {\n uint32 txHashChainId;\n address rewardTokenAddress;\n uint256 endTime;\n uint256 startTime;\n uint256 totalParticipants;\n uint256 tokenId;\n string questId;\n string actionType;\n string questName;\n string projectName;\n }\n\n // Events\n event ExtraMintFeeReturned(address indexed recipient, uint256 amount);\n event MintFeeSet(uint256 mintFee);\n event NftQuestFeeListSet(address[] addresses, uint256[] fees);\n event NftQuestFeeSet(uint256 nftQuestFee);\n\n event QuestCancelled(address indexed questAddress, string questId, uint256 endsAt);\n\n event QuestClaimedData(\n address indexed recipient,\n address indexed questAddress,\n string extraData\n );\n event Quest1155Claimed(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 tokenId\n );\n event QuestClaimed(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWei\n );\n event QuestClaimedReferred(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWeiOrTokenId,\n address referrer,\n uint16 referralFee,\n uint256 mintFeeEthWei\n );\n event QuestClaimReferred(\n address indexed recipient,\n address indexed questAddress,\n string questId,\n address rewardToken,\n uint256 rewardAmountInWeiOrTokenId,\n address referrer,\n uint16 referralFee,\n uint256 mintFeeEthWei,\n uint256 tokenReferralFee,\n uint256 referralClaimAmount\n );\n event MintFeePaid(\n string questId,\n address rabbitHoleAddress,\n uint256 rabbitHoleAmountWei,\n address questCreatorAddress,\n uint256 questCreatorAmountWei,\n address referrerAddress,\n uint256 referrerAmountWei\n );\n event QuestCreated(\n address indexed creator,\n address indexed contractAddress,\n string projectName,\n string questName,\n string questId,\n string questType,\n string actionType,\n uint32 chainId,\n address rewardToken,\n uint256 endTime,\n uint256 startTime,\n uint256 totalParticipants,\n uint256 rewardAmountOrTokenId\n );\n event ReferralFeeSet(uint16 percent);\n\n // Read Functions\n function getAddressMinted(string memory questId_, address address_) external view returns (bool);\n function getNumberMinted(string memory questId_) external view returns (uint256);\n function questData(string memory questId_) external view returns (QuestData memory);\n function questInfo(string memory questId_) external view returns (address, uint256, uint256);\n function recoverSigner(bytes32 hash_, bytes memory signature_) external view returns (address);\n function mintFee() external view returns (uint256);\n function questJsonData(string memory questId_) external view returns (QuestJsonData memory);\n function buildJsonString(\n bytes32 txHash,\n uint32 txHashChainId,\n string memory actionType,\n string memory questName\n ) external pure returns (string memory);\n function questFee() external view returns (uint16);\n function referralRewardFee() external view returns (uint16);\n \n // Create\n function createERC20Boost(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_\n ) external returns (address);\n function createERC20Quest(\n uint32 txHashChainId_,\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 rewardAmount_,\n string memory questId_,\n string memory actionType_,\n string memory questName_,\n string memory projectName_,\n uint256 referralRewardFee_\n ) external returns (address);\n\n function create1155QuestAndQueue(\n address rewardTokenAddress_,\n uint256 endTime_,\n uint256 startTime_,\n uint256 totalParticipants_,\n uint256 tokenId_,\n string memory questId_,\n string memory\n ) external payable returns (address);\n\n function claimOptimized(bytes calldata signature_, bytes calldata data_) external payable;\n\n function cancelQuest(string calldata questId_) external;\n\n // Set\n function setClaimSignerAddress(address claimSignerAddress_) external;\n function setErc1155QuestAddress(address erc1155QuestAddress_) external;\n function setErc20QuestAddress(address erc20QuestAddress_) external;\n function setMintFee(uint256 mintFee_) external;\n function setDefaultMintFeeRecipient(address mintFeeRecipient_) external;\n function setProtocolFeeRecipient(address protocolFeeRecipient_) external;\n function setQuestFee(uint16 questFee_) external;\n\n // Callbacks\n function withdrawCallback(string calldata questId_, address protocolFeeRecipient_, uint protocolPayout_, address mintFeeRecipient_, uint mintPayout) external;\n}"},"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] calldata accounts,\n uint256[] calldata ids\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"},"lib/openzeppelin-contracts/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"},"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"},"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n"},"lib/solady/src/utils/SafeTransferLib.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\n/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)\n///\n/// @dev Note:\n/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.\n/// - For ERC20s, this implementation won't check that a token has code,\n/// responsibility is delegated to the caller.\nlibrary SafeTransferLib {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ETH transfer has failed.\n error ETHTransferFailed();\n\n /// @dev The ERC20 `transferFrom` has failed.\n error TransferFromFailed();\n\n /// @dev The ERC20 `transfer` has failed.\n error TransferFailed();\n\n /// @dev The ERC20 `approve` has failed.\n error ApproveFailed();\n\n /// @dev The Permit2 operation has failed.\n error Permit2Failed();\n\n /// @dev The Permit2 amount must be less than `2**160 - 1`.\n error Permit2AmountOverflow();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.\n uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;\n\n /// @dev Suggested gas stipend for contract receiving ETH to perform a few\n /// storage reads and writes, but low enough to prevent griefing.\n uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;\n\n /// @dev The unique EIP-712 domain domain separator for the DAI token contract.\n bytes32 internal constant DAI_DOMAIN_SEPARATOR =\n 0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;\n\n /// @dev The address for the WETH9 contract on Ethereum mainnet.\n address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n\n /// @dev The canonical Permit2 address.\n /// [Github](https://github.com/Uniswap/permit2)\n /// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)\n address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ETH OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.\n //\n // The regular variants:\n // - Forwards all remaining gas to the target.\n // - Reverts if the target reverts.\n // - Reverts if the current contract has insufficient balance.\n //\n // The force variants:\n // - Forwards with an optional gas stipend\n // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).\n // - If the target reverts, or if the gas stipend is exhausted,\n // creates a temporary contract to force send the ETH via `SELFDESTRUCT`.\n // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.\n // - Reverts if the current contract has insufficient balance.\n //\n // The try variants:\n // - Forwards with a mandatory gas stipend.\n // - Instead of reverting, returns whether the transfer succeeded.\n\n /// @dev Sends `amount` (in wei) ETH to `to`.\n function safeTransferETH(address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Sends all the ETH in the current contract to `to`.\n function safeTransferAllETH(address to) internal {\n /// @solidity memory-safe-assembly\n assembly {\n // Transfer all the ETH and check if it succeeded or not.\n if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if lt(selfbalance(), amount) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.\n function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.\n function forceSafeTransferETH(address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n if lt(selfbalance(), amount) {\n mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.\n revert(0x1c, 0x04)\n }\n if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.\n function forceSafeTransferAllETH(address to) internal {\n /// @solidity memory-safe-assembly\n assembly {\n // forgefmt: disable-next-item\n if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {\n mstore(0x00, to) // Store the address in scratch space.\n mstore8(0x0b, 0x73) // Opcode `PUSH20`.\n mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.\n if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.\n }\n }\n }\n\n /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.\n function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)\n }\n }\n\n /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.\n function trySafeTransferAllETH(address to, uint256 gasStipend)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC20 OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n /// Reverts upon failure.\n ///\n /// The `from` account must have at least `amount` approved for\n /// the current contract to manage.\n function safeTransferFrom(address token, address from, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x60, amount) // Store the `amount` argument.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n ///\n /// The `from` account must have at least `amount` approved for the current contract to manage.\n function trySafeTransferFrom(address token, address from, address to, uint256 amount)\n internal\n returns (bool success)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x60, amount) // Store the `amount` argument.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.\n success :=\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends all of ERC20 `token` from `from` to `to`.\n /// Reverts upon failure.\n ///\n /// The `from` account must have their entire balance approved for the current contract to manage.\n function safeTransferAllFrom(address token, address from, address to)\n internal\n returns (uint256 amount)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40) // Cache the free memory pointer.\n mstore(0x40, to) // Store the `to` argument.\n mstore(0x2c, shl(96, from)) // Store the `from` argument.\n mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\n // Read the balance, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.\n amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x7939f424) // `TransferFromFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x60, 0) // Restore the zero slot to zero.\n mstore(0x40, m) // Restore the free memory pointer.\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.\n /// Reverts upon failure.\n function safeTransfer(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sends all of ERC20 `token` from the current contract to `to`.\n /// Reverts upon failure.\n function safeTransferAll(address token, address to) internal returns (uint256 amount) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.\n mstore(0x20, address()) // Store the address of the current contract.\n // Read the balance, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x14, to) // Store the `to` argument.\n amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.\n mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.\n // Perform the transfer, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x90b8ec18) // `TransferFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n /// Reverts upon failure.\n function safeApprove(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n // Perform the approval, reverting upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n revert(0x1c, 0x04)\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.\n /// If the initial attempt to approve fails, attempts to reset the approved amount to zero,\n /// then retries the approval again (some tokens, e.g. USDT, requires this).\n /// Reverts upon failure.\n function safeApproveWithRetry(address token, address to, uint256 amount) internal {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, to) // Store the `to` argument.\n mstore(0x34, amount) // Store the `amount` argument.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n // Perform the approval, retrying upon failure.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x34, 0) // Store 0 for the `amount`.\n mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.\n pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.\n mstore(0x34, amount) // Store back the original `amount`.\n // Retry the approval, reverting upon failure.\n if iszero(\n and(\n or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.\n call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)\n )\n ) {\n mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.\n revert(0x1c, 0x04)\n }\n }\n mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.\n }\n }\n\n /// @dev Returns the amount of ERC20 `token` owned by `account`.\n /// Returns zero if the `token` does not exist.\n function balanceOf(address token, address account) internal view returns (uint256 amount) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x14, account) // Store the `account` argument.\n mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.\n amount :=\n mul( // The arguments of `mul` are evaluated from right to left.\n mload(0x20),\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x1f), // At least 32 bytes returned.\n staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)\n )\n )\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.\n /// If the initial attempt fails, try to use Permit2 to transfer the token.\n /// Reverts upon failure.\n ///\n /// The `from` account must have at least `amount` approved for the current contract to manage.\n function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {\n if (!trySafeTransferFrom(token, from, to, amount)) {\n permit2TransferFrom(token, from, to, amount);\n }\n }\n\n /// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.\n /// Reverts upon failure.\n function permit2TransferFrom(address token, address from, address to, uint256 amount)\n internal\n {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40)\n mstore(add(m, 0x74), shr(96, shl(96, token)))\n mstore(add(m, 0x54), amount)\n mstore(add(m, 0x34), to)\n mstore(add(m, 0x20), shl(96, from))\n // `transferFrom(address,address,uint160,address)`.\n mstore(m, 0x36c78516000000000000000000000000)\n let p := PERMIT2\n let exists := eq(chainid(), 1)\n if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }\n if iszero(and(call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00), exists)) {\n mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.\n revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)\n }\n }\n }\n\n /// @dev Permit a user to spend a given amount of\n /// another user's tokens via native EIP-2612 permit if possible, falling\n /// back to Permit2 if native permit fails or is not implemented on the token.\n function permit2(\n address token,\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n bool success;\n /// @solidity memory-safe-assembly\n assembly {\n for {} shl(96, xor(token, WETH9)) {} {\n mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.\n // Gas stipend to limit gas burn for tokens that don't refund gas when\n // an non-existing function is called. 5K should be enough for a SLOAD.\n staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)\n )\n ) { break }\n // After here, we can be sure that token is a contract.\n let m := mload(0x40)\n mstore(add(m, 0x34), spender)\n mstore(add(m, 0x20), shl(96, owner))\n mstore(add(m, 0x74), deadline)\n if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {\n mstore(0x14, owner)\n mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.\n mstore(add(m, 0x94), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))\n mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.\n // `nonces` is already at `add(m, 0x54)`.\n // `1` is already stored at `add(m, 0x94)`.\n mstore(add(m, 0xb4), and(0xff, v))\n mstore(add(m, 0xd4), r)\n mstore(add(m, 0xf4), s)\n success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)\n break\n }\n mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.\n mstore(add(m, 0x54), amount)\n mstore(add(m, 0x94), and(0xff, v))\n mstore(add(m, 0xb4), r)\n mstore(add(m, 0xd4), s)\n success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)\n break\n }\n }\n if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);\n }\n\n /// @dev Simple permit on the Permit2 contract.\n function simplePermit2(\n address token,\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let m := mload(0x40)\n mstore(m, 0x927da105) // `allowance(address,address,address)`.\n {\n let addressMask := shr(96, not(0))\n mstore(add(m, 0x20), and(addressMask, owner))\n mstore(add(m, 0x40), and(addressMask, token))\n mstore(add(m, 0x60), and(addressMask, spender))\n mstore(add(m, 0xc0), and(addressMask, spender))\n }\n let p := mul(PERMIT2, iszero(shr(160, amount)))\n if iszero(\n and( // The arguments of `and` are evaluated from right to left.\n gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.\n staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)\n )\n ) {\n mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.\n revert(add(0x18, shl(2, iszero(p))), 0x04)\n }\n mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).\n // `owner` is already `add(m, 0x20)`.\n // `token` is already at `add(m, 0x40)`.\n mstore(add(m, 0x60), amount)\n mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.\n // `nonce` is already at `add(m, 0xa0)`.\n // `spender` is already at `add(m, 0xc0)`.\n mstore(add(m, 0xe0), deadline)\n mstore(add(m, 0x100), 0x100) // `signature` offset.\n mstore(add(m, 0x120), 0x41) // `signature` length.\n mstore(add(m, 0x140), r)\n mstore(add(m, 0x160), s)\n mstore(add(m, 0x180), shl(248, v))\n if iszero(call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00)) {\n mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.\n revert(0x1c, 0x04)\n }\n }\n }\n}\n"},"lib/solady/src/utils/ReentrancyGuard.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Reentrancy guard mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ReentrancyGuard.sol)\nabstract contract ReentrancyGuard {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Unauthorized reentrant call.\n error Reentrancy();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to: `uint72(bytes9(keccak256(\"_REENTRANCY_GUARD_SLOT\")))`.\n /// 9 bytes is large enough to avoid collisions with lower slots,\n /// but not too large to result in excessive bytecode bloat.\n uint256 private constant _REENTRANCY_GUARD_SLOT = 0x929eee149b4bd21268;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* REENTRANCY GUARD */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Guards a function from reentrancy.\n modifier nonReentrant() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n if eq(sload(_REENTRANCY_GUARD_SLOT), address()) {\n mstore(0x00, 0xab143c06) // `Reentrancy()`.\n revert(0x1c, 0x04)\n }\n sstore(_REENTRANCY_GUARD_SLOT, address())\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n sstore(_REENTRANCY_GUARD_SLOT, codesize())\n }\n }\n\n /// @dev Guards a view function from read-only reentrancy.\n modifier nonReadReentrant() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n if eq(sload(_REENTRANCY_GUARD_SLOT), address()) {\n mstore(0x00, 0xab143c06) // `Reentrancy()`.\n revert(0x1c, 0x04)\n }\n }\n _;\n }\n}\n"},"contracts/references/Budget.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {Ownable} from \"solady/auth/Ownable.sol\";\nimport {Receiver} from \"solady/accounts/Receiver.sol\";\nimport {SafeTransferLib} from \"solady/utils/SafeTransferLib.sol\";\n\nimport {BoostError} from \"contracts/references/BoostError.sol\";\nimport {Cloneable} from \"contracts/references/Cloneable.sol\";\n\n/// @title Boost Budget\n/// @notice Abstract contract for a generic Budget within the Boost protocol\n/// @dev Budget classes are expected to implement the allocation, reclamation, and disbursement of assets.\n/// @dev WARNING: Budgets currently support only ETH, ERC20, and ERC1155 assets. Other asset types may be added in the future.\nabstract contract Budget is Ownable, Cloneable, Receiver {\n using SafeTransferLib for address;\n\n enum AssetType {\n ETH,\n ERC20,\n ERC1155\n }\n\n /// @notice A struct representing the inputs for an allocation\n /// @param assetType The type of asset to allocate\n /// @param asset The address of the asset to allocate\n /// @param target The address of the payee or payer (from or to, depending on the operation)\n /// @param data The implementation-specific data for the allocation (amount, token ID, etc.)\n struct Transfer {\n AssetType assetType;\n address asset;\n address target;\n bytes data;\n }\n\n /// @notice The payload for an ETH or ERC20 transfer\n /// @param amount The amount of the asset to transfer\n struct FungiblePayload {\n uint256 amount;\n }\n\n /// @notice The payload for an ERC1155 transfer\n /// @param tokenId The ID of the token to transfer\n /// @param amount The amount of the token to transfer\n /// @param data Any additional data to forward to the ERC1155 contract\n struct ERC1155Payload {\n uint256 tokenId;\n uint256 amount;\n bytes data;\n }\n\n /// @notice Emitted when an address's authorization status changes\n event Authorized(address indexed account, bool isAuthorized);\n\n /// @notice Emitted when assets are distributed from the budget\n event Distributed(address indexed asset, address to, uint256 amount);\n\n /// @notice Thrown when the allocation is invalid\n error InvalidAllocation(address asset, uint256 amount);\n\n /// @notice Thrown when there are insufficient funds for an operation\n error InsufficientFunds(address asset, uint256 available, uint256 required);\n\n /// @notice Thrown when the length of two arrays are not equal\n error LengthMismatch();\n\n /// @notice Thrown when a transfer fails for an unknown reason\n error TransferFailed(address asset, address to, uint256 amount);\n\n /// @notice Initialize the budget and set the owner\n /// @dev The owner is set to the contract deployer\n constructor() {\n _initializeOwner(msg.sender);\n }\n\n /// @notice Allocate assets to the budget\n /// @param data_ The compressed data for the allocation (amount, token address, token ID, etc.)\n /// @return True if the allocation was successful\n function allocate(bytes calldata data_) external payable virtual returns (bool);\n\n /// @notice Reclaim assets from the budget\n /// @param data_ The compressed data for the reclamation (amount, token address, token ID, etc.)\n /// @return True if the reclamation was successful\n function reclaim(bytes calldata data_) external virtual returns (bool);\n\n /// @notice Disburse assets from the budget to a single recipient\n /// @param data_ The compressed {Transfer} request\n /// @return True if the disbursement was successful\n function disburse(bytes calldata data_) external virtual returns (bool);\n\n /// @notice Disburse assets from the budget to multiple recipients\n /// @param data_ The array of compressed {Transfer} requests\n /// @return True if all disbursements were successful\n function disburseBatch(bytes[] calldata data_) external virtual returns (bool);\n\n /// @notice Get the total amount of assets allocated to the budget, including any that have been distributed\n /// @param asset_ The address of the asset\n /// @return The total amount of assets\n function total(address asset_) external view virtual returns (uint256);\n\n /// @notice Get the amount of assets available for distribution from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets available\n function available(address asset_) external view virtual returns (uint256);\n\n /// @notice Get the amount of assets that have been distributed from the budget\n /// @param asset_ The address of the asset\n /// @return The amount of assets distributed\n function distributed(address asset_) external view virtual returns (uint256);\n\n /// @notice Reconcile the budget to ensure the known state matches the actual state\n /// @param data_ The compressed data for the reconciliation (amount, token address, token ID, etc.)\n /// @return The amount of assets reconciled\n function reconcile(bytes calldata data_) external virtual returns (uint256);\n\n /// @inheritdoc Cloneable\n function supportsInterface(bytes4 interfaceId) public view virtual override(Cloneable) returns (bool) {\n return interfaceId == type(Budget).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /// @notice Set the authorized status of the given accounts\n /// @param accounts_ The accounts to authorize or deauthorize\n /// @param isAuthorized_ The authorization status for the given accounts\n /// @dev The mechanism for managing authorization is left to the implementing contract\n function setAuthorized(address[] calldata accounts_, bool[] calldata isAuthorized_) external virtual;\n\n /// @notice Check if the given account is authorized to use the budget\n /// @param account_ The account to check\n /// @return True if the account is authorized\n /// @dev The mechanism for checking authorization is left to the implementing contract\n function isAuthorized(address account_) external view virtual returns (bool);\n\n /// @inheritdoc Receiver\n receive() external payable virtual override {\n return;\n }\n\n /// @inheritdoc Receiver\n fallback() external payable virtual override {\n return;\n }\n}"},"contracts/references/Cloneable.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\nimport {Initializable} from \"solady/utils/Initializable.sol\";\nimport {ERC165} from \"openzeppelin-contracts/utils/introspection/ERC165.sol\";\n\n/// @title Cloneable\n/// @notice A contract that can be cloned and initialized only once\nabstract contract Cloneable is Initializable, ERC165 {\n /// @notice Thrown when an inheriting contract does not implement the initializer function\n error InitializerNotImplemented();\n\n /// @notice Thrown when the provided initialization data is invalid\n /// @dev This error indicates that the given data is not valid for the implementation (i.e. does not decode to the expected types)\n error InvalidInitializationData();\n\n /// @notice Thrown when the contract has already been initialized\n error CloneAlreadyInitialized();\n\n /// @notice A modifier to restrict a function to only be called before initialization\n /// @dev This is intended to enforce that a function can only be called before the contract has been initialized\n modifier onlyBeforeInitialization() {\n if (_getInitializedVersion() != 0) revert CloneAlreadyInitialized();\n _;\n }\n\n /// @notice Initialize the clone with the given arbitrary data\n /// @param - The compressed initialization data (if required)\n /// @dev The data is expected to be ABI encoded bytes compressed using {LibZip-cdCompress}\n /// @dev All implementations must override this function to initialize the contract\n function initialize(bytes calldata) public virtual initializer {\n revert InitializerNotImplemented();\n }\n\n /// @inheritdoc ERC165\n /// @notice Check if the contract supports the given interface\n /// @param interfaceId The interface identifier\n /// @return True if the contract supports the interface\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(Cloneable).interfaceId || super.supportsInterface(interfaceId);\n }\n}"},"lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"},"lib/openzeppelin-contracts/contracts/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/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.8.0/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(address target, bytes memory data, uint256 value) 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"},"lib/solady/src/auth/Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)\n///\n/// @dev Note:\n/// This implementation does NOT auto-initialize the owner to `msg.sender`.\n/// You MUST call the `_initializeOwner` in the constructor / initializer.\n///\n/// While the ownable portion follows\n/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,\n/// the nomenclature for the 2-step ownership handover may be unique to this codebase.\nabstract contract Ownable {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The caller is not authorized to call the function.\n error Unauthorized();\n\n /// @dev The `newOwner` cannot be the zero address.\n error NewOwnerIsZeroAddress();\n\n /// @dev The `pendingOwner` does not have a valid handover request.\n error NoHandoverRequest();\n\n /// @dev Cannot double-initialize.\n error AlreadyInitialized();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ownership is transferred from `oldOwner` to `newOwner`.\n /// This event is intentionally kept the same as OpenZeppelin's Ownable to be\n /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),\n /// despite it not being as lightweight as a single argument event.\n event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);\n\n /// @dev An ownership handover to `pendingOwner` has been requested.\n event OwnershipHandoverRequested(address indexed pendingOwner);\n\n /// @dev The ownership handover to `pendingOwner` has been canceled.\n event OwnershipHandoverCanceled(address indexed pendingOwner);\n\n /// @dev `keccak256(bytes(\"OwnershipTransferred(address,address)\"))`.\n uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =\n 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverRequested(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =\n 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;\n\n /// @dev `keccak256(bytes(\"OwnershipHandoverCanceled(address)\"))`.\n uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =\n 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The owner slot is given by:\n /// `bytes32(~uint256(uint32(bytes4(keccak256(\"_OWNER_SLOT_NOT\")))))`.\n /// It is intentionally chosen to be a high value\n /// to avoid collision with lower slots.\n /// The choice of manual storage layout is to enable compatibility\n /// with both regular and upgradeable contracts.\n bytes32 internal constant _OWNER_SLOT =\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;\n\n /// The ownership handover slot of `newOwner` is given by:\n /// ```\n /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))\n /// let handoverSlot := keccak256(0x00, 0x20)\n /// ```\n /// It stores the expiry timestamp of the two-step ownership handover.\n uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.\n function _guardInitializeOwner() internal pure virtual returns (bool guard) {}\n\n /// @dev Initializes the owner directly without authorization guard.\n /// This function must be called upon initialization,\n /// regardless of whether the contract is upgradeable or not.\n /// This is to enable generalization to both regular and upgradeable contracts,\n /// and to save gas in case the initial owner is not the caller.\n /// For performance reasons, this function will not check if there\n /// is an existing owner.\n function _initializeOwner(address newOwner) internal virtual {\n if (_guardInitializeOwner()) {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n if sload(ownerSlot) {\n mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.\n revert(0x1c, 0x04)\n }\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Store the new value.\n sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n }\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Store the new value.\n sstore(_OWNER_SLOT, newOwner)\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)\n }\n }\n }\n\n /// @dev Sets the owner directly without authorization guard.\n function _setOwner(address newOwner) internal virtual {\n if (_guardInitializeOwner()) {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n // Store the new value.\n sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))\n }\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n let ownerSlot := _OWNER_SLOT\n // Clean the upper 96 bits.\n newOwner := shr(96, shl(96, newOwner))\n // Emit the {OwnershipTransferred} event.\n log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)\n // Store the new value.\n sstore(ownerSlot, newOwner)\n }\n }\n }\n\n /// @dev Throws if the sender is not the owner.\n function _checkOwner() internal view virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // If the caller is not the stored owner, revert.\n if iszero(eq(caller(), sload(_OWNER_SLOT))) {\n mstore(0x00, 0x82b42900) // `Unauthorized()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Returns how long a two-step ownership handover is valid for in seconds.\n /// Override to return a different value if needed.\n /// Made internal to conserve bytecode. Wrap it in a public function if needed.\n function _ownershipHandoverValidFor() internal view virtual returns (uint64) {\n return 48 * 3600;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC UPDATE FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Allows the owner to transfer the ownership to `newOwner`.\n function transferOwnership(address newOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(shl(96, newOwner)) {\n mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.\n revert(0x1c, 0x04)\n }\n }\n _setOwner(newOwner);\n }\n\n /// @dev Allows the owner to renounce their ownership.\n function renounceOwnership() public payable virtual onlyOwner {\n _setOwner(address(0));\n }\n\n /// @dev Request a two-step ownership handover to the caller.\n /// The request will automatically expire in 48 hours (172800 seconds) by default.\n function requestOwnershipHandover() public payable virtual {\n unchecked {\n uint256 expires = block.timestamp + _ownershipHandoverValidFor();\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to `expires`.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), expires)\n // Emit the {OwnershipHandoverRequested} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())\n }\n }\n }\n\n /// @dev Cancels the two-step ownership handover to the caller, if any.\n function cancelOwnershipHandover() public payable virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x20), 0)\n // Emit the {OwnershipHandoverCanceled} event.\n log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())\n }\n }\n\n /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.\n /// Reverts if there is no existing ownership handover requested by `pendingOwner`.\n function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute and set the handover slot to 0.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n let handoverSlot := keccak256(0x0c, 0x20)\n // If the handover does not exist, or has expired.\n if gt(timestamp(), sload(handoverSlot)) {\n mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.\n revert(0x1c, 0x04)\n }\n // Set the handover slot to 0.\n sstore(handoverSlot, 0)\n }\n _setOwner(pendingOwner);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PUBLIC READ FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the owner of the contract.\n function owner() public view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := sload(_OWNER_SLOT)\n }\n }\n\n /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.\n function ownershipHandoverExpiresAt(address pendingOwner)\n public\n view\n virtual\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n // Compute the handover slot.\n mstore(0x0c, _HANDOVER_SLOT_SEED)\n mstore(0x00, pendingOwner)\n // Load the handover slot.\n result := sload(keccak256(0x0c, 0x20))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* MODIFIERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Marks a function as only callable by the owner.\n modifier onlyOwner() virtual {\n _checkOwner();\n _;\n }\n}\n"},"lib/solady/src/accounts/Receiver.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Receiver mixin for ETH and safe-transferred ERC721 and ERC1155 tokens.\n/// @author Solady (https://github.com/Vectorized/solady/blob/main/src/accounts/Receiver.sol)\n///\n/// @dev Note:\n/// - Handles all ERC721 and ERC1155 token safety callbacks.\n/// - Collapses function table gas overhead and code size.\n/// - Utilizes fallback so unknown calldata will pass on.\nabstract contract Receiver {\n /// @dev For receiving ETH.\n receive() external payable virtual {}\n\n /// @dev Fallback function with the `receiverFallback` modifier.\n fallback() external payable virtual receiverFallback {}\n\n /// @dev Modifier for the fallback function to handle token callbacks.\n modifier receiverFallback() virtual {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, calldataload(0))\n // 0x150b7a02: `onERC721Received(address,address,uint256,bytes)`.\n // 0xf23a6e61: `onERC1155Received(address,address,uint256,uint256,bytes)`.\n // 0xbc197c81: `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n if or(eq(s, 0x150b7a02), or(eq(s, 0xf23a6e61), eq(s, 0xbc197c81))) {\n mstore(0x20, s) // Store `msg.sig`.\n return(0x3c, 0x20) // Return `msg.sig`.\n }\n }\n _;\n }\n}\n"},"contracts/references/BoostError.sol":{"content":"// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.19;\n\n/// @title BoostError\n/// @notice Standardized errors for the Boost protocol\n/// @dev Some of these errors are introduced by third-party libraries, rather than Boost contracts directly, and are copied here for clarity and ease of testing.\nlibrary BoostError {\n /// @notice Thrown when a claim attempt fails\n error ClaimFailed(address caller, bytes data);\n\n /// @notice Thrown when there are insufficient funds for an operation\n error InsufficientFunds(address asset, uint256 available, uint256 required);\n\n /// @notice Thrown when a non-conforming instance for a given type is encountered\n error InvalidInstance(bytes4 expectedInterface, address instance);\n\n /// @notice Thrown when an invalid initialization is attempted\n error InvalidInitialization();\n\n /// @notice Thrown when the length of two arrays are not equal\n error LengthMismatch();\n\n /// @notice Thrown when a method is not implemented\n error NotImplemented();\n\n /// @notice Thrown when a previously used signature is replayed\n error Replayed(address signer, bytes32 hash, bytes signature);\n\n /// @notice Thrown when a transfer fails for an unknown reason\n error TransferFailed(address asset, address to, uint256 amount);\n\n /// @notice Thrown when the requested action is unauthorized\n error Unauthorized();\n}"},"lib/solady/src/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Initializable mixin for the upgradeable contracts.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Initializable.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/proxy/utils/Initializable.sol)\nabstract contract Initializable {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The contract is already initialized.\n error InvalidInitialization();\n\n /// @dev The contract is not initializing.\n error NotInitializing();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Triggered when the contract has been initialized.\n event Initialized(uint64 version);\n\n /// @dev `keccak256(bytes(\"Initialized(uint64)\"))`.\n bytes32 private constant _INTIALIZED_EVENT_SIGNATURE =\n 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The default initializable slot is given by:\n /// `bytes32(~uint256(uint32(bytes4(keccak256(\"_INITIALIZABLE_SLOT\")))))`.\n ///\n /// Bits Layout:\n /// - [0] `initializing`\n /// - [1..64] `initializedVersion`\n bytes32 private constant _INITIALIZABLE_SLOT =\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffbf601132;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override to return a custom storage slot if required.\n function _initializableSlot() internal pure virtual returns (bytes32) {\n return _INITIALIZABLE_SLOT;\n }\n\n /// @dev Guards an initializer function so that it can be invoked at most once.\n ///\n /// You can guard a function with `onlyInitializing` such that it can be called\n /// through a function guarded with `initializer`.\n ///\n /// This is similar to `reinitializer(1)`, except that in the context of a constructor,\n /// an `initializer` guarded function can be invoked multiple times.\n /// This can be useful during testing and is not expected to be used in production.\n ///\n /// Emits an {Initialized} event.\n modifier initializer() virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n let i := sload(s)\n // Set `initializing` to 1, `initializedVersion` to 1.\n sstore(s, 3)\n // If `!(initializing == 0 && initializedVersion == 0)`.\n if i {\n // If `!(address(this).code.length == 0 && initializedVersion == 1)`.\n if iszero(lt(extcodesize(address()), eq(shr(1, i), 1))) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n s := shl(shl(255, i), s) // Skip initializing if `initializing == 1`.\n }\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n if s {\n // Set `initializing` to 0, `initializedVersion` to 1.\n sstore(s, 2)\n // Emit the {Initialized} event.\n mstore(0x20, 1)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n }\n\n /// @dev Guards an reinitialzer function so that it can be invoked at most once.\n ///\n /// You can guard a function with `onlyInitializing` such that it can be called\n /// through a function guarded with `reinitializer`.\n ///\n /// Emits an {Initialized} event.\n modifier reinitializer(uint64 version) virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n version := and(version, 0xffffffffffffffff) // Clean upper bits.\n let i := sload(s)\n // If `initializing == 1 || initializedVersion >= version`.\n if iszero(lt(and(i, 1), lt(shr(1, i), version))) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n // Set `initializing` to 1, `initializedVersion` to `version`.\n sstore(s, or(1, shl(1, version)))\n }\n _;\n /// @solidity memory-safe-assembly\n assembly {\n // Set `initializing` to 0, `initializedVersion` to `version`.\n sstore(s, shl(1, version))\n // Emit the {Initialized} event.\n mstore(0x20, version)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n\n /// @dev Guards a function such that it can only be called in the scope\n /// of a function guarded with `initializer` or `reinitializer`.\n modifier onlyInitializing() virtual {\n _checkInitializing();\n _;\n }\n\n /// @dev Reverts if the contract is not initializing.\n function _checkInitializing() internal view virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(and(1, sload(s))) {\n mstore(0x00, 0xd7e6bcf8) // `NotInitializing()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Locks any future initializations by setting the initialized version to `2**64 - 1`.\n ///\n /// Calling this in the constructor will prevent the contract from being initialized\n /// or reinitialized. It is recommended to use this to lock implementation contracts\n /// that are designed to be called through proxies.\n ///\n /// Emits an {Initialized} event the first time it is successfully called.\n function _disableInitializers() internal virtual {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n let i := sload(s)\n if and(i, 1) {\n mstore(0x00, 0xf92ee8a9) // `InvalidInitialization()`.\n revert(0x1c, 0x04)\n }\n let uint64max := shr(192, s) // Computed to save bytecode.\n if iszero(eq(shr(1, i), uint64max)) {\n // Set `initializing` to 0, `initializedVersion` to `2**64 - 1`.\n sstore(s, shl(1, uint64max))\n // Emit the {Initialized} event.\n mstore(0x20, uint64max)\n log1(0x20, 0x20, _INTIALIZED_EVENT_SIGNATURE)\n }\n }\n }\n\n /// @dev Returns the highest version that has been initialized.\n function _getInitializedVersion() internal view virtual returns (uint64 version) {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n version := shr(1, sload(s))\n }\n }\n\n /// @dev Returns whether the contract is currently initializing.\n function _isInitializing() internal view virtual returns (bool result) {\n bytes32 s = _initializableSlot();\n /// @solidity memory-safe-assembly\n assembly {\n result := and(1, sload(s))\n }\n }\n}\n"},"lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"}},"settings":{"remappings":["forge-std/=lib/forge-std/src/","solady/=lib/solady/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/=node_modules/@openzeppelin/","@openzeppelin/contracts/=lib/v2-core/lib/openzeppelin-contracts/contracts/","@prb/=node_modules/@prb/","@prb/math/=lib/v2-core/lib/prb-math/","@prb/test/=lib/v2-core/lib/prb-test/src/","@sablier/=node_modules/@sablier/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","eth-gas-reporter/=node_modules/eth-gas-reporter/","hardhat-deploy/=node_modules/hardhat-deploy/","hardhat/=node_modules/hardhat/","openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/","prb-math/=lib/v2-core/lib/prb-math/src/","prb-test/=lib/v2-core/lib/prb-test/src/","solarray/=lib/v2-core/lib/solarray/src/","v2-core/=lib/v2-core/"],"optimizer":{"enabled":true,"runs":1000},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"outputSelection":{"*":{"":["ast"],"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"]}},"evmVersion":"paris","viaIR":true,"libraries":{}}} diff --git a/broadcast/QuestBudget.s.sol/10/run-latest.json b/broadcast/QuestBudget.s.sol/10/run-latest.json index 26779b87..834ba80e 100644 --- a/broadcast/QuestBudget.s.sol/10/run-latest.json +++ b/broadcast/QuestBudget.s.sol/10/run-latest.json @@ -1,57 +1,57 @@ { "transactions": [ { - "hash": "0x41b2d6d41cb0d58402b95c7efcdc9289bef5bcfef3486fcd5e43abaaf5d7be0c", + "hash": "0x4fffdd06bc3ce7a29cf42b46c9076c7f7c7bee18e44242a91a62f134dead2dc5", "transactionType": "CREATE", "contractName": "QuestBudget", - "contractAddress": "0xf843cebab292240892f7030b744f7327c43db845", + "contractAddress": "0x04131c2f15631b57a9369b9424981264ad69355e", "function": null, "arguments": null, "transaction": { "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", - "gas": "0x288dc8", + "gas": "0x33766b", "value": "0x0", - "input": "0x608080604052346100b95733638b78c6d819553360007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a363409feecd19805490600182166100ab576001600160401b039160011c6002600160401b031901610071575b61233083816100bf8239f35b6002600160411b03905560209081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080a13880610065565b63f92ee8a96000526004601cfd5b600080fdfe608080604052600436101561001a575b50361561001857005b005b600090813560e01c90816301ffc9a71461105e5750806310098ad51461103a57806319cbad06146110155780631c9fd0c314610fcb5780632569296214610f805780634359d28a14610e90578063439fab9114610c60578063451cc19114610c2157806354d1f13d14610bdb578063578bcf3514610ba35780635aef467a14610b6b57806361400c9914610b2e578063627bbbaa14610ac1578063715018a614610a7b578063774c33ab14610a395780638da5cb5b14610a0e57806392f5e0eb146109e8578063bc197c8114610943578063d2514e84146108ff578063de0580dc14610569578063e15cfcf5146104a1578063f04e283e14610420578063f1c30ec0146103db578063f23a6e6114610367578063f2fde38b146102f9578063f8724aba146102d1578063f9a802c31461020d578063fa4ca9b1146101d0578063fe9fbb80146101a25763fee81cf40361000f573461019f57602036600319011261019f57610186611164565b9063389a75e1600c5252602080600c2054604051908152f35b80fd5b503461019f57602036600319011261019f5760206101c66101c1611164565b6121de565b6040519015158152f35b503461019f57602036600319011261019f576004359067ffffffffffffffff821161019f5760206101c661020736600486016111d5565b90611c96565b503461019f57604036600319011261019f57610227611164565b604051627eeac760e11b81523060048201526024803590820181905260209390926001600160a01b03168483604481845afa9283156102c657829361028e575b5090610286936040928252600286528282209082528552205490611c89565b604051908152f35b919092508482813d83116102bf575b6102a78183611249565b810103126102ba57905191610286610267565b600080fd5b503d61029d565b6040513d84823e3d90fd5b503461019f57604036600319011261019f5760206102866102f0611164565b60243590612233565b50602036600319011261019f5761030e611164565b6103166122ae565b8060601b1561035a576001600160a01b0316638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35580f35b637448fbae82526004601cfd5b503461019f5760a036600319011261019f57610381611164565b5061038a61117a565b5060843567ffffffffffffffff81116103d7576103ab9036906004016111d5565b505060206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b5080fd5b503461019f57602036600319011261019f576004359067ffffffffffffffff821161019f5760206101c661041236600486016111d5565b9061041b6122ae565b6117ee565b50602036600319011261019f57610435611164565b61043d6122ae565b63389a75e1600c528082526020600c20805442116104945790826001600160a01b03925516638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35580f35b636f5e881883526004601cfd5b503461019f57602036600319011261019f578060043567ffffffffffffffff8111610566576104d49036906004016111d5565b91906104de6122ae565b6001600160a01b03825416803b156105625783918360446040518097819682957fe15cfcf500000000000000000000000000000000000000000000000000000000845260206004850152816024850152848401378181018301849052601f01601f191681010301925af180156102c657610556575080f35b61055f90611235565b80f35b8280fd5b50fd5b503461019f5761016036600319011261019f5760043563ffffffff811681036103d75761059461117a565b9067ffffffffffffffff9060c4358281116108fb576105b79036906004016112be565b9160e4358181116108f7576105d09036906004016112be565b90610104358181116108f3576105ea9036906004016112be565b90610124359081116108f3576106049036906004016112be565b9161060e336121de565b156108c95761062160a435608435611c5c565b6001600160a01b0388541690604051907f67dfa3e7000000000000000000000000000000000000000000000000000000008252602082600481865afa9182156108be578a9261089d575b506040517f17a7e45e000000000000000000000000000000000000000000000000000000008152602081600481875afa8015610892576106dd936106d8928d92610861575b506106d161271091826106c861ffff80931688611c5c565b04931685611c5c565b0492611c89565b611c89565b906014526034526f095ea7b3000000000000000000000000875260208760446010828a5af13d156001895114171615610854576001600160a01b0395936107df602096946107cc63ffffffff956107b98c96876034526107a78d8954169a6040519e8f9d8e9c8d9b7fde0580dc000000000000000000000000000000000000000000000000000000008d521660048c01521660248a015260443560448a015260643560648a015260843560848a015260a43560a48a015261016060c48a015261016489019061145c565b8781036003190160e48901529061145c565b858103600319016101048701529061145c565b838103600319016101248501529061145c565b61014480359083015203925af19081156102c657829161080e575b6020826001600160a01b0360405191168152f35b90506020813d60201161084c575b8161082960209383611249565b810103126103d757516001600160a01b03811681036103d75760209150386107fa565b3d915061081c565b633e3f8f7387526004601cfd5b61088491925060203d60201161088b575b61087c8183611249565b810190611c6f565b90386106b0565b503d610872565b6040513d8d823e3d90fd5b6108b791925060203d60201161088b5761087c8183611249565b903861066b565b6040513d8c823e3d90fd5b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8580fd5b8480fd5b503461019f57602036600319011261019f576102866020916040610921611164565b916001600160a01b0361093384612215565b9316815260018552205490611c89565b503461019f5760a036600319011261019f5761095d611164565b5061096661117a565b5067ffffffffffffffff604435818111610562576109889036906004016111a4565b5050606435818111610562576109a29036906004016111a4565b50506084359081116103d7576109bc9036906004016111d5565b505060206040517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b503461019f578060031936011261019f576001600160a01b036020915416604051908152f35b503461019f578060031936011261019f576020638b78c6d819546001600160a01b0360405191168152f35b503461019f57604036600319011261019f5760406020916001600160a01b03610a60611164565b16815260028352818120602435825283522054604051908152f35b508060031936011261019f57610a8f6122ae565b80638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35580f35b503461019f57602036600319011261019f576004358015158091036103d757610ae86122ae565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000083549260a01b16911617815580f35b503461019f57602036600319011261019f576004359067ffffffffffffffff821161019f5760206101c6610b6536600486016111a4565b9061214c565b50602036600319011261019f576004359067ffffffffffffffff821161019f5760206101c6610b9d36600486016111d5565b906114e5565b503461019f57602036600319011261019f5760406020916001600160a01b03610bca611164565b168152600183522054604051908152f35b508060031936011261019f5763389a75e1600c52338152806020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c928280a280f35b503461019f57602036600319011261019f5760043567ffffffffffffffff81116103d75790610c5660209236906004016111d5565b5050604051908152f35b503461019f576020806003193601126103d75767ffffffffffffffff90600435828111610e8c57610c959036906004016111d5565b63409feecd1980546003808355949392919080610e67575b509082019183818403126108f357803590868211610e635701916060838203126108f357604051610cdd81611203565b610ce684611190565b8152610cf3858501611190565b93858201948552604081013590888211610e5f57019180601f84011215610e5b578235978811610e475760059288841b9060405199610d348984018c611249565b8a5287808b0192820101928311610e435787809101915b838310610e2b5750505050604081019687526001600160a01b0393848092511680638b78c6d81955897f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a3511673ffffffffffffffffffffffffffffffffffffffff19885416178755865b86518051821015610dee5781831b018501518416885285855260408820805460ff19166001179055610de9906112dc565b610db8565b88848781610dfa578280f35b60027fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d292556001815280a181808280f35b8190610e3684611190565b8152019101908790610d4b565b8a80fd5b602489634e487b7160e01b81526041600452fd5b8880fd5b8980fd5b8780fd5b600181811c14303b1015610e7f5760ff1b1b38610cad565b63f92ee8a988526004601cfd5b8380fd5b503461019f57604036600319011261019f5767ffffffffffffffff60043581811161056257610ec39036906004016111a4565b91602435908111610e8c57610edc9036906004016111a4565b610ee79391936122ae565b808203610f5657845b828110610efb578580f35b610f068183876121b8565b35908115158092036108f357610f1d8185876121b8565b35916001600160a01b038316809303610e6357610f519288526003602052604088209060ff801983541691161790556112dc565b610ef0565b60046040517fff633a38000000000000000000000000000000000000000000000000000000008152fd5b508060031936011261019f5763389a75e1600c523381526202a30042016020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d8280a280f35b503461019f57602036600319011261019f576001600160a01b03610fed611164565b610ff56122ae565b1673ffffffffffffffffffffffffffffffffffffffff1982541617815580f35b503461019f578060031936011261019f5760ff6020915460a01c166040519015158152f35b503461019f57602036600319011261019f576020610286611059611164565b612215565b9050346103d75760203660031901126103d7576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361056257602092507f4e2312e00000000000000000000000000000000000000000000000000000000081149081156110d4575b5015158152f35b7f5cd687ca00000000000000000000000000000000000000000000000000000000811491508115611107575b50386110cd565b7f426062360000000000000000000000000000000000000000000000000000000081149150811561113a575b5038611100565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438611133565b600435906001600160a01b03821682036102ba57565b602435906001600160a01b03821682036102ba57565b35906001600160a01b03821682036102ba57565b9181601f840112156102ba5782359167ffffffffffffffff83116102ba576020808501948460051b0101116102ba57565b9181601f840112156102ba5782359167ffffffffffffffff83116102ba57602083818601950101116102ba57565b6060810190811067ffffffffffffffff82111761121f57604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161121f57604052565b90601f8019910116810190811067ffffffffffffffff82111761121f57604052565b67ffffffffffffffff811161121f57601f01601f191660200190565b9291926112938261126b565b916112a16040519384611249565b8294818452818301116102ba578281602093846000960137010152565b9080601f830112156102ba578160206112d993359101611287565b90565b60001981146112eb5760010190565b634e487b7160e01b600052601160045260246000fd5b906020828203126102ba57813567ffffffffffffffff928382116102ba5701916080838303126102ba5760405192608084018481108382111761121f57604052803560038110156102ba57845261135a60208201611190565b602085015261136b60408201611190565b604085015260608101359182116102ba57019080601f830112156102ba5781602061139893359101611287565b606082015290565b60005b8381106113b35750506000910152565b81810151838201526020016113a3565b90602080838303126102ba57825167ffffffffffffffff938482116102ba5701926060848403126102ba57604051936113fb85611203565b80518552828101518386015260408101519182116102ba570182601f820112156102ba5780519061142b8261126b565b936114396040519586611249565b8285528383830101116102ba578261145493850191016113a0565b604082015290565b90602091611475815180928185528580860191016113a0565b601f01601f1916010190565b91926112d995949160a0946001600160a01b03809216855216602084015260408301526060820152816080820152019061145c565b908160209103126102ba57604051906020820182811067ffffffffffffffff82111761121f5760405251815290565b6114f191810190611301565b805160009060038110156117da5761155d575061151b6060820151602080825183010191016114b6565b519081340361152b575050600190565b6020015160405163cece04c560e01b81526001600160a01b0390911660048201526024810191909152604490fd5b0390fd5b815160038110156117da57600103611654576115866060830151602080825183010191016114b6565b9160208101906001600160a01b03926020816064601c82604089895116970151968a519760405198606052306040526bffffffffffffffffffffffff199060601b16602c526f23b872dd000000000000000000000000600c525af13d1560018351141716156116475760605260405261160230838351166122cb565b925180931061161357505050600190565b511661155960405192839263cece04c560e01b845260048401602090939291936001600160a01b0360408201951681520152565b637939f42490526004601cfd5b90805160038110156117c6576002036117c25760608101516116806020918280825183010191016113c3565b818301906001600160a01b0392838351169184604080970151168151838301948551918985015193823b156117be57908b809493926116d68d5197889687958694637921219560e11b8652309060048701611481565b03925af180156117b45761179b575b50835190518651627eeac760e11b8152306004820152602481019190915291908190839087168180604481015b03915afa9687156117905796611760575b5050518094106117365750505050600190565b51915163cece04c560e01b815291166001600160a01b031660048201526024810191909152604490fd5b9080929650813d8311611789575b6117788183611249565b810103126102ba5751933880611723565b503d61176e565b8651903d90823e3d90fd5b918091976117ab61171294611235565b979192506116e5565b87513d8a823e3d90fd5b8b80fd5b5090565b602483634e487b7160e01b81526021600452fd5b602482634e487b7160e01b81526021600452fd5b6117fa91810190611301565b80516003811015611c3257158015611c48575b15611a00576118296060820151602080825183010191016114b6565b906001600160a01b0360408160208401511692015116915180156000146119fa575061185481612215565b915b68929eee149b4bd2126892308454146119ec5730845581156119bc5761187b83612215565b811161197b57826000526001602052604060002061189a828254611c89565b90558261190a57600038818084865af1156118fc577fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542915b604080516001600160a01b039092168252602082019290925290819081015b0390a2389055600190565b63b12d13eb6000526004601cfd5b81601452806034526fa9059cbb000000000000000000000000600052602060006044601082875af13d1560016000511417161561196d577fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd435429160006034526118d2565b6390b8ec186000526004601cfd5b8261155961198882612215565b92604051938493632e2a182f60e11b8552600485016040919493926001600160a01b03606083019616825260208201520152565b6040516317e3057d60e31b81526001600160a01b0384811660048301529290921660248301526044820152606490fd5b63ab143c066000526004601cfd5b91611856565b80516003811015611c3257600203611c2c57606081015190611a2c6020928380825183010191016113c3565b6001600160a01b0391828482015116926040809201511690825181868501518015600014611c26575051627eeac760e11b8152306004820152602481018290528681604481895afa908115611c1b57908391600091611beb575b50945b01519068929eee149b4bd2126896308854146119ec573088558415611bbc57611ab28288612233565b8611611b7a5786600052600281528360002090826000525282600020611ad9868254611c89565b9055853b156102ba5784600091611b0585519485938493637921219560e11b8552893060048701611481565b038183895af18015611b6f57916118f1917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542959493611b60575b505192839283602090939291936001600160a01b0360408201951681520152565b611b6990611235565b38611b3f565b82513d6000823e3d90fd5b838761155988611b8a8684612233565b9351938493632e2a182f60e11b8552600485016040919493926001600160a01b03606083019616825260208201520152565b83516317e3057d60e31b81526001600160a01b0388811660048301528616602482015260448101879052606490fd5b91508782813d8311611c14575b611c028183611249565b8101031261019f575082905138611a86565b503d611bf8565b83513d6000823e3d90fd5b94611a89565b50600090565b634e487b7160e01b600052602160045260246000fd5b5080516003811015611c325760011461180d565b818102929181159184041417156112eb57565b908160209103126102ba575161ffff811681036102ba5790565b919082018092116112eb57565b90611ca0336121de565b156108c9576112d9919060009160ff835460a01c16156108c957611cc691810190611301565b805160038110156117c657600114801561213a575b15611ebc57611cf76060820151602080825183010191016114b6565b602082016001600160a01b0390611d1082825116612215565b8351818111611e8a5750508160409151169301511690519068929eee149b4bd212689330855414611e7d573085558115611e4a57611d4d84612215565b8311611e3c57838152600160205260408120611d6a848254611c89565b905583611dd0578038818086865af115611dc35750604080516001600160a01b03909216825260208201929092527fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354291819081016118f1565b63b12d13eb90526004601cfd5b81601452826034526fa9059cbb00000000000000000000000081526020816044601082885af13d156001835114171615611e2f576034527fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354291906118d2565b6390b8ec1890526004601cfd5b828461155961198882612215565b506040516317e3057d60e31b81526001600160a01b03848116600483015291909116602482015260448101829052606490fd5b63ab143c0690526004601cfd5b8251604051632e2a182f60e11b81529085166001600160a01b0316600482015260248101929092526044820152606490fd5b805160038110156117c6576002036117c257606081015191611ee86020938480825183010191016113c3565b908383016001600160a01b039182825116908451936040938885518095627eeac760e11b82528180611f3560049b308d8401602090939291936001600160a01b0360408201951681520152565b03915afa938415612130578394612101575b50888701938451908082116120c657505081859151169701511693838651935196015168929eee149b4bd2126898308a54146120ba57308a55861561208557611f90858a612233565b881161204557888452600281528584209085855252848320611fb3888254611c89565b9055873b15610562578291611fde87928988519788958695637921219560e11b875230908701611481565b0381838a5af190811561203a5750916118f1917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542959493611b6057505192839283602090939291936001600160a01b0360408201951681520152565b8351903d90823e3d90fd5b88836115598a896120568a86612233565b9051632e2a182f60e11b81526001600160a01b0390951693850193845260208401526040830152829160600190565b85516317e3057d60e31b81526001600160a01b03808b168286019081529089166020820152604081018a905281906060010390fd5b8263ab143c068552601cfd5b86945087936115599351169451948594632e2a182f60e11b865285016040919493926001600160a01b03606083019616825260208201520152565b9093508881813d8311612129575b6121198183611249565b8101031261056257519238611f47565b503d61210f565b85513d85823e3d90fd5b50805160038110156117c65715611cdb565b60005b82811061215e57505050600190565b8060051b820135601e19833603018112156102ba57820180359067ffffffffffffffff82116102ba576020019080360382136102ba5761219d91611c96565b156121b0576121ab906112dc565b61214f565b505050600090565b91908110156121c85760051b0190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0380911680600052600360205260ff6040600020541691821561220757505090565b638b78c6d819541614919050565b6001600160a01b03811661222857504790565b6112d99030906122cb565b604051627eeac760e11b81523060048201526024810192909252602090829060449082906001600160a01b03165afa9081156122a257600091612274575090565b906020823d821161229a575b8161228d60209383611249565b8101031261019f57505190565b3d9150612280565b6040513d6000823e3d90fd5b638b78c6d8195433036122bd57565b6382b429006000526004601cfd5b602460106020939284936014526f70a082310000000000000000000000006000525afa601f3d1116602051029056fea2646970667358221220ddc686d33c9782ebfa21fd751337d9fb548c71456b3000878cd1843b71bb8f0264736f6c63430008130033", - "nonce": "0x139", + "input": "0x608080604052346100ba5733638b78c6d819553360007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a363409feecd19805490600182166100ac576001600160401b039160011c6002600160401b031901610072575b612d2b8381620000c08239f35b6002600160411b03905560209081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29080a13880610065565b63f92ee8a96000526004601cfd5b600080fdfe608080604052600436101561001a575b50361561001857005b005b600090813560e01c90816301ffc9a71461192f5750806310098ad51461190b57806317c87e4c1461133957806319cbad06146113145780631c9fd0c3146112ca578063256929621461127f5780634359d28a1461118f578063439fab9114610f67578063451cc19114610f28578063509c5df614610f0a57806354d1f13d14610ec4578063578bcf3514610e8c5780635aef467a14610e5457806361400c9914610e17578063627bbbaa14610daa578063715018a614610d64578063774c33ab14610d225780638da5cb5b14610cf757806392f5e0eb14610cd1578063a6f7f5d614610cb3578063bc197c8114610c0e578063d2514e8414610bca578063de0580dc146106a3578063e15cfcf5146105db578063f04e283e1461055a578063f1c30ec014610515578063f23a6e61146104a1578063f2fde38b14610433578063f8724aba1461040b578063f9a802c314610347578063fa4ca9b11461030a578063fce95f57146102a3578063fe56e23214610207578063fe9fbb80146101d95763fee81cf40361000f57346101d65760203660031901126101d6576101bd611a35565b9063389a75e1600c5252602080600c2054604051908152f35b80fd5b50346101d65760203660031901126101d65760206101fd6101f8611a35565b612af5565b6040519015158152f35b50346101d65760203660031901126101d657600435610224612cd8565b612710811161025f576020817f74f254e69f1d1aa50fbf15b184112c15530415ac9f4b4bf2b75778c6befd097892600455604051908152a180f35b606460405162461bcd60e51b815260206004820152601660248201527f4665652063616e6e6f74206578636565642031303025000000000000000000006044820152fd5b50346101d65760203660031901126101d6576004359067ffffffffffffffff82116101d65760206001600160a01b036102f6826102e33660048801611b30565b8160405193828580945193849201611bad565b810160058152030190205416604051908152f35b50346101d65760203660031901126101d6576004359067ffffffffffffffff82116101d65760206101fd6103413660048601611b7f565b906125ad565b50346101d65760403660031901126101d657610361611a35565b604051627eeac760e11b81523060048201526024803590820181905260209390926001600160a01b03168483604481845afa9283156104005782936103c8575b50906103c0936040928252600286528282209082528552205490612572565b604051908152f35b919092508482813d83116103f9575b6103e18183611abb565b810103126103f4579051916103c06103a1565b600080fd5b503d6103d7565b6040513d84823e3d90fd5b50346101d65760403660031901126101d65760206103c061042a611a35565b60243590612bc5565b5060203660031901126101d657610448611a35565b610450612cd8565b8060601b15610494576001600160a01b0316638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35580f35b637448fbae82526004601cfd5b50346101d65760a03660031901126101d6576104bb611a35565b506104c4611a4b565b5060843567ffffffffffffffff8111610511576104e5903690600401611b7f565b505060206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b5080fd5b50346101d65760203660031901126101d6576004359067ffffffffffffffff82116101d65760206101fd61054c3660048601611b7f565b90610555612cd8565b6120e2565b5060203660031901126101d65761056f611a35565b610577612cd8565b63389a75e1600c528082526020600c20805442116105ce5790826001600160a01b03925516638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a35580f35b636f5e881883526004601cfd5b50346101d65760203660031901126101d6578060043567ffffffffffffffff81116106a05761060e903690600401611b7f565b9190610618612cd8565b6001600160a01b03825416803b1561069c5783918360446040518097819682957fe15cfcf500000000000000000000000000000000000000000000000000000000845260206004850152816024850152848401378181018301849052601f01601f191681010301925af1801561040057610690575080f35b61069990611aa7565b80f35b8280fd5b50fd5b50346101d6576101603660031901126101d6576004359063ffffffff821682036101d6576106cf611a4b565b67ffffffffffffffff9060c435828111610bc6576106f1903690600401611b30565b9360e435838111610bc25761070a903690600401611b30565b9261010435818111610bbe57610724903690600401611b30565b9061012435908111610bbe5761073e903690600401611b30565b9061074833612af5565b15610b945761075b60a435608435612550565b6001600160a01b038754166040517f67dfa3e7000000000000000000000000000000000000000000000000000000008152602081600481855afa908115610b89578991610b4b575b506040517f17a7e45e000000000000000000000000000000000000000000000000000000008152602081600481865afa908115610af9578a91610b04575b5061082161080c91610826936127109384918261080361ffff8093168b612550565b04931688612550565b049261081a60045488612550565b0495612572565b612572565b916040517f10098ad50000000000000000000000000000000000000000000000000000000081526001600160a01b0388166004820152602081602481305afa908115610af9578a91610ac3575b5061087e8285612572565b11610a595761088f90600654612572565b6006556014526034526f095ea7b300000000000000000000000086526020866044601082885af13d156001885114171615610a4c5785603452604051808851818160208c01916108de92611bad565b81016005815203602001902033815473ffffffffffffffffffffffffffffffffffffffff191617905585546001600160a01b03169460405197889586957fde0580dc00000000000000000000000000000000000000000000000000000000875263ffffffff1660048701526001600160a01b0316602486015260443560448601526064356064860152608435608486015260a43560a486015260c485016101609052610164850161098e91611d2d565b8481036003190160e48601526109a391611d2d565b838103600319016101048501526109b991611d2d565b828103600319016101248401526109cf91611d2d565b6101448035908301520381845a94602095f1908115610a40578091610a03575b6020826001600160a01b0360405191168152f35b90506020823d602011610a38575b81610a1e60209383611abb565b810103126101d65750610a3260209161257f565b386109ef565b3d9150610a11565b604051903d90823e3d90fd5b633e3f8f7386526004601cfd5b608460405162461bcd60e51b815260206004820152602560248201527f496e73756666696369656e742066756e647320666f722071756573742063726560448201527f6174696f6e0000000000000000000000000000000000000000000000000000006064820152fd5b90506020813d602011610af1575b81610ade60209383611abb565b81010312610aed575138610873565b8980fd5b3d9150610ad1565b6040513d8c823e3d90fd5b90506020813d602011610b43575b81610b1f60209383611abb565b81010312610aed5761082161082692610b3a61080c93612563565b925092506107e1565b3d9150610b12565b90506020813d602011610b81575b81610b6660209383611abb565b81010312610b7d57610b7790612563565b386107a3565b8880fd5b3d9150610b59565b6040513d8b823e3d90fd5b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8480fd5b8380fd5b50346101d65760203660031901126101d6576103c06020916040610bec611a35565b916001600160a01b03610bfe84612b2c565b9316815260018552205490612572565b50346101d65760a03660031901126101d657610c28611a35565b50610c31611a4b565b5067ffffffffffffffff60443581811161069c57610c53903690600401611b4e565b505060643581811161069c57610c6d903690600401611b4e565b505060843590811161051157610c87903690600401611b7f565b505060206040517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b50346101d657806003193601126101d6576020600454604051908152f35b50346101d657806003193601126101d6576001600160a01b036020915416604051908152f35b50346101d657806003193601126101d6576020638b78c6d819546001600160a01b0360405191168152f35b50346101d65760403660031901126101d65760406020916001600160a01b03610d49611a35565b16815260028352818120602435825283522054604051908152f35b50806003193601126101d657610d78612cd8565b80638b78c6d8198181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a35580f35b50346101d65760203660031901126101d65760043580151580910361051157610dd1612cd8565b7fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000083549260a01b16911617815580f35b50346101d65760203660031901126101d6576004359067ffffffffffffffff82116101d65760206101fd610e4e3660048601611b4e565b90612a63565b5060203660031901126101d6576004359067ffffffffffffffff82116101d65760206101fd610e863660048601611b7f565b90611db6565b50346101d65760203660031901126101d65760406020916001600160a01b03610eb3611a35565b168152600183522054604051908152f35b50806003193601126101d65763389a75e1600c52338152806020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c928280a280f35b50346101d657806003193601126101d6576020600654604051908152f35b50346101d65760203660031901126101d65760043567ffffffffffffffff81116105115790610f5d6020923690600401611b7f565b5050604051908152f35b50346101d6576020806003193601126105115767ffffffffffffffff90600435828111610bc657610f9c903690600401611b7f565b63409feecd198054600380835594939291908061116a575b509082019183818403126111625780359086821161116657019160608382031261116257604051610fe481611a75565b610fed84611a61565b8152610ffa858501611a61565b93858201948552604081013590888211610aed57019180601f84011215610b7d57823597881161114e5760059288841b906040519961103b8984018c611abb565b8a5287808b019282010192831161114a5787809101915b8383106111325750505050604081019687526001600160a01b0393848092511680638b78c6d81955897f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a3511673ffffffffffffffffffffffffffffffffffffffff19885416178755865b865180518210156110f55781831b018501518416885285855260408820805460ff191660011790556110f090611bd0565b6110bf565b88848781611101578280f35b60027fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d292556001815280a181808280f35b819061113d84611a61565b8152019101908790611052565b8a80fd5b602489634e487b7160e01b81526041600452fd5b8680fd5b8780fd5b600181811c14303b10156111825760ff1b1b38610fb4565b63f92ee8a988526004601cfd5b50346101d65760403660031901126101d65767ffffffffffffffff60043581811161069c576111c2903690600401611b4e565b91602435908111610bc6576111db903690600401611b4e565b6111e6939193612cd8565b80820361125557845b8281106111fa578580f35b611205818387612acf565b35908115158092036111625761121c818587612acf565b35916001600160a01b038316809303611166576112509288526003602052604088209060ff80198354169116179055611bd0565b6111ef565b60046040517fff633a38000000000000000000000000000000000000000000000000000000008152fd5b50806003193601126101d65763389a75e1600c523381526202a30042016020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d8280a280f35b50346101d65760203660031901126101d6576001600160a01b036112ec611a35565b6112f4612cd8565b1673ffffffffffffffffffffffffffffffffffffffff1982541617815580f35b50346101d657806003193601126101d65760ff6020915460a01c166040519015158152f35b50346101d6576020806003193601126105115767ffffffffffffffff90600435828111610bc65761136e903690600401611b30565b9161137833612af5565b15610b94576001600160a01b03928385541693604051947f7f7c0ef7000000000000000000000000000000000000000000000000000000008652846004870152610160808760249381806113ce8782018a611d2d565b03915afa96871561190057889761181d575b50506040519383519483878601966113f981848a611bad565b8201916005835288813394030190205416036117b457610140870151156117255760c0870151928661012089015161145c6114398260e08d015198612550565b611457600454938492611450612710968792612550565b0499612550565b612550565b049801838883835116604051928380926370a0823160e01b82523060048301525afa801561171a578a918c916116e9575b5010611680575116604051878101907fa9059cbb0000000000000000000000000000000000000000000000000000000082526114f4816114e68c33898401602090939291936001600160a01b0360408201951681520152565b03601f198101835282611abb565b6040519360408501908582109082111761166d576040528884527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564898501525161156e9392918b91829182855af13d15611665573d9161155383611add565b926115616040519485611abb565b83523d8c8b85013e612c40565b8051868115918215611646575b50509050156115dd5750916115cb916115b77ff127d9b407dccf1fa850f14ca0e9b2502941de3fb9f0dab630b91af442f4e886946006546125a0565b600655604051928392839251928391611bad565b8101039020916040519384523393a380f35b84602a6084926040519262461bcd60e51b845260048401528201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b8380929350010312611166578561165d9101612593565b80863861157b565b606091612c40565b858c634e487b7160e01b81526041600452fd5b6084886028866040519262461bcd60e51b845260048401528201527f496e73756666696369656e742066756e647320746f20706179206d616e61676560448201527f6d656e74206665650000000000000000000000000000000000000000000000006064820152fd5b8092508a8092503d8311611713575b6117028183611abb565b8101031261114a578990513861148d565b503d6116f8565b6040513d8d823e3d90fd5b60a4866046846040519262461bcd60e51b845260048401528201527f4d616e6167656d656e74206665652063616e6e6f7420626520636c61696d656460448201527f20756e74696c207468652071756573742072657761726473206172652077697460648201527f68647261776e00000000000000000000000000000000000000000000000000006084820152fd5b6084866033846040519262461bcd60e51b845260048401528201527f4f6e6c79207468652071756573742063726561746f722063616e20636c61696d60448201527f20746865206d616e6167656d656e7420666565000000000000000000000000006064820152fd5b908092975081813d83116118f9575b6118368183611abb565b8101031261116657604051918201828110868211176118e65760405261185b8161257f565b825261186886820161257f565b8683015261187860408201612593565b604083015261188960608201612563565b60608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201519083015261012080820151908301526118da610140809201612593565b908201529438806113e0565b8789634e487b7160e01b81526041600452fd5b503d61182c565b6040513d8a823e3d90fd5b50346101d65760203660031901126101d65760206103c061192a611a35565b612b2c565b905034610511576020366003190112610511576004357fffffffff00000000000000000000000000000000000000000000000000000000811680910361069c57602092507f4e2312e00000000000000000000000000000000000000000000000000000000081149081156119a5575b5015158152f35b7f5cd687ca000000000000000000000000000000000000000000000000000000008114915081156119d8575b503861199e565b7f4260623600000000000000000000000000000000000000000000000000000000811491508115611a0b575b50386119d1565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501438611a04565b600435906001600160a01b03821682036103f457565b602435906001600160a01b03821682036103f457565b35906001600160a01b03821682036103f457565b6060810190811067ffffffffffffffff821117611a9157604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff8111611a9157604052565b90601f8019910116810190811067ffffffffffffffff821117611a9157604052565b67ffffffffffffffff8111611a9157601f01601f191660200190565b929192611b0582611add565b91611b136040519384611abb565b8294818452818301116103f4578281602093846000960137010152565b9080601f830112156103f457816020611b4b93359101611af9565b90565b9181601f840112156103f45782359167ffffffffffffffff83116103f4576020808501948460051b0101116103f457565b9181601f840112156103f45782359167ffffffffffffffff83116103f457602083818601950101116103f457565b60005b838110611bc05750506000910152565b8181015183820152602001611bb0565b6000198114611bdf5760010190565b634e487b7160e01b600052601160045260246000fd5b906020828203126103f457813567ffffffffffffffff928382116103f45701916080838303126103f457604051926080840184811083821117611a9157604052803560038110156103f4578452611c4e60208201611a61565b6020850152611c5f60408201611a61565b604085015260608101359182116103f457019080601f830112156103f457816020611c8c93359101611af9565b606082015290565b90602080838303126103f457825167ffffffffffffffff938482116103f45701926060848403126103f45760405193611ccc85611a75565b80518552828101518386015260408101519182116103f4570182601f820112156103f457805190611cfc82611add565b93611d0a6040519586611abb565b8285528383830101116103f45782611d259385019101611bad565b604082015290565b90602091611d4681518092818552858086019101611bad565b601f01601f1916010190565b9192611b4b95949160a0946001600160a01b038092168552166020840152604083015260608201528160808201520190611d2d565b908160209103126103f457604051906020820182811067ffffffffffffffff821117611a915760405251815290565b611dc291810190611bf5565b805160009060038110156120ce57611e2e5750611dec606082015160208082518301019101611d87565b5190813403611dfc575050600190565b6020015160405163cece04c560e01b81526001600160a01b0390911660048201526024810191909152604490fd5b0390fd5b90805160038110156120ba57600103611f4957606081015191611e5b602093848082518301019101611d87565b92808301916001600160a01b039382826064601c8260408a8a5116960151958b519660405197606052306040526bffffffffffffffffffffffff199060601b16602c526f23b872dd000000000000000000000000600c525af13d156001845114171615611f3c57602460108385949385946060526040526f70a08231000000000000000000000000888851169130601452525afa601f3d11169051029251809310611f0857505050600190565b5116611e2a60405192839263cece04c560e01b845260048401602090939291936001600160a01b0360408201951681520152565b637939f42482526004601cfd5b805160038110156120ba576002036120b6576060810151611f74602091828082518301019101611c94565b818301906001600160a01b0392838351169184604080970151168151838301948551918985015193823b156120b257908b80949392611fca8d5197889687958694637921219560e11b8652309060048701611d52565b03925af180156120a85761208f575b50835190518651627eeac760e11b8152306004820152602481019190915291908190839087168180604481015b03915afa9687156120845796612054575b50505180941061202a5750505050600190565b51915163cece04c560e01b815291166001600160a01b031660048201526024810191909152604490fd5b9080929650813d831161207d575b61206c8183611abb565b810103126103f45751933880612017565b503d612062565b8651903d90823e3d90fd5b9180919761209f61200694611aa7565b97919250611fd9565b87513d8a823e3d90fd5b8b80fd5b5090565b602483634e487b7160e01b81526021600452fd5b602482634e487b7160e01b81526021600452fd5b6120ee91810190611bf5565b805160038110156125265715801561253c575b156122f45761211d606082015160208082518301019101611d87565b906001600160a01b0360408160208401511692015116915180156000146122ee575061214881612b2c565b915b68929eee149b4bd2126892308454146122e05730845581156122b05761216f83612b2c565b811161226f57826000526001602052604060002061218e828254612572565b9055826121fe57600038818084865af1156121f0577fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542915b604080516001600160a01b039092168252602082019290925290819081015b0390a2389055600190565b63b12d13eb6000526004601cfd5b81601452806034526fa9059cbb000000000000000000000000600052602060006044601082875af13d15600160005114171615612261577fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd435429160006034526121c6565b6390b8ec186000526004601cfd5b82611e2a61227c82612b2c565b92604051938493632e2a182f60e11b8552600485016040919493926001600160a01b03606083019616825260208201520152565b6040516317e3057d60e31b81526001600160a01b0384811660048301529290921660248301526044820152606490fd5b63ab143c066000526004601cfd5b9161214a565b805160038110156125265760020361252057606081015190612320602092838082518301019101611c94565b6001600160a01b039182848201511692604080920151169082518186850151801560001461251a575051627eeac760e11b8152306004820152602481018290528681604481895afa90811561250f579083916000916124df575b50945b01519068929eee149b4bd2126896308854146122e05730885584156124b0576123a68288612bc5565b861161246e57866000526002815283600020908260005252826000206123cd868254612572565b9055853b156103f457846000916123f985519485938493637921219560e11b8552893060048701611d52565b038183895af1801561246357916121e5917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd43542959493612454575b505192839283602090939291936001600160a01b0360408201951681520152565b61245d90611aa7565b38612433565b82513d6000823e3d90fd5b8387611e2a8861247e8684612bc5565b9351938493632e2a182f60e11b8552600485016040919493926001600160a01b03606083019616825260208201520152565b83516317e3057d60e31b81526001600160a01b0388811660048301528616602482015260448101879052606490fd5b91508782813d8311612508575b6124f68183611abb565b810103126101d657508290513861237a565b503d6124ec565b83513d6000823e3d90fd5b9461237d565b50600090565b634e487b7160e01b600052602160045260246000fd5b508051600381101561252657600114612101565b81810292918115918404141715611bdf57565b519061ffff821682036103f457565b91908201809211611bdf57565b51906001600160a01b03821682036103f457565b519081151582036103f457565b91908203918211611bdf57565b906125b733612af5565b15610b9457611b4b919060009160ff835460a01c1615610b94576125dd91810190611bf5565b805160038110156120ba576001148015612a51575b156127d35761260e606082015160208082518301019101611d87565b602082016001600160a01b039061262782825116612b2c565b83518181116127a15750508160409151169301511690519068929eee149b4bd2126893308554146127945730855581156127615761266484612b2c565b831161275357838152600160205260408120612681848254612572565b9055836126e7578038818086865af1156126da5750604080516001600160a01b03909216825260208201929092527fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354291819081016121e5565b63b12d13eb90526004601cfd5b81601452826034526fa9059cbb00000000000000000000000081526020816044601082885af13d156001835114171615612746576034527fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354291906121c6565b6390b8ec1890526004601cfd5b8284611e2a61227c82612b2c565b506040516317e3057d60e31b81526001600160a01b03848116600483015291909116602482015260448101829052606490fd5b63ab143c0690526004601cfd5b8251604051632e2a182f60e11b81529085166001600160a01b0316600482015260248101929092526044820152606490fd5b805160038110156120ba576002036120b6576060810151916127ff602093848082518301019101611c94565b908383016001600160a01b039182825116908451936040938885518095627eeac760e11b8252818061284c60049b308d8401602090939291936001600160a01b0360408201951681520152565b03915afa938415612a47578394612a18575b50888701938451908082116129dd57505081859151169701511693838651935196015168929eee149b4bd2126898308a54146129d157308a55861561299c576128a7858a612bc5565b881161295c578884526002815285842090858552528483206128ca888254612572565b9055873b1561069c5782916128f587928988519788958695637921219560e11b875230908701611d52565b0381838a5af19081156129515750916121e5917fad4a9acf26d8bba7a8cf1a41160d59be042ee554578e256c98d2ab74cdd4354295949361245457505192839283602090939291936001600160a01b0360408201951681520152565b8351903d90823e3d90fd5b8883611e2a8a8961296d8a86612bc5565b9051632e2a182f60e11b81526001600160a01b0390951693850193845260208401526040830152829160600190565b85516317e3057d60e31b81526001600160a01b03808b168286019081529089166020820152604081018a905281906060010390fd5b8263ab143c068552601cfd5b8694508793611e2a9351169451948594632e2a182f60e11b865285016040919493926001600160a01b03606083019616825260208201520152565b9093508881813d8311612a40575b612a308183611abb565b8101031261069c5751923861285e565b503d612a26565b85513d85823e3d90fd5b50805160038110156120ba57156125f2565b60005b828110612a7557505050600190565b8060051b820135601e19833603018112156103f457820180359067ffffffffffffffff82116103f4576020019080360382136103f457612ab4916125ad565b15612ac757612ac290611bd0565b612a66565b505050600090565b9190811015612adf5760051b0190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0380911680600052600360205260ff60406000205416918215612b1e57505090565b638b78c6d819541614919050565b6000906001600160a01b031680612b5e575050475b60065460009181811115612b5957611b4b92506125a0565b505090565b6020602491604051928380926370a0823160e01b82523060048301525afa918215610a40578092612b91575b5050612b41565b9091506020823d8211612bbd575b81612bac60209383611abb565b810103126101d65750513880612b8a565b3d9150612b9f565b604051627eeac760e11b81523060048201526024810192909252602090829060449082906001600160a01b03165afa908115612c3457600091612c06575090565b906020823d8211612c2c575b81612c1f60209383611abb565b810103126101d657505190565b3d9150612c12565b6040513d6000823e3d90fd5b91929015612ca15750815115612c54575090565b3b15612c5d5790565b606460405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015612cb45750805190602001fd5b611e2a9060405191829162461bcd60e51b8352602060048401526024830190611d2d565b638b78c6d819543303612ce757565b6382b429006000526004601cfdfea26469706673582212206e99b6cb2520dc4807991a078f7288d5e1aa9a21e850bdf6a66eeeea92402b1f64736f6c63430008130033", + "nonce": "0x145", "chainId": "0xa" }, "additionalContracts": [], "isFixedGasLimit": false }, { - "hash": "0x7e4ce209617e04b9baa198ff1359931edd5072259ed038e287d0d8023da81dbc", + "hash": "0x6a35a7ea23c977121436da92062444353f663304948c305a47df412b51696d7b", "transactionType": "CREATE", "contractName": null, - "contractAddress": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "contractAddress": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "function": null, "arguments": null, "transaction": { "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", "gas": "0x13e46", "value": "0x0", - "input": "0x602c3d8160093d39f33d3d3d3d363d3d37363d73f843cebab292240892f7030b744f7327c43db8455af43d3d93803e602a57fd5bf3", - "nonce": "0x13a", + "input": "0x602c3d8160093d39f33d3d3d3d363d3d37363d7304131c2f15631b57a9369b9424981264ad69355e5af43d3d93803e602a57fd5bf3", + "nonce": "0x146", "chainId": "0xa" }, "additionalContracts": [], "isFixedGasLimit": false }, { - "hash": "0xf93dc5c900fd76a7fbd428ac4f94b5ab8d0d3e920539fc17e3da43c24551390d", + "hash": "0xbc4a6e8e7ec22123fd3ab8608895594e699e57feaf0c3a2a3c3476a1cf11052b", "transactionType": "CALL", "contractName": null, - "contractAddress": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "contractAddress": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "function": "initialize(bytes)", "arguments": [ - "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c178af0b22860c5ff0f17b3eea595dfa5ea16eb900000000000000000000000052629961f71c1c2564c5aa22372cb1b9fa9eba3e00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c178af0b22860c5ff0f17b3eea595dfa5ea16eb9" + "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c34fd9b40afb41ac528abb3c7ef643a6ba3667e300000000000000000000000052629961f71c1c2564c5aa22372cb1b9fa9eba3e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000006f12e1adc691000ce26f96415ee8f262f356d6e" ], "transaction": { "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", - "to": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", - "gas": "0x27e8b", + "to": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", + "gas": "0x27e99", "value": "0x0", - "input": "0x439fab91000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c178af0b22860c5ff0f17b3eea595dfa5ea16eb900000000000000000000000052629961f71c1c2564c5aa22372cb1b9fa9eba3e00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c178af0b22860c5ff0f17b3eea595dfa5ea16eb9", - "nonce": "0x13b", + "input": "0x439fab91000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c34fd9b40afb41ac528abb3c7ef643a6ba3667e300000000000000000000000052629961f71c1c2564c5aa22372cb1b9fa9eba3e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000006f12e1adc691000ce26f96415ee8f262f356d6e", + "nonce": "0x147", "chainId": "0xa" }, "additionalContracts": [], @@ -61,133 +61,133 @@ "receipts": [ { "status": "0x1", - "cumulativeGasUsed": "0x243419", + "cumulativeGasUsed": "0x31804c", "logs": [ { - "address": "0xf843cebab292240892f7030b744f7327c43db845", + "address": "0x04131c2f15631b57a9369b9424981264ad69355e", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000017f8ad14a2e745ea0f756bd57cd4852400be78c" ], "data": "0x", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "transactionHash": "0x41b2d6d41cb0d58402b95c7efcdc9289bef5bcfef3486fcd5e43abaaf5d7be0c", - "transactionIndex": "0x3", - "logIndex": "0x6", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "transactionHash": "0x4fffdd06bc3ce7a29cf42b46c9076c7f7c7bee18e44242a91a62f134dead2dc5", + "transactionIndex": "0x7", + "logIndex": "0x11", "removed": false }, { - "address": "0xf843cebab292240892f7030b744f7327c43db845", + "address": "0x04131c2f15631b57a9369b9424981264ad69355e", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "transactionHash": "0x41b2d6d41cb0d58402b95c7efcdc9289bef5bcfef3486fcd5e43abaaf5d7be0c", - "transactionIndex": "0x3", - "logIndex": "0x7", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "transactionHash": "0x4fffdd06bc3ce7a29cf42b46c9076c7f7c7bee18e44242a91a62f134dead2dc5", + "transactionIndex": "0x7", + "logIndex": "0x12", "removed": false } ], - "logsBloom": "0x00000000000000000000000000000000000000400000000000800000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000400000000000005000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000100000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "logsBloom": "0x00000000000000000000000000000040000000000000000000800000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000400000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000200000000000000000000200000000000000000000000000000000000000000000000100000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000", "type": "0x2", - "transactionHash": "0x41b2d6d41cb0d58402b95c7efcdc9289bef5bcfef3486fcd5e43abaaf5d7be0c", - "transactionIndex": "0x3", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "gasUsed": "0x1f343d", - "effectiveGasPrice": "0x3a7e8fc", + "transactionHash": "0x4fffdd06bc3ce7a29cf42b46c9076c7f7c7bee18e44242a91a62f134dead2dc5", + "transactionIndex": "0x7", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "gasUsed": "0x27990b", + "effectiveGasPrice": "0x16606", "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", "to": null, - "contractAddress": "0xf843cebab292240892f7030b744f7327c43db845", + "contractAddress": "0x04131c2f15631b57a9369b9424981264ad69355e", "l1BaseFeeScalar": "0x146b", - "l1BlobBaseFee": "0x1", + "l1BlobBaseFee": "0x45cf0", "l1BlobBaseFeeScalar": "0xf79c5", - "l1Fee": "0x31c661168ec", - "l1GasPrice": "0x1e335d8ce", - "l1GasUsed": "0x13b50" + "l1Fee": "0x33890a3589e", + "l1GasPrice": "0x187661254", + "l1GasUsed": "0x192d4" }, { "status": "0x1", - "cumulativeGasUsed": "0x2528f1", + "cumulativeGasUsed": "0x327524", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "type": "0x2", - "transactionHash": "0x7e4ce209617e04b9baa198ff1359931edd5072259ed038e287d0d8023da81dbc", - "transactionIndex": "0x4", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", + "transactionHash": "0x6a35a7ea23c977121436da92062444353f663304948c305a47df412b51696d7b", + "transactionIndex": "0x8", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", "gasUsed": "0xf4d8", - "effectiveGasPrice": "0x3a7e8fc", + "effectiveGasPrice": "0x16606", "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", "to": null, - "contractAddress": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "contractAddress": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "l1BaseFeeScalar": "0x146b", - "l1BlobBaseFee": "0x1", + "l1BlobBaseFee": "0x45cf0", "l1BlobBaseFeeScalar": "0xf79c5", - "l1Fee": "0xfc92f4998", - "l1GasPrice": "0x1e335d8ce", + "l1Fee": "0xccb13046a", + "l1GasPrice": "0x187661254", "l1GasUsed": "0x640" }, { "status": "0x1", - "cumulativeGasUsed": "0x26f73d", + "cumulativeGasUsed": "0x34437a", "logs": [ { - "address": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "address": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000c178af0b22860c5ff0f17b3eea595dfa5ea16eb9" + "0x000000000000000000000000c34fd9b40afb41ac528abb3c7ef643a6ba3667e3" ], "data": "0x", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "transactionHash": "0xf93dc5c900fd76a7fbd428ac4f94b5ab8d0d3e920539fc17e3da43c24551390d", - "transactionIndex": "0x5", - "logIndex": "0x8", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "transactionHash": "0xbc4a6e8e7ec22123fd3ab8608895594e699e57feaf0c3a2a3c3476a1cf11052b", + "transactionIndex": "0x9", + "logIndex": "0x13", "removed": false }, { - "address": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "address": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "topics": [ "0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "transactionHash": "0xf93dc5c900fd76a7fbd428ac4f94b5ab8d0d3e920539fc17e3da43c24551390d", - "transactionIndex": "0x5", - "logIndex": "0x9", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "transactionHash": "0xbc4a6e8e7ec22123fd3ab8608895594e699e57feaf0c3a2a3c3476a1cf11052b", + "transactionIndex": "0x9", + "logIndex": "0x14", "removed": false } ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000004000000000000800000000000040000000000000000000400000000000000000000800000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000004000000000000000020000000000000000000000000000000000000000000400000000000040000000000", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000001000000000000000000000000000000000000020000000000000400000800000000000000000000000000000000400000000200000000800800000000000000000000000080000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000008000000000", "type": "0x2", - "transactionHash": "0xf93dc5c900fd76a7fbd428ac4f94b5ab8d0d3e920539fc17e3da43c24551390d", - "transactionIndex": "0x5", - "blockHash": "0x94e759212711692473ada997d0cd6d0ccd3ec7b81088213abe764dc4558636c1", - "blockNumber": "0x752e246", - "gasUsed": "0x1ce4c", - "effectiveGasPrice": "0x3a7e8fc", + "transactionHash": "0xbc4a6e8e7ec22123fd3ab8608895594e699e57feaf0c3a2a3c3476a1cf11052b", + "transactionIndex": "0x9", + "blockHash": "0x2ee88b707dc8adb26743dcd32497decbe5c591a580f74af1f57c910f6f99753f", + "blockNumber": "0x79224df", + "gasUsed": "0x1ce56", + "effectiveGasPrice": "0x16606", "from": "0x017f8ad14a2e745ea0f756bd57cd4852400be78c", - "to": "0x0a711cd075eaf8294c7a415824be299cc971ceb8", + "to": "0xa321ce8bec426dcd5fd8d7db67f0dfaa1014b0a1", "contractAddress": null, "l1BaseFeeScalar": "0x146b", - "l1BlobBaseFee": "0x1", + "l1BlobBaseFee": "0x45cf0", "l1BlobBaseFeeScalar": "0xf79c5", - "l1Fee": "0x1501fbffee", - "l1GasPrice": "0x1e335d8ce", - "l1GasUsed": "0x851" + "l1Fee": "0x12bcc8ffb8", + "l1GasPrice": "0x187661254", + "l1GasUsed": "0x927" } ], "libraries": [], "pending": [], "returns": {}, - "timestamp": 1721343562, + "timestamp": 1729635197, "chain": 10, - "commit": "768d66e" + "commit": "bab77d5" } \ No newline at end of file