From 74df0242dd4346e3330b0cab42715ff13f88a996 Mon Sep 17 00:00:00 2001 From: Rahul Sethuram Date: Wed, 1 Nov 2023 21:27:28 +0400 Subject: [PATCH] fix: redeploy after bugfix --- .../GrumpyCat/GrumpyCatLockboxAdapter.sol | 1 + deploy/GrumpyCat/index.ts | 3 +- .../mainnet/GrumpyCatLockboxAdapter.json | 28 +++++++++---------- hardhat.config.ts | 4 ++- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol b/contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol index 2f55b19..fca59d2 100644 --- a/contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol +++ b/contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol @@ -41,6 +41,7 @@ contract GrumpyCatLockboxAdapter is IXReceiver { bytes calldata _callData ) external payable returns (bytes32) { erc20.transferFrom(msg.sender, address(this), _amount); + erc20.approve(address(lockbox), _amount); lockbox.deposit(_amount); xerc20.approve(address(connext), _amount); diff --git a/deploy/GrumpyCat/index.ts b/deploy/GrumpyCat/index.ts index 17f50eb..e5729fb 100644 --- a/deploy/GrumpyCat/index.ts +++ b/deploy/GrumpyCat/index.ts @@ -27,7 +27,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if (!deployer) { throw new Error(`Cannot find signer to deploy with`); } - console.log("\n============================= Deploying MidasProtocolTarget ==============================="); + console.log("\n============================= Deploying GrumpyCatLockboxAdapter ==============================="); console.log("deployer: ", deployer.address); console.log("constructorArgs:", args); @@ -35,7 +35,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const adapter = await hre.deployments.deploy("GrumpyCatLockboxAdapter", { from: deployer.address, args: args, - skipIfAlreadyDeployed: true, log: true, // deterministicDeployment: true, }); diff --git a/deployments/mainnet/GrumpyCatLockboxAdapter.json b/deployments/mainnet/GrumpyCatLockboxAdapter.json index de2b2ea..a0a44a7 100644 --- a/deployments/mainnet/GrumpyCatLockboxAdapter.json +++ b/deployments/mainnet/GrumpyCatLockboxAdapter.json @@ -1,5 +1,5 @@ { - "address": "0x78A92753D6D33F39f178f332538f0728D5d0928D", + "address": "0x3045597e25f8C57e32c08Fe5276c5Cf4AA4dD7f7", "abi": [ { "inputs": [ @@ -184,19 +184,19 @@ "type": "function" } ], - "transactionHash": "0x9a75e1bedef28ef355b2932e76eb1e665be9a6a5b9df7ff70b89f0f27de14cb7", + "transactionHash": "0x9ac220326d01e96b24be3c9c63e5f0585bfecbab9eedf9b2aa44fa8693cb1566", "receipt": { "to": null, "from": "0xFaDede2cFbfA7443497acacf76cFc4Fe59112DbB", - "contractAddress": "0x78A92753D6D33F39f178f332538f0728D5d0928D", - "transactionIndex": 74, - "gasUsed": "663808", + "contractAddress": "0x3045597e25f8C57e32c08Fe5276c5Cf4AA4dD7f7", + "transactionIndex": 56, + "gasUsed": "696956", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x040828bacec31b2d50c9012b788b47f0bdc84e1e6773e131001c87bd3e367e5b", - "transactionHash": "0x9a75e1bedef28ef355b2932e76eb1e665be9a6a5b9df7ff70b89f0f27de14cb7", + "blockHash": "0xd0239e0348214be114fedfa47bddfef4853669099cb91e011ad5f90f8a5f79eb", + "transactionHash": "0x9ac220326d01e96b24be3c9c63e5f0585bfecbab9eedf9b2aa44fa8693cb1566", "logs": [], - "blockNumber": 18463591, - "cumulativeGasUsed": "6488036", + "blockNumber": 18478694, + "cumulativeGasUsed": "5043121", "status": 1, "byzantium": true }, @@ -206,11 +206,11 @@ "0xd8E2D95C8614F28169757cD6445a71c291dEc5bF", "0x3B350F202473932411772C8Cb76DB7975f42397E" ], - "numDeployments": 1, - "solcInputHash": "25bd20701b0128f2d0efbda94c126fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_connext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_lockbox\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_erc20\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_xerc20\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"XReceiver__onlyConnext\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"connext\",\"outputs\":[{\"internalType\":\"contract IConnext\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockbox\",\"outputs\":[{\"internalType\":\"contract IXERC20Lockbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_transferId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_originSender\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_origin\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xReceive\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_destination\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_slippage\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xcall\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"xerc20\",\"outputs\":[{\"internalType\":\"contract IXERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"xReceive(bytes32,uint256,address,address,uint32,bytes)\":{\"details\":\"This function receives xERC20s from Connext and calls the Lockbox\",\"params\":{\"_amount\":\"The amount of funds that will be received.\",\"_asset\":\"The address of the asset that will be received.\",\"_callData\":\"The data that will be sent to the targets.\",\"_transferId\":\"The id of the transfer.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol\":\"GrumpyCatLockboxAdapter\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":connext-interfaces/=lib/connext-interfaces/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":vulcan/=lib/vulcan/src/\"],\"viaIR\":true},\"sources\":{\"@connext/interfaces/core/IConnext.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ExecuteArgs, TransferInfo, DestinationTransferStatus} from \\\"../libraries/LibConnextStorage.sol\\\";\\nimport {TokenId} from \\\"../libraries/TokenId.sol\\\";\\n\\ninterface IConnext {\\n\\n // ============ BRIDGE ==============\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function xcallIntoLocal(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function execute(ExecuteArgs calldata _args) external returns (bytes32 transferId);\\n\\n function forceUpdateSlippage(TransferInfo calldata _params, uint256 _slippage) external;\\n\\n function forceReceiveLocal(TransferInfo calldata _params) external;\\n\\n function bumpTransfer(bytes32 _transferId) external payable;\\n\\n function routedTransfers(bytes32 _transferId) external view returns (address[] memory);\\n\\n function transferStatus(bytes32 _transferId) external view returns (DestinationTransferStatus);\\n\\n function remote(uint32 _domain) external view returns (address);\\n\\n function domain() external view returns (uint256);\\n\\n function nonce() external view returns (uint256);\\n\\n function approvedSequencers(address _sequencer) external view returns (bool);\\n\\n function xAppConnectionManager() external view returns (address);\\n\\n // ============ ROUTERS ==============\\n\\n function LIQUIDITY_FEE_NUMERATOR() external view returns (uint256);\\n\\n function LIQUIDITY_FEE_DENOMINATOR() external view returns (uint256);\\n\\n function getRouterApproval(address _router) external view returns (bool);\\n\\n function getRouterRecipient(address _router) external view returns (address);\\n\\n function getRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwnerTimestamp(address _router) external view returns (uint256);\\n\\n function maxRoutersPerTransfer() external view returns (uint256);\\n\\n function routerBalances(address _router, address _asset) external view returns (uint256);\\n\\n function getRouterApprovalForPortal(address _router) external view returns (bool);\\n\\n function initializeRouter(address _owner, address _recipient) external;\\n\\n function setRouterRecipient(address _router, address _recipient) external;\\n\\n function proposeRouterOwner(address _router, address _proposed) external;\\n\\n function acceptProposedRouterOwner(address _router) external;\\n\\n function addRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address _router\\n ) external payable;\\n\\n function addRouterLiquidity(uint256 _amount, address _local) external payable;\\n\\n function removeRouterLiquidityFor(\\n TokenId memory _canonical,\\n uint256 _amount,\\n address payable _to,\\n address _router\\n ) external;\\n\\n function removeRouterLiquidity(TokenId memory _canonical, uint256 _amount, address payable _to) external;\\n\\n // ============ TOKEN_FACET ==============\\n function adoptedToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function approvedAssets(TokenId calldata _canonical) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x0b0676707cecd45da82623f18f73bd6bb733acae56dd7bd893f15c0dc08ea391\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/core/IXReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface IXReceiver {\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x37a35045d40f3bde688c70bb631581cbc609796514319db1361e061da8d9349b\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/libraries/LibConnextStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\n/**\\n * @notice Enum representing status of destination transfer\\n * @dev Status is only assigned on the destination domain, will always be \\\"none\\\" for the\\n * origin domains\\n * @return uint - Index of value in enum\\n */\\nenum DestinationTransferStatus {\\n None, // 0\\n Reconciled, // 1\\n Executed, // 2\\n Completed // 3 - executed + reconciled\\n}\\n\\n/**\\n * @notice These are the parameters that will remain constant between the\\n * two chains. They are supplied on `xcall` and should be asserted on `execute`\\n * @property to - The account that receives funds, in the event of a crosschain call,\\n * will receive funds if the call fails.\\n *\\n * @param originDomain - The originating domain (i.e. where `xcall` is called)\\n * @param destinationDomain - The final domain (i.e. where `execute` / `reconcile` are called)\\\\\\n * @param canonicalDomain - The canonical domain of the asset you are bridging\\n * @param to - The address you are sending funds (and potentially data) to\\n * @param delegate - An address who can execute txs on behalf of `to`, in addition to allowing relayers\\n * @param receiveLocal - If true, will use the local asset on the destination instead of adopted.\\n * @param callData - The data to execute on the receiving chain. If no crosschain call is needed, then leave empty.\\n * @param slippage - Slippage user is willing to accept from original amount in expressed in BPS (i.e. if\\n * a user takes 1% slippage, this is expressed as 1_000)\\n * @param originSender - The msg.sender of the xcall\\n * @param bridgedAmt - The amount sent over the bridge (after potential AMM on xcall)\\n * @param normalizedIn - The amount sent to `xcall`, normalized to 18 decimals\\n * @param nonce - The nonce on the origin domain used to ensure the transferIds are unique\\n * @param canonicalId - The unique identifier of the canonical token corresponding to bridge assets\\n */\\nstruct TransferInfo {\\n uint32 originDomain;\\n uint32 destinationDomain;\\n uint32 canonicalDomain;\\n address to;\\n address delegate;\\n bool receiveLocal;\\n bytes callData;\\n uint256 slippage;\\n address originSender;\\n uint256 bridgedAmt;\\n uint256 normalizedIn;\\n uint256 nonce;\\n bytes32 canonicalId;\\n}\\n\\n/**\\n * @notice\\n * @param params - The TransferInfo. These are consistent across sending and receiving chains.\\n * @param routers - The routers who you are sending the funds on behalf of.\\n * @param routerSignatures - Signatures belonging to the routers indicating permission to use funds\\n * for the signed transfer ID.\\n * @param sequencer - The sequencer who assigned the router path to this transfer.\\n * @param sequencerSignature - Signature produced by the sequencer for path assignment accountability\\n * for the path that was signed.\\n */\\nstruct ExecuteArgs {\\n TransferInfo params;\\n address[] routers;\\n bytes[] routerSignatures;\\n address sequencer;\\n bytes sequencerSignature;\\n}\",\"keccak256\":\"0xb8581253c5ebe58445c37d344fafe6126d3f7a15784337b3571637cd0068de57\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/libraries/TokenId.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity ^0.8.0;\\n\\n// ============= Structs =============\\n\\n// Tokens are identified by a TokenId:\\n// domain - 4 byte chain ID of the chain from which the token originates\\n// id - 32 byte identifier of the token address on the origin chain, in that chain's address format\\nstruct TokenId {\\n uint32 domain;\\n bytes32 id;\\n}\\n\",\"keccak256\":\"0xfa4e01760604863ea105e18380c243cd2250a7553d2b852f67ecb747f9916b6d\",\"license\":\"MIT OR Apache-2.0\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-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 function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) 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(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) 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 function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\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 if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9b72f93be69ca894d8492c244259615c4a742afc8d63720dbc8bb81087d9b238\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.13;\\n\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {IXReceiver} from \\\"@connext/interfaces/core/IXReceiver.sol\\\";\\nimport {IConnext} from \\\"@connext/interfaces/core/IConnext.sol\\\";\\n\\nimport {IXERC20} from \\\"../../shared/IXERC20/IXERC20.sol\\\";\\nimport {IXERC20Lockbox} from \\\"../../shared/IXERC20/IXERC20Lockbox.sol\\\";\\n\\ncontract GrumpyCatLockboxAdapter is IXReceiver {\\n IXERC20Lockbox public immutable lockbox;\\n IERC20 public immutable erc20;\\n IXERC20 public immutable xerc20;\\n IConnext public immutable connext;\\n\\n error XReceiver__onlyConnext(address sender);\\n\\n modifier onlyConnext() {\\n if (msg.sender != address(connext)) {\\n revert XReceiver__onlyConnext(msg.sender);\\n }\\n _;\\n }\\n\\n constructor(address _connext, address _lockbox, address _erc20, address _xerc20) {\\n connext = IConnext(_connext);\\n lockbox = IXERC20Lockbox(_lockbox);\\n erc20 = IERC20(_erc20);\\n xerc20 = IXERC20(_xerc20);\\n }\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32) {\\n erc20.transferFrom(msg.sender, address(this), _amount);\\n lockbox.deposit(_amount);\\n xerc20.approve(address(connext), _amount);\\n\\n return IConnext(connext).xcall(_destination, _to, address(xerc20), _delegate, _amount, _slippage, _callData);\\n }\\n\\n /// @dev This function receives xERC20s from Connext and calls the Lockbox\\n /// @param _amount The amount of funds that will be received.\\n /// @param _asset The address of the asset that will be received.\\n /// @param _transferId The id of the transfer.\\n /// @param _callData The data that will be sent to the targets.\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external onlyConnext returns (bytes memory) {\\n // Check for the right xerc20\\n require(_asset == address(xerc20), \\\"Wrong asset received\\\");\\n\\n // Unpack the _callData to get the recipient's address\\n address _recipient = abi.decode(_callData, (address));\\n\\n withdraw(_amount, _recipient);\\n }\\n\\n /// @notice Deposit ERC20s into the Lockbox\\n /// @param _amount Amount of ERC20s to use\\n /// @param _recipient Recipient of the xERC20s\\n function deposit(uint256 _amount, address _recipient) internal {\\n require(_amount > 0, \\\"Zero amount\\\");\\n IERC20 _xerc20 = IERC20(address(xerc20));\\n\\n if (erc20.allowance(address(this), address(lockbox)) < _amount) {\\n erc20.approve(address(lockbox), type(uint256).max);\\n }\\n lockbox.deposit(_amount);\\n\\n // Transfer the xERC20s to the recipient\\n SafeERC20.safeTransfer(_xerc20, _recipient, _amount);\\n }\\n\\n /// @notice Withdraw ERC20s from the Lockbox\\n /// @param _amount Amount of xERC20s to use\\n /// @param _recipient Recipient of the ERC20s\\n function withdraw(uint256 _amount, address _recipient) internal {\\n require(_amount > 0, \\\"Zero amount\\\");\\n IERC20 _xerc20 = IERC20(address(xerc20));\\n\\n if (_xerc20.allowance(address(this), address(lockbox)) < _amount) {\\n _xerc20.approve(address(lockbox), type(uint256).max);\\n }\\n lockbox.withdraw(_amount);\\n\\n // Transfer the ERC20s to the recipient\\n SafeERC20.safeTransfer(erc20, _recipient, _amount);\\n }\\n}\\n\",\"keccak256\":\"0xa01950ed588a64468b9b529e266374594ea9f67709bab65041a5cddf66ad646c\",\"license\":\"UNLICENSED\"},\"contracts/shared/IXERC20/IXERC20.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.4 <0.9.0;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IXERC20 is IERC20 {\\n /**\\n * @notice Emits when a lockbox is set\\n *\\n * @param _lockbox The address of the lockbox\\n */\\n\\n event LockboxSet(address _lockbox);\\n\\n /**\\n * @notice Emits when a limit is set\\n *\\n * @param _mintingLimit The updated minting limit we are setting to the bridge\\n * @param _burningLimit The updated burning limit we are setting to the bridge\\n * @param _bridge The address of the bridge we are setting the limit too\\n */\\n event BridgeLimitsSet(uint256 _mintingLimit, uint256 _burningLimit, address indexed _bridge);\\n\\n /**\\n * @notice Reverts when a user with too low of a limit tries to call mint/burn\\n */\\n\\n error IXERC20_NotHighEnoughLimits();\\n\\n /**\\n * @notice Reverts when caller is not the factory\\n */\\n\\n error IXERC20_NotFactory();\\n\\n struct Bridge {\\n BridgeParameters minterParams;\\n BridgeParameters burnerParams;\\n }\\n\\n struct BridgeParameters {\\n uint256 timestamp;\\n uint256 ratePerSecond;\\n uint256 maxLimit;\\n uint256 currentLimit;\\n }\\n\\n /**\\n * @notice Sets the lockbox address\\n *\\n * @param _lockbox The address of the lockbox\\n */\\n\\n function setLockbox(address _lockbox) external;\\n\\n /**\\n * @notice Updates the limits of any bridge\\n * @dev Can only be called by the owner\\n * @param _mintingLimit The updated minting limit we are setting to the bridge\\n * @param _burningLimit The updated burning limit we are setting to the bridge\\n * @param _bridge The address of the bridge we are setting the limits too\\n */\\n function setLimits(address _bridge, uint256 _mintingLimit, uint256 _burningLimit) external;\\n\\n /**\\n * @notice Returns the max limit of a minter\\n *\\n * @param _minter The minter we are viewing the limits of\\n * @return _limit The limit the minter has\\n */\\n function mintingMaxLimitOf(address _minter) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the max limit of a bridge\\n *\\n * @param _bridge the bridge we are viewing the limits of\\n * @return _limit The limit the bridge has\\n */\\n\\n function burningMaxLimitOf(address _bridge) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the current limit of a minter\\n *\\n * @param _minter The minter we are viewing the limits of\\n * @return _limit The limit the minter has\\n */\\n\\n function mintingCurrentLimitOf(address _minter) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the current limit of a bridge\\n *\\n * @param _bridge the bridge we are viewing the limits of\\n * @return _limit The limit the bridge has\\n */\\n\\n function burningCurrentLimitOf(address _bridge) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Mints tokens for a user\\n * @dev Can only be called by a minter\\n * @param _user The address of the user who needs tokens minted\\n * @param _amount The amount of tokens being minted\\n */\\n\\n function mint(address _user, uint256 _amount) external;\\n\\n /**\\n * @notice Burns tokens for a user\\n * @dev Can only be called by a minter\\n * @param _user The address of the user who needs tokens burned\\n * @param _amount The amount of tokens being burned\\n */\\n\\n function burn(address _user, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0x79336da6dbf66ea8ef1ade2e96b1d57c1fab4191b73c9242f358b76852a28e88\",\"license\":\"UNLICENSED\"},\"contracts/shared/IXERC20/IXERC20Lockbox.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.4 <0.9.0;\\n\\ninterface IXERC20Lockbox {\\n /**\\n * @notice Emitted when tokens are deposited into the lockbox\\n */\\n\\n event Deposit(address _sender, uint256 _amount);\\n\\n /**\\n * @notice Emitted when tokens are withdrawn from the lockbox\\n */\\n\\n event Withdraw(address _sender, uint256 _amount);\\n\\n /**\\n * @notice Reverts when a user tries to deposit native tokens on a non-native lockbox\\n */\\n\\n error IXERC20Lockbox_NotNative();\\n\\n /**\\n * @notice Reverts when a user tries to deposit non-native tokens on a native lockbox\\n */\\n\\n error IXERC20Lockbox_Native();\\n\\n /**\\n * @notice Reverts when a user tries to withdraw and the call fails\\n */\\n\\n error IXERC20Lockbox_WithdrawFailed();\\n\\n /**\\n * @notice Deposit ERC20 tokens into the lockbox\\n *\\n * @param _amount The amount of tokens to deposit\\n */\\n\\n function deposit(uint256 _amount) external;\\n\\n /**\\n * @notice Withdraw ERC20 tokens from the lockbox\\n *\\n * @param _amount The amount of tokens to withdraw\\n */\\n\\n function withdraw(uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0x2a7f6f297d115b13875600b436a180889ae027a4e2b99ac4076739bb5eca1614\",\"license\":\"UNLICENSED\"}},\"version\":1}", - "bytecode": "0x610100346100f657601f610c2638819003918201601f19168301916001600160401b038311848410176100fb578084926080946040528339810103126100f65761004881610111565b9061005560208201610111565b9161006e606061006760408501610111565b9301610111565b6001600160a01b0391821660e05292811660805290811660a0521660c052604051610b00908161012682396080518181816101c60152818161069d015261091b015260a0518181816102a00152818161066b01526108d8015260c051818181607a015281816101770152610700015260e05181818161014e0152818161058d01526107260152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036100f65756fe608060408181526004918236101561001657600080fd5b600092833560e01c91826366cc57021461090757508163785e9e86146108c35781638aac16ba146105bc578163de4b054814610578578163fd614f41146100ad575063ffcbd8d01461006757600080fd5b346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b9050346104305760c0366003190112610430576024908135916100ce61094a565b926100d7610960565b5060843563ffffffff8116036105735760a4359567ffffffffffffffff918288116100a957366023890112156100a9578785013597610115896109c2565b610121895191826109a0565b8981526020998a820192368883830101116104e057818692898e93018637830101526001600160a01b03977f00000000000000000000000000000000000000000000000000000000000000008916330361055e577f0000000000000000000000000000000000000000000000000000000000000000891693929190891684900361052557808b91518101031261043e57519187831680930361043e5781156104f557877f000000000000000000000000000000000000000000000000000000000000000016908951636eb1769f60e11b8152308982015282888201528b81604481855afa9081156104eb578b8a888f948890889583916104ad575b5010610442575b5050509150503b1561043e57838091878b5180948193632e1a7d4d60e01b8352878d8401525af180156104345790849161041c575b5050875163a9059cbb60e01b8a82019081526001600160a01b03909316868201908152602081019290925291908290604001039661029e601f19988981018552846109a0565b7f0000000000000000000000000000000000000000000000000000000000000000169188519489860190868210908211176104085789528985527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648a86015251610339949392918391829182855af1903d156103ff573d61031e816109c2565b9061032b8b5192836109a0565b815280938b3d92013e6109f6565b805190868261038e575b505050505091815192818492835260605190818185015260005b8281106103795750506000838201850152601f01168101030190f35b6080810151878201870152869450810161035d565b8061039d9383010191016109de565b156103aa57808086610343565b835162461bcd60e51b8152918201859052602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b606092506109f6565b86604189634e487b7160e01b600052526000fd5b61042590610976565b610430578238610258565b8280fd5b89513d86823e3d90fd5b8380fd5b60449251958694859363095ea7b360e01b85528401526000198d8401525af180156104a357610476575b8a828b8a88610223565b610495908b3d8d1161049c575b61048d81836109a0565b8101906109de565b503861046c565b503d610483565b8a513d87823e3d90fd5b969550505050505081813d83116104e4575b6104c981836109a0565b810103126104e057828b8a888f948890513861021c565b8580fd5b503d6104bf565b8b513d88823e3d90fd5b885162461bcd60e51b81528088018b9052600b818801526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b895162461bcd60e51b81528089018c90526014818901527315dc9bdb99c8185cdcd95d081c9958d95a5d995960621b6044820152606490fd5b895163298655cb60e21b815233818a01528790fd5b600080fd5b5050346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b90508260e03660031901126108375781359263ffffffff84168094036100a9576001600160a01b0392602435848116919082900361043e576105fc61094a565b50610605610960565b956084359560c4359067ffffffffffffffff908183116108bf57366023840112156108bf57828501359182116108bf5736602483850101116108bf5786516323b872dd60e01b81523386820152306024820152604481018a905260209a908b816064818d7f000000000000000000000000000000000000000000000000000000000000000088165af18015610894576108a2575b50817f000000000000000000000000000000000000000000000000000000000000000016803b1561089e5789809160248d8c51948593849263b6b55f2560e01b84528d8401525af1801561089457908c91610873575b50918a916107778895948c9d8c9d857f0000000000000000000000000000000000000000000000000000000000000000169d8e91877f0000000000000000000000000000000000000000000000000000000000000000169d8e92519687958694859363095ea7b360e01b8552840160209093929193604081019460018060a01b031681520152565b03925af1801561086957918e9a9998979593918e97959361084c575b508c519b8c9a8b998a976345560b5d60e11b895288015260248701526044860152166064840152608483015260a43560a483015260e060c48301528060e48301528060246101049401848401378181018301849052601f01601f191681010301925af192831561084157809361080c575b505051908152f35b909192508382813d831161083a575b61082581836109a0565b81010312610837575051908380610804565b80fd5b503d61081b565b8251903d90823e3d90fd5b610862908c8d3d1061049c5761048d81836109a0565b508f610793565b8c513d8f823e3d90fd5b91610777889594928b9c6108878f96610976565b9c509294955050916106ef565b89513d8c823e3d90fd5b8980fd5b6108b8908c8d3d1061049c5761048d81836109a0565b508b610699565b8780fd5b5050346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8490346100a957816003193601126100a9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b604435906001600160a01b038216820361057357565b606435906001600160a01b038216820361057357565b67ffffffffffffffff811161098a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761098a57604052565b67ffffffffffffffff811161098a57601f01601f191660200190565b90816020910312610573575180151581036105735790565b91929015610a585750815115610a0a575090565b3b15610a135790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610a6b5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610ab1575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610a8e56fea2646970667358221220a26280b9abe7404fb6e4c77eb8db19fa3df486b33cee52cb3a5c4642c49741ad64736f6c63430008130033", - "deployedBytecode": "0x608060408181526004918236101561001657600080fd5b600092833560e01c91826366cc57021461090757508163785e9e86146108c35781638aac16ba146105bc578163de4b054814610578578163fd614f41146100ad575063ffcbd8d01461006757600080fd5b346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b9050346104305760c0366003190112610430576024908135916100ce61094a565b926100d7610960565b5060843563ffffffff8116036105735760a4359567ffffffffffffffff918288116100a957366023890112156100a9578785013597610115896109c2565b610121895191826109a0565b8981526020998a820192368883830101116104e057818692898e93018637830101526001600160a01b03977f00000000000000000000000000000000000000000000000000000000000000008916330361055e577f0000000000000000000000000000000000000000000000000000000000000000891693929190891684900361052557808b91518101031261043e57519187831680930361043e5781156104f557877f000000000000000000000000000000000000000000000000000000000000000016908951636eb1769f60e11b8152308982015282888201528b81604481855afa9081156104eb578b8a888f948890889583916104ad575b5010610442575b5050509150503b1561043e57838091878b5180948193632e1a7d4d60e01b8352878d8401525af180156104345790849161041c575b5050875163a9059cbb60e01b8a82019081526001600160a01b03909316868201908152602081019290925291908290604001039661029e601f19988981018552846109a0565b7f0000000000000000000000000000000000000000000000000000000000000000169188519489860190868210908211176104085789528985527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648a86015251610339949392918391829182855af1903d156103ff573d61031e816109c2565b9061032b8b5192836109a0565b815280938b3d92013e6109f6565b805190868261038e575b505050505091815192818492835260605190818185015260005b8281106103795750506000838201850152601f01168101030190f35b6080810151878201870152869450810161035d565b8061039d9383010191016109de565b156103aa57808086610343565b835162461bcd60e51b8152918201859052602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b606092506109f6565b86604189634e487b7160e01b600052526000fd5b61042590610976565b610430578238610258565b8280fd5b89513d86823e3d90fd5b8380fd5b60449251958694859363095ea7b360e01b85528401526000198d8401525af180156104a357610476575b8a828b8a88610223565b610495908b3d8d1161049c575b61048d81836109a0565b8101906109de565b503861046c565b503d610483565b8a513d87823e3d90fd5b969550505050505081813d83116104e4575b6104c981836109a0565b810103126104e057828b8a888f948890513861021c565b8580fd5b503d6104bf565b8b513d88823e3d90fd5b885162461bcd60e51b81528088018b9052600b818801526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b895162461bcd60e51b81528089018c90526014818901527315dc9bdb99c8185cdcd95d081c9958d95a5d995960621b6044820152606490fd5b895163298655cb60e21b815233818a01528790fd5b600080fd5b5050346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b90508260e03660031901126108375781359263ffffffff84168094036100a9576001600160a01b0392602435848116919082900361043e576105fc61094a565b50610605610960565b956084359560c4359067ffffffffffffffff908183116108bf57366023840112156108bf57828501359182116108bf5736602483850101116108bf5786516323b872dd60e01b81523386820152306024820152604481018a905260209a908b816064818d7f000000000000000000000000000000000000000000000000000000000000000088165af18015610894576108a2575b50817f000000000000000000000000000000000000000000000000000000000000000016803b1561089e5789809160248d8c51948593849263b6b55f2560e01b84528d8401525af1801561089457908c91610873575b50918a916107778895948c9d8c9d857f0000000000000000000000000000000000000000000000000000000000000000169d8e91877f0000000000000000000000000000000000000000000000000000000000000000169d8e92519687958694859363095ea7b360e01b8552840160209093929193604081019460018060a01b031681520152565b03925af1801561086957918e9a9998979593918e97959361084c575b508c519b8c9a8b998a976345560b5d60e11b895288015260248701526044860152166064840152608483015260a43560a483015260e060c48301528060e48301528060246101049401848401378181018301849052601f01601f191681010301925af192831561084157809361080c575b505051908152f35b909192508382813d831161083a575b61082581836109a0565b81010312610837575051908380610804565b80fd5b503d61081b565b8251903d90823e3d90fd5b610862908c8d3d1061049c5761048d81836109a0565b508f610793565b8c513d8f823e3d90fd5b91610777889594928b9c6108878f96610976565b9c509294955050916106ef565b89513d8c823e3d90fd5b8980fd5b6108b8908c8d3d1061049c5761048d81836109a0565b508b610699565b8780fd5b5050346100a957816003193601126100a957517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8490346100a957816003193601126100a9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b604435906001600160a01b038216820361057357565b606435906001600160a01b038216820361057357565b67ffffffffffffffff811161098a57604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761098a57604052565b67ffffffffffffffff811161098a57601f01601f191660200190565b90816020910312610573575180151581036105735790565b91929015610a585750815115610a0a575090565b3b15610a135790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610a6b5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610ab1575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610a8e56fea2646970667358221220a26280b9abe7404fb6e4c77eb8db19fa3df486b33cee52cb3a5c4642c49741ad64736f6c63430008130033", + "numDeployments": 3, + "solcInputHash": "5f7124abd6b8147eb28e3b3ed9f78f24", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_connext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_lockbox\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_erc20\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_xerc20\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"XReceiver__onlyConnext\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"connext\",\"outputs\":[{\"internalType\":\"contract IConnext\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"erc20\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockbox\",\"outputs\":[{\"internalType\":\"contract IXERC20Lockbox\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_transferId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_originSender\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_origin\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xReceive\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_destination\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_slippage\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xcall\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"xerc20\",\"outputs\":[{\"internalType\":\"contract IXERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"xReceive(bytes32,uint256,address,address,uint32,bytes)\":{\"details\":\"This function receives xERC20s from Connext and calls the Lockbox\",\"params\":{\"_amount\":\"The amount of funds that will be received.\",\"_asset\":\"The address of the asset that will be received.\",\"_callData\":\"The data that will be sent to the targets.\",\"_transferId\":\"The id of the transfer.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol\":\"GrumpyCatLockboxAdapter\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":connext-interfaces/=lib/connext-interfaces/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":vulcan/=lib/vulcan/src/\"],\"viaIR\":true},\"sources\":{\"@connext/interfaces/core/IConnext.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport {ExecuteArgs, TransferInfo, DestinationTransferStatus} from \\\"../libraries/LibConnextStorage.sol\\\";\\nimport {TokenId} from \\\"../libraries/TokenId.sol\\\";\\n\\ninterface IConnext {\\n\\n // ============ BRIDGE ==============\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function xcallIntoLocal(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function execute(ExecuteArgs calldata _args) external returns (bytes32 transferId);\\n\\n function forceUpdateSlippage(TransferInfo calldata _params, uint256 _slippage) external;\\n\\n function forceReceiveLocal(TransferInfo calldata _params) external;\\n\\n function bumpTransfer(bytes32 _transferId) external payable;\\n\\n function routedTransfers(bytes32 _transferId) external view returns (address[] memory);\\n\\n function transferStatus(bytes32 _transferId) external view returns (DestinationTransferStatus);\\n\\n function remote(uint32 _domain) external view returns (address);\\n\\n function domain() external view returns (uint256);\\n\\n function nonce() external view returns (uint256);\\n\\n function approvedSequencers(address _sequencer) external view returns (bool);\\n\\n function xAppConnectionManager() external view returns (address);\\n\\n // ============ ROUTERS ==============\\n\\n function LIQUIDITY_FEE_NUMERATOR() external view returns (uint256);\\n\\n function LIQUIDITY_FEE_DENOMINATOR() external view returns (uint256);\\n\\n function getRouterApproval(address _router) external view returns (bool);\\n\\n function getRouterRecipient(address _router) external view returns (address);\\n\\n function getRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwnerTimestamp(address _router) external view returns (uint256);\\n\\n function maxRoutersPerTransfer() external view returns (uint256);\\n\\n function routerBalances(address _router, address _asset) external view returns (uint256);\\n\\n function getRouterApprovalForPortal(address _router) external view returns (bool);\\n\\n function initializeRouter(address _owner, address _recipient) external;\\n\\n function setRouterRecipient(address _router, address _recipient) external;\\n\\n function proposeRouterOwner(address _router, address _proposed) external;\\n\\n function acceptProposedRouterOwner(address _router) external;\\n\\n function addRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address _router\\n ) external payable;\\n\\n function addRouterLiquidity(uint256 _amount, address _local) external payable;\\n\\n function removeRouterLiquidityFor(\\n TokenId memory _canonical,\\n uint256 _amount,\\n address payable _to,\\n address _router\\n ) external;\\n\\n function removeRouterLiquidity(TokenId memory _canonical, uint256 _amount, address payable _to) external;\\n\\n // ============ TOKEN_FACET ==============\\n function adoptedToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function approvedAssets(TokenId calldata _canonical) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x0b0676707cecd45da82623f18f73bd6bb733acae56dd7bd893f15c0dc08ea391\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/core/IXReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface IXReceiver {\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x37a35045d40f3bde688c70bb631581cbc609796514319db1361e061da8d9349b\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/libraries/LibConnextStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\n/**\\n * @notice Enum representing status of destination transfer\\n * @dev Status is only assigned on the destination domain, will always be \\\"none\\\" for the\\n * origin domains\\n * @return uint - Index of value in enum\\n */\\nenum DestinationTransferStatus {\\n None, // 0\\n Reconciled, // 1\\n Executed, // 2\\n Completed // 3 - executed + reconciled\\n}\\n\\n/**\\n * @notice These are the parameters that will remain constant between the\\n * two chains. They are supplied on `xcall` and should be asserted on `execute`\\n * @property to - The account that receives funds, in the event of a crosschain call,\\n * will receive funds if the call fails.\\n *\\n * @param originDomain - The originating domain (i.e. where `xcall` is called)\\n * @param destinationDomain - The final domain (i.e. where `execute` / `reconcile` are called)\\\\\\n * @param canonicalDomain - The canonical domain of the asset you are bridging\\n * @param to - The address you are sending funds (and potentially data) to\\n * @param delegate - An address who can execute txs on behalf of `to`, in addition to allowing relayers\\n * @param receiveLocal - If true, will use the local asset on the destination instead of adopted.\\n * @param callData - The data to execute on the receiving chain. If no crosschain call is needed, then leave empty.\\n * @param slippage - Slippage user is willing to accept from original amount in expressed in BPS (i.e. if\\n * a user takes 1% slippage, this is expressed as 1_000)\\n * @param originSender - The msg.sender of the xcall\\n * @param bridgedAmt - The amount sent over the bridge (after potential AMM on xcall)\\n * @param normalizedIn - The amount sent to `xcall`, normalized to 18 decimals\\n * @param nonce - The nonce on the origin domain used to ensure the transferIds are unique\\n * @param canonicalId - The unique identifier of the canonical token corresponding to bridge assets\\n */\\nstruct TransferInfo {\\n uint32 originDomain;\\n uint32 destinationDomain;\\n uint32 canonicalDomain;\\n address to;\\n address delegate;\\n bool receiveLocal;\\n bytes callData;\\n uint256 slippage;\\n address originSender;\\n uint256 bridgedAmt;\\n uint256 normalizedIn;\\n uint256 nonce;\\n bytes32 canonicalId;\\n}\\n\\n/**\\n * @notice\\n * @param params - The TransferInfo. These are consistent across sending and receiving chains.\\n * @param routers - The routers who you are sending the funds on behalf of.\\n * @param routerSignatures - Signatures belonging to the routers indicating permission to use funds\\n * for the signed transfer ID.\\n * @param sequencer - The sequencer who assigned the router path to this transfer.\\n * @param sequencerSignature - Signature produced by the sequencer for path assignment accountability\\n * for the path that was signed.\\n */\\nstruct ExecuteArgs {\\n TransferInfo params;\\n address[] routers;\\n bytes[] routerSignatures;\\n address sequencer;\\n bytes sequencerSignature;\\n}\",\"keccak256\":\"0xb8581253c5ebe58445c37d344fafe6126d3f7a15784337b3571637cd0068de57\",\"license\":\"UNLICENSED\"},\"@connext/interfaces/libraries/TokenId.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity ^0.8.0;\\n\\n// ============= Structs =============\\n\\n// Tokens are identified by a TokenId:\\n// domain - 4 byte chain ID of the chain from which the token originates\\n// id - 32 byte identifier of the token address on the origin chain, in that chain's address format\\nstruct TokenId {\\n uint32 domain;\\n bytes32 id;\\n}\\n\",\"keccak256\":\"0xfa4e01760604863ea105e18380c243cd2250a7553d2b852f67ecb747f9916b6d\",\"license\":\"MIT OR Apache-2.0\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-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 function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) 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(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) 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 function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\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 if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9b72f93be69ca894d8492c244259615c4a742afc8d63720dbc8bb81087d9b238\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"contracts/integration/GrumpyCat/GrumpyCatLockboxAdapter.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.13;\\n\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {IXReceiver} from \\\"@connext/interfaces/core/IXReceiver.sol\\\";\\nimport {IConnext} from \\\"@connext/interfaces/core/IConnext.sol\\\";\\n\\nimport {IXERC20} from \\\"../../shared/IXERC20/IXERC20.sol\\\";\\nimport {IXERC20Lockbox} from \\\"../../shared/IXERC20/IXERC20Lockbox.sol\\\";\\n\\ncontract GrumpyCatLockboxAdapter is IXReceiver {\\n IXERC20Lockbox public immutable lockbox;\\n IERC20 public immutable erc20;\\n IXERC20 public immutable xerc20;\\n IConnext public immutable connext;\\n\\n error XReceiver__onlyConnext(address sender);\\n\\n modifier onlyConnext() {\\n if (msg.sender != address(connext)) {\\n revert XReceiver__onlyConnext(msg.sender);\\n }\\n _;\\n }\\n\\n constructor(address _connext, address _lockbox, address _erc20, address _xerc20) {\\n connext = IConnext(_connext);\\n lockbox = IXERC20Lockbox(_lockbox);\\n erc20 = IERC20(_erc20);\\n xerc20 = IXERC20(_xerc20);\\n }\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32) {\\n erc20.transferFrom(msg.sender, address(this), _amount);\\n erc20.approve(address(lockbox), _amount);\\n lockbox.deposit(_amount);\\n xerc20.approve(address(connext), _amount);\\n\\n return\\n IConnext(connext).xcall{value: msg.value}(\\n _destination,\\n _to,\\n address(xerc20),\\n _delegate,\\n _amount,\\n _slippage,\\n _callData\\n );\\n }\\n\\n /// @dev This function receives xERC20s from Connext and calls the Lockbox\\n /// @param _amount The amount of funds that will be received.\\n /// @param _asset The address of the asset that will be received.\\n /// @param _transferId The id of the transfer.\\n /// @param _callData The data that will be sent to the targets.\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external onlyConnext returns (bytes memory) {\\n // Check for the right xerc20\\n require(_asset == address(xerc20), \\\"Wrong asset received\\\");\\n\\n // Unpack the _callData to get the recipient's address\\n address _recipient = abi.decode(_callData, (address));\\n\\n withdraw(_amount, _recipient);\\n }\\n\\n /// @notice Deposit ERC20s into the Lockbox\\n /// @param _amount Amount of ERC20s to use\\n /// @param _recipient Recipient of the xERC20s\\n function deposit(uint256 _amount, address _recipient) internal {\\n require(_amount > 0, \\\"Zero amount\\\");\\n IERC20 _xerc20 = IERC20(address(xerc20));\\n\\n if (erc20.allowance(address(this), address(lockbox)) < _amount) {\\n erc20.approve(address(lockbox), type(uint256).max);\\n }\\n lockbox.deposit(_amount);\\n\\n // Transfer the xERC20s to the recipient\\n SafeERC20.safeTransfer(_xerc20, _recipient, _amount);\\n }\\n\\n /// @notice Withdraw ERC20s from the Lockbox\\n /// @param _amount Amount of xERC20s to use\\n /// @param _recipient Recipient of the ERC20s\\n function withdraw(uint256 _amount, address _recipient) internal {\\n require(_amount > 0, \\\"Zero amount\\\");\\n IERC20 _xerc20 = IERC20(address(xerc20));\\n\\n if (_xerc20.allowance(address(this), address(lockbox)) < _amount) {\\n _xerc20.approve(address(lockbox), type(uint256).max);\\n }\\n lockbox.withdraw(_amount);\\n\\n // Transfer the ERC20s to the recipient\\n SafeERC20.safeTransfer(erc20, _recipient, _amount);\\n }\\n}\\n\",\"keccak256\":\"0x4492b6de43ecc9c499bfab14ef8c101f7fcf64e7c642bfc3fe20c61514d23508\",\"license\":\"UNLICENSED\"},\"contracts/shared/IXERC20/IXERC20.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.4 <0.9.0;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IXERC20 is IERC20 {\\n /**\\n * @notice Emits when a lockbox is set\\n *\\n * @param _lockbox The address of the lockbox\\n */\\n\\n event LockboxSet(address _lockbox);\\n\\n /**\\n * @notice Emits when a limit is set\\n *\\n * @param _mintingLimit The updated minting limit we are setting to the bridge\\n * @param _burningLimit The updated burning limit we are setting to the bridge\\n * @param _bridge The address of the bridge we are setting the limit too\\n */\\n event BridgeLimitsSet(uint256 _mintingLimit, uint256 _burningLimit, address indexed _bridge);\\n\\n /**\\n * @notice Reverts when a user with too low of a limit tries to call mint/burn\\n */\\n\\n error IXERC20_NotHighEnoughLimits();\\n\\n /**\\n * @notice Reverts when caller is not the factory\\n */\\n\\n error IXERC20_NotFactory();\\n\\n struct Bridge {\\n BridgeParameters minterParams;\\n BridgeParameters burnerParams;\\n }\\n\\n struct BridgeParameters {\\n uint256 timestamp;\\n uint256 ratePerSecond;\\n uint256 maxLimit;\\n uint256 currentLimit;\\n }\\n\\n /**\\n * @notice Sets the lockbox address\\n *\\n * @param _lockbox The address of the lockbox\\n */\\n\\n function setLockbox(address _lockbox) external;\\n\\n /**\\n * @notice Updates the limits of any bridge\\n * @dev Can only be called by the owner\\n * @param _mintingLimit The updated minting limit we are setting to the bridge\\n * @param _burningLimit The updated burning limit we are setting to the bridge\\n * @param _bridge The address of the bridge we are setting the limits too\\n */\\n function setLimits(address _bridge, uint256 _mintingLimit, uint256 _burningLimit) external;\\n\\n /**\\n * @notice Returns the max limit of a minter\\n *\\n * @param _minter The minter we are viewing the limits of\\n * @return _limit The limit the minter has\\n */\\n function mintingMaxLimitOf(address _minter) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the max limit of a bridge\\n *\\n * @param _bridge the bridge we are viewing the limits of\\n * @return _limit The limit the bridge has\\n */\\n\\n function burningMaxLimitOf(address _bridge) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the current limit of a minter\\n *\\n * @param _minter The minter we are viewing the limits of\\n * @return _limit The limit the minter has\\n */\\n\\n function mintingCurrentLimitOf(address _minter) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Returns the current limit of a bridge\\n *\\n * @param _bridge the bridge we are viewing the limits of\\n * @return _limit The limit the bridge has\\n */\\n\\n function burningCurrentLimitOf(address _bridge) external view returns (uint256 _limit);\\n\\n /**\\n * @notice Mints tokens for a user\\n * @dev Can only be called by a minter\\n * @param _user The address of the user who needs tokens minted\\n * @param _amount The amount of tokens being minted\\n */\\n\\n function mint(address _user, uint256 _amount) external;\\n\\n /**\\n * @notice Burns tokens for a user\\n * @dev Can only be called by a minter\\n * @param _user The address of the user who needs tokens burned\\n * @param _amount The amount of tokens being burned\\n */\\n\\n function burn(address _user, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0x79336da6dbf66ea8ef1ade2e96b1d57c1fab4191b73c9242f358b76852a28e88\",\"license\":\"UNLICENSED\"},\"contracts/shared/IXERC20/IXERC20Lockbox.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.4 <0.9.0;\\n\\ninterface IXERC20Lockbox {\\n /**\\n * @notice Emitted when tokens are deposited into the lockbox\\n */\\n\\n event Deposit(address _sender, uint256 _amount);\\n\\n /**\\n * @notice Emitted when tokens are withdrawn from the lockbox\\n */\\n\\n event Withdraw(address _sender, uint256 _amount);\\n\\n /**\\n * @notice Reverts when a user tries to deposit native tokens on a non-native lockbox\\n */\\n\\n error IXERC20Lockbox_NotNative();\\n\\n /**\\n * @notice Reverts when a user tries to deposit non-native tokens on a native lockbox\\n */\\n\\n error IXERC20Lockbox_Native();\\n\\n /**\\n * @notice Reverts when a user tries to withdraw and the call fails\\n */\\n\\n error IXERC20Lockbox_WithdrawFailed();\\n\\n /**\\n * @notice Deposit ERC20 tokens into the lockbox\\n *\\n * @param _amount The amount of tokens to deposit\\n */\\n\\n function deposit(uint256 _amount) external;\\n\\n /**\\n * @notice Withdraw ERC20 tokens from the lockbox\\n *\\n * @param _amount The amount of tokens to withdraw\\n */\\n\\n function withdraw(uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0x2a7f6f297d115b13875600b436a180889ae027a4e2b99ac4076739bb5eca1614\",\"license\":\"UNLICENSED\"}},\"version\":1}", + "bytecode": "0x610100346100f657601f610cbf38819003918201601f19168301916001600160401b038311848410176100fb578084926080946040528339810103126100f65761004881610111565b9061005560208201610111565b9161006e606061006760408501610111565b9301610111565b6001600160a01b0391821660e05292811660805290811660a0521660c052604051610b99908161012682396080518181816101d9015281816106b001526109af015260a0518181816102a801528181610656015261096c015260c05181818160870152818161018a015261076b015260e05181818161016101528181610596015261078f0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036100f65756fe6101206040908082526004908136101561001857600080fd5b60006101009281845260e08235811c93846366cc57021461099b57508363785e9e86146109555783638aac16ba146105c557508263de4b05481461057e578263fd614f41146100be57505063ffcbd8d01461007257600080fd5b346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b5180fd5b849084346100ba5760c03660031901126100ba576024918235926100e06109de565b936100e96109f9565b5060843563ffffffff81160361057a5760a4359367ffffffffffffffff91828611610575573660238701121561057557858501359561012787610a5b565b6101338a519182610a39565b87815260209788820192368883830101116104df5787829101843784519082018901526001600160a01b03987f00000000000000000000000000000000000000000000000000000000000000008a163303610560577f00000000000000000000000000000000000000000000000000000000000000008a16939291908a168490036105275780899151810103126104415751918883168093036104415781156104f757887f000000000000000000000000000000000000000000000000000000000000000016908a51636eb1769f60e11b8152308982015282888201528981604481855afa9081156104eb578a9185918851916104b4575b5010610446575b5050803b1561044157895190632e1a7d4d60e01b82528288830152818781875180945af1801561043557610421575b50885163a9059cbb60e01b8882019081526001600160a01b0390931686820190815260208101929092529190829060400103976102a6601f19998a8101855284610a39565b7f000000000000000000000000000000000000000000000000000000000000000016918951948a8601908682109082111761040f578a528785527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488860152835190516103449594939282919082855af1903d15610406573d9261032984610a5b565b936103368c519586610a39565b8452513d908985013e610a8f565b8051908482610397575b505050505092908251938492818452606051918281860152815b838110610382575050838201850152601f01168101030190f35b60808101518882018801528795508101610368565b806103a6938301019101610a77565b156103b35780808461034e565b602a9060849386519362461bcd60e51b85528401528201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b60609250610a8f565b634e487b7160e01b8c5260418852868cfd5b61042a90610a0f565b825180156102615780fd5b8a5185513d90823e3d90fd5b835180fd5b6044918c519283809263095ea7b360e01b8252868d8301526000198c8301528951905af180156104a85761047b575b88610232565b61049a90893d8b116104a1575b6104928183610a39565b810190610a77565b508b610475565b503d610488565b8b5186513d90823e3d90fd5b928092508391503d83116104e4575b6104cd8183610a39565b810103126104df57838a91518f61022b565b855180fd5b503d6104c3565b8c5187513d90823e3d90fd5b895162461bcd60e51b8152808801899052600b818801526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b8a5162461bcd60e51b81528089018a90526014818901527315dc9bdb99c8185cdcd95d081c9958d95a5d995960621b6044820152606490fd5b8a5163298655cb60e21b815233818a01528790fd5b505180fd5b8680fd5b505050346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b80868693849360031936011261044157803563ffffffff8116809103610950576001600160a01b0360248035828116949193929085900361094b576106086109de565b506106116109f9565b9360843560c4359267ffffffffffffffff96878511610946573660238601121561094657848601359788116109465736848987010111610946578b60208060648e8e877f0000000000000000000000000000000000000000000000000000000000000000166080525194859384926323b872dd60e01b84528d3390850152308c8501528a604485015252516080515af180156108ed57610928575b50817f00000000000000000000000000000000000000000000000000000000000000001660a0528a8c878c518092818061070e8a63095ea7b360e01b98898452519660a05190840160209093929193604081019460018060a01b031681520152565b0391516080515af1801561091c576108fe575b5060a0513b156108f9578a518060c05263b6b55f2560e01b9052838760c05101528c5160c05186818360a0515af180156108ed57878c8e9f6107da9b9c9d9e9f88946108dd575b877f00000000000000000000000000000000000000000000000000000000000000001695887f0000000000000000000000000000000000000000000000000000000000000000169d8e94519687958694859485525197840160209093929193604081019460018060a01b031681520152565b039151865af180156108d0578b9695949392918f916108b2575b50508c519b8c9a8b996345560b5d60e11b8b528a0152858901526044880152166064860152608485015260a43560a48501528960c48501528160e48501526101049201828401378851828601820152875194601f01601f19168201829003019134905af19384156108a657805194610871575b5050519182525190f35b9091935082513d811161089f575b6108898184610a39565b82845191810103126100ba575051918380610867565b503d61087f565b8251903d9051823e3d90fd5b6108c891513d81116104a1576104928183610a39565b508d386107f4565b8f8e51903d9051823e3d90fd5b6108e860c051610a0f565b610768565b8b518e513d90823e3d90fd5b8c5180fd5b610915908d513d81116104a1576104928183610a39565b508e610721565b8c518f513d90823e3d90fd5b61093f908c513d81116104a1576104928183610a39565b508d6106ac565b8b5180fd5b875180fd5b845180fd5b8585346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8390346100b657816003193601126100b6577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b604435906001600160a01b03821682036109f457565b600080fd5b606435906001600160a01b03821682036109f457565b67ffffffffffffffff8111610a2357604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610a2357604052565b67ffffffffffffffff8111610a2357601f01601f191660200190565b908160209103126109f4575180151581036109f45790565b91929015610af15750815115610aa3575090565b3b15610aac5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610b045750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610b4a575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610b2756fea26469706673582212206099a8a22d78d0acf3f3700a41a0d165039cfd8d982f8e0a350339651dcda88364736f6c63430008130033", + "deployedBytecode": "0x6101206040908082526004908136101561001857600080fd5b60006101009281845260e08235811c93846366cc57021461099b57508363785e9e86146109555783638aac16ba146105c557508263de4b05481461057e578263fd614f41146100be57505063ffcbd8d01461007257600080fd5b346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b5180fd5b849084346100ba5760c03660031901126100ba576024918235926100e06109de565b936100e96109f9565b5060843563ffffffff81160361057a5760a4359367ffffffffffffffff91828611610575573660238701121561057557858501359561012787610a5b565b6101338a519182610a39565b87815260209788820192368883830101116104df5787829101843784519082018901526001600160a01b03987f00000000000000000000000000000000000000000000000000000000000000008a163303610560577f00000000000000000000000000000000000000000000000000000000000000008a16939291908a168490036105275780899151810103126104415751918883168093036104415781156104f757887f000000000000000000000000000000000000000000000000000000000000000016908a51636eb1769f60e11b8152308982015282888201528981604481855afa9081156104eb578a9185918851916104b4575b5010610446575b5050803b1561044157895190632e1a7d4d60e01b82528288830152818781875180945af1801561043557610421575b50885163a9059cbb60e01b8882019081526001600160a01b0390931686820190815260208101929092529190829060400103976102a6601f19998a8101855284610a39565b7f000000000000000000000000000000000000000000000000000000000000000016918951948a8601908682109082111761040f578a528785527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488860152835190516103449594939282919082855af1903d15610406573d9261032984610a5b565b936103368c519586610a39565b8452513d908985013e610a8f565b8051908482610397575b505050505092908251938492818452606051918281860152815b838110610382575050838201850152601f01168101030190f35b60808101518882018801528795508101610368565b806103a6938301019101610a77565b156103b35780808461034e565b602a9060849386519362461bcd60e51b85528401528201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b60609250610a8f565b634e487b7160e01b8c5260418852868cfd5b61042a90610a0f565b825180156102615780fd5b8a5185513d90823e3d90fd5b835180fd5b6044918c519283809263095ea7b360e01b8252868d8301526000198c8301528951905af180156104a85761047b575b88610232565b61049a90893d8b116104a1575b6104928183610a39565b810190610a77565b508b610475565b503d610488565b8b5186513d90823e3d90fd5b928092508391503d83116104e4575b6104cd8183610a39565b810103126104df57838a91518f61022b565b855180fd5b503d6104c3565b8c5187513d90823e3d90fd5b895162461bcd60e51b8152808801899052600b818801526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b8a5162461bcd60e51b81528089018a90526014818901527315dc9bdb99c8185cdcd95d081c9958d95a5d995960621b6044820152606490fd5b8a5163298655cb60e21b815233818a01528790fd5b505180fd5b8680fd5b505050346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b80868693849360031936011261044157803563ffffffff8116809103610950576001600160a01b0360248035828116949193929085900361094b576106086109de565b506106116109f9565b9360843560c4359267ffffffffffffffff96878511610946573660238601121561094657848601359788116109465736848987010111610946578b60208060648e8e877f0000000000000000000000000000000000000000000000000000000000000000166080525194859384926323b872dd60e01b84528d3390850152308c8501528a604485015252516080515af180156108ed57610928575b50817f00000000000000000000000000000000000000000000000000000000000000001660a0528a8c878c518092818061070e8a63095ea7b360e01b98898452519660a05190840160209093929193604081019460018060a01b031681520152565b0391516080515af1801561091c576108fe575b5060a0513b156108f9578a518060c05263b6b55f2560e01b9052838760c05101528c5160c05186818360a0515af180156108ed57878c8e9f6107da9b9c9d9e9f88946108dd575b877f00000000000000000000000000000000000000000000000000000000000000001695887f0000000000000000000000000000000000000000000000000000000000000000169d8e94519687958694859485525197840160209093929193604081019460018060a01b031681520152565b039151865af180156108d0578b9695949392918f916108b2575b50508c519b8c9a8b996345560b5d60e11b8b528a0152858901526044880152166064860152608485015260a43560a48501528960c48501528160e48501526101049201828401378851828601820152875194601f01601f19168201829003019134905af19384156108a657805194610871575b5050519182525190f35b9091935082513d811161089f575b6108898184610a39565b82845191810103126100ba575051918380610867565b503d61087f565b8251903d9051823e3d90fd5b6108c891513d81116104a1576104928183610a39565b508d386107f4565b8f8e51903d9051823e3d90fd5b6108e860c051610a0f565b610768565b8b518e513d90823e3d90fd5b8c5180fd5b610915908d513d81116104a1576104928183610a39565b508e610721565b8c518f513d90823e3d90fd5b61093f908c513d81116104a1576104928183610a39565b508d6106ac565b8b5180fd5b875180fd5b845180fd5b8585346100ba575190816003193601126100b657517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b8390346100b657816003193601126100b6577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b604435906001600160a01b03821682036109f457565b600080fd5b606435906001600160a01b03821682036109f457565b67ffffffffffffffff8111610a2357604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610a2357604052565b67ffffffffffffffff8111610a2357601f01601f191660200190565b908160209103126109f4575180151581036109f45790565b91929015610af15750815115610aa3575090565b3b15610aac5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610b045750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610b4a575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610b2756fea26469706673582212206099a8a22d78d0acf3f3700a41a0d165039cfd8d982f8e0a350339651dcda88364736f6c63430008130033", "devdoc": { "kind": "dev", "methods": { diff --git a/hardhat.config.ts b/hardhat.config.ts index 8b82c0d..b2bb273 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -28,7 +28,9 @@ function createConfig(network: string) { } function getNetworkUrl(networkType: string) { - if (networkType === "polygon") + if (networkType === "mainnet") + return alchemyApiKey ? `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}` : "https://eth.llamarpc.com"; + else if (networkType === "polygon") return alchemyApiKey ? `https://polygon-mainnet.g.alchemy.com/v2/${alchemyApiKey}` : "https://polygon.llamarpc.com"; else if (networkType === "arbitrum") return alchemyApiKey ? `https://arb-mainnet.g.alchemy.com/v2/${alchemyApiKey}` : "https://arb1.arbitrum.io/rpc";