COOK COOK N/A
Last Block- HealthChecking Head-
BT--:--
ConsensusQBFT Chain ID20261001 Nodes0/0
Gas price- Gwei
Cookchain Cookchain

Contract Details

Overview

COOK BALANCE

Loading…

TOKEN NAME

EVM Contract

TOTAL SUPPLY

Not available

More Info

CONTRACT ADDRESS

0x1605e9b2d74414d80d79ef13d1559fa751ab316c

CONTRACT CREATOR

Not available

TOKEN TRACKER

Checking ERC-20 metadata…

Contract Info

SOURCE CODE

✓ Verified

TOKEN DECIMALS

Not available

Market and multichain values require verified data feeds.

Latest Contract Transactions

Loading indexed transactions…

Transaction HashActionBlockAgeFromToAmountTxn Fee
Raw Contract Data · JSON
{
  "id": "0x1605e9b2d74414d80d79ef13d1559fa751ab316c",
  "contract": "0x1605e9b2d74414d80d79ef13d1559fa751ab316c",
  "name": "EVM Contract",
  "type": "contract",
  "bytecode": "0x6080604052600436106102cc575f3560e01c80638bd90b821161017b578063d5438eae116100d1578063e9198bf911610087578063f2ed8c5311610062578063f2ed8c531461088a578063f2fde38b146108a9578063fc0c546a146108c8575f5ffd5b8063e9198bf914610838578063efae508a14610857578063f11f446114610876575f5ffd5b8063de523cf3116100b7578063de523cf3146107dd578063e74b981b146107fa578063e80a7c7914610819575f5ffd5b8063d5438eae14610766578063dd62ed3e14610799575f5ffd5b806395d89b4111610131578063a9059cbb1161010c578063a9059cbb14610709578063b1bd643614610728578063b49c53a714610747575f5ffd5b806395d89b41146106a35780639f0b7659146106b7578063a457c2d7146106ea575f5ffd5b80638da5cb5b116101615780638da5cb5b1461061f57806392c184541461063c57806393c448471461065b575f5ffd5b80638bd90b82146105ab5780638d3638f4146105d7575f5ffd5b8063440df4f41161023057806370a08231116101e6578063775313a1116101c1578063775313a11461054e5780637f5a7c7b1461057957806381b4e8b414610598575f5ffd5b806370a08231146104e7578063715018a61461051b57806371a15b381461052f575f5ffd5b806349d462ef1161021657806349d462ef146104a157806356d5d475146104c0578063647846a5146104d3575f5ffd5b8063440df4f4146104545780634690484014610475575f5ffd5b806323b872dd11610285578063313ce5671161026b578063313ce567146103d957806339509351146104165780633dfd387314610435575f5ffd5b806323b872dd1461039b5780632ead72f6146103ba575f5ffd5b80630e72cc06116102b55780630e72cc061461032957806318160ddd1461034a5780631c2eaac014610368575f5ffd5b806306fdde03146102d0578063095ea7b3146102fa575b5f5ffd5b3480156102db575f5ffd5b506102e46108da565b6040516102f19190613400565b60405180910390f35b348015610305575f5ffd5b50610319610314366004613426565b61096a565b60405190151581526020016102f1565b348015610334575f5ffd5b50610348610343366004613450565b610983565b005b348015610355575f5ffd5b506035545b6040519081526020016102f1565b348015610373575f5ffd5b5061035a7f000000000000000000000000000000000000000000000000000000000000000181565b3480156103a6575f5ffd5b506103196103b536600461346b565b610a90565b3480156103c5575f5ffd5b5061035a6103d43660046134c1565b610ab5565b3480156103e4575f5ffd5b5060405160ff7f00000000000000000000000000000000000000000000000000000000000000121681526020016102f1565b348015610421575f5ffd5b50610319610430366004613426565b610ad3565b348015610440575f5ffd5b5061034861044f366004613450565b610b11565b34801561045f575f5ffd5b50610468610c11565b6040516102f191906134da565b348015610480575f5ffd5b50610489610c22565b6040516001600160a01b0390911681526020016102f1565b3480156104ac575f5ffd5b506103486104bb366004613522565b610c54565b6103486104ce36600461353c565b610c6a565b3480156104de575f5ffd5b50610489610d9c565b3480156104f2575f5ffd5b5061035a610501366004613450565b6001600160a01b03165f9081526033602052604090205490565b348015610526575f5ffd5b50610348610dbe565b34801561053a575f5ffd5b50610348610549366004613600565b610dd1565b348015610559575f5ffd5b5061035a6105683660046134c1565b60fc6020525f908152604090205481565b348015610584575f5ffd5b50609754610489906001600160a01b031681565b61035a6105a636600461363f565b610e2b565b3480156105b6575f5ffd5b506105ca6105c536600461363f565b610e37565b6040516102f1919061366f565b3480156105e2575f5ffd5b5061060a7f000000000000000000000000000000000000000000000000000000000135288981565b60405163ffffffff90911681526020016102f1565b34801561062a575f5ffd5b506065546001600160a01b0316610489565b348015610647575f5ffd5b50610348610656366004613450565b610f6d565b348015610666575f5ffd5b506102e46040518060400160405280600681526020017f31322e312e30000000000000000000000000000000000000000000000000000081525081565b3480156106ae575f5ffd5b506102e4610f81565b3480156106c2575f5ffd5b5061035a7f000000000000000000000000000000000000000000000000000000000000000181565b3480156106f5575f5ffd5b50610319610704366004613426565b610f90565b348015610714575f5ffd5b50610319610723366004613426565b611044565b348015610733575f5ffd5b506103486107423660046136bb565b611051565b348015610752575f5ffd5b50610348610761366004613522565b6110c6565b348015610771575f5ffd5b506104897f0000000000000000000000008ecd10fd6d7822ef16418689f92e5e1d5f144bd981565b3480156107a4575f5ffd5b5061035a6107b336600461372c565b6001600160a01b039182165f90815260346020908152604080832093909416825291909152205490565b3480156107e8575f5ffd5b506098546001600160a01b0316610489565b348015610805575f5ffd5b50610348610814366004613450565b6110d8565b348015610824575f5ffd5b50610348610833366004613856565b6111c5565b348015610843575f5ffd5b506103486108523660046138fb565b611354565b348015610862575f5ffd5b506103486108713660046134c1565b611418565b348015610881575f5ffd5b50610489611429565b348015610895575f5ffd5b5061035a6108a43660046134c1565b611450565b3480156108b4575f5ffd5b506103486108c3366004613450565b61147e565b3480156108d3575f5ffd5b5030610489565b6060603680546108e990613967565b80601f016020809104026020016040519081016040528092919081815260200182805461091590613967565b80156109605780601f1061093757610100808354040283529160200191610960565b820191905f5260205f20905b81548152906001019060200180831161094357829003601f168201915b5050505050905090565b5f3361097781858561150b565b60019150505b92915050565b806001600160a01b0381163b1515806109a357506001600160a01b038116155b610a1a5760405162461bcd60e51b815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e670000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610a22611662565b609880547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091556040519081527fc47cbcc588c67679e52261c45cc315e56562f8d0ccaba16facb9093ff9498799906020015b60405180910390a15050565b5f33610a9d8582856116bc565b610aa8858585611746565b60019150505b9392505050565b5f80610acb60c963ffffffff8086169061193816565b949350505050565b335f8181526034602090815260408083206001600160a01b03871684529091528120549091906109779082908690610b0c9087906139e5565b61150b565b806001600160a01b0381163b151580610b3157506001600160a01b038116155b610ba35760405162461bcd60e51b815260206004820152602760248201527f4d61696c626f78436c69656e743a20696e76616c696420636f6e74726163742060448201527f73657474696e67000000000000000000000000000000000000000000000000006064820152608401610a11565b610bab611662565b609780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384169081179091556040519081527f4eab7b127c764308788622363ad3e9532de3dfba7845bd4f84c125a22544255a90602001610a84565b6060610c1d60c9611950565b905090565b5f7f721d42344eebce0a76684e8fddd9c81a84afda39f3019e5a078a53853f098d115b546001600160a01b0316919050565b610c5c611662565b610c6682826119ff565b5050565b336001600160a01b037f0000000000000000000000008ecd10fd6d7822ef16418689f92e5e1d5f144bd91614610d085760405162461bcd60e51b815260206004820152602160248201527f4d61696c626f78436c69656e743a2073656e646572206e6f74206d61696c626f60448201527f78000000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b5f610d1285611a88565b9050838114610d895760405162461bcd60e51b815260206004820152602560248201527f456e726f6c6c656420726f7574657220646f6573206e6f74206d61746368207360448201527f656e6465720000000000000000000000000000000000000000000000000000006064820152608401610a11565b610d9585858585611ad2565b5050505050565b5f80610da6611429565b6001600160a01b031603610db957505f90565b503090565b610dc6611662565b610dcf5f611b47565b565b610dd9611662565b805f5b81811015610e2557610e13848483818110610df957610df96139f8565b9050602002016020810190610e0e91906134c1565b611bb0565b610e1e6001826139e5565b9050610ddc565b50505050565b5f610acb848484611beb565b60605f610e42610d9c565b60408051600380825260808201909252919250816020015b604080518082019091525f8082526020820152815260200190600190039081610e5a5790505091506040518060400160405280826001600160a01b03168152602001610ea887878786611c5d565b815250825f81518110610ebd57610ebd6139f8565b60200260200101819052505f610ed4868686611ca8565b9150506040518060400160405280610ee93090565b6001600160a01b03168152602001610f0183876139e5565b81525083600181518110610f1757610f176139f8565b60200260200101819052506040518060400160405280610f343090565b6001600160a01b031681526020015f81525083600281518110610f5957610f596139f8565b602002602001018190525050509392505050565b610f75611662565b610f7e81611e4d565b50565b6060603780546108e990613967565b335f8181526034602090815260408083206001600160a01b03871684529091528120549091908381101561102c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610a11565b611039828686840361150b565b506001949350505050565b5f33610977818585611746565b611059611662565b5f5b818110156110c1576110af838383818110611078576110786139f8565b61108e92602060409092020190810191506134c1565b8484848181106110a0576110a06139f8565b905060400201602001356119ff565b6110ba6001826139e5565b905061105b565b505050565b6110ce611662565b610c668282611f55565b6110e0611662565b306001600160a01b038216036111385760405162461bcd60e51b815260206004820152601c60248201527f46656520726563697069656e742063616e6e6f742062652073656c66000000006044820152606401610a11565b807f721d42344eebce0a76684e8fddd9c81a84afda39f3019e5a078a53853f098d1180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392831617905560405190821681527fbf9a9534339a9d6b81696e05dcfb614b7dc518a31d48be3cfb757988381fb323906020015b60405180910390a150565b5f54610100900460ff16158080156111e357505f54600160ff909116105b806111fc5750303b1580156111fc57505f5460ff166001145b61126e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610a11565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156112ca575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6112d48686611f6b565b6112de3388611ff1565b6112e98484846120b0565b801561134b575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b61135c611662565b8281146113ab5760405162461bcd60e51b815260206004820152600760248201527f216c656e677468000000000000000000000000000000000000000000000000006044820152606401610a11565b825f5b81811015611410576113fe8686838181106113cb576113cb6139f8565b90506020020160208101906113e091906134c1565b8585848181106113f2576113f26139f8565b90506020020135611f55565b6114096001826139e5565b90506113ae565b505050505050565b611420611662565b610f7e81611bb0565b5f7fe797cab0ddd50f45c2a522220a721ebb6d0f53785d8595512b6122e7164a201f610c45565b5f61097d8260405180602001604052805f81525061146d8561214f565b6097546001600160a01b0316612170565b611486611662565b6001600160a01b0381166115025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a11565b610f7e81611b47565b6001600160a01b0383166115865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b0382166116025760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b038381165f8181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6065546001600160a01b03163314610dcf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a11565b6001600160a01b038381165f908152603460209081526040808320938616835292905220545f198114610e2557818110156117395760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a11565b610e25848484840361150b565b6001600160a01b0383166117c25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b03821661183e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b0383165f90815260336020526040902054818110156118cc5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b038085165f8181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061192b9086815260200190565b60405180910390a3610e25565b5f806119448484612234565b915091505b9250929050565b60605f61195c8361226c565b9050805167ffffffffffffffff81111561197857611978613763565b6040519080825280602002602001820160405280156119a1578160200160208202803683370190505b5091505f5b81518110156119f8578181815181106119c1576119c16139f8565b60200260200101518382815181106119db576119db6139f8565b63ffffffff909216602092830291909101909101526001016119a6565b5050919050565b611a1360c963ffffffff808516906122fa16565b611a1c83612305565b90611a3a5760405162461bcd60e51b8152600401610a119190613400565b5063ffffffff82165f81815260fc6020908152604091829020849055815192835282018390527fc3de732a98b24a2b5c6f67e8a7fb057ffc14046b83968a2c73e4148d2fba978b9101610a84565b5f8080611a9f60c963ffffffff8087169061193816565b915091508115611ab0579392505050565b611ab984612305565b60405162461bcd60e51b8152600401610a119190613400565b5f611add838361233c565b90505f611aea8484612364565b9050818663ffffffff167fba20947a325f450d232530e5f5fce293e7963499d5309a07cee84a269f2f15a683604051611b2591815260200190565b60405180910390a3611410611b3983612373565b611b42836123f4565b612441565b606580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b611bc460c963ffffffff8084169061244b16565b611bcd82612305565b90610c665760405162461bcd60e51b8152600401610a119190613400565b5f5f611bf5611429565b90505f611c00610d9c565b90505f611c108787873487612456565b9150505f611c1d86612538565b60408051602081018a90528082018390528151808203830181526060909101909152909150611c50898984868589612585565b9998505050505050505050565b5f611c9f85611c9586611c6f87612538565b604080516020810193909352828101919091528051808303820181526060909201905290565b61146d88866125f3565b95945050505050565b5f5f611cb2610c22565b91506001600160a01b038216611cc957505f611e45565b6040517f8bd90b8200000000000000000000000000000000000000000000000000000000815263ffffffff8616600482015260248101859052604481018490525f906001600160a01b03841690638bd90b82906064015f60405180830381865afa158015611d39573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611d609190810190613a25565b905080515f03611d7357505f9050611e45565b80516001148015611db15750306001600160a01b0316815f81518110611d9b57611d9b6139f8565b60200260200101515f01516001600160a01b0316145b611e235760405162461bcd60e51b815260206004820152602960248201527f46756e6769626c65546f6b656e526f757465723a20666565206d757374206d6160448201527f74636820746f6b656e00000000000000000000000000000000000000000000006064820152608401610a11565b805f81518110611e3557611e356139f8565b6020026020010151602001519150505b935093915050565b6001600160a01b03811615611ecf5730611ecf5760405162461bcd60e51b815260206004820152602a60248201527f546f6b656e526f757465723a2066656520686f6f6b207265717569726573204560448201527f5243323020746f6b656e000000000000000000000000000000000000000000006064820152608401610a11565b807fe797cab0ddd50f45c2a522220a721ebb6d0f53785d8595512b6122e7164a201f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392831617905560405190821681527fd6e2f80c31feccfd7c896d69ad9963871021131ff84f2a9828b40bad60dd8cb4906020016111ba565b610c6660c963ffffffff80851690849061261716565b5f54610100900460ff16611fe75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b610c668282612622565b6001600160a01b0382166120475760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a11565b8060355f82825461205891906139e5565b90915550506001600160a01b0382165f818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f54610100900460ff1661212c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b6121346126b7565b61213d83610b11565b61214682610983565b6110c181611b47565b63ffffffff81165f90815260fc602052604090205460609061097d9061273b565b5f5f61217b86611a88565b6040517f81d2ea950000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000008ecd10fd6d7822ef16418689f92e5e1d5f144bd916906381d2ea95906121eb90899085908a908a908a90600401613af5565b602060405180830381865afa158015612206573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061222a9190613b47565b9695505050505050565b5f818152600283016020526040812054819080612261576122558585612757565b92505f91506119499050565b600192509050611949565b60605f61227883612762565b90508067ffffffffffffffff81111561229357612293613763565b6040519080825280602002602001820160405280156122bc578160200160208202803683370190505b5091505f5b818110156119f8576122d3848261276c565b5f1c8382815181106122e7576122e76139f8565b60209081029190910101526001016122c1565b5f610aae8383612757565b60606123168263ffffffff16612777565b6040516020016123269190613b75565b6040516020818303038152906040529050919050565b5f82818361234b826020613ba6565b60ff169261235b93929190613bbf565b610aae91613be6565b5f8260208361234b8280613ba6565b5f6001600160a01b038211156123f05760405162461bcd60e51b8152602060048201526024808201527f5479706543617374733a2062797465733332546f41646472657373206f76657260448201527f666c6f77000000000000000000000000000000000000000000000000000000006064820152608401610a11565b5090565b5f61097d827f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000000184612814565b610c668282611ff1565b5f610aae8383612863565b5f5f5f5f612465898989611ca8565b90925090505f93505f84612479838a6139e5565b61248391906139e5565b9050306001600160a01b038716156124f0575f6124a28c8c8c85611c5d565b90506001600160a01b03821630146124c5576124be81846139e5565b92506124da565b6124da6001600160a01b03831633308461287f565b6124ee6001600160a01b0383168983612930565b505b6124f982612a05565b8215612509576125098484612a0f565b6001600160a01b038116612526576125218289613c03565b612528565b875b9450505050509550959350505050565b5f61097d827f00000000000000000000000000000000000000000000000000000000000000017f000000000000000000000000000000000000000000000000000000000000000184612814565b5f858763ffffffff167fd229aacb94204188fe8042965fa6b269c62dc5818b21238779ab64bdd17efeec876040516125bf91815260200190565b60405180910390a36125e88785856125d78b876125f3565b6097546001600160a01b0316612a19565b979650505050505050565b63ffffffff82165f90815260fc6020526040812054606091610acb90823386612abc565b610e25838383612b47565b5f54610100900460ff1661269e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b60366126aa8382613c64565b5060376110c18282613c64565b5f54610100900460ff166127335760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b610dcf612b63565b606061097d5f833360405180602001604052805f815250612be8565b5f610aae8383612c04565b5f61097d82612c1b565b5f610aae8383612c24565b60605f61278383612c4a565b60010190505f8167ffffffffffffffff8111156127a2576127a2613763565b6040519080825280601f01601f1916602001820160405280156127cc576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846127d657509392505050565b5f5f612821868686612d2b565b9050600183600281111561283757612837613d4c565b14801561285357505f848061284e5761284e613d1f565b868809115b15611c9f5761222a6001826139e5565b5f8181526002830160205260408120819055610aae8383612e18565b6040516001600160a01b0380851660248301528316604482015260648101829052610e259085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612e23565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526129af8482612f09565b610e25576040516001600160a01b03841660248201525f60448201526129fb9085907f095ea7b300000000000000000000000000000000000000000000000000000000906064016128cc565b610e258482612e23565b610f7e3382612fa6565b610c668282612441565b5f5f612a2487611a88565b90507f0000000000000000000000008ecd10fd6d7822ef16418689f92e5e1d5f144bd96001600160a01b03166310b83dc08789848989896040518763ffffffff1660e01b8152600401612a7b959493929190613af5565b60206040518083038185885af1158015612a97573d5f5f3e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906125e89190613b47565b6040517e0100000000000000000000000000000000000000000000000000000000000060208201526022810185905260428101849052606083811b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000908116606284015283821b16607683015290608a015b6040516020818303038152906040529050949350505050565b5f8281526002840160205260408120829055610acb848461310f565b5f54610100900460ff16612bdf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a11565b610dcf33611b47565b6060600185858585604051602001612b2e959493929190613d79565b5f8181526001830160205260408120541515610aae565b5f61097d825490565b5f825f018281548110612c3957612c396139f8565b905f5260205f200154905092915050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612c92577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612cbe576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612cdc57662386f26fc10000830492506010015b6305f5e1008310612cf4576305f5e100830492506008015b6127108310612d0857612710830492506004015b60648310612d1a576064830492506002015b600a831061097d5760010192915050565b5f80805f19858709858702925082811083820303915050805f03612d6257838281612d5857612d58613d1f565b0492505050610aae565b808411612db15760405162461bcd60e51b815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152606401610a11565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f610aae838361311a565b5f612e77826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166131fd9092919063ffffffff16565b905080515f1480612e97575080806020019051810190612e979190613de6565b6110c15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a11565b5f5f5f846001600160a01b031684604051612f249190613e05565b5f604051808303815f865af19150503d805f8114612f5d576040519150601f19603f3d011682016040523d82523d5f602084013e612f62565b606091505b5091509150818015612f8c575080511580612f8c575080806020019051810190612f8c9190613de6565b8015611c9f5750505050506001600160a01b03163b151590565b6001600160a01b0382166130225760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b0382165f90815260336020526040902054818110156130b05760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610a11565b6001600160a01b0383165f8181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b5f610aae838361320b565b5f81815260018301602052604081205480156131f4575f61313c600183613c03565b85549091505f9061314f90600190613c03565b90508181146131ae575f865f01828154811061316d5761316d6139f8565b905f5260205f200154905080875f01848154811061318d5761318d6139f8565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806131bf576131bf613e10565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061097d565b5f91505061097d565b6060610acb84845f85613257565b5f81815260018301602052604081205461325057508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561097d565b505f61097d565b6060824710156132cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a11565b5f5f866001600160a01b031685876040516132ea9190613e05565b5f6040518083038185875af1925050503d805f8114613324576040519150601f19603f3d011682016040523d82523d5f602084013e613329565b606091505b50915091506125e887838387606083156133a35782515f0361339c576001600160a01b0385163b61339c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a11565b5081610acb565b610acb83838151156133b85781518083602001fd5b8060405162461bcd60e51b8152600401610a119190613400565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610aae60208301846133d2565b6001600160a01b0381168114610f7e575f5ffd5b5f5f60408385031215613437575f5ffd5b823561344281613412565b946020939093013593505050565b5f60208284031215613460575f5ffd5b8135610aae81613412565b5f5f5f6060848603121561347d575f5ffd5b833561348881613412565b9250602084013561349881613412565b929592945050506040919091013590565b803563ffffffff811681146134bc575f5ffd5b919050565b5f602082840312156134d1575f5ffd5b610aae826134a9565b602080825282518282018190525f918401906040840190835b8181101561351757835163ffffffff168352602093840193909201916001016134f3565b509095945050505050565b5f5f60408385031215613533575f5ffd5b613442836134a9565b5f5f5f5f6060858703121561354f575f5ffd5b613558856134a9565b935060208501359250604085013567ffffffffffffffff81111561357a575f5ffd5b8501601f8101871361358a575f5ffd5b803567ffffffffffffffff8111156135a0575f5ffd5b8760208284010111156135b1575f5ffd5b949793965060200194505050565b5f5f83601f8401126135cf575f5ffd5b50813567ffffffffffffffff8111156135e6575f5ffd5b6020830191508360208260051b8501011115611949575f5ffd5b5f5f60208385031215613611575f5ffd5b823567ffffffffffffffff811115613627575f5ffd5b613633858286016135bf565b90969095509350505050565b5f5f5f60608486031215613651575f5ffd5b61365a846134a9565b95602085013595506040909401359392505050565b602080825282518282018190525f918401906040840190835b8181101561351757835180516001600160a01b031684526020908101518185015290930192604090920191600101613688565b5f5f602083850312156136cc575f5ffd5b823567ffffffffffffffff8111156136e2575f5ffd5b8301601f810185136136f2575f5ffd5b803567ffffffffffffffff811115613708575f5ffd5b8560208260061b840101111561371c575f5ffd5b6020919091019590945092505050565b5f5f6040838503121561373d575f5ffd5b823561374881613412565b9150602083013561375881613412565b809150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156137b3576137b3613763565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156137e2576137e2613763565b604052919050565b5f82601f8301126137f9575f5ffd5b813567ffffffffffffffff81111561381357613813613763565b6138266020601f19601f840116016137b9565b81815284602083860101111561383a575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f5f5f5f5f60c0878903121561386b575f5ffd5b86359550602087013567ffffffffffffffff811115613888575f5ffd5b61389489828a016137ea565b955050604087013567ffffffffffffffff8111156138b0575f5ffd5b6138bc89828a016137ea565b94505060608701356138cd81613412565b925060808701356138dd81613412565b915060a08701356138ed81613412565b809150509295509295509295565b5f5f5f5f6040858703121561390e575f5ffd5b843567ffffffffffffffff811115613924575f5ffd5b613930878288016135bf565b909550935050602085013567ffffffffffffffff81111561394f575f5ffd5b61395b878288016135bf565b95989497509550505050565b600181811c9082168061397b57607f821691505b6020821081036139b2577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561097d5761097d6139b8565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215613a35575f5ffd5b815167ffffffffffffffff811115613a4b575f5ffd5b8201601f81018413613a5b575f5ffd5b805167ffffffffffffffff811115613a7557613a75613763565b613a8460208260051b016137b9565b8082825260208201915060208360061b850101925086831115613aa5575f5ffd5b6020840193505b8284101561222a5760408488031215613ac3575f5ffd5b613acb613790565b8451613ad681613412565b8152602085810151818301529083526040909401939190910190613aac565b63ffffffff8616815284602082015260a060408201525f613b1960a08301866133d2565b8281036060840152613b2b81866133d2565b9150506001600160a01b03831660808301529695505050505050565b5f60208284031215613b57575f5ffd5b5051919050565b5f81518060208401855e5f93019283525090919050565b7f4e6f20726f7574657220656e726f6c6c656420666f7220646f6d61696e3a200081525f610aae601f830184613b5e565b60ff818116838216019081111561097d5761097d6139b8565b5f5f85851115613bcd575f5ffd5b83861115613bd9575f5ffd5b5050820193919092039150565b8035602083101561097d575f19602084900360031b1b1692915050565b8181038181111561097d5761097d6139b8565b601f8211156110c157828211156110c157805f5260205f20601f840160051c6020851015613c4157505f5b90810190601f840160051c035f5b81811015611410575f83820155600101613c4f565b815167ffffffffffffffff811115613c7e57613c7e613763565b613c9281613c8c8454613967565b84613c16565b6020601f821160018114613cc4575f8315613cad5750848201515b5f19600385901b1c1916600184901b178455610d95565b5f84815260208120601f198516915b82811015613cf35787850151825560209485019460019092019101613cd3565b5084821015613d1057868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b7fffff0000000000000000000000000000000000000000000000000000000000008660f01b1681528460028201528360228201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008360601b1660428201525f6125e86056830184613b5e565b5f60208284031215613df6575f5ffd5b81518015158114610aae575f5ffd5b5f610aae8284613b5e565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea2646970667358221220b1c6619f2d532e0ad795a589b93393fcb8f57181d5dafd847d9a2670403b480764736f6c63430008210033",
  "is_contract": true,
  "verified": true,
  "verification": {
    "address": "0x1605e9b2d74414d80d79ef13d1559fa751ab316c",
    "compiler": "0.8.33+commit.64118f21.Emscripten.clang",
    "contract": "contracts/token/HypERC20.sol:HypERC20",
    "verified": true,
    "match": "runtime-with-metadata",
    "creation_verified": true,
    "factory_deployment": {
      "factory": "0xb82E1234a2F3F01888761bd7A53d0fE02A92514F",
      "transaction_hash": "0x31a20e8bf208ddea08a810b1cfa4cfc45a4327002151b202c7ca50a6532ee799",
      "block_hash": "0xb8f7fc62a6486d58f2608f900af17ff02784481bfb3a7d88c55ba6e41dc7b859",
      "block_number": 591102,
      "method": "deployRoute"
    },
    "constructor_arguments": "0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ecd10fd6d7822ef16418689f92e5e1d5f144bd9",
    "verified_at": "2026-10-25T19:27:53.643Z",
    "chain_id": 20261001,
    "abi": [
      {
        "inputs": [
          {
            "internalType": "uint8",
            "name": "__decimals",
            "type": "uint8"
          },
          {
            "internalType": "uint256",
            "name": "_scaleNumerator",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "_scaleDenominator",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "_mailbox",
            "type": "address"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "constructor"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": true,
            "internalType": "address",
            "name": "owner",
            "type": "address"
          },
          {
            "indexed": true,
            "internalType": "address",
            "name": "spender",
            "type": "address"
          },
          {
            "indexed": false,
            "internalType": "uint256",
            "name": "value",
            "type": "uint256"
          }
        ],
        "name": "Approval",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "address",
            "name": "feeHook",
            "type": "address"
          }
        ],
        "name": "FeeHookSet",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "address",
            "name": "feeRecipient",
            "type": "address"
          }
        ],
        "name": "FeeRecipientSet",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "uint32",
            "name": "domain",
            "type": "uint32"
          },
          {
            "indexed": false,
            "internalType": "uint256",
            "name": "gas",
            "type": "uint256"
          }
        ],
        "name": "GasSet",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "address",
            "name": "_hook",
            "type": "address"
          }
        ],
        "name": "HookSet",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "uint8",
            "name": "version",
            "type": "uint8"
          }
        ],
        "name": "Initialized",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": false,
            "internalType": "address",
            "name": "_ism",
            "type": "address"
          }
        ],
        "name": "IsmSet",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": true,
            "internalType": "address",
            "name": "previousOwner",
            "type": "address"
          },
          {
            "indexed": true,
            "internalType": "address",
            "name": "newOwner",
            "type": "address"
          }
        ],
        "name": "OwnershipTransferred",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": true,
            "internalType": "uint32",
            "name": "origin",
            "type": "uint32"
          },
          {
            "indexed": true,
            "internalType": "bytes32",
            "name": "recipient",
            "type": "bytes32"
          },
          {
            "indexed": false,
            "internalType": "uint256",
            "name": "amountOrId",
            "type": "uint256"
          }
        ],
        "name": "ReceivedTransferRemote",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": true,
            "internalType": "uint32",
            "name": "destination",
            "type": "uint32"
          },
          {
            "indexed": true,
            "internalType": "bytes32",
            "name": "recipient",
            "type": "bytes32"
          },
          {
            "indexed": false,
            "internalType": "uint256",
            "name": "amountOrId",
            "type": "uint256"
          }
        ],
        "name": "SentTransferRemote",
        "type": "event"
      },
      {
        "anonymous": false,
        "inputs": [
          {
            "indexed": true,
            "internalType": "address",
            "name": "from",
            "type": "address"
          },
          {
            "indexed": true,
            "internalType": "address",
            "name": "to",
            "type": "address"
          },
          {
            "indexed": false,
            "internalType": "uint256",
            "name": "value",
            "type": "uint256"
          }
        ],
        "name": "Transfer",
        "type": "event"
      },
      {
        "inputs": [],
        "name": "PACKAGE_VERSION",
        "outputs": [
          {
            "internalType": "string",
            "name": "",
            "type": "string"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "owner",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "spender",
            "type": "address"
          }
        ],
        "name": "allowance",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "spender",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          }
        ],
        "name": "approve",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "account",
            "type": "address"
          }
        ],
        "name": "balanceOf",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "decimals",
        "outputs": [
          {
            "internalType": "uint8",
            "name": "",
            "type": "uint8"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "spender",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "subtractedValue",
            "type": "uint256"
          }
        ],
        "name": "decreaseAllowance",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "destinationDomain",
            "type": "uint32"
          }
        ],
        "name": "destinationGas",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "gasLimit",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "domains",
        "outputs": [
          {
            "internalType": "uint32[]",
            "name": "",
            "type": "uint32[]"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_domain",
            "type": "uint32"
          },
          {
            "internalType": "bytes32",
            "name": "_router",
            "type": "bytes32"
          }
        ],
        "name": "enrollRemoteRouter",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32[]",
            "name": "_domains",
            "type": "uint32[]"
          },
          {
            "internalType": "bytes32[]",
            "name": "_addresses",
            "type": "bytes32[]"
          }
        ],
        "name": "enrollRemoteRouters",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "feeHook",
        "outputs": [
          {
            "internalType": "address",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "feeRecipient",
        "outputs": [
          {
            "internalType": "address",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "feeToken",
        "outputs": [
          {
            "internalType": "address",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_origin",
            "type": "uint32"
          },
          {
            "internalType": "bytes32",
            "name": "_sender",
            "type": "bytes32"
          },
          {
            "internalType": "bytes",
            "name": "_message",
            "type": "bytes"
          }
        ],
        "name": "handle",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "hook",
        "outputs": [
          {
            "internalType": "contract IPostDispatchHook",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "spender",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "addedValue",
            "type": "uint256"
          }
        ],
        "name": "increaseAllowance",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint256",
            "name": "_totalSupply",
            "type": "uint256"
          },
          {
            "internalType": "string",
            "name": "_name",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "_symbol",
            "type": "string"
          },
          {
            "internalType": "address",
            "name": "_hook",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "_interchainSecurityModule",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "_owner",
            "type": "address"
          }
        ],
        "name": "initialize",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "interchainSecurityModule",
        "outputs": [
          {
            "internalType": "contract IInterchainSecurityModule",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "localDomain",
        "outputs": [
          {
            "internalType": "uint32",
            "name": "",
            "type": "uint32"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "mailbox",
        "outputs": [
          {
            "internalType": "contract IMailbox",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "name",
        "outputs": [
          {
            "internalType": "string",
            "name": "",
            "type": "string"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "owner",
        "outputs": [
          {
            "internalType": "address",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_destinationDomain",
            "type": "uint32"
          }
        ],
        "name": "quoteGasPayment",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_destination",
            "type": "uint32"
          },
          {
            "internalType": "bytes32",
            "name": "_recipient",
            "type": "bytes32"
          },
          {
            "internalType": "uint256",
            "name": "_amount",
            "type": "uint256"
          }
        ],
        "name": "quoteTransferRemote",
        "outputs": [
          {
            "components": [
              {
                "internalType": "address",
                "name": "token",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "amount",
                "type": "uint256"
              }
            ],
            "internalType": "struct Quote[]",
            "name": "quotes",
            "type": "tuple[]"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "renounceOwnership",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_domain",
            "type": "uint32"
          }
        ],
        "name": "routers",
        "outputs": [
          {
            "internalType": "bytes32",
            "name": "",
            "type": "bytes32"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "scaleDenominator",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "scaleNumerator",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "domain",
            "type": "uint32"
          },
          {
            "internalType": "uint256",
            "name": "gas",
            "type": "uint256"
          }
        ],
        "name": "setDestinationGas",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "components": [
              {
                "internalType": "uint32",
                "name": "domain",
                "type": "uint32"
              },
              {
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              }
            ],
            "internalType": "struct GasRouter.GasRouterConfig[]",
            "name": "gasConfigs",
            "type": "tuple[]"
          }
        ],
        "name": "setDestinationGas",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "_feeHook",
            "type": "address"
          }
        ],
        "name": "setFeeHook",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "recipient",
            "type": "address"
          }
        ],
        "name": "setFeeRecipient",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "_hook",
            "type": "address"
          }
        ],
        "name": "setHook",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "_module",
            "type": "address"
          }
        ],
        "name": "setInterchainSecurityModule",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "symbol",
        "outputs": [
          {
            "internalType": "string",
            "name": "",
            "type": "string"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "token",
        "outputs": [
          {
            "internalType": "address",
            "name": "",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [],
        "name": "totalSupply",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "to",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          }
        ],
        "name": "transfer",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "from",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "to",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "amount",
            "type": "uint256"
          }
        ],
        "name": "transferFrom",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "newOwner",
            "type": "address"
          }
        ],
        "name": "transferOwnership",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_destination",
            "type": "uint32"
          },
          {
            "internalType": "bytes32",
            "name": "_recipient",
            "type": "bytes32"
          },
          {
            "internalType": "uint256",
            "name": "_amount",
            "type": "uint256"
          }
        ],
        "name": "transferRemote",
        "outputs": [
          {
            "internalType": "bytes32",
            "name": "messageId",
            "type": "bytes32"
          }
        ],
        "stateMutability": "payable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32",
            "name": "_domain",
            "type": "uint32"
          }
        ],
        "name": "unenrollRemoteRouter",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      },
      {
        "inputs": [
          {
            "internalType": "uint32[]",
            "name": "_domains",
            "type": "uint32[]"
          }
        ],
        "name": "unenrollRemoteRouters",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
      }
    ],
    "input": {
      "language": "Solidity",
      "sources": {
        "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/interfaces/IERC4626Upgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4626.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../token/ERC20/IERC20Upgradeable.sol\";\nimport \"../token/ERC20/extensions/IERC20MetadataUpgradeable.sol\";\n\n/**\n * @dev Interface of the ERC4626 \"Tokenized Vault Standard\", as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n *\n * _Available since v4.7._\n */\ninterface IERC4626Upgradeable is IERC20Upgradeable, IERC20MetadataUpgradeable {\n    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\n\n    event Withdraw(\n        address indexed sender,\n        address indexed receiver,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /**\n     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\n     *\n     * - MUST be an ERC-20 token contract.\n     * - MUST NOT revert.\n     */\n    function asset() external view returns (address assetTokenAddress);\n\n    /**\n     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n     *\n     * - SHOULD include any compounding that occurs from yield.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function totalAssets() external view returns (uint256 totalManagedAssets);\n\n    /**\n     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToShares(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n     * through a deposit call.\n     *\n     * - MUST return a limited value if receiver is subject to some deposit limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n     * - MUST NOT revert.\n     */\n    function maxDeposit(address receiver) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n     *   in the same transaction.\n     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewDeposit(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   deposit execution, and are accounted for during deposit.\n     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function deposit(uint256 assets, address receiver) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n     * - MUST return a limited value if receiver is subject to some mint limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n     * - MUST NOT revert.\n     */\n    function maxMint(address receiver) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n     *   same transaction.\n     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n     *   would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by minting.\n     */\n    function previewMint(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n     *   execution, and are accounted for during mint.\n     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function mint(uint256 shares, address receiver) external returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n     * Vault, through a withdraw call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxWithdraw(address owner) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n     *   called\n     *   in the same transaction.\n     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewWithdraw(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   withdraw execution, and are accounted for during withdraw.\n     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n     * through a redeem call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n     *   same transaction.\n     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n     *   redemption would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n     */\n    function previewRedeem(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   redeem execution, and are accounted for during redeem.\n     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\n        );\n        _initialized = 1;\n        if (isTopLevelCall) {\n            _initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            _initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: setting the version to 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n        _initialized = version;\n        _initializing = true;\n        _;\n        _initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _initializing;\n    }\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n    mapping(address => uint256) private _balances;\n\n    mapping(address => mapping(address => uint256)) private _allowances;\n\n    uint256 private _totalSupply;\n\n    string private _name;\n    string private _symbol;\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * All two of these values are immutable: they can only be set once during\n     * construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        _name = name_;\n        _symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual override returns (string memory) {\n        return _name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual override returns (string memory) {\n        return _symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual override returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual override returns (uint256) {\n        return _totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual override returns (uint256) {\n        return _balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `amount`.\n     */\n    function transfer(address to, uint256 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, amount);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Emits an {Approval} event indicating the updated allowance. This is not\n     * required by the EIP. See the note at the beginning of {ERC20}.\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `amount`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `amount`.\n     */\n    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, amount);\n        _transfer(from, to, amount);\n        return true;\n    }\n\n    /**\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, allowance(owner, spender) + addedValue);\n        return true;\n    }\n\n    /**\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\n     *\n     * This is an alternative to {approve} that can be used as a mitigation for\n     * problems described in {IERC20-approve}.\n     *\n     * Emits an {Approval} event indicating the updated allowance.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `spender` must have allowance for the caller of at least\n     * `subtractedValue`.\n     */\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n        address owner = _msgSender();\n        uint256 currentAllowance = allowance(owner, spender);\n        require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n        unchecked {\n            _approve(owner, spender, currentAllowance - subtractedValue);\n        }\n\n        return true;\n    }\n\n    /**\n     * @dev Moves `amount` of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `from` must have a balance of at least `amount`.\n     */\n    function _transfer(address from, address to, uint256 amount) internal virtual {\n        require(from != address(0), \"ERC20: transfer from the zero address\");\n        require(to != address(0), \"ERC20: transfer to the zero address\");\n\n        _beforeTokenTransfer(from, to, amount);\n\n        uint256 fromBalance = _balances[from];\n        require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n        unchecked {\n            _balances[from] = fromBalance - amount;\n            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n            // decrementing then incrementing.\n            _balances[to] += amount;\n        }\n\n        emit Transfer(from, to, amount);\n\n        _afterTokenTransfer(from, to, amount);\n    }\n\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n     * the total supply.\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function _mint(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: mint to the zero address\");\n\n        _beforeTokenTransfer(address(0), account, amount);\n\n        _totalSupply += amount;\n        unchecked {\n            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n            _balances[account] += amount;\n        }\n        emit Transfer(address(0), account, amount);\n\n        _afterTokenTransfer(address(0), account, amount);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens from `account`, reducing the\n     * total supply.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     * - `account` must have at least `amount` tokens.\n     */\n    function _burn(address account, uint256 amount) internal virtual {\n        require(account != address(0), \"ERC20: burn from the zero address\");\n\n        _beforeTokenTransfer(account, address(0), amount);\n\n        uint256 accountBalance = _balances[account];\n        require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n        unchecked {\n            _balances[account] = accountBalance - amount;\n            // Overflow not possible: amount <= accountBalance <= totalSupply.\n            _totalSupply -= amount;\n        }\n\n        emit Transfer(account, address(0), amount);\n\n        _afterTokenTransfer(account, address(0), amount);\n    }\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     */\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\n        require(owner != address(0), \"ERC20: approve from the zero address\");\n        require(spender != address(0), \"ERC20: approve to the zero address\");\n\n        _allowances[owner][spender] = amount;\n        emit Approval(owner, spender, amount);\n    }\n\n    /**\n     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n     *\n     * Does not update the allowance amount in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Might emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance != type(uint256).max) {\n            require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n            unchecked {\n                _approve(owner, spender, currentAllowance - amount);\n            }\n        }\n    }\n\n    /**\n     * @dev Hook that is called before any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * will be transferred to `to`.\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n    /**\n     * @dev Hook that is called after any transfer of tokens. This includes\n     * minting and burning.\n     *\n     * Calling conditions:\n     *\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * has been transferred to `to`.\n     * - when `from` is zero, `amount` tokens have been minted for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n     * - `from` and `to` are never both zero.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[45] private __gap;\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC4626.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../utils/SafeERC20Upgradeable.sol\";\nimport \"../../../interfaces/IERC4626Upgradeable.sol\";\nimport \"../../../utils/math/MathUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the ERC4626 \"Tokenized Vault Standard\" as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\n *\n * This extension allows the minting and burning of \"shares\" (represented using the ERC20 inheritance) in exchange for\n * underlying \"assets\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\n * the ERC20 standard. Any additional extensions included along it would affect the \"shares\" token represented by this\n * contract and not the \"assets\" token which is an independent contract.\n *\n * [CAUTION]\n * ====\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\n * with a \"donation\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\n *\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\n * expensive than it is profitable. More details about the underlying math can be found\n * xref:erc4626.adoc#inflation-attack[here].\n *\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\n * `_convertToShares` and `_convertToAssets` functions.\n *\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\n * ====\n *\n * _Available since v4.7._\n */\nabstract contract ERC4626Upgradeable is Initializable, ERC20Upgradeable, IERC4626Upgradeable {\n    using MathUpgradeable for uint256;\n\n    IERC20Upgradeable private _asset;\n    uint8 private _underlyingDecimals;\n\n    /**\n     * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\n     */\n    function __ERC4626_init(IERC20Upgradeable asset_) internal onlyInitializing {\n        __ERC4626_init_unchained(asset_);\n    }\n\n    function __ERC4626_init_unchained(IERC20Upgradeable asset_) internal onlyInitializing {\n        (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\n        _underlyingDecimals = success ? assetDecimals : 18;\n        _asset = asset_;\n    }\n\n    /**\n     * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\n     */\n    function _tryGetAssetDecimals(IERC20Upgradeable asset_) private view returns (bool, uint8) {\n        (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\n            abi.encodeWithSelector(IERC20MetadataUpgradeable.decimals.selector)\n        );\n        if (success && encodedDecimals.length >= 32) {\n            uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\n            if (returnedDecimals <= type(uint8).max) {\n                return (true, uint8(returnedDecimals));\n            }\n        }\n        return (false, 0);\n    }\n\n    /**\n     * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\n     * \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\n     * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\n     *\n     * See {IERC20Metadata-decimals}.\n     */\n    function decimals() public view virtual override(IERC20MetadataUpgradeable, ERC20Upgradeable) returns (uint8) {\n        return _underlyingDecimals + _decimalsOffset();\n    }\n\n    /** @dev See {IERC4626-asset}. */\n    function asset() public view virtual override returns (address) {\n        return address(_asset);\n    }\n\n    /** @dev See {IERC4626-totalAssets}. */\n    function totalAssets() public view virtual override returns (uint256) {\n        return _asset.balanceOf(address(this));\n    }\n\n    /** @dev See {IERC4626-convertToShares}. */\n    function convertToShares(uint256 assets) public view virtual override returns (uint256) {\n        return _convertToShares(assets, MathUpgradeable.Rounding.Down);\n    }\n\n    /** @dev See {IERC4626-convertToAssets}. */\n    function convertToAssets(uint256 shares) public view virtual override returns (uint256) {\n        return _convertToAssets(shares, MathUpgradeable.Rounding.Down);\n    }\n\n    /** @dev See {IERC4626-maxDeposit}. */\n    function maxDeposit(address) public view virtual override returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /** @dev See {IERC4626-maxMint}. */\n    function maxMint(address) public view virtual override returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /** @dev See {IERC4626-maxWithdraw}. */\n    function maxWithdraw(address owner) public view virtual override returns (uint256) {\n        return _convertToAssets(balanceOf(owner), MathUpgradeable.Rounding.Down);\n    }\n\n    /** @dev See {IERC4626-maxRedeem}. */\n    function maxRedeem(address owner) public view virtual override returns (uint256) {\n        return balanceOf(owner);\n    }\n\n    /** @dev See {IERC4626-previewDeposit}. */\n    function previewDeposit(uint256 assets) public view virtual override returns (uint256) {\n        return _convertToShares(assets, MathUpgradeable.Rounding.Down);\n    }\n\n    /** @dev See {IERC4626-previewMint}. */\n    function previewMint(uint256 shares) public view virtual override returns (uint256) {\n        return _convertToAssets(shares, MathUpgradeable.Rounding.Up);\n    }\n\n    /** @dev See {IERC4626-previewWithdraw}. */\n    function previewWithdraw(uint256 assets) public view virtual override returns (uint256) {\n        return _convertToShares(assets, MathUpgradeable.Rounding.Up);\n    }\n\n    /** @dev See {IERC4626-previewRedeem}. */\n    function previewRedeem(uint256 shares) public view virtual override returns (uint256) {\n        return _convertToAssets(shares, MathUpgradeable.Rounding.Down);\n    }\n\n    /** @dev See {IERC4626-deposit}. */\n    function deposit(uint256 assets, address receiver) public virtual override returns (uint256) {\n        require(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n        uint256 shares = previewDeposit(assets);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return shares;\n    }\n\n    /** @dev See {IERC4626-mint}.\n     *\n     * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\n     * In this case, the shares will be minted without requiring any assets to be deposited.\n     */\n    function mint(uint256 shares, address receiver) public virtual override returns (uint256) {\n        require(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n        uint256 assets = previewMint(shares);\n        _deposit(_msgSender(), receiver, assets, shares);\n\n        return assets;\n    }\n\n    /** @dev See {IERC4626-withdraw}. */\n    function withdraw(uint256 assets, address receiver, address owner) public virtual override returns (uint256) {\n        require(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n        uint256 shares = previewWithdraw(assets);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return shares;\n    }\n\n    /** @dev See {IERC4626-redeem}. */\n    function redeem(uint256 shares, address receiver, address owner) public virtual override returns (uint256) {\n        require(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");\n\n        uint256 assets = previewRedeem(shares);\n        _withdraw(_msgSender(), receiver, owner, assets, shares);\n\n        return assets;\n    }\n\n    /**\n     * @dev Internal conversion function (from assets to shares) with support for rounding direction.\n     */\n    function _convertToShares(uint256 assets, MathUpgradeable.Rounding rounding) internal view virtual returns (uint256) {\n        return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\n    }\n\n    /**\n     * @dev Internal conversion function (from shares to assets) with support for rounding direction.\n     */\n    function _convertToAssets(uint256 shares, MathUpgradeable.Rounding rounding) internal view virtual returns (uint256) {\n        return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\n    }\n\n    /**\n     * @dev Deposit/mint common workflow.\n     */\n    function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\n        // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\n        // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\n        // assets are transferred and before the shares are minted, which is a valid state.\n        // slither-disable-next-line reentrancy-no-eth\n        SafeERC20Upgradeable.safeTransferFrom(_asset, caller, address(this), assets);\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, shares);\n    }\n\n    /**\n     * @dev Withdraw/redeem common workflow.\n     */\n    function _withdraw(\n        address caller,\n        address receiver,\n        address owner,\n        uint256 assets,\n        uint256 shares\n    ) internal virtual {\n        if (caller != owner) {\n            _spendAllowance(owner, caller, shares);\n        }\n\n        // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\n        // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\n        // calls the vault, which is assumed not malicious.\n        //\n        // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\n        // shares are burned and after the assets are transferred, which is a valid state.\n        _burn(owner, shares);\n        SafeERC20Upgradeable.safeTransfer(_asset, receiver, assets);\n\n        emit Withdraw(caller, receiver, owner, assets, shares);\n    }\n\n    function _decimalsOffset() internal view virtual returns (uint8) {\n        return 0;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\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"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n    using AddressUpgradeable for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20PermitUpgradeable 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(IERC20Upgradeable token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n    }\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
        },
        "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
        },
        "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
        },
        "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     *\n     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"
        },
        "@openzeppelin/contracts/token/ERC721/IERC721.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n     * understand this adds an external call which potentially creates a reentrancy vulnerability.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
        },
        "@openzeppelin/contracts/utils/Address.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/introspection/IERC165.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
        },
        "@openzeppelin/contracts/utils/math/Math.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/math/SignedMath.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/StorageSlot.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/Strings.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n    uint8 private constant _ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toString(int256 value) internal pure returns (string memory) {\n        return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/structs/EnumerableMap.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableMap.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.\n\npragma solidity ^0.8.0;\n\nimport \"./EnumerableSet.sol\";\n\n/**\n * @dev Library for managing an enumerable variant of Solidity's\n * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]\n * type.\n *\n * Maps have the following properties:\n *\n * - Entries are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Entries are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableMap for EnumerableMap.UintToAddressMap;\n *\n *     // Declare a set state variable\n *     EnumerableMap.UintToAddressMap private myMap;\n * }\n * ```\n *\n * The following map types are supported:\n *\n * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0\n * - `address -> uint256` (`AddressToUintMap`) since v4.6.0\n * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0\n * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0\n * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableMap.\n * ====\n */\nlibrary EnumerableMap {\n    using EnumerableSet for EnumerableSet.Bytes32Set;\n\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Map type with\n    // bytes32 keys and values.\n    // The Map implementation uses private functions, and user-facing\n    // implementations (such as Uint256ToAddressMap) are just wrappers around\n    // the underlying Map.\n    // This means that we can only create new EnumerableMaps for types that fit\n    // in bytes32.\n\n    struct Bytes32ToBytes32Map {\n        // Storage of keys\n        EnumerableSet.Bytes32Set _keys;\n        mapping(bytes32 => bytes32) _values;\n    }\n\n    /**\n     * @dev Adds a key-value pair to a map, or updates the value for an existing\n     * key. O(1).\n     *\n     * Returns true if the key was added to the map, that is if it was not\n     * already present.\n     */\n    function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) {\n        map._values[key] = value;\n        return map._keys.add(key);\n    }\n\n    /**\n     * @dev Removes a key-value pair from a map. O(1).\n     *\n     * Returns true if the key was removed from the map, that is if it was present.\n     */\n    function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {\n        delete map._values[key];\n        return map._keys.remove(key);\n    }\n\n    /**\n     * @dev Returns true if the key is in the map. O(1).\n     */\n    function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {\n        return map._keys.contains(key);\n    }\n\n    /**\n     * @dev Returns the number of key-value pairs in the map. O(1).\n     */\n    function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {\n        return map._keys.length();\n    }\n\n    /**\n     * @dev Returns the key-value pair stored at position `index` in the map. O(1).\n     *\n     * Note that there are no guarantees on the ordering of entries inside the\n     * array, and it may change when more entries are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32, bytes32) {\n        bytes32 key = map._keys.at(index);\n        return (key, map._values[key]);\n    }\n\n    /**\n     * @dev Tries to returns the value associated with `key`. O(1).\n     * Does not revert if `key` is not in the map.\n     */\n    function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool, bytes32) {\n        bytes32 value = map._values[key];\n        if (value == bytes32(0)) {\n            return (contains(map, key), bytes32(0));\n        } else {\n            return (true, value);\n        }\n    }\n\n    /**\n     * @dev Returns the value associated with `key`. O(1).\n     *\n     * Requirements:\n     *\n     * - `key` must be in the map.\n     */\n    function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {\n        bytes32 value = map._values[key];\n        require(value != 0 || contains(map, key), \"EnumerableMap: nonexistent key\");\n        return value;\n    }\n\n    /**\n     * @dev Same as {get}, with a custom error message when `key` is not in the map.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryGet}.\n     */\n    function get(\n        Bytes32ToBytes32Map storage map,\n        bytes32 key,\n        string memory errorMessage\n    ) internal view returns (bytes32) {\n        bytes32 value = map._values[key];\n        require(value != 0 || contains(map, key), errorMessage);\n        return value;\n    }\n\n    /**\n     * @dev Return the an array containing all the keys\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) {\n        return map._keys.values();\n    }\n\n    // UintToUintMap\n\n    struct UintToUintMap {\n        Bytes32ToBytes32Map _inner;\n    }\n\n    /**\n     * @dev Adds a key-value pair to a map, or updates the value for an existing\n     * key. O(1).\n     *\n     * Returns true if the key was added to the map, that is if it was not\n     * already present.\n     */\n    function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) {\n        return set(map._inner, bytes32(key), bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a map. O(1).\n     *\n     * Returns true if the key was removed from the map, that is if it was present.\n     */\n    function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {\n        return remove(map._inner, bytes32(key));\n    }\n\n    /**\n     * @dev Returns true if the key is in the map. O(1).\n     */\n    function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {\n        return contains(map._inner, bytes32(key));\n    }\n\n    /**\n     * @dev Returns the number of elements in the map. O(1).\n     */\n    function length(UintToUintMap storage map) internal view returns (uint256) {\n        return length(map._inner);\n    }\n\n    /**\n     * @dev Returns the element stored at position `index` in the map. O(1).\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintToUintMap storage map, uint256 index) internal view returns (uint256, uint256) {\n        (bytes32 key, bytes32 value) = at(map._inner, index);\n        return (uint256(key), uint256(value));\n    }\n\n    /**\n     * @dev Tries to returns the value associated with `key`. O(1).\n     * Does not revert if `key` is not in the map.\n     */\n    function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool, uint256) {\n        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));\n        return (success, uint256(value));\n    }\n\n    /**\n     * @dev Returns the value associated with `key`. O(1).\n     *\n     * Requirements:\n     *\n     * - `key` must be in the map.\n     */\n    function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {\n        return uint256(get(map._inner, bytes32(key)));\n    }\n\n    /**\n     * @dev Same as {get}, with a custom error message when `key` is not in the map.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryGet}.\n     */\n    function get(UintToUintMap storage map, uint256 key, string memory errorMessage) internal view returns (uint256) {\n        return uint256(get(map._inner, bytes32(key), errorMessage));\n    }\n\n    /**\n     * @dev Return the an array containing all the keys\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function keys(UintToUintMap storage map) internal view returns (uint256[] memory) {\n        bytes32[] memory store = keys(map._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintToAddressMap\n\n    struct UintToAddressMap {\n        Bytes32ToBytes32Map _inner;\n    }\n\n    /**\n     * @dev Adds a key-value pair to a map, or updates the value for an existing\n     * key. O(1).\n     *\n     * Returns true if the key was added to the map, that is if it was not\n     * already present.\n     */\n    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {\n        return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a map. O(1).\n     *\n     * Returns true if the key was removed from the map, that is if it was present.\n     */\n    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {\n        return remove(map._inner, bytes32(key));\n    }\n\n    /**\n     * @dev Returns true if the key is in the map. O(1).\n     */\n    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {\n        return contains(map._inner, bytes32(key));\n    }\n\n    /**\n     * @dev Returns the number of elements in the map. O(1).\n     */\n    function length(UintToAddressMap storage map) internal view returns (uint256) {\n        return length(map._inner);\n    }\n\n    /**\n     * @dev Returns the element stored at position `index` in the map. O(1).\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {\n        (bytes32 key, bytes32 value) = at(map._inner, index);\n        return (uint256(key), address(uint160(uint256(value))));\n    }\n\n    /**\n     * @dev Tries to returns the value associated with `key`. O(1).\n     * Does not revert if `key` is not in the map.\n     */\n    function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {\n        (bool success, bytes32 value) = tryGet(map._inner, bytes32(key));\n        return (success, address(uint160(uint256(value))));\n    }\n\n    /**\n     * @dev Returns the value associated with `key`. O(1).\n     *\n     * Requirements:\n     *\n     * - `key` must be in the map.\n     */\n    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {\n        return address(uint160(uint256(get(map._inner, bytes32(key)))));\n    }\n\n    /**\n     * @dev Same as {get}, with a custom error message when `key` is not in the map.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryGet}.\n     */\n    function get(\n        UintToAddressMap storage map,\n        uint256 key,\n        string memory errorMessage\n    ) internal view returns (address) {\n        return address(uint160(uint256(get(map._inner, bytes32(key), errorMessage))));\n    }\n\n    /**\n     * @dev Return the an array containing all the keys\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) {\n        bytes32[] memory store = keys(map._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressToUintMap\n\n    struct AddressToUintMap {\n        Bytes32ToBytes32Map _inner;\n    }\n\n    /**\n     * @dev Adds a key-value pair to a map, or updates the value for an existing\n     * key. O(1).\n     *\n     * Returns true if the key was added to the map, that is if it was not\n     * already present.\n     */\n    function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) {\n        return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a map. O(1).\n     *\n     * Returns true if the key was removed from the map, that is if it was present.\n     */\n    function remove(AddressToUintMap storage map, address key) internal returns (bool) {\n        return remove(map._inner, bytes32(uint256(uint160(key))));\n    }\n\n    /**\n     * @dev Returns true if the key is in the map. O(1).\n     */\n    function contains(AddressToUintMap storage map, address key) internal view returns (bool) {\n        return contains(map._inner, bytes32(uint256(uint160(key))));\n    }\n\n    /**\n     * @dev Returns the number of elements in the map. O(1).\n     */\n    function length(AddressToUintMap storage map) internal view returns (uint256) {\n        return length(map._inner);\n    }\n\n    /**\n     * @dev Returns the element stored at position `index` in the map. O(1).\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressToUintMap storage map, uint256 index) internal view returns (address, uint256) {\n        (bytes32 key, bytes32 value) = at(map._inner, index);\n        return (address(uint160(uint256(key))), uint256(value));\n    }\n\n    /**\n     * @dev Tries to returns the value associated with `key`. O(1).\n     * Does not revert if `key` is not in the map.\n     */\n    function tryGet(AddressToUintMap storage map, address key) internal view returns (bool, uint256) {\n        (bool success, bytes32 value) = tryGet(map._inner, bytes32(uint256(uint160(key))));\n        return (success, uint256(value));\n    }\n\n    /**\n     * @dev Returns the value associated with `key`. O(1).\n     *\n     * Requirements:\n     *\n     * - `key` must be in the map.\n     */\n    function get(AddressToUintMap storage map, address key) internal view returns (uint256) {\n        return uint256(get(map._inner, bytes32(uint256(uint160(key)))));\n    }\n\n    /**\n     * @dev Same as {get}, with a custom error message when `key` is not in the map.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryGet}.\n     */\n    function get(\n        AddressToUintMap storage map,\n        address key,\n        string memory errorMessage\n    ) internal view returns (uint256) {\n        return uint256(get(map._inner, bytes32(uint256(uint160(key))), errorMessage));\n    }\n\n    /**\n     * @dev Return the an array containing all the keys\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function keys(AddressToUintMap storage map) internal view returns (address[] memory) {\n        bytes32[] memory store = keys(map._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // Bytes32ToUintMap\n\n    struct Bytes32ToUintMap {\n        Bytes32ToBytes32Map _inner;\n    }\n\n    /**\n     * @dev Adds a key-value pair to a map, or updates the value for an existing\n     * key. O(1).\n     *\n     * Returns true if the key was added to the map, that is if it was not\n     * already present.\n     */\n    function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) {\n        return set(map._inner, key, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a map. O(1).\n     *\n     * Returns true if the key was removed from the map, that is if it was present.\n     */\n    function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {\n        return remove(map._inner, key);\n    }\n\n    /**\n     * @dev Returns true if the key is in the map. O(1).\n     */\n    function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {\n        return contains(map._inner, key);\n    }\n\n    /**\n     * @dev Returns the number of elements in the map. O(1).\n     */\n    function length(Bytes32ToUintMap storage map) internal view returns (uint256) {\n        return length(map._inner);\n    }\n\n    /**\n     * @dev Returns the element stored at position `index` in the map. O(1).\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32, uint256) {\n        (bytes32 key, bytes32 value) = at(map._inner, index);\n        return (key, uint256(value));\n    }\n\n    /**\n     * @dev Tries to returns the value associated with `key`. O(1).\n     * Does not revert if `key` is not in the map.\n     */\n    function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool, uint256) {\n        (bool success, bytes32 value) = tryGet(map._inner, key);\n        return (success, uint256(value));\n    }\n\n    /**\n     * @dev Returns the value associated with `key`. O(1).\n     *\n     * Requirements:\n     *\n     * - `key` must be in the map.\n     */\n    function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {\n        return uint256(get(map._inner, key));\n    }\n\n    /**\n     * @dev Same as {get}, with a custom error message when `key` is not in the map.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryGet}.\n     */\n    function get(\n        Bytes32ToUintMap storage map,\n        bytes32 key,\n        string memory errorMessage\n    ) internal view returns (uint256) {\n        return uint256(get(map._inner, key, errorMessage));\n    }\n\n    /**\n     * @dev Return the an array containing all the keys\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = keys(map._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
        },
        "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
          "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position of the value in the `values` array, plus 1 because index 0\n        // means a value is not in the set.\n        mapping(bytes32 => uint256) _indexes;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._indexes[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We read and store the value's index to prevent multiple reads from the same storage slot\n        uint256 valueIndex = set._indexes[value];\n\n        if (valueIndex != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 toDeleteIndex = valueIndex - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (lastIndex != toDeleteIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the last value to the index where the value to delete is\n                set._values[toDeleteIndex] = lastValue;\n                // Update the index for the moved value\n                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the index for the deleted slot\n            delete set._indexes[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._indexes[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
        },
        "contracts/client/GasRouter.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\n// ============ Internal Imports ============\nimport {Router} from \"./Router.sol\";\nimport {EnumerableMapExtended} from \"../libs/EnumerableMapExtended.sol\";\nimport {StandardHookMetadata} from \"../hooks/libs/StandardHookMetadata.sol\";\n\nabstract contract GasRouter is Router {\n    using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;\n\n    event GasSet(uint32 domain, uint256 gas);\n\n    // ============ Mutable Storage ============\n    mapping(uint32 destinationDomain => uint256 gasLimit) public destinationGas;\n\n    struct GasRouterConfig {\n        uint32 domain;\n        uint256 gas;\n    }\n\n    constructor(address _mailbox) Router(_mailbox) {}\n\n    /**\n     * @notice Sets the gas amount dispatched for each configured domain.\n     * @param gasConfigs The array of GasRouterConfig structs\n     */\n    function setDestinationGas(\n        GasRouterConfig[] calldata gasConfigs\n    ) external onlyOwner {\n        for (uint256 i = 0; i < gasConfigs.length; i += 1) {\n            _setDestinationGas(gasConfigs[i].domain, gasConfigs[i].gas);\n        }\n    }\n\n    /**\n     * @notice Sets the gas amount dispatched for each configured domain.\n     * @param domain The destination domain ID\n     * @param gas The gas limit\n     */\n    function setDestinationGas(uint32 domain, uint256 gas) external onlyOwner {\n        _setDestinationGas(domain, gas);\n    }\n\n    /**\n     * @notice Returns the gas payment required to dispatch a message to the given domain's router.\n     * @param _destinationDomain The domain of the router.\n     * @return _gasPayment Payment computed by the registered InterchainGasPaymaster.\n     */\n    function quoteGasPayment(\n        uint32 _destinationDomain\n    ) public view virtual returns (uint256) {\n        return\n            _Router_quoteDispatch(\n                _destinationDomain,\n                \"\",\n                _GasRouter_hookMetadata(_destinationDomain),\n                address(hook)\n            );\n    }\n\n    function _GasRouter_hookMetadata(\n        uint32 _destination\n    ) internal view returns (bytes memory) {\n        return\n            StandardHookMetadata.overrideGasLimit(destinationGas[_destination]);\n    }\n\n    function _setDestinationGas(uint32 domain, uint256 gas) internal virtual {\n        require(\n            _routers.contains(uint256(domain)),\n            _domainNotFoundError(domain)\n        );\n        destinationGas[domain] = gas;\n        emit GasSet(domain, gas);\n    }\n}\n"
        },
        "contracts/client/MailboxClient.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\n// ============ Internal Imports ============\nimport {IMailbox} from \"../interfaces/IMailbox.sol\";\nimport {IPostDispatchHook} from \"../interfaces/hooks/IPostDispatchHook.sol\";\nimport {IInterchainSecurityModule} from \"../interfaces/IInterchainSecurityModule.sol\";\nimport {Message} from \"../libs/Message.sol\";\nimport {PackageVersioned} from \"../PackageVersioned.sol\";\n\n// ============ External Imports ============\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nabstract contract MailboxClient is OwnableUpgradeable, PackageVersioned {\n    using Message for bytes;\n\n    event HookSet(address _hook);\n    event IsmSet(address _ism);\n\n    IMailbox public immutable mailbox;\n\n    uint32 public immutable localDomain;\n\n    IPostDispatchHook public hook;\n\n    IInterchainSecurityModule internal _interchainSecurityModule;\n\n    uint256[48] private __GAP; // gap for upgrade safety\n\n    // ============ Modifiers ============\n    modifier onlyContract(address _contract) {\n        require(\n            Address.isContract(_contract),\n            \"MailboxClient: invalid mailbox\"\n        );\n        _;\n    }\n\n    modifier onlyContractOrNull(address _contract) {\n        require(\n            Address.isContract(_contract) || _contract == address(0),\n            \"MailboxClient: invalid contract setting\"\n        );\n        _;\n    }\n\n    /**\n     * @notice Only accept messages from a Hyperlane Mailbox contract\n     */\n    modifier onlyMailbox() {\n        require(\n            msg.sender == address(mailbox),\n            \"MailboxClient: sender not mailbox\"\n        );\n        _;\n    }\n\n    constructor(address _mailbox) onlyContract(_mailbox) {\n        mailbox = IMailbox(_mailbox);\n        localDomain = mailbox.localDomain();\n        _transferOwnership(msg.sender);\n    }\n\n    function interchainSecurityModule()\n        external\n        view\n        virtual\n        returns (IInterchainSecurityModule)\n    {\n        return _interchainSecurityModule;\n    }\n\n    /**\n     * @notice Sets the address of the application's custom hook.\n     * @param _hook The address of the hook contract.\n     */\n    function setHook(\n        address _hook\n    ) public virtual onlyContractOrNull(_hook) onlyOwner {\n        hook = IPostDispatchHook(_hook);\n        emit HookSet(_hook);\n    }\n\n    /**\n     * @notice Sets the address of the application's custom interchain security module.\n     * @param _module The address of the interchain security module contract.\n     */\n    function setInterchainSecurityModule(\n        address _module\n    ) public onlyContractOrNull(_module) onlyOwner {\n        _interchainSecurityModule = IInterchainSecurityModule(_module);\n        emit IsmSet(_module);\n    }\n\n    // ======== Initializer =========\n    function _MailboxClient_initialize(\n        address _hook,\n        address __interchainSecurityModule,\n        address _owner\n    ) internal onlyInitializing {\n        __Ownable_init();\n        setHook(_hook);\n        setInterchainSecurityModule(__interchainSecurityModule);\n        _transferOwnership(_owner);\n    }\n\n    function _isLatestDispatched(bytes32 id) internal view returns (bool) {\n        return mailbox.latestDispatchedId() == id;\n    }\n\n    function _isDelivered(bytes32 id) internal view returns (bool) {\n        return mailbox.delivered(id);\n    }\n\n    /// @dev True only while `mailbox.process()` is delivering `id` in the\n    /// current transaction. `process(...)` writes `deliveries[id].blockNumber`\n    /// before invoking the ISM, so this binds a check to the message being\n    /// processed *now* — stricter than `_isDelivered`, which stays true for any\n    /// previously-delivered message.\n    function _isProcessing(bytes32 id) internal view returns (bool) {\n        return mailbox.processedAt(id) == block.number;\n    }\n}\n"
        },
        "contracts/client/Router.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\n// ============ Internal Imports ============\nimport {IMessageRecipient} from \"../interfaces/IMessageRecipient.sol\";\nimport {IPostDispatchHook} from \"../interfaces/hooks/IPostDispatchHook.sol\";\nimport {MailboxClient} from \"./MailboxClient.sol\";\nimport {EnumerableMapExtended} from \"../libs/EnumerableMapExtended.sol\";\n\n// ============ External Imports ============\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\nabstract contract Router is MailboxClient, IMessageRecipient {\n    using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;\n    using Strings for uint32;\n\n    // ============ Mutable Storage ============\n    /// @dev Mapping of domain => router. For a given domain we have one router we send/receive messages from.\n    EnumerableMapExtended.UintToBytes32Map internal _routers;\n\n    uint256[48] private __GAP; // gap for upgrade safety\n\n    constructor(address _mailbox) MailboxClient(_mailbox) {}\n\n    // ============ External functions ============\n    function domains() external view returns (uint32[] memory) {\n        return _routers.uint32Keys();\n    }\n\n    /**\n     * @notice Returns the address of the Router contract for the given domain\n     * @param _domain The remote domain ID.\n     * @dev Returns 0 address if no router is enrolled for the given domain\n     * @return router The address of the Router contract for the given domain\n     */\n    function routers(uint32 _domain) public view virtual returns (bytes32) {\n        (, bytes32 _router) = _routers.tryGet(_domain);\n        return _router;\n    }\n\n    /**\n     * @notice Unregister the domain\n     * @param _domain The domain of the remote Application Router\n     */\n    function unenrollRemoteRouter(uint32 _domain) external virtual onlyOwner {\n        _unenrollRemoteRouter(_domain);\n    }\n\n    /**\n     * @notice Register the address of a Router contract for the same Application on a remote chain\n     * @param _domain The domain of the remote Application Router\n     * @param _router The address of the remote Application Router\n     */\n    function enrollRemoteRouter(\n        uint32 _domain,\n        bytes32 _router\n    ) external virtual onlyOwner {\n        _enrollRemoteRouter(_domain, _router);\n    }\n\n    /**\n     * @notice Batch version of `enrollRemoteRouter`\n     * @param _domains The domains of the remote Application Routers\n     * @param _addresses The addresses of the remote Application Routers\n     */\n    function enrollRemoteRouters(\n        uint32[] calldata _domains,\n        bytes32[] calldata _addresses\n    ) external virtual onlyOwner {\n        require(_domains.length == _addresses.length, \"!length\");\n        uint256 length = _domains.length;\n        for (uint256 i = 0; i < length; i += 1) {\n            _enrollRemoteRouter(_domains[i], _addresses[i]);\n        }\n    }\n\n    /**\n     * @notice Batch version of `unenrollRemoteRouter`\n     * @param _domains The domains of the remote Application Routers\n     */\n    function unenrollRemoteRouters(\n        uint32[] calldata _domains\n    ) external virtual onlyOwner {\n        uint256 length = _domains.length;\n        for (uint256 i = 0; i < length; i += 1) {\n            _unenrollRemoteRouter(_domains[i]);\n        }\n    }\n\n    /**\n     * @notice Handles an incoming message\n     * @param _origin The origin domain\n     * @param _sender The sender address\n     * @param _message The message\n     */\n    // solhint-disable-next-line hyperlane/no-virtual-override\n    function handle(\n        uint32 _origin,\n        bytes32 _sender,\n        bytes calldata _message\n    ) external payable virtual override onlyMailbox {\n        bytes32 _router = _mustHaveRemoteRouter(_origin);\n        require(_router == _sender, \"Enrolled router does not match sender\");\n        _handle(_origin, _sender, _message);\n    }\n\n    // ============ Virtual functions ============\n    function _handle(\n        uint32 _origin,\n        bytes32 _sender,\n        bytes calldata _message\n    ) internal virtual;\n\n    // ============ Internal functions ============\n\n    /**\n     * @notice Set the router for a given domain\n     * @param _domain The domain\n     * @param _address The new router\n     */\n    function _enrollRemoteRouter(\n        uint32 _domain,\n        bytes32 _address\n    ) internal virtual {\n        _routers.set(_domain, _address);\n    }\n\n    /**\n     * @notice Remove the router for a given domain\n     * @param _domain The domain\n     */\n    function _unenrollRemoteRouter(uint32 _domain) internal virtual {\n        require(_routers.remove(_domain), _domainNotFoundError(_domain));\n    }\n\n    /**\n     * @notice Return true if the given domain / router is the address of a remote Application Router\n     * @param _domain The domain of the potential remote Application Router\n     * @param _address The address of the potential remote Application Router\n     */\n    function _isRemoteRouter(\n        uint32 _domain,\n        bytes32 _address\n    ) internal view returns (bool) {\n        return routers(_domain) == _address;\n    }\n\n    /**\n     * @notice Assert that the given domain has an Application Router registered and return its address\n     * @param _domain The domain of the chain for which to get the Application Router\n     * @return _router The address of the remote Application Router on _domain\n     */\n    function _mustHaveRemoteRouter(\n        uint32 _domain\n    ) internal view returns (bytes32) {\n        (bool contained, bytes32 _router) = _routers.tryGet(_domain);\n        if (contained) {\n            return _router;\n        }\n        revert(_domainNotFoundError(_domain));\n    }\n\n    function _domainNotFoundError(\n        uint32 _domain\n    ) internal pure returns (string memory) {\n        return\n            string.concat(\n                \"No router enrolled for domain: \",\n                _domain.toString()\n            );\n    }\n\n    function _Router_dispatch(\n        uint32 _destinationDomain,\n        uint256 _value,\n        bytes memory _messageBody\n    ) internal returns (bytes32) {\n        return\n            _Router_dispatch(\n                _destinationDomain,\n                _value,\n                _messageBody,\n                \"\",\n                address(hook)\n            );\n    }\n\n    function _Router_dispatch(\n        uint32 _destinationDomain,\n        uint256 _value,\n        bytes memory _messageBody,\n        bytes memory _hookMetadata,\n        address _hook\n    ) internal returns (bytes32) {\n        bytes32 _router = _mustHaveRemoteRouter(_destinationDomain);\n        return\n            mailbox.dispatch{value: _value}(\n                _destinationDomain,\n                _router,\n                _messageBody,\n                _hookMetadata,\n                IPostDispatchHook(_hook)\n            );\n    }\n\n    function _Router_quoteDispatch(\n        uint32 _destinationDomain,\n        bytes memory _messageBody\n    ) internal view returns (uint256) {\n        return\n            _Router_quoteDispatch(\n                _destinationDomain,\n                _messageBody,\n                \"\",\n                address(hook)\n            );\n    }\n\n    function _Router_quoteDispatch(\n        uint32 _destinationDomain,\n        bytes memory _messageBody,\n        bytes memory _hookMetadata,\n        address _hook\n    ) internal view returns (uint256) {\n        bytes32 _router = _mustHaveRemoteRouter(_destinationDomain);\n        return\n            mailbox.quoteDispatch(\n                _destinationDomain,\n                _router,\n                _messageBody,\n                _hookMetadata,\n                IPostDispatchHook(_hook)\n            );\n    }\n}\n"
        },
        "contracts/hooks/libs/StandardHookMetadata.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\n/**\n * Format of metadata:\n *\n * [0:2]   variant (uint16) = 1\n * [2:34]  msg.value (uint256)\n * [34:66] Gas limit for message (uint256)\n * [66:86] Refund address (address)\n * [86:106] Fee token address (address) - OPTIONAL, read if length >= 106\n *\n * Fee Token Semantics:\n * - When feeToken is address(0) or unspecified (metadata length < 106), fees are\n *   paid in native ETH via msg.value.\n * - When feeToken is set to a non-zero address, fees are paid in that ERC-20 token.\n *   The caller must approve the hook to spend the fee token before calling dispatch.\n *\n * IMPORTANT: Mixing fee denominations within a single dispatch is NOT supported.\n * All hooks in the call chain (requiredHook + hook, including any child hooks in\n * aggregation) must use the same fee denomination. Hooks that only support native\n * fees will reject metadata with a non-zero feeToken via supportsMetadata.\n *\n * The Mailbox.quoteDispatch function sums quotes from requiredHook and hook,\n * assuming both return values in the same denomination. This works because:\n * - Native-only hooks return 0 when feeToken is set (via supportsMetadata rejection)\n * - The requiredHook (typically ProtocolFee) returns 0 when protocolFee is 0, allowing\n *   ERC-20 fee tokens to be used with the default hook even when requiredHook exists\n */\n\nlibrary StandardHookMetadata {\n    struct Metadata {\n        uint16 variant;\n        uint256 msgValue;\n        uint256 gasLimit;\n        address refundAddress;\n    }\n\n    uint8 private constant VARIANT_OFFSET = 0;\n    uint8 private constant MSG_VALUE_OFFSET = 2;\n    uint8 private constant GAS_LIMIT_OFFSET = 34;\n    uint8 private constant REFUND_ADDRESS_OFFSET = 66;\n    uint8 private constant FEE_TOKEN_OFFSET = 86;\n\n    uint16 public constant VARIANT = 1;\n\n    /**\n     * @notice Returns the variant of the metadata.\n     * @param _metadata ABI encoded standard hook metadata.\n     * @return variant of the metadata as uint16.\n     */\n    function variant(bytes calldata _metadata) internal pure returns (uint16) {\n        if (_metadata.length < VARIANT_OFFSET + 2) return 0;\n        return uint16(bytes2(_metadata[VARIANT_OFFSET:VARIANT_OFFSET + 2]));\n    }\n\n    /**\n     * @notice Returns the specified value for the message.\n     * @param _metadata ABI encoded standard hook metadata.\n     * @param _default Default fallback value.\n     * @return Value for the message as uint256.\n     */\n    function msgValue(\n        bytes calldata _metadata,\n        uint256 _default\n    ) internal pure returns (uint256) {\n        if (_metadata.length < MSG_VALUE_OFFSET + 32) return _default;\n        return\n            uint256(bytes32(_metadata[MSG_VALUE_OFFSET:MSG_VALUE_OFFSET + 32]));\n    }\n\n    /**\n     * @notice Returns the specified gas limit for the message.\n     * @param _metadata ABI encoded standard hook metadata.\n     * @param _default Default fallback gas limit.\n     * @return Gas limit for the message as uint256.\n     */\n    function gasLimit(\n        bytes calldata _metadata,\n        uint256 _default\n    ) internal pure returns (uint256) {\n        if (_metadata.length < GAS_LIMIT_OFFSET + 32) return _default;\n        return\n            uint256(bytes32(_metadata[GAS_LIMIT_OFFSET:GAS_LIMIT_OFFSET + 32]));\n    }\n\n    function gasLimit(\n        bytes memory _metadata\n    ) internal pure returns (uint256 _gasLimit) {\n        if (_metadata.length < GAS_LIMIT_OFFSET + 32) return 50_000;\n        assembly {\n            _gasLimit := mload(add(_metadata, add(0x20, GAS_LIMIT_OFFSET)))\n        }\n    }\n\n    /**\n     * @notice Returns the specified refund address for the message.\n     * @param _metadata ABI encoded standard hook metadata.\n     * @param _default Default fallback refund address.\n     * @return Refund address for the message as address.\n     */\n    function refundAddress(\n        bytes calldata _metadata,\n        address _default\n    ) internal pure returns (address) {\n        if (_metadata.length < REFUND_ADDRESS_OFFSET + 20) return _default;\n        return\n            address(\n                bytes20(\n                    _metadata[REFUND_ADDRESS_OFFSET:REFUND_ADDRESS_OFFSET + 20]\n                )\n            );\n    }\n\n    /**\n     * @notice Returns the fee token address for token-based gas payments.\n     * @param _metadata ABI encoded standard hook metadata.\n     * @param _default Default fallback fee token (typically address(0) for native).\n     * @return Fee token address at [86:106], or _default if metadata too short.\n     */\n    function feeToken(\n        bytes calldata _metadata,\n        address _default\n    ) internal pure returns (address) {\n        if (_metadata.length < FEE_TOKEN_OFFSET + 20) return _default;\n        return\n            address(bytes20(_metadata[FEE_TOKEN_OFFSET:FEE_TOKEN_OFFSET + 20]));\n    }\n\n    /**\n     * @notice Returns the fee token address for token-based gas payments (memory version).\n     * @param _metadata ABI encoded standard hook metadata.\n     * @return _feeToken Fee token address at [86:106], or address(0) if metadata too short.\n     */\n    function feeToken(\n        bytes memory _metadata\n    ) internal pure returns (address _feeToken) {\n        if (_metadata.length < FEE_TOKEN_OFFSET + 20) return address(0);\n        assembly {\n            let data_start_ptr := add(_metadata, 32) // Skip length prefix\n            let mload_ptr := add(data_start_ptr, sub(FEE_TOKEN_OFFSET, 12))\n            _feeToken := mload(mload_ptr) // Loads 32 bytes; address takes lower 20 bytes\n        }\n    }\n\n    /**\n     * @notice Formats the specified gas limit and refund address into standard hook metadata.\n     * @param _msgValue msg.value for the message.\n     * @param _gasLimit Gas limit for the message.\n     * @param _refundAddress Refund address for the message.\n     * @return ABI encoded standard hook metadata.\n     */\n    function format(\n        uint256 _msgValue,\n        uint256 _gasLimit,\n        address _refundAddress\n    ) internal pure returns (bytes memory) {\n        return abi.encodePacked(VARIANT, _msgValue, _gasLimit, _refundAddress);\n    }\n\n    /**\n     * @notice Formats the specified gas limit and refund address into standard hook metadata.\n     * @param _msgValue msg.value for the message.\n     * @param _gasLimit Gas limit for the message.\n     * @param _refundAddress Refund address for the message.\n     * @param _customMetadata Additional metadata to include in the standard hook metadata.\n     * @return ABI encoded standard hook metadata.\n     */\n    function formatMetadata(\n        uint256 _msgValue,\n        uint256 _gasLimit,\n        address _refundAddress,\n        bytes memory _customMetadata\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                VARIANT,\n                _msgValue,\n                _gasLimit,\n                _refundAddress,\n                _customMetadata\n            );\n    }\n\n    /**\n     * @notice Formats the specified gas limit and refund address into standard hook metadata.\n     * @param _msgValue msg.value for the message.\n     * @return ABI encoded standard hook metadata.\n     */\n    function overrideMsgValue(\n        uint256 _msgValue\n    ) internal view returns (bytes memory) {\n        return formatMetadata(_msgValue, uint256(0), msg.sender, \"\");\n    }\n\n    /**\n     * @notice Formats the specified gas limit and refund address into standard hook metadata.\n     * @param _gasLimit Gas limit for the message.\n     * @return ABI encoded standard hook metadata.\n     */\n    function overrideGasLimit(\n        uint256 _gasLimit\n    ) internal view returns (bytes memory) {\n        return formatMetadata(uint256(0), _gasLimit, msg.sender, \"\");\n    }\n\n    /**\n     * @notice Formats the specified refund address into standard hook metadata.\n     * @param _refundAddress Refund address for the message.\n     * @return ABI encoded standard hook metadata.\n     */\n    function overrideRefundAddress(\n        address _refundAddress\n    ) internal pure returns (bytes memory) {\n        return formatMetadata(uint256(0), uint256(0), _refundAddress, \"\");\n    }\n\n    /**\n     * @notice Formats metadata with fee token for token-based gas payments.\n     * @param _msgValue msg.value for the message.\n     * @param _gasLimit Gas limit for the message.\n     * @param _refundAddress Refund address for the message.\n     * @param _feeToken Fee token address for gas payment.\n     * @return ABI encoded hook metadata with fee token at [86:106].\n     */\n    function formatWithFeeToken(\n        uint256 _msgValue,\n        uint256 _gasLimit,\n        address _refundAddress,\n        address _feeToken\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                VARIANT,\n                _msgValue,\n                _gasLimit,\n                _refundAddress,\n                _feeToken\n            );\n    }\n\n    function getRefundAddress(\n        bytes memory _metadata,\n        address _default\n    ) internal pure returns (address) {\n        if (_metadata.length < REFUND_ADDRESS_OFFSET + 20) return _default;\n        address result;\n        assembly {\n            let data_start_ptr := add(_metadata, 32) // Skip length prefix of _metadata\n            let mload_ptr := add(data_start_ptr, sub(REFUND_ADDRESS_OFFSET, 12))\n            result := mload(mload_ptr) // Loads 32 bytes; address takes lower 20 bytes.\n        }\n        return result;\n    }\n}\n"
        },
        "contracts/interfaces/hooks/IPostDispatchHook.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\ninterface IPostDispatchHook {\n    enum HookTypes {\n        UNUSED,\n        ROUTING,\n        AGGREGATION,\n        MERKLE_TREE,\n        INTERCHAIN_GAS_PAYMASTER,\n        FALLBACK_ROUTING,\n        ID_AUTH_ISM,\n        PAUSABLE,\n        PROTOCOL_FEE,\n        DEPRECATED,\n        RATE_LIMITED,\n        ARB_L2_TO_L1,\n        OP_L2_TO_L1,\n        MAILBOX_DEFAULT_HOOK,\n        AMOUNT_ROUTING,\n        CCTP,\n        TIMELOCK_ROUTING,\n        PREDICATE_ROUTER_WRAPPER\n    }\n\n    /**\n     * @notice Returns an enum that represents the type of hook\n     */\n    function hookType() external view returns (uint8);\n\n    /**\n     * @notice Returns whether the hook supports metadata\n     * @param metadata metadata\n     * @return Whether the hook supports metadata\n     */\n    function supportsMetadata(\n        bytes calldata metadata\n    ) external view returns (bool);\n\n    /**\n     * @notice Post action after a message is dispatched via the Mailbox\n     * @param metadata The metadata required for the hook\n     * @param message The message passed from the Mailbox.dispatch() call\n     */\n    function postDispatch(\n        bytes calldata metadata,\n        bytes calldata message\n    ) external payable;\n\n    /**\n     * @notice Compute the payment required by the postDispatch call\n     * @dev The returned quote is denominated in a single currency - either native ETH\n     * (when metadata.feeToken is address(0) or unspecified) or an ERC-20 token\n     * (when metadata.feeToken is set). Mixing fee denominations within a single\n     * dispatch is not supported.\n     *\n     * When feeToken is set, hooks that only support native fees should return 0 or\n     * revert via supportsMetadata. The Mailbox.quoteDispatch sums quotes from\n     * requiredHook and hook, which assumes both use the same denomination.\n     *\n     * @param metadata The metadata required for the hook\n     * @param message The message passed from the Mailbox.dispatch() call\n     * @return Quoted payment for the postDispatch call\n     */\n    function quoteDispatch(\n        bytes calldata metadata,\n        bytes calldata message\n    ) external view returns (uint256);\n}\n"
        },
        "contracts/interfaces/IInterchainSecurityModule.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\ninterface IInterchainSecurityModule {\n    enum Types {\n        UNUSED,\n        ROUTING,\n        AGGREGATION,\n        LEGACY_MULTISIG,\n        MERKLE_ROOT_MULTISIG,\n        MESSAGE_ID_MULTISIG,\n        NULL, // used with relayer carrying no metadata\n        CCIP_READ,\n        ARB_L2_TO_L1,\n        WEIGHTED_MERKLE_ROOT_MULTISIG,\n        WEIGHTED_MESSAGE_ID_MULTISIG,\n        OP_L2_TO_L1,\n        POLYMER\n    }\n\n    /**\n     * @notice Returns an enum that represents the type of security model\n     * encoded by this ISM.\n     * @dev Relayers infer how to fetch and format metadata.\n     */\n    function moduleType() external view returns (uint8);\n\n    /**\n     * @notice Defines a security model responsible for verifying interchain\n     * messages based on the provided metadata.\n     * @param _metadata Off-chain metadata provided by a relayer, specific to\n     * the security model encoded by the module (e.g. validator signatures)\n     * @param _message Hyperlane encoded interchain message\n     * @return True if the message was verified\n     */\n    function verify(\n        bytes calldata _metadata,\n        bytes calldata _message\n    ) external returns (bool);\n}\n\ninterface ISpecifiesInterchainSecurityModule {\n    function interchainSecurityModule()\n        external\n        view\n        returns (IInterchainSecurityModule);\n}\n"
        },
        "contracts/interfaces/IMailbox.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\nimport {IInterchainSecurityModule} from \"./IInterchainSecurityModule.sol\";\nimport {IPostDispatchHook} from \"./hooks/IPostDispatchHook.sol\";\n\ninterface IMailbox {\n    // ============ Events ============\n    /**\n     * @notice Emitted when a new message is dispatched via Hyperlane\n     * @param sender The address that dispatched the message\n     * @param destination The destination domain of the message\n     * @param recipient The message recipient address on `destination`\n     * @param message Raw bytes of message\n     */\n    event Dispatch(\n        address indexed sender,\n        uint32 indexed destination,\n        bytes32 indexed recipient,\n        bytes message\n    );\n\n    /**\n     * @notice Emitted when a new message is dispatched via Hyperlane\n     * @param messageId The unique message identifier\n     */\n    event DispatchId(bytes32 indexed messageId);\n\n    /**\n     * @notice Emitted when a Hyperlane message is processed\n     * @param messageId The unique message identifier\n     */\n    event ProcessId(bytes32 indexed messageId);\n\n    /**\n     * @notice Emitted when a Hyperlane message is delivered\n     * @param origin The origin domain of the message\n     * @param sender The message sender address on `origin`\n     * @param recipient The address that handled the message\n     */\n    event Process(\n        uint32 indexed origin,\n        bytes32 indexed sender,\n        address indexed recipient\n    );\n\n    function localDomain() external view returns (uint32);\n\n    function delivered(bytes32 messageId) external view returns (bool);\n\n    /// @notice Returns the block number at which `messageId` was processed,\n    /// or 0 if it has not been processed.\n    /// @dev Implementation in `Mailbox.sol::processedAt`. The block number is\n    /// written to `deliveries[id].blockNumber` inside `process(...)` *before*\n    /// the ISM verify call, so within a single `process(...)` transaction,\n    /// `processedAt(id) == block.number` is true while the ISM is running.\n    function processedAt(bytes32 messageId) external view returns (uint48);\n\n    function defaultIsm() external view returns (IInterchainSecurityModule);\n\n    function defaultHook() external view returns (IPostDispatchHook);\n\n    function requiredHook() external view returns (IPostDispatchHook);\n\n    function latestDispatchedId() external view returns (bytes32);\n\n    function nonce() external view returns (uint32);\n\n    function dispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata messageBody\n    ) external payable returns (bytes32 messageId);\n\n    function quoteDispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata messageBody\n    ) external view returns (uint256 fee);\n\n    function dispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata body,\n        bytes calldata defaultHookMetadata\n    ) external payable returns (bytes32 messageId);\n\n    function quoteDispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata messageBody,\n        bytes calldata defaultHookMetadata\n    ) external view returns (uint256 fee);\n\n    function dispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata body,\n        bytes calldata customHookMetadata,\n        IPostDispatchHook customHook\n    ) external payable returns (bytes32 messageId);\n\n    function quoteDispatch(\n        uint32 destinationDomain,\n        bytes32 recipientAddress,\n        bytes calldata messageBody,\n        bytes calldata customHookMetadata,\n        IPostDispatchHook customHook\n    ) external view returns (uint256 fee);\n\n    function process(\n        bytes calldata metadata,\n        bytes calldata message\n    ) external payable;\n\n    function recipientIsm(\n        address recipient\n    ) external view returns (IInterchainSecurityModule module);\n}\n"
        },
        "contracts/interfaces/IMessageRecipient.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\ninterface IMessageRecipient {\n    function handle(\n        uint32 _origin,\n        bytes32 _sender,\n        bytes calldata _message\n    ) external payable;\n}\n"
        },
        "contracts/interfaces/ITokenBridge.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\nstruct Quote {\n    address token; // address(0) for the native token, or ERC20 for token payments\n    uint256 amount;\n}\n\ninterface ITokenFee {\n    /**\n     * @notice Provide the value transfer quote\n     * @param _destination The destination domain of the message\n     * @param _recipient The message recipient address on `destination`\n     * @param _amount The amount to send to the recipient\n     * @return quotes Indicate how much of each token to approve and/or send.\n     * @dev Good practice is to use the first entry of the quotes for the IGP fee (native or ERC20).\n     * @dev Good practice is to use the last entry of the quotes for the token to be transferred.\n     * @dev There should not be duplicate `token` addresses in the returned quotes.\n     */\n    function quoteTransferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) external view returns (Quote[] memory quotes);\n}\n\ninterface ITokenBridge is ITokenFee {\n    /**\n     * @notice Transfer value to another domain\n     * @param _destination The destination domain of the message\n     * @param _recipient The message recipient address on `destination`\n     * @param _amount The amount to send to the recipient\n     * @return messageId The identifier of the dispatched message.\n     */\n    function transferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) external payable returns (bytes32);\n}\n"
        },
        "contracts/libs/EnumerableMapExtended.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\n// ============ External Imports ============\nimport \"@openzeppelin/contracts/utils/structs/EnumerableMap.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// extends EnumerableMap with uint256 => bytes32 type\n// modelled after https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.8.0/contracts/utils/structs/EnumerableMap.sol\nlibrary EnumerableMapExtended {\n    using EnumerableMap for EnumerableMap.Bytes32ToBytes32Map;\n    using EnumerableSet for EnumerableSet.Bytes32Set;\n\n    struct UintToBytes32Map {\n        EnumerableMap.Bytes32ToBytes32Map _inner;\n    }\n\n    // ============ Library Functions ============\n    function keys(\n        UintToBytes32Map storage map\n    ) internal view returns (uint256[] memory _keys) {\n        uint256 _length = map._inner.length();\n        _keys = new uint256[](_length);\n        for (uint256 i = 0; i < _length; i++) {\n            _keys[i] = uint256(map._inner._keys.at(i));\n        }\n    }\n\n    function uint32Keys(\n        UintToBytes32Map storage map\n    ) internal view returns (uint32[] memory _keys) {\n        uint256[] memory uint256keys = keys(map);\n        _keys = new uint32[](uint256keys.length);\n        for (uint256 i = 0; i < uint256keys.length; i++) {\n            _keys[i] = uint32(uint256keys[i]);\n        }\n    }\n\n    function set(\n        UintToBytes32Map storage map,\n        uint256 key,\n        bytes32 value\n    ) internal {\n        map._inner.set(bytes32(key), value);\n    }\n\n    function get(\n        UintToBytes32Map storage map,\n        uint256 key\n    ) internal view returns (bytes32) {\n        return map._inner.get(bytes32(key));\n    }\n\n    function tryGet(\n        UintToBytes32Map storage map,\n        uint256 key\n    ) internal view returns (bool, bytes32) {\n        return map._inner.tryGet(bytes32(key));\n    }\n\n    function remove(\n        UintToBytes32Map storage map,\n        uint256 key\n    ) internal returns (bool) {\n        return map._inner.remove(bytes32(key));\n    }\n\n    function contains(\n        UintToBytes32Map storage map,\n        uint256 key\n    ) internal view returns (bool) {\n        return map._inner.contains(bytes32(key));\n    }\n\n    function length(\n        UintToBytes32Map storage map\n    ) internal view returns (uint256) {\n        return map._inner.length();\n    }\n\n    function at(\n        UintToBytes32Map storage map,\n        uint256 index\n    ) internal view returns (uint256, bytes32) {\n        (bytes32 key, bytes32 value) = map._inner.at(index);\n        return (uint256(key), value);\n    }\n}\n"
        },
        "contracts/libs/Message.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\nimport {TypeCasts} from \"./TypeCasts.sol\";\n\n/**\n * @title Hyperlane Message Library\n * @notice Library for formatted messages used by Mailbox\n **/\nlibrary Message {\n    using TypeCasts for bytes32;\n\n    uint256 private constant VERSION_OFFSET = 0;\n    uint256 private constant NONCE_OFFSET = 1;\n    uint256 private constant ORIGIN_OFFSET = 5;\n    uint256 private constant SENDER_OFFSET = 9;\n    uint256 private constant DESTINATION_OFFSET = 41;\n    uint256 private constant RECIPIENT_OFFSET = 45;\n    uint256 private constant BODY_OFFSET = 77;\n\n    /**\n     * @notice Returns formatted (packed) Hyperlane message with provided fields\n     * @dev This function should only be used in memory message construction.\n     * @param _version The version of the origin and destination Mailboxes\n     * @param _nonce A nonce to uniquely identify the message on its origin chain\n     * @param _originDomain Domain of origin chain\n     * @param _sender Address of sender as bytes32\n     * @param _destinationDomain Domain of destination chain\n     * @param _recipient Address of recipient on destination chain as bytes32\n     * @param _messageBody Raw bytes of message body\n     * @return Formatted message\n     */\n    function formatMessage(\n        uint8 _version,\n        uint32 _nonce,\n        uint32 _originDomain,\n        bytes32 _sender,\n        uint32 _destinationDomain,\n        bytes32 _recipient,\n        bytes calldata _messageBody\n    ) internal pure returns (bytes memory) {\n        return\n            abi.encodePacked(\n                _version,\n                _nonce,\n                _originDomain,\n                _sender,\n                _destinationDomain,\n                _recipient,\n                _messageBody\n            );\n    }\n\n    /**\n     * @notice Returns the message ID.\n     * @param _message ABI encoded Hyperlane message.\n     * @return ID of `_message`\n     */\n    function id(bytes memory _message) internal pure returns (bytes32) {\n        return keccak256(_message);\n    }\n\n    /**\n     * @notice Returns the message version.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Version of `_message`\n     */\n    function version(bytes calldata _message) internal pure returns (uint8) {\n        return uint8(bytes1(_message[VERSION_OFFSET:NONCE_OFFSET]));\n    }\n\n    /**\n     * @notice Returns the message nonce.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Nonce of `_message`\n     */\n    function nonce(bytes calldata _message) internal pure returns (uint32) {\n        return uint32(bytes4(_message[NONCE_OFFSET:ORIGIN_OFFSET]));\n    }\n\n    /**\n     * @notice Returns the message origin domain.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Origin domain of `_message`\n     */\n    function origin(bytes calldata _message) internal pure returns (uint32) {\n        return uint32(bytes4(_message[ORIGIN_OFFSET:SENDER_OFFSET]));\n    }\n\n    /**\n     * @notice Returns the message sender as bytes32.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Sender of `_message` as bytes32\n     */\n    function sender(bytes calldata _message) internal pure returns (bytes32) {\n        return bytes32(_message[SENDER_OFFSET:DESTINATION_OFFSET]);\n    }\n\n    /**\n     * @notice Returns the message sender as address.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Sender of `_message` as address\n     */\n    function senderAddress(\n        bytes calldata _message\n    ) internal pure returns (address) {\n        return sender(_message).bytes32ToAddress();\n    }\n\n    /**\n     * @notice Returns the message destination domain.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Destination domain of `_message`\n     */\n    function destination(\n        bytes calldata _message\n    ) internal pure returns (uint32) {\n        return uint32(bytes4(_message[DESTINATION_OFFSET:RECIPIENT_OFFSET]));\n    }\n\n    /**\n     * @notice Returns the message recipient as bytes32.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Recipient of `_message` as bytes32\n     */\n    function recipient(\n        bytes calldata _message\n    ) internal pure returns (bytes32) {\n        return bytes32(_message[RECIPIENT_OFFSET:BODY_OFFSET]);\n    }\n\n    /**\n     * @notice Returns the message recipient as address.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Recipient of `_message` as address\n     */\n    function recipientAddress(\n        bytes calldata _message\n    ) internal pure returns (address) {\n        return recipient(_message).bytes32ToAddress();\n    }\n\n    /**\n     * @notice Returns the message body.\n     * @param _message ABI encoded Hyperlane message.\n     * @return Body of `_message`\n     */\n    function body(\n        bytes calldata _message\n    ) internal pure returns (bytes calldata) {\n        return bytes(_message[BODY_OFFSET:]);\n    }\n}\n"
        },
        "contracts/libs/TypeCasts.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\nlibrary TypeCasts {\n    // alignment preserving cast\n    function addressToBytes32(address _addr) internal pure returns (bytes32) {\n        return bytes32(uint256(uint160(_addr)));\n    }\n\n    // alignment preserving cast\n    function bytes32ToAddress(bytes32 _buf) internal pure returns (address) {\n        require(\n            uint256(_buf) <= uint256(type(uint160).max),\n            \"TypeCasts: bytes32ToAddress overflow\"\n        );\n        return address(uint160(uint256(_buf)));\n    }\n}\n"
        },
        "contracts/PackageVersioned.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.6.11;\n\n/**\n * @title PackageVersioned\n * @notice Package version getter for contracts\n **/\nabstract contract PackageVersioned {\n    // GENERATED CODE - DO NOT EDIT\n    string public constant PACKAGE_VERSION = \"12.1.0\";\n}\n"
        },
        "contracts/token/CrossCollateralRouter.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\n// ============ Core Imports ============\nimport {HypERC20Collateral} from \"./HypERC20Collateral.sol\";\nimport {TokenMessage} from \"./libs/TokenMessage.sol\";\nimport {TypeCasts} from \"../libs/TypeCasts.sol\";\nimport {IPostDispatchHook} from \"../interfaces/hooks/IPostDispatchHook.sol\";\nimport {ITokenBridge, Quote} from \"../interfaces/ITokenBridge.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n// ============ Local Imports ============\nimport {ICrossCollateralFee} from \"./interfaces/ICrossCollateralFee.sol\";\nimport {IRebalanceTargets} from \"./interfaces/IRebalanceTargets.sol\";\n\n/**\n * @title CrossCollateralRouter\n * @notice Multi-router collateral: direct 1-message atomic transfers between\n * collateral routers, both cross-chain and same-chain.\n * @dev Extends HypERC20Collateral. Each deployed instance holds collateral for\n * one ERC20. Enrolled routers are other CrossCollateralRouter instances (same or\n * different token) that this instance trusts to send/receive transfers.\n * CrossCollateralRouter assumes standard ERC20 behavior with exact transfer\n * amounts. Rebasing tokens, fee-on-transfer tokens, and ERC777 tokens are not\n * supported due to exact-amount accounting in transfer/handle flows.\n *\n * Overrides:\n *  - handle(): accepts messages from the mailbox (cross-chain) or directly\n *    from enrolled routers on the same chain.\n */\n// solhint-disable-next-line hyperlane/enumerable-domain-mapping\ncontract CrossCollateralRouter is\n    HypERC20Collateral,\n    ICrossCollateralFee,\n    IRebalanceTargets\n{\n    using TypeCasts for address;\n    using TypeCasts for bytes32;\n    using SafeERC20 for IERC20;\n    using EnumerableSet for EnumerableSet.Bytes32Set;\n    using EnumerableSet for EnumerableSet.UintSet;\n\n    // ============ Events ============\n\n    event CrossCollateralRouterEnrolled(\n        uint32 indexed domain,\n        bytes32 indexed router\n    );\n    event CrossCollateralRouterUnenrolled(\n        uint32 indexed domain,\n        bytes32 indexed router\n    );\n    event RebalanceTargetAdded(uint32 indexed domain, bytes32 indexed target);\n    event RebalanceTargetRemoved(uint32 indexed domain, bytes32 indexed target);\n\n    // ============ Storage ============\n\n    /// @notice Additional enrolled routers by domain (beyond the standard\n    /// enrolled remote router). Local routers use localDomain as key.\n    mapping(uint32 domain => EnumerableSet.Bytes32Set routers)\n        private _crossCollateralRouters;\n\n    /// @notice Tracks which domains have at least one CrossCollateral-enrolled router,\n    /// enabling on-chain enumeration for the SDK reader.\n    EnumerableSet.UintSet private _crossCollateralDomains;\n\n    /// @notice Additional allowed rebalance targets by domain, beyond the\n    /// enrolled remote router. Consulted by `isRebalanceTarget`.\n    // solhint-disable-next-line hyperlane/enumerable-domain-mapping\n    mapping(uint32 domain => EnumerableSet.Bytes32Set targets)\n        private _rebalanceTargets;\n\n    // ============ Constructor ============\n\n    constructor(\n        address erc20,\n        uint256 _scaleNumerator,\n        uint256 _scaleDenominator,\n        address _mailbox\n    ) HypERC20Collateral(erc20, _scaleNumerator, _scaleDenominator, _mailbox) {}\n\n    // ============ Router Management (onlyOwner) ============\n\n    function enrollCrossCollateralRouters(\n        uint32[] calldata _domains,\n        bytes32[] calldata _routers\n    ) external onlyOwner {\n        require(_domains.length == _routers.length, \"CCR: length mismatch\");\n        for (uint256 i = 0; i < _domains.length; i++) {\n            if (_crossCollateralRouters[_domains[i]].add(_routers[i])) {\n                _crossCollateralDomains.add(uint256(_domains[i]));\n                emit CrossCollateralRouterEnrolled(_domains[i], _routers[i]);\n            }\n        }\n    }\n\n    function unenrollCrossCollateralRouters(\n        uint32[] calldata _domains,\n        bytes32[] calldata _routers\n    ) external onlyOwner {\n        require(_domains.length == _routers.length, \"CCR: length mismatch\");\n        for (uint256 i = 0; i < _domains.length; i++) {\n            if (_crossCollateralRouters[_domains[i]].remove(_routers[i])) {\n                if (_crossCollateralRouters[_domains[i]].length() == 0) {\n                    _crossCollateralDomains.remove(uint256(_domains[i]));\n                    // Last cross-collateral route for this domain is gone; if no\n                    // route remains at all, clear its rebalance config so a\n                    // removed route cannot retain rebalance authority.\n                    if (\n                        !_MovableCollateralRouter_hasRebalanceRoutes(\n                            _domains[i]\n                        )\n                    ) {\n                        _clearRebalanceState(_domains[i]);\n                    }\n                }\n                emit CrossCollateralRouterUnenrolled(_domains[i], _routers[i]);\n            }\n        }\n    }\n\n    function crossCollateralRouters(\n        uint32 _domain,\n        bytes32 _router\n    ) external view returns (bool) {\n        return _crossCollateralRouters[_domain].contains(_router);\n    }\n\n    // ============ Enumeration ============\n\n    function getCrossCollateralRouters(\n        uint32 _domain\n    ) external view returns (bytes32[] memory) {\n        return _crossCollateralRouters[_domain].values();\n    }\n\n    /// @notice Returns all domains that have at least one CrossCollateral-enrolled router.\n    function getCrossCollateralDomains()\n        external\n        view\n        returns (uint32[] memory domains)\n    {\n        uint256 len = _crossCollateralDomains.length();\n        domains = new uint32[](len);\n        for (uint256 i = 0; i < len; i++) {\n            domains[i] = uint32(_crossCollateralDomains.at(i));\n        }\n    }\n\n    // ============ Rebalance Targets (onlyOwner) ============\n\n    /// @notice Adds an allowed rebalance target for `_domain`.\n    function addRebalanceTarget(\n        uint32 _domain,\n        bytes32 _target\n    ) external onlyOwner {\n        if (_rebalanceTargets[_domain].add(_target)) {\n            emit RebalanceTargetAdded(_domain, _target);\n        }\n    }\n\n    /// @notice Removes a previously allowed rebalance target for `_domain`.\n    function removeRebalanceTarget(\n        uint32 _domain,\n        bytes32 _target\n    ) external onlyOwner {\n        if (_rebalanceTargets[_domain].remove(_target)) {\n            emit RebalanceTargetRemoved(_domain, _target);\n        }\n    }\n\n    /// @notice Returns the explicitly added rebalance targets for `_domain`.\n    /// @dev Excludes the enrolled remote router, which is always a valid target.\n    function rebalanceTargets(\n        uint32 _domain\n    ) external view returns (bytes32[] memory) {\n        return _rebalanceTargets[_domain].values();\n    }\n\n    /// @inheritdoc IRebalanceTargets\n    /// @dev The enrolled remote router is always a valid target; additional\n    /// targets are opt-in via `addRebalanceTarget`. Cross-collateral routers\n    /// (enrolled via `enrollCrossCollateralRouters`) are NOT automatically valid\n    /// targets and must be added explicitly with `addRebalanceTarget`. The zero\n    /// address is never a valid target, even when `_domain` has no enrolled router.\n    function isRebalanceTarget(\n        uint32 _domain,\n        bytes32 _target\n    ) external view override returns (bool) {\n        return\n            _target != bytes32(0) &&\n            (_target == routers(_domain) ||\n                _rebalanceTargets[_domain].contains(_target));\n    }\n\n    // ============ Destination Gas Override ============\n\n    /// @dev Overrides GasRouter._setDestinationGas to also accept CrossCollateral-enrolled\n    /// domains (not just default Router._routers). Excludes localDomain since\n    /// same-chain transfers skip mailbox dispatch.\n    function _setDestinationGas(uint32 domain, uint256 gas) internal override {\n        require(domain != localDomain, \"CCR: no gas for local domain\");\n        require(\n            routers(domain) != bytes32(0) ||\n                _crossCollateralRouters[domain].length() > 0,\n            \"CCR: domain has no routers\"\n        );\n        destinationGas[domain] = gas;\n        emit GasSet(domain, gas);\n    }\n\n    // ============ Movable Collateral Overrides ============\n\n    /// @notice Emitted when the CCR override `setRecipient` writes the\n    /// per-domain rebalance recipient. Distinct from any base-contract event\n    /// so off-chain consumers can attribute changes to the CCR admin path.\n    event CCRRecipientSet(uint32 indexed domain, bytes32 recipient);\n\n    /// @notice Emitted when the CCR override `addBridge` registers a new\n    /// rebalance bridge for a CCR-enrolled domain.\n    event CCRBridgeAdded(uint32 indexed domain, address indexed bridge);\n\n    /// @dev Widens MovableCollateralRouter's rebalance-domain check to also\n    /// accept CCR-enrolled domains. For CCR-only domains, `setRecipient` must\n    /// be called to pin a target router — `_recipient`'s fallback would\n    /// otherwise revert in `_mustHaveRemoteRouter`.\n    function setRecipient(\n        uint32 domain,\n        bytes32 recipient\n    ) external override onlyOwner {\n        _requireEnrolledRouter(domain);\n        allowed.recipient[domain] = recipient;\n        emit CCRRecipientSet(domain, recipient);\n    }\n\n    function addBridge(\n        uint32 domain,\n        ITokenBridge bridge\n    ) external override onlyOwner {\n        _requireEnrolledRouter(domain);\n        _addBridge(domain, bridge);\n        emit CCRBridgeAdded(domain, address(bridge));\n    }\n\n    function _requireEnrolledRouter(uint32 domain) internal view {\n        require(\n            routers(domain) != bytes32(0) ||\n                _crossCollateralRouters[domain].length() > 0,\n            \"CCR: domain has no routers\"\n        );\n    }\n\n    /// @dev A domain also has rebalance routes if it has cross-collateral routers.\n    function _MovableCollateralRouter_hasRebalanceRoutes(\n        uint32 domain\n    ) internal view override returns (bool) {\n        return\n            super._MovableCollateralRouter_hasRebalanceRoutes(domain) ||\n            _crossCollateralRouters[domain].length() > 0;\n    }\n\n    // ============ Internal Helpers ============\n\n    /// @dev Reverts unless `_router` is enrolled for `_domain` (either via the\n    /// standard Router._routers map or via the CrossCollateral-specific _crossCollateralRouters set).\n    function _requireAuthorizedRouter(\n        uint32 _domain,\n        bytes32 _router\n    ) internal view {\n        require(_router != bytes32(0), \"CCR: router is zero address\");\n        require(\n            _isRemoteRouter(_domain, _router) ||\n                _crossCollateralRouters[_domain].contains(_router),\n            \"CCR: unauthorized router\"\n        );\n    }\n\n    // ============ Handle Override ============\n\n    /// @dev Overrides `Router.handle` from core (`client/Router.sol`) via\n    /// HypERC20Collateral -> TokenRouter -> GasRouter -> Router.\n    /// Accepts messages from the mailbox (cross-chain) or directly from\n    /// enrolled routers on the same chain. Removes the onlyMailbox modifier.\n    // solhint-disable-next-line hyperlane/no-virtual-override\n    function handle(\n        uint32 _origin,\n        bytes32 _sender,\n        bytes calldata _message\n    ) external payable override {\n        if (msg.sender == address(mailbox)) {\n            // Cross-chain via mailbox: origin must differ from local domain\n            require(\n                _origin != localDomain,\n                \"CCR: same-domain via mailbox not allowed\"\n            );\n            // Cross-chain via mailbox: sender must be enrolled\n            _requireAuthorizedRouter(_origin, _sender);\n        } else {\n            // Same-chain direct call: caller must be an enrolled router\n            require(\n                _crossCollateralRouters[localDomain].contains(\n                    TypeCasts.addressToBytes32(msg.sender)\n                ),\n                \"CCR: unauthorized router\"\n            );\n        }\n        _handle(_origin, _sender, _message);\n    }\n\n    // ============ Per-Router Fee Lookup ============\n    // Mirrors TokenRouter._feeRecipientAndAmount but routes through\n    // ICrossCollateralFee.quoteTransferRemoteTo (which includes _targetRouter)\n    // instead of ITokenFee.quoteTransferRemote (destination-only).\n\n    function _feeRecipientAndAmountForRouter(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        bytes32 _targetRouter\n    ) internal view returns (address _feeRecipient, uint256 feeAmount) {\n        _feeRecipient = feeRecipient();\n        if (_feeRecipient == address(0)) return (_feeRecipient, 0);\n\n        // Only difference from base: quoteTransferRemoteTo with _targetRouter\n        Quote[] memory quotes = ICrossCollateralFee(_feeRecipient)\n            .quoteTransferRemoteTo(\n                _destination,\n                _recipient,\n                _amount,\n                _targetRouter\n            );\n        if (quotes.length == 0) return (_feeRecipient, 0);\n\n        require(\n            quotes.length == 1 && quotes[0].token == token(),\n            \"CCR: fee must match token\"\n        );\n        feeAmount = quotes[0].amount;\n    }\n\n    // Mirrors TokenRouter._calculateFeesAndCharge. Identical charge/hook/transfer\n    // logic — only the fee lookup differs (router-aware via _feeRecipientAndAmountForRouter).\n    // Duplicated here because the base hardcodes _feeRecipientAndAmount.\n    function _calculateFeesAndChargeForRouter(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        uint256 _msgValue,\n        bytes32 _targetRouter\n    ) internal returns (uint256 externalFee, uint256 remainingNativeValue) {\n        // Only difference from base: router-aware fee lookup\n        (\n            address _feeRecipient,\n            uint256 feeAmount\n        ) = _feeRecipientAndAmountForRouter(\n                _destination,\n                _recipient,\n                _amount,\n                _targetRouter\n            );\n        // --- remainder identical to TokenRouter._calculateFeesAndCharge ---\n        externalFee = _externalFeeAmount(_destination, _recipient, _amount);\n        uint256 charge = _amount + feeAmount + externalFee;\n\n        address _feeHook = feeHook();\n        address _token = token();\n\n        // Same-domain transferRemoteTo calls handle() directly and does not dispatch\n        // through mailbox hooks, so do not charge hook fees in that path.\n        if (_feeHook != address(0) && _destination != localDomain) {\n            uint256 hookFee = _quoteGasPaymentTo(\n                _destination,\n                _recipient,\n                _amount,\n                _token,\n                _targetRouter\n            );\n            if (hookFee > 0) {\n                if (_token != address(this)) {\n                    charge += hookFee;\n                } else {\n                    IERC20(_token).safeTransferFrom(\n                        msg.sender,\n                        address(this),\n                        hookFee\n                    );\n                }\n                IERC20(_token).forceApprove(_feeHook, hookFee);\n            }\n        }\n\n        _transferFromSender(charge);\n        if (feeAmount > 0) {\n            _transferFee(_feeRecipient, feeAmount);\n        }\n        remainingNativeValue = _token != address(0)\n            ? _msgValue\n            : _msgValue - charge;\n    }\n\n    // ============ Cross-chain Transfer to Specific Router ============\n\n    /**\n     * @notice Transfers tokens to the primary enrolled router for `_destination`.\n     * @dev Uses the enrolled primary remote router for `_destination` and routes through\n     * router-aware fee lookup (`ICrossCollateralFee`) via `transferRemoteTo`.\n     * @dev This override is required because TokenRouter's `_feeRecipientAndAmount`\n     * is non-virtual and hardcodes `ITokenFee`. Delegating through\n     * `transferRemoteTo` keeps both transfer paths on `ICrossCollateralFee`.\n     */\n    function transferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) public payable override returns (bytes32 messageId) {\n        bytes32 targetRouter = _mustHaveRemoteRouter(_destination);\n        return\n            transferRemoteTo(_destination, _recipient, _amount, targetRouter);\n    }\n\n    /**\n     * @notice Transfer tokens cross-chain to a specific target router.\n     * @dev Follows TokenRouter.transferRemote() flow: fees → message → emit → dispatch.\n     * Bypasses _Router_dispatch (which hardcodes the enrolled router) to dispatch\n     * directly to the target router.\n     * @param _destination Destination domain.\n     * @param _recipient Final token recipient on destination.\n     * @param _amount Amount in local token decimals.\n     * @param _targetRouter The enrolled router to receive the message on destination.\n     * @return messageId The dispatched message ID.\n     */\n    function transferRemoteTo(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        bytes32 _targetRouter\n    ) public payable returns (bytes32 messageId) {\n        _requireAuthorizedRouter(_destination, _targetRouter);\n        if (_destination == localDomain) {\n            // Local transfers call handle() directly without mailbox dispatch,\n            // so any msg.value would be stuck in this contract permanently.\n            require(msg.value == 0, \"CCR: local transfer no msg.value\");\n        }\n\n        (, uint256 remainingValue) = _calculateFeesAndChargeForRouter(\n            _destination,\n            _recipient,\n            _amount,\n            msg.value,\n            _targetRouter\n        );\n\n        uint256 scaled = _outboundAmount(_amount);\n        bytes memory tokenMsg = TokenMessage.format(_recipient, scaled);\n\n        if (_destination == localDomain) {\n            // Same-domain: call target router's handle directly\n            address target = _targetRouter.bytes32ToAddress();\n            require(target.code.length > 0, \"CCR: target router not contract\");\n            CrossCollateralRouter(target).handle(\n                localDomain,\n                TypeCasts.addressToBytes32(address(this)),\n                tokenMsg\n            );\n        } else {\n            emit SentTransferRemote(_destination, _recipient, scaled);\n            messageId = mailbox.dispatch{value: remainingValue}(\n                _destination,\n                _targetRouter,\n                tokenMsg,\n                _generateHookMetadata(_destination, feeToken()),\n                IPostDispatchHook(address(hook))\n            );\n        }\n    }\n\n    // ============ Quoting ============\n\n    // Mirrors TokenRouter.quoteTransferRemote. Same 3-element quote structure.\n    // Differences: (1) router-aware fee lookup, (2) same-domain returns 0 gas\n    // since handle() is called directly without mailbox dispatch.\n\n    function quoteTransferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) public view override returns (Quote[] memory quotes) {\n        bytes32 targetRouter = _mustHaveRemoteRouter(_destination);\n        return\n            quoteTransferRemoteTo(\n                _destination,\n                _recipient,\n                _amount,\n                targetRouter\n            );\n    }\n\n    /// @inheritdoc ICrossCollateralFee\n    function quoteTransferRemoteTo(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        bytes32 _targetRouter\n    ) public view override returns (Quote[] memory quotes) {\n        _requireAuthorizedRouter(_destination, _targetRouter);\n        if (_destination == localDomain) {\n            require(\n                _targetRouter.bytes32ToAddress().code.length > 0,\n                \"CCR: target router not contract\"\n            );\n        }\n\n        quotes = new Quote[](3);\n\n        // Same-domain: handle() called directly, no interchain gas\n        uint256 gasQuote = 0;\n        address _feeToken = feeToken();\n        if (_destination != localDomain) {\n            gasQuote = _quoteGasPaymentTo(\n                _destination,\n                _recipient,\n                _amount,\n                _feeToken,\n                _targetRouter\n            );\n        }\n        quotes[0] = Quote({token: _feeToken, amount: gasQuote});\n\n        // Only difference from base: router-aware fee lookup\n        (, uint256 feeAmount) = _feeRecipientAndAmountForRouter(\n            _destination,\n            _recipient,\n            _amount,\n            _targetRouter\n        );\n        quotes[1] = Quote({token: token(), amount: _amount + feeAmount});\n\n        quotes[2] = Quote({\n            token: token(),\n            amount: _externalFeeAmount(_destination, _recipient, _amount)\n        });\n    }\n\n    /// @dev Target-router-aware gas quote helper. Avoids Router._mustHaveRemoteRouter().\n    /// Caller must validate `_targetRouter` is authorized for `_destination`.\n    function _quoteGasPaymentTo(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        address _feeToken,\n        bytes32 _targetRouter\n    ) internal view returns (uint256) {\n        return\n            mailbox.quoteDispatch(\n                _destination,\n                _targetRouter,\n                TokenMessage.format(_recipient, _outboundAmount(_amount)),\n                _generateHookMetadata(_destination, _feeToken),\n                IPostDispatchHook(address(hook))\n            );\n    }\n}\n"
        },
        "contracts/token/HypERC20Collateral.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n/*@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n     @@@@@  HYPERLANE  @@@@@@@\n    @@@@@@@@@@@@@@@@@@@@@@@@@\n   @@@@@@@@@       @@@@@@@@@\n  @@@@@@@@@       @@@@@@@@@\n @@@@@@@@@       @@@@@@@@@\n@@@@@@@@@       @@@@@@@@*/\n\n// ============ Internal Imports ============\nimport {TokenMessage} from \"./libs/TokenMessage.sol\";\nimport {TokenRouter} from \"./libs/TokenRouter.sol\";\nimport {MovableCollateralRouter} from \"./libs/MovableCollateralRouter.sol\";\nimport {LpCollateralRouter} from \"./libs/LpCollateralRouter.sol\";\nimport {ITokenBridge, Quote} from \"../interfaces/ITokenBridge.sol\";\nimport {ERC20Collateral} from \"./libs/TokenCollateral.sol\";\nimport {EnumerableMapExtended} from \"../libs/EnumerableMapExtended.sol\";\n\n// ============ External Imports ============\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\n\n/**\n * @title Hyperlane ERC20 Token Collateral that wraps an existing ERC20 with remote transfer functionality.\n * @author Abacus Works\n */\ncontract HypERC20Collateral is LpCollateralRouter {\n    using SafeERC20 for IERC20;\n    using ERC20Collateral for IERC20;\n    using EnumerableSet for EnumerableSet.AddressSet;\n    using EnumerableMapExtended for EnumerableMapExtended.UintToBytes32Map;\n\n    IERC20 public immutable wrappedToken;\n\n    /**\n     * @notice Constructor\n     * @param erc20 Address of the token to keep as collateral\n     */\n    constructor(\n        address erc20,\n        uint256 _scaleNumerator,\n        uint256 _scaleDenominator,\n        address _mailbox\n    ) TokenRouter(_scaleNumerator, _scaleDenominator, _mailbox) {\n        require(Address.isContract(erc20), \"HypERC20Collateral: invalid token\");\n        wrappedToken = IERC20(erc20);\n    }\n\n    function initialize(\n        address _hook,\n        address _interchainSecurityModule,\n        address _owner\n    ) public initializer {\n        _MailboxClient_initialize(_hook, _interchainSecurityModule, _owner);\n        _LpCollateralRouter_initialize();\n    }\n\n    function token() public view override returns (address) {\n        return address(wrappedToken);\n    }\n\n    function _removeBridge(\n        uint32 domain,\n        ITokenBridge bridge\n    ) internal override {\n        MovableCollateralRouter._removeBridge(domain, bridge);\n\n        uint32[] memory knownDomains = _routers.uint32Keys();\n\n        // Iteration is fine as number of enrolled domains is bounded\n        for (uint256 i = 0; i < knownDomains.length; i++) {\n            EnumerableSet.AddressSet storage bridges = allowed.bridges[\n                knownDomains[i]\n            ];\n\n            if (bridges.contains(address(bridge))) {\n                return;\n            }\n        }\n\n        wrappedToken.forceApprove(address(bridge), 0);\n    }\n\n    /**\n     * @dev Transfers `_amount` of `wrappedToken` from `msg.sender` to this contract.\n     * @inheritdoc TokenRouter\n     */\n    function _transferFromSender(uint256 _amount) internal override {\n        wrappedToken._transferFromSender(_amount);\n    }\n\n    /**\n     * @dev Transfers `_amount` of `wrappedToken` from this contract to `_recipient`.\n     * @inheritdoc TokenRouter\n     */\n    function _transferTo(\n        address _recipient,\n        uint256 _amount\n    ) internal override {\n        wrappedToken._transferTo(_recipient, _amount);\n    }\n}\n"
        },
        "contracts/token/interfaces/ICrossCollateralFee.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\nimport {Quote} from \"../../interfaces/ITokenBridge.sol\";\n\ninterface ICrossCollateralFee {\n    function quoteTransferRemoteTo(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        bytes32 _targetRouter\n    ) external view returns (Quote[] memory);\n}\n"
        },
        "contracts/token/interfaces/IRebalanceTargets.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n/// @notice Authorizes rebalance recipients per domain beyond the enrolled\n/// remote router, generalizing the single per-domain recipient override to a\n/// set. Implemented by routers that allow rebalancing into multiple targets.\ninterface IRebalanceTargets {\n    function isRebalanceTarget(\n        uint32 domain,\n        bytes32 target\n    ) external view returns (bool);\n}\n"
        },
        "contracts/token/interfaces/IWETH.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IWETH is IERC20 {\n    function deposit() external payable;\n    function withdraw(uint256 amount) external;\n}\n"
        },
        "contracts/token/libs/LpCollateralRouter.sol": {
          "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\n// ============ Internal Imports ============\nimport {MovableCollateralRouter, MovableCollateralRouterStorage} from \"./MovableCollateralRouter.sol\";\n\n// ============ External Imports ============\nimport {ERC4626Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol\";\nimport {IERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\n\nstruct LpCollateralRouterStorage {\n    // MovableCollateralRouter layout\n    MovableCollateralRouterStorage __MOVABLE_COLLATERAL_GAP;\n    // ERC4626 layout\n    // - (ERC20 layout)\n    mapping(address => uint256) _balances;\n    mapping(address => mapping(address => uint256)) _allowances;\n    uint256 _totalSupply;\n    string _name;\n    string _symbol;\n    // @openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376\n    uint256[45] __ERC20_GAP;\n    // - (ERC4626 layout)\n    address _asset;\n    uint8 _underlyingDecimals;\n    // @openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol:267\n    uint256[49] __ERC4626_GAP;\n    // user defined fields\n    uint256 lpAssets;\n}\n\nabstract contract LpCollateralRouter is\n    MovableCollateralRouter,\n    ERC4626Upgradeable\n{\n    uint256 private lpAssets;\n\n    event Donation(address sender, uint256 amount);\n\n    function _LpCollateralRouter_initialize() internal onlyInitializing {\n        __ERC4626_init(IERC20Upgradeable(token()));\n    }\n\n    function totalAssets() public view override returns (uint256) {\n        return lpAssets;\n    }\n\n    function asset() public view override returns (address) {\n        return token();\n    }\n\n    // modeled after ERC4626Upgradeable._deposit\n    function _deposit(\n        address caller,\n        address receiver,\n        uint256 assets,\n        uint256 shares\n    ) internal override {\n        // checks\n        _transferFromSender(assets);\n\n        // effects\n        lpAssets += assets;\n\n        // interactions\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, shares);\n    }\n\n    // modeled after ERC4626Upgradeable._withdraw\n    function _withdraw(\n        address caller,\n        address receiver,\n        address owner,\n        uint256 assets,\n        uint256 shares\n    ) internal override {\n        // checks\n        if (caller != owner) {\n            _spendAllowance(owner, caller, shares);\n        }\n        _burn(owner, shares);\n\n        // effects\n        lpAssets -= assets;\n\n        // interactions\n        _transferTo(receiver, assets);\n\n        emit Withdraw(caller, receiver, owner, assets, shares);\n    }\n\n    // can be used to distribute rewards to LPs pro rata\n    function donate(uint256 amount) public payable {\n        // checks\n        _transferFromSender(amount);\n\n        // effects\n        lpAssets += amount;\n        emit Donation(msg.sender, amount);\n    }\n}\n"
        },
        "contracts/token/libs/MovableCollateralRouter.sol": {
          "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.8.0;\n\nimport {ITokenBridge, Quote} from \"../../interfaces/ITokenBridge.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport {TokenRouter} from \"./TokenRouter.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {Router} from \"../../client/Router.sol\";\nimport {Quotes} from \"./Quotes.sol\";\n\nstruct MovableCollateralRouterStorage {\n    // TODO: replace the single recipient override with a per-domain recipient\n    // set when routes need multiple allowed same-chain rebalance recipients.\n    mapping(uint32 routerDomain => bytes32 recipient) recipient;\n    mapping(uint32 routerDomain => EnumerableSet.AddressSet bridges) bridges;\n    EnumerableSet.AddressSet rebalancers;\n}\n\nabstract contract MovableCollateralRouter is TokenRouter {\n    using SafeERC20 for IERC20;\n    using EnumerableSet for EnumerableSet.AddressSet;\n    using Quotes for Quote[];\n\n    MovableCollateralRouterStorage internal allowed;\n\n    /// @dev For a move driven by `AtomicLocalRebalancingBridge`, `recipient` is\n    /// this router's configured recipient rather than the address the bridge\n    /// funds, and `amount` is the source outflow rather than the (decimal-\n    /// converted) amount delivered. Off-chain consumers should read the bridge's\n    /// `LocalRebalanceExecuted` event for that flow instead.\n    event CollateralMoved(\n        uint32 indexed domain,\n        bytes32 recipient,\n        uint256 amount,\n        address indexed rebalancer\n    );\n\n    modifier onlyRebalancer() {\n        require(isAllowedRebalancer(_msgSender()), \"MCR: Only Rebalancer\");\n        _;\n    }\n\n    modifier onlyAllowedBridge(uint32 domain, ITokenBridge bridge) {\n        EnumerableSet.AddressSet storage bridges = allowed.bridges[domain];\n        require(bridges.contains(address(bridge)), \"MCR: Not allowed bridge\");\n        _;\n    }\n\n    /// @notice Set of addresses that are allowed to rebalance.\n    function allowedRebalancers() external view returns (address[] memory) {\n        return allowed.rebalancers.values();\n    }\n\n    /// @notice Returns whether an address is allowed to rebalance.\n    function isAllowedRebalancer(\n        address rebalancer\n    ) public view returns (bool) {\n        return allowed.rebalancers.contains(rebalancer);\n    }\n\n    /// @notice Mapping of domain to allowed rebalance recipient.\n    /// @dev Keys constrained to a subset of Router.domains()\n    function allowedRecipient(uint32 domain) external view returns (bytes32) {\n        return allowed.recipient[domain];\n    }\n\n    /// @notice Mapping of domain to allowed rebalance bridges.\n    /// @dev Keys constrained to a subset of Router.domains()\n    function allowedBridges(\n        uint32 domain\n    ) external view returns (address[] memory) {\n        return allowed.bridges[domain].values();\n    }\n\n    function setRecipient(\n        uint32 domain,\n        bytes32 recipient\n    ) external virtual onlyOwner {\n        // constrain to a subset of Router.domains()\n        _mustHaveRemoteRouter(domain);\n        allowed.recipient[domain] = recipient;\n    }\n\n    function removeRecipient(uint32 domain) external onlyOwner {\n        delete allowed.recipient[domain];\n    }\n\n    function addBridge(\n        uint32 domain,\n        ITokenBridge bridge\n    ) external virtual onlyOwner {\n        // constrain to a subset of Router.domains()\n        _mustHaveRemoteRouter(domain);\n        _addBridge(domain, bridge);\n    }\n\n    function _addBridge(uint32 domain, ITokenBridge bridge) internal virtual {\n        allowed.bridges[domain].add(address(bridge));\n    }\n\n    function removeBridge(\n        uint32 domain,\n        ITokenBridge bridge\n    ) external onlyOwner {\n        _removeBridge(domain, bridge);\n    }\n\n    function _removeBridge(\n        uint32 domain,\n        ITokenBridge bridge\n    ) internal virtual {\n        allowed.bridges[domain].remove(address(bridge));\n    }\n\n    /**\n     * @notice Clears legacy standing token approval for a bridge.\n     * @custom:deprecated Despite the name this revokes rather than approves.\n     *      `rebalance` grants exact per-call approval from the bridge quote;\n     *      the selector is retained so existing upgrade / governance tooling\n     *      stays compatible and can clear old max allowances.\n     */\n    function approveTokenForBridge(\n        IERC20 token,\n        ITokenBridge bridge\n    ) external onlyOwner {\n        // Revokes the allowance; it does not approve.\n        token.forceApprove(address(bridge), 0);\n    }\n\n    function addRebalancer(address rebalancer) external onlyOwner {\n        allowed.rebalancers.add(rebalancer);\n    }\n\n    function removeRebalancer(address rebalancer) external onlyOwner {\n        allowed.rebalancers.remove(rebalancer);\n    }\n\n    /**\n     * @notice Rebalances the collateral between router domains.\n     * @param domain The domain to rebalance to.\n     * @param collateralAmount The amount of collateral to rebalance.\n     * @param bridge The bridge to use for the rebalance.\n     * @dev The caller must be an allowed rebalancer and the bridge must be an allowed bridge for the domain.\n     * @dev The recipient is the enrolled router if no recipient is set for the domain.\n     */\n    function rebalance(\n        uint32 domain,\n        uint256 collateralAmount,\n        ITokenBridge bridge\n    ) external payable onlyRebalancer onlyAllowedBridge(domain, bridge) {\n        bytes32 recipient = _recipient(domain);\n\n        Quote[] memory quotes = bridge.quoteTransferRemote(\n            domain,\n            recipient,\n            collateralAmount\n        );\n\n        address collateralToken = token();\n\n        // charge the rebalancer any bridging fees denominated in the collateral\n        // token to avoid undercollateralization\n        uint256 collateralFees = quotes.extract(collateralToken);\n        if (collateralFees > collateralAmount) {\n            _transferFromSender(collateralFees - collateralAmount);\n        }\n\n        // need to handle native quote separately from collateral quote because\n        // token() may be address(0), in which case we need to use address(this).balance\n        // to move native collateral tokens across chains\n        uint256 nativeFees = quotes.extract(address(0));\n        if (nativeFees > address(this).balance) {\n            revert(\"Rebalance native fee exceeds balance\");\n        }\n\n        // Grant only the route collateral amount for this transfer. Expected\n        // bridges consume the full quoted collateral allowance.\n        if (collateralToken != address(0)) {\n            IERC20(collateralToken).forceApprove(\n                address(bridge),\n                collateralFees\n            );\n        }\n\n        bridge.transferRemote{value: nativeFees}(\n            domain,\n            recipient,\n            collateralAmount\n        );\n\n        // Revoke any allowance the bridge did not consume.\n        if (collateralToken != address(0)) {\n            IERC20(collateralToken).forceApprove(address(bridge), 0);\n        }\n\n        emit CollateralMoved(domain, recipient, collateralAmount, msg.sender);\n    }\n\n    function _recipient(\n        uint32 domain\n    ) internal view returns (bytes32 recipient) {\n        recipient = allowed.recipient[domain];\n        if (recipient == bytes32(0)) {\n            recipient = _mustHaveRemoteRouter(domain);\n        }\n    }\n\n    /// @dev This function in `EnumerableSet` was introduced in OpenZeppelin v5. We are using 4.9\n    /// See https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.3.0-rc.0/contracts/utils/structs/EnumerableSet.sol#L126\n    function _clear(EnumerableSet.Set storage set) private {\n        uint256 len = set._values.length;\n        for (uint256 i = 0; i < len; ++i) {\n            delete set._indexes[set._values[i]];\n        }\n        _unsafeSetLength(set._values, 0);\n    }\n\n    /// @dev A helper for `_clear`. See https://github.com/OpenZeppelin/openzeppelin-contracts/blob/39f5a0284e7eb539354e44b76fcbb69033b22b56/contracts/utils/Arrays.sol#L466\n    function _unsafeSetLength(bytes32[] storage array, uint256 len) internal {\n        assembly (\"memory-safe\") {\n            sstore(array.slot, len)\n        }\n    }\n\n    /// @dev Constrains keys of rebalance mappings to Router.domains()\n    function _unenrollRemoteRouter(uint32 domain) internal override {\n        Router._unenrollRemoteRouter(domain);\n        if (!_MovableCollateralRouter_hasRebalanceRoutes(domain)) {\n            _clearRebalanceState(domain);\n        }\n    }\n\n    /// @dev Whether `domain` still has any route that can drive a rebalance.\n    /// Base tracks only classic remote routers; `CrossCollateralRouter` also\n    /// considers its cross-collateral routes.\n    function _MovableCollateralRouter_hasRebalanceRoutes(\n        uint32 domain\n    ) internal view virtual returns (bool) {\n        return routers(domain) != bytes32(0);\n    }\n\n    /// @dev Clears the rebalance config (recipient + allowed bridges) for a\n    /// domain that no longer has any route, so a removed route cannot retain\n    /// rebalance authority.\n    function _clearRebalanceState(uint32 domain) internal {\n        delete allowed.recipient[domain];\n        _clear(allowed.bridges[domain]._inner);\n    }\n}\n"
        },
        "contracts/token/libs/Quotes.sol": {
          "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.8.0;\n\nimport {Quote} from \"../../interfaces/ITokenBridge.sol\";\n\nlibrary Quotes {\n    function extract(\n        Quote[] memory quotes,\n        address token\n    ) internal pure returns (uint256 sum) {\n        sum = 0;\n        for (uint256 i = 0; i < quotes.length; i++) {\n            if (quotes[i].token == token) {\n                sum += quotes[i].amount;\n            }\n        }\n    }\n}\n"
        },
        "contracts/token/libs/TokenCollateral.sol": {
          "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.8.0;\n\nimport {IWETH} from \"../interfaces/IWETH.sol\";\n\n// ============ External Imports ============\nimport {Address} from \"@openzeppelin/contracts/utils/Address.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IERC721} from \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\n/**\n * @title Handles deposits and withdrawals of native token collateral.\n */\nlibrary NativeCollateral {\n    function _transferFromSender(uint256 _amount) internal {\n        require(msg.value >= _amount, \"Native: amount exceeds msg.value\");\n    }\n\n    function _transferTo(address _recipient, uint256 _amount) internal {\n        Address.sendValue(payable(_recipient), _amount);\n    }\n}\n\n/**\n * @title Handles deposits and withdrawals of WETH collateral.\n * @dev TokenRouters must have `token() == address(0)` to use this library.\n */\nlibrary WETHCollateral {\n    function _transferFromSender(IWETH token, uint256 _amount) internal {\n        NativeCollateral._transferFromSender(_amount);\n        token.deposit{value: _amount}();\n    }\n\n    function _transferTo(\n        IWETH token,\n        address _recipient,\n        uint256 _amount\n    ) internal {\n        token.withdraw(_amount);\n        NativeCollateral._transferTo(_recipient, _amount);\n    }\n}\n\n/**\n * @title Handles deposits and withdrawals of ERC20 collateral.\n */\nlibrary ERC20Collateral {\n    using SafeERC20 for IERC20;\n\n    function _transferFromSender(IERC20 token, uint256 _amount) internal {\n        token.safeTransferFrom(msg.sender, address(this), _amount);\n    }\n\n    function _transferTo(\n        IERC20 token,\n        address _recipient,\n        uint256 _amount\n    ) internal {\n        token.safeTransfer(_recipient, _amount);\n    }\n}\n\n/**\n * @title Handles deposits and withdrawals of ERC721 collateral.\n */\nlibrary ERC721Collateral {\n    function _transferFromSender(IERC721 token, uint256 _tokenId) internal {\n        // safeTransferFrom not used here because recipient is this contract\n        token.transferFrom(msg.sender, address(this), _tokenId);\n    }\n\n    function _transferTo(\n        IERC721 token,\n        address _recipient,\n        uint256 _tokenId\n    ) internal {\n        token.safeTransferFrom(address(this), _recipient, _tokenId);\n    }\n}\n"
        },
        "contracts/token/libs/TokenMessage.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\nlibrary TokenMessage {\n    uint8 internal constant RECIPIENT_OFFSET = 0;\n    uint8 internal constant AMOUNT_OFFSET = 32;\n    uint8 internal constant METADATA_OFFSET = 64;\n\n    function format(\n        bytes32 _recipient,\n        uint256 _amount,\n        bytes memory _metadata\n    ) internal pure returns (bytes memory) {\n        return abi.encodePacked(_recipient, _amount, _metadata);\n    }\n\n    function format(\n        bytes32 _recipient,\n        uint256 _amount\n    ) internal pure returns (bytes memory) {\n        return abi.encodePacked(_recipient, _amount);\n    }\n\n    function recipient(bytes calldata message) internal pure returns (bytes32) {\n        return bytes32(message[RECIPIENT_OFFSET:RECIPIENT_OFFSET + 32]);\n    }\n\n    function amount(bytes calldata message) internal pure returns (uint256) {\n        return uint256(bytes32(message[AMOUNT_OFFSET:AMOUNT_OFFSET + 32]));\n    }\n\n    // alias for ERC721\n    function tokenId(bytes calldata message) internal pure returns (uint256) {\n        return amount(message);\n    }\n\n    function metadata(\n        bytes calldata message\n    ) internal pure returns (bytes calldata) {\n        return message[METADATA_OFFSET:];\n    }\n}\n"
        },
        "contracts/token/libs/TokenRouter.sol": {
          "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.8.0;\n\n// ============ Internal Imports ============\nimport {TypeCasts} from \"../../libs/TypeCasts.sol\";\nimport {GasRouter} from \"../../client/GasRouter.sol\";\nimport {TokenMessage} from \"./TokenMessage.sol\";\nimport {Quote, ITokenBridge, ITokenFee} from \"../../interfaces/ITokenBridge.sol\";\nimport {Quotes} from \"./Quotes.sol\";\nimport {StandardHookMetadata} from \"../../hooks/libs/StandardHookMetadata.sol\";\n\n// ============ External Imports ============\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {StorageSlot} from \"@openzeppelin/contracts/utils/StorageSlot.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\n/**\n * @title Hyperlane Token Router that extends Router with abstract token (ERC20/ERC721) remote transfer functionality.\n * @dev Overridable functions:\n *  - token(): specify the managed token address\n *  - _transferFromSender(uint256): pull tokens/ETH from msg.sender\n *  - _transferTo(address,uint256): send tokens/ETH to the recipient\n *  - _externalFeeAmount(uint32,bytes32,uint256): compute external fees (default returns 0)\n * @dev Override transferRemote only to implement custom logic that can't be accomplished with the above functions.\n *\n * @author Abacus Works\n */\nabstract contract TokenRouter is GasRouter, ITokenBridge {\n    using TypeCasts for bytes32;\n    using TypeCasts for address;\n    using TokenMessage for bytes;\n    using StandardHookMetadata for bytes;\n    using StorageSlot for bytes32;\n    using Quotes for Quote[];\n    using Math for uint256;\n    using SafeERC20 for IERC20;\n\n    /**\n     * @dev Emitted on `transferRemote` when a transfer message is dispatched.\n     * @param destination The identifier of the destination chain.\n     * @param recipient The address of the recipient on the destination chain.\n     * @param amountOrId The amount or ID of tokens sent in to the remote recipient.\n     */\n    event SentTransferRemote(\n        uint32 indexed destination,\n        bytes32 indexed recipient,\n        uint256 amountOrId\n    );\n\n    /**\n     * @dev Emitted on `_handle` when a transfer message is processed.\n     * @param origin The identifier of the origin chain.\n     * @param recipient The address of the recipient on the destination chain.\n     * @param amountOrId The amount or ID of tokens received from the remote sender.\n     */\n    event ReceivedTransferRemote(\n        uint32 indexed origin,\n        bytes32 indexed recipient,\n        uint256 amountOrId\n    );\n\n    uint256 public immutable scaleNumerator;\n    uint256 public immutable scaleDenominator;\n\n    // cannot use compiler assigned slot without\n    // breaking backwards compatibility of storage layout\n    bytes32 private constant FEE_RECIPIENT_SLOT =\n        keccak256(\"FungibleTokenRouter.feeRecipient\");\n    bytes32 private constant FEE_HOOK_SLOT = keccak256(\"TokenRouter.feeHook\");\n\n    event FeeRecipientSet(address feeRecipient);\n    event FeeHookSet(address feeHook);\n\n    constructor(\n        uint256 _scaleNumerator,\n        uint256 _scaleDenominator,\n        address _mailbox\n    ) GasRouter(_mailbox) {\n        require(\n            _scaleNumerator > 0 && _scaleDenominator > 0,\n            \"TokenRouter: scale cannot be 0\"\n        );\n        scaleNumerator = _scaleNumerator;\n        scaleDenominator = _scaleDenominator;\n    }\n\n    // ===========================\n    // ========== Main API ==========\n    // ===========================\n\n    /**\n     * @notice Returns the address of the token managed by this router. It can be one of three options:\n     * - ERC20 token address for fungible tokens that are being collateralized (HypERC20Collateral, HypERC4626, etc.)\n     * - 0x0 address for native tokens (ETH, MATIC, etc.) (HypNative, etc.)\n     * - address(this) for synthetic ERC20 tokens (HypERC20, etc.)\n     * It is being used for quotes and fees from the fee recipient and pulling/push the tokens from the sender/receipient.\n     * @dev This function must be implemented by derived contracts to specify the token address.\n     * @return The address of the token contract.\n     */\n    function token() public view virtual returns (address);\n\n    /**\n     * @inheritdoc ITokenFee\n     * @notice Implements the standardized fee quoting interface for token transfers based on\n     * overridable internal functions of _quoteGasPayment, _feeRecipientAndAmount, and _externalFeeAmount.\n     * @param _destination The identifier of the destination chain.\n     * @param _recipient The address of the recipient on the destination chain.\n     * @param _amount The amount or identifier of tokens to be sent to the remote recipient\n     * @return quotes An array of Quote structs representing the fees in different tokens.\n     * @dev This function may return multiple quotes with the same denomination. Convention is to return:\n     *  [index 0] native fees charged by the mailbox dispatch\n     *  [index 1] then any internal warp route fees (amount bridged plus fee recipient)\n     *  [index 2] then any external bridging fees (if any, else 0)\n     * These are surfaced as separate elements to enable clients to interpret/render fees independently.\n     * There is a Quotes library with an extract function for onchain quoting in a specific denomination,\n     * but we discourage onchain quoting in favor of offchain quoting and overpaying with refunds.\n     */\n    function quoteTransferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) external view virtual override returns (Quote[] memory quotes) {\n        address _feeToken = feeToken();\n        quotes = new Quote[](3);\n        quotes[0] = Quote({\n            token: _feeToken, // address(0) for native, token() for ERC20 payments\n            amount: _quoteGasPayment(\n                _destination,\n                _recipient,\n                _amount,\n                _feeToken\n            )\n        });\n        (, uint256 feeAmount) = _feeRecipientAndAmount(\n            _destination,\n            _recipient,\n            _amount\n        );\n        quotes[1] = Quote({token: token(), amount: _amount + feeAmount});\n        quotes[2] = Quote({\n            token: token(),\n            amount: _externalFeeAmount(_destination, _recipient, _amount)\n        });\n    }\n\n    /**\n     * @notice Transfers `_amount` token to `_recipient` on the `_destination` domain.\n     * @dev Delegates transfer logic to `_transferFromSender` implementation.\n     * Emits `SentTransferRemote` event on the origin chain.\n     * Override with custom behavior for storing or forwarding tokens.\n     * Known overrides:\n     * - OPL2ToL1TokenBridgeNative: adds hook metadata for message dispatch.\n     * - EverclearTokenBridge: creates Everclear intent for cross-chain token transfer.\n     * - TokenBridgeCctpBase: adds CCTP-specific metadata for message dispatch.\n     * - HypERC4626Collateral: deposits into vault and handles shares.\n     * When overriding, mirror the general flow of this function for consistency:\n     * 1. Calculate fees and charge the sender.\n     * 2. Prepare the token message with recipient, amount, and any additional metadata.\n     * 3. Emit `SentTransferRemote` event.\n     * 4. Dispatch the message.\n     * @param _destination The identifier of the destination chain.\n     * @param _recipient The address of the recipient on the destination chain.\n     * @param _amount The amount or identifier of tokens to be sent to the remote recipient.\n     * @return messageId The identifier of the dispatched message.\n     */\n    function transferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) public payable virtual returns (bytes32 messageId) {\n        return _transferRemote(_destination, _recipient, _amount);\n    }\n\n    /// @notice Internal transfer implementation.\n    function _transferRemote(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) internal virtual returns (bytes32 messageId) {\n        address _feeHook = feeHook();\n        address _feeToken = feeToken();\n\n        // 1. Calculate the fee amounts, charge the sender and distribute to feeRecipient if necessary\n        (, uint256 remainingNativeValue) = _calculateFeesAndCharge(\n            _destination,\n            _recipient,\n            _amount,\n            msg.value,\n            _feeHook\n        );\n\n        uint256 scaledAmount = _outboundAmount(_amount);\n\n        // 2. Prepare the token message with the recipient and amount\n        bytes memory _tokenMessage = TokenMessage.format(\n            _recipient,\n            scaledAmount\n        );\n\n        messageId = _emitAndDispatch(\n            _destination,\n            _recipient,\n            scaledAmount,\n            remainingNativeValue,\n            _tokenMessage,\n            _feeToken\n        );\n    }\n\n    // ===========================\n    // ========== Internal convenience functions for readability ==========\n    // ==========================\n\n    function _calculateFeesAndCharge(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        uint256 _msgValue,\n        address _feeHook\n    ) internal returns (uint256 externalFee, uint256 remainingNativeValue) {\n        (address _feeRecipient, uint256 feeAmount) = _feeRecipientAndAmount(\n            _destination,\n            _recipient,\n            _amount\n        );\n        externalFee = _externalFeeAmount(_destination, _recipient, _amount);\n        uint256 charge = _amount + feeAmount + externalFee;\n\n        address _token = token();\n\n        // ERC20 fee hook: use token() for gas payments\n        if (_feeHook != address(0)) {\n            uint256 hookFee = _quoteGasPayment(\n                _destination,\n                _recipient,\n                _amount,\n                _token\n            );\n\n            // For collateral routers (token() != address(this)), we can add hook fee to charge\n            // because _transferFromSender pulls tokens TO the router.\n            // For synthetic routers (token() == address(this)), we must pull separately\n            // because _transferFromSender burns tokens, so router never receives them.\n            if (_token != address(this)) {\n                // Collateral router: add hook fee to charge\n                charge += hookFee;\n            } else {\n                // Synthetic router: pull hook fee tokens separately\n                IERC20(_token).safeTransferFrom(\n                    msg.sender,\n                    address(this),\n                    hookFee\n                );\n            }\n\n            // Per-call approval only: standing approvals to fee hooks are unsafe\n            // because postDispatch is publicly callable with arbitrary message data,\n            // allowing a third party to spend the approval. Funds would go to the\n            // hook beneficiary (not the attacker), but the caller still loses tokens.\n            IERC20(_token).forceApprove(_feeHook, hookFee);\n        }\n\n        _transferFromSender(charge);\n\n        if (feeAmount > 0) {\n            // transfer atomically so we don't need to keep track of collateral\n            // and fee balances separately\n            _transferFee(_feeRecipient, feeAmount);\n        }\n\n        // Calculate remaining native value for other hooks\n        // When token() is ERC20 (non-native), all native value is available for other hooks\n        // When token() is native (address(0)), subtract the charge from msg.value\n        remainingNativeValue = _token != address(0)\n            ? _msgValue\n            : _msgValue - charge;\n    }\n\n    // Convenience overload that computes feeHook() internally.\n    function _calculateFeesAndCharge(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        uint256 _msgValue\n    ) internal returns (uint256 externalFee, uint256 remainingNativeValue) {\n        return\n            _calculateFeesAndCharge(\n                _destination,\n                _recipient,\n                _amount,\n                _msgValue,\n                feeHook()\n            );\n    }\n\n    // Emits the SentTransferRemote event and dispatches the message with explicit feeToken.\n    function _emitAndDispatch(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        uint256 _messageDispatchValue,\n        bytes memory _tokenMessage,\n        address _feeToken\n    ) internal returns (bytes32 messageId) {\n        // effects\n        emit SentTransferRemote(_destination, _recipient, _amount);\n\n        // interactions\n        messageId = _Router_dispatch(\n            _destination,\n            _messageDispatchValue,\n            _tokenMessage,\n            _generateHookMetadata(_destination, _feeToken),\n            address(hook)\n        );\n    }\n\n    // Convenience overload that computes feeToken from feeHook().\n    function _emitAndDispatch(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        uint256 _messageDispatchValue,\n        bytes memory _tokenMessage\n    ) internal returns (bytes32 messageId) {\n        address _feeToken = feeToken();\n        return\n            _emitAndDispatch(\n                _destination,\n                _recipient,\n                _amount,\n                _messageDispatchValue,\n                _tokenMessage,\n                _feeToken\n            );\n    }\n\n    // ===========================\n    // ========== Fees & Quoting ==========\n    // ===========================\n\n    /**\n     * @notice Sets the fee recipient for the router.\n     * @dev Allows for address(0) to be set, which disables fees.\n     * @param recipient The address that receives fees.\n     */\n    function setFeeRecipient(address recipient) public onlyOwner {\n        require(recipient != address(this), \"Fee recipient cannot be self\");\n        FEE_RECIPIENT_SLOT.getAddressSlot().value = recipient;\n        emit FeeRecipientSet(recipient);\n    }\n\n    /**\n     * @notice Returns the address of the fee recipient.\n     * @dev Returns address(0) if no fee recipient is set.\n     * @dev Can be overridden with address(0) to disable fees entirely.\n     * @return address of the fee recipient.\n     */\n    function feeRecipient() public view virtual returns (address) {\n        return FEE_RECIPIENT_SLOT.getAddressSlot().value;\n    }\n\n    /**\n     * @notice Initializes the TokenRouter with fee hook configuration.\n     * @param _feeHook The fee hook contract address.\n     */\n    function _TokenRouter_initialize(address _feeHook) internal {\n        _setFeeHook(_feeHook);\n    }\n\n    /**\n     * @notice Sets the fee hook contract address.\n     * @param _feeHook The fee hook address.\n     */\n    function setFeeHook(address _feeHook) external onlyOwner {\n        _setFeeHook(_feeHook);\n    }\n\n    /**\n     * @notice Internal function to set the fee hook address.\n     * @param _feeHook The fee hook address.\n     */\n    function _setFeeHook(address _feeHook) internal {\n        if (_feeHook != address(0)) {\n            require(\n                token() != address(0),\n                \"TokenRouter: fee hook requires ERC20 token\"\n            );\n        }\n        FEE_HOOK_SLOT.getAddressSlot().value = _feeHook;\n        emit FeeHookSet(_feeHook);\n    }\n\n    /**\n     * @notice Returns the fee hook contract address.\n     * @return The fee hook address.\n     */\n    function feeHook() public view returns (address) {\n        return FEE_HOOK_SLOT.getAddressSlot().value;\n    }\n\n    /**\n     * @notice Returns the fee token address for gas payments.\n     * @return The token address if a fee hook is configured, otherwise address(0) for native payments.\n     */\n    function feeToken() public view returns (address) {\n        return feeHook() != address(0) ? token() : address(0);\n    }\n\n    // To be overridden by derived contracts if they have additional fees\n    /**\n     * @notice Returns the external fee amount for the given parameters.\n     * param _destination The identifier of the destination chain.\n     * param _recipient The address of the recipient on the destination chain.\n     * param _amount The amount or identifier of tokens to be sent to the remote recipient\n     * @return feeAmount The external fee amount.\n     * @dev This fee must be denominated in the `token()` defined by this router.\n     * @dev The default implementation returns 0, meaning no external fees are charged.\n     * This function is intended to be overridden by derived contracts that have additional fees.\n     * Known overrides:\n     * - TokenBridgeCctpBase: for CCTP-specific fees\n     * - EverclearTokenBridge: for Everclear-specific fees\n     */\n    function _externalFeeAmount(\n        uint32, // _destination,\n        bytes32, // _recipient,\n        uint256 // _amount\n    ) internal view virtual returns (uint256 feeAmount) {\n        return 0;\n    }\n\n    /**\n     * @notice Returns the fee recipient amount for the given parameters.\n     * @param _destination The identifier of the destination chain.\n     * @param _recipient The address of the recipient on the destination chain.\n     * @param _amount The amount or identifier of tokens to be sent to the remote recipient\n     * @return _feeRecipient The address of the fee recipient.\n     * @return feeAmount The fee recipient amount.\n     * @dev This function is is not intended to be overridden as storage and logic is contained in TokenRouter.\n     */\n    function _feeRecipientAndAmount(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount\n    ) internal view returns (address _feeRecipient, uint256 feeAmount) {\n        _feeRecipient = feeRecipient();\n        if (_feeRecipient == address(0)) {\n            return (_feeRecipient, 0);\n        }\n\n        Quote[] memory quotes = ITokenFee(_feeRecipient).quoteTransferRemote(\n            _destination,\n            _recipient,\n            _amount\n        );\n        if (quotes.length == 0) {\n            return (_feeRecipient, 0);\n        }\n\n        require(\n            quotes.length == 1 && quotes[0].token == token(),\n            \"FungibleTokenRouter: fee must match token\"\n        );\n        feeAmount = quotes[0].amount;\n    }\n\n    /**\n     * @notice Returns the gas payment required to dispatch a message to the given domain's router.\n     * @param _destination The identifier of the destination chain.\n     * @param _recipient The address of the recipient on the destination chain.\n     * @param _amount The amount or identifier of tokens to be sent to the remote recipient\n     * @return payment How much value to send in transferRemote call (native or feeToken based on config).\n     * @dev This function is intended to be overridden by derived contracts that trigger multiple messages.\n     * Known overrides:\n     * - OPL2ToL1TokenBridgeNative: Quote for two messages (prove and finalize).\n     */\n    function _quoteGasPayment(\n        uint32 _destination,\n        bytes32 _recipient,\n        uint256 _amount,\n        address _feeToken\n    ) internal view virtual returns (uint256) {\n        return\n            _Router_quoteDispatch(\n                _destination,\n                TokenMessage.format(_recipient, _outboundAmount(_amount)),\n                _generateHookMetadata(_destination, _feeToken),\n                address(hook)\n            );\n    }\n\n    /**\n     * @notice Generates hook metadata for dispatch, including feeToken if configured.\n     * @param _destination The destination chain.\n     * @param _feeToken The fee token address (address(0) for native).\n     * @return Hook metadata with the specified feeToken.\n     */\n    function _generateHookMetadata(\n        uint32 _destination,\n        address _feeToken\n    ) internal view returns (bytes memory) {\n        uint256 gasLimit = destinationGas[_destination];\n        return\n            StandardHookMetadata.formatWithFeeToken(\n                0,\n                gasLimit,\n                msg.sender,\n                _feeToken\n            );\n    }\n\n    // ===========================\n    // ========== Internal virtual functions for token handling ==========\n    // ===========================\n\n    /**\n     * @dev Should transfer `_amount` of tokens from `msg.sender` to this token router.\n     * Called by `transferRemote` before message dispatch.\n     * Known overrides:\n     * - HypERC20: Burns the tokens from the sender.\n     * - HypERC20Collateral: Pulls the tokens from the sender.\n     * - HypNative: Asserts msg.value >= _amount\n     * - TokenBridgeCctpBase: (like HypERC20Collateral) Pulls the tokens from the sender.\n     * - EverclearEthTokenBridge: Wraps the native token (ETH) to WETH\n     * - HypERC4626: Converts the amounts to shares and burns from the User (via HypERC20 implementation)\n     * - HypFiatToken: Pulls the tokens from the sender and burns them on the FiatToken contract.\n     * - HypXERC20: Burns the tokens from the sender.\n     * - HypXERC20Lockbox: Pulls the tokens from the sender, locks them in the XERC20Lockbox contract and burns the resulting xERC20 tokens.\n     */\n    function _transferFromSender(uint256 _amountOrId) internal virtual;\n\n    /**\n     * @dev Should transfer `_amountOrId` of tokens from this token router to `_recipient`.\n     * @dev Called by `handle` after message decoding.\n     * Known overrides:\n     * - HypERC20: Mints the tokens to the recipient.\n     * - HypERC20Collateral: Releases the tokens to the recipient.\n     * - HypNative: Releases native tokens to the recipient.\n     * - TokenBridgeCctpBase: Do nothing (CCTP transfers tokens to the recipient directly).\n     * - EverclearEthTokenBridge: Unwraps WETH to ETH and sends to the recipient.\n     * - HypERC4626: Converts the amount to shares and mints to the User (via HypERC20 implementation)\n     * - HypFiatToken: Mints the tokens to the recipient on the FiatToken contract.\n     * - HypXERC20: Mints the tokens to the recipient.\n     * - HypXERC20Lockbox: Withdraws the underlying tokens from the Lockbox and sends to the recipient.\n     * - OpL1NativeTokenBridge: Do nothing (the L2 bridge transfers the native tokens to the recipient directly).\n     */\n    function _transferTo(\n        address _recipient,\n        uint256 _amountOrId\n    ) internal virtual;\n\n    /**\n     * @dev Should transfer `_amount` of tokens from this token router to the fee recipient.\n     * @dev Called by `_calculateFeesAndCharge` when fee recipient is set and feeAmount > 0.\n     * @dev The default implementation delegates to `_transferTo`, which works for most token routers\n     * where tokens are held by the router (e.g., collateral routers, synthetic token routers).\n     * @dev Override this function for bridges where tokens are NOT held by the router but fees still\n     * need to be paid (e.g., CCTP, Everclear). In those cases, use direct token transfers from the\n     * router's balance collected via `_transferFromSender`.\n     * Known overrides:\n     * - TokenBridgeCctpBase: Directly transfers tokens from router balance.\n     * - EverclearTokenBridge: Directly transfers tokens from router balance.\n     */\n    function _transferFee(\n        address _recipient,\n        uint256 _amount\n    ) internal virtual {\n        _transferTo(_recipient, _amount);\n    }\n\n    /**\n     * @dev Scales local amount to message amount by the scale fraction.\n     * Applies: messageAmount = (localAmount * scaleNumerator) / scaleDenominator\n     * - If scaleNumerator > scaleDenominator: scales up (e.g., 2/1)\n     * - If scaleNumerator < scaleDenominator: scales down (e.g., 1/2)\n     * - If scaleNumerator == scaleDenominator: no scaling (e.g., 1/1)\n     * Known overrides:\n     * - HypERC4626: Scales by exchange rate\n     */\n    function _outboundAmount(\n        uint256 _localAmount\n    ) internal view virtual returns (uint256 _messageAmount) {\n        _messageAmount = _localAmount.mulDiv(\n            scaleNumerator,\n            scaleDenominator,\n            Math.Rounding.Down\n        );\n    }\n\n    /**\n     * @dev Scales message amount to local amount by the inverse scale fraction.\n     * Applies: localAmount = (messageAmount * scaleDenominator) / scaleNumerator\n     * - If scaleNumerator > scaleDenominator: scales down (e.g., 1/2 for 2/1 outbound)\n     * - If scaleNumerator < scaleDenominator: scales up (e.g., 2/1 for 1/2 outbound)\n     * - If scaleNumerator == scaleDenominator: no scaling (e.g., 1/1)\n     * Known overrides:\n     * - HypERC4626: Scales by exchange rate\n     */\n    function _inboundAmount(\n        uint256 _messageAmount\n    ) internal view virtual returns (uint256 _localAmount) {\n        _localAmount = _messageAmount.mulDiv(\n            scaleDenominator,\n            scaleNumerator,\n            Math.Rounding.Down\n        );\n    }\n\n    /**\n     * @notice Handles the incoming transfer message.\n     * It decodes the message, emits the ReceivedTransferRemote event, and transfers tokens to the recipient.\n     * @param _origin The identifier of the origin chain.\n     * @dev param _sender The address of the sender router on the origin chain.\n     * @param _message The message data containing recipient and amount.\n     * @dev Override this function if custom logic is required for sending out the tokens.\n     * Known overrides:\n     * - EverclearTokenBridge: Receives the tokens and sends them to the recipient.\n     * - EverclearEthBridge: Receives WETH, unwraps it and sends native ETH to the recipient.\n     * - HypERC4626: Updates the exchange rate from the metadata\n     */\n    // solhint-disable-next-line hyperlane/no-virtual-override\n    function _handle(\n        uint32 _origin,\n        bytes32,\n        bytes calldata _message\n    ) internal virtual override {\n        bytes32 recipient = _message.recipient();\n        uint256 amount = _message.amount();\n\n        // effects\n        emit ReceivedTransferRemote(_origin, recipient, amount);\n\n        // interactions\n        _transferTo(recipient.bytes32ToAddress(), _inboundAmount(amount));\n    }\n}\n"
        },
        "contracts/token/HypERC20.sol": {
          "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.8.0;\n\nimport {TokenRouter} from \"./libs/TokenRouter.sol\";\nimport {Quote} from \"../interfaces/ITokenBridge.sol\";\nimport {TokenRouter} from \"./libs/TokenRouter.sol\";\n\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n/**\n * @title Hyperlane ERC20 Token Router that extends ERC20 with remote transfer functionality.\n * @author Abacus Works\n * @dev Supply on each chain is not constant but the aggregate supply across all chains is.\n */\ncontract HypERC20 is ERC20Upgradeable, TokenRouter {\n    uint8 private immutable _decimals;\n\n    constructor(\n        uint8 __decimals,\n        uint256 _scaleNumerator,\n        uint256 _scaleDenominator,\n        address _mailbox\n    ) TokenRouter(_scaleNumerator, _scaleDenominator, _mailbox) {\n        _decimals = __decimals;\n    }\n\n    /**\n     * @notice Initializes the Hyperlane router, ERC20 metadata, and mints initial supply to deployer.\n     * @param _totalSupply The initial supply of the token.\n     * @param _name The name of the token.\n     * @param _symbol The symbol of the token.\n     */\n    function initialize(\n        uint256 _totalSupply,\n        string memory _name,\n        string memory _symbol,\n        address _hook,\n        address _interchainSecurityModule,\n        address _owner\n    ) public initializer {\n        // Initialize ERC20 metadata\n        __ERC20_init(_name, _symbol);\n        _mint(msg.sender, _totalSupply);\n        _MailboxClient_initialize(_hook, _interchainSecurityModule, _owner);\n    }\n\n    function decimals() public view override returns (uint8) {\n        return _decimals;\n    }\n\n    // ============ TokenRouter overrides ============\n\n    /**\n     * @inheritdoc TokenRouter\n     */\n    function token() public view override returns (address) {\n        return address(this);\n    }\n\n    /**\n     * @inheritdoc TokenRouter\n     * @dev Overrides to burn `_amount` of token from `msg.sender` balance.\n     * @dev Known overrides:\n     * - HypERC4626: Converts the amount to shares and burns from the User (via HypERC20 implementation)\n     */\n    // solhint-disable-next-line hyperlane/no-virtual-override\n    function _transferFromSender(uint256 _amount) internal virtual override {\n        _burn(msg.sender, _amount);\n    }\n\n    /**\n     * @inheritdoc TokenRouter\n     * @dev Overrides to mint `_amount` of token to `_recipient` balance.\n     */\n    function _transferTo(\n        address _recipient,\n        uint256 _amount\n    ) internal override {\n        _mint(_recipient, _amount);\n    }\n}\n"
        }
      },
      "settings": {
        "evmVersion": "cancun",
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "outputSelection": {
          "contracts/token/HypERC20.sol": {
            "HypERC20": [
              "abi",
              "metadata",
              "evm.bytecode",
              "evm.deployedBytecode"
            ],
            "": [
              "ast"
            ]
          }
        }
      }
    },
    "metadata": {
      "compiler": {
        "version": "0.8.33+commit.64118f21"
      },
      "language": "Solidity",
      "output": {
        "abi": [
          {
            "inputs": [
              {
                "internalType": "uint8",
                "name": "__decimals",
                "type": "uint8"
              },
              {
                "internalType": "uint256",
                "name": "_scaleNumerator",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "_scaleDenominator",
                "type": "uint256"
              },
              {
                "internalType": "address",
                "name": "_mailbox",
                "type": "address"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "constructor"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": true,
                "internalType": "address",
                "name": "owner",
                "type": "address"
              },
              {
                "indexed": true,
                "internalType": "address",
                "name": "spender",
                "type": "address"
              },
              {
                "indexed": false,
                "internalType": "uint256",
                "name": "value",
                "type": "uint256"
              }
            ],
            "name": "Approval",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "address",
                "name": "feeHook",
                "type": "address"
              }
            ],
            "name": "FeeHookSet",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "address",
                "name": "feeRecipient",
                "type": "address"
              }
            ],
            "name": "FeeRecipientSet",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "uint32",
                "name": "domain",
                "type": "uint32"
              },
              {
                "indexed": false,
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              }
            ],
            "name": "GasSet",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "address",
                "name": "_hook",
                "type": "address"
              }
            ],
            "name": "HookSet",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "uint8",
                "name": "version",
                "type": "uint8"
              }
            ],
            "name": "Initialized",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": false,
                "internalType": "address",
                "name": "_ism",
                "type": "address"
              }
            ],
            "name": "IsmSet",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": true,
                "internalType": "address",
                "name": "previousOwner",
                "type": "address"
              },
              {
                "indexed": true,
                "internalType": "address",
                "name": "newOwner",
                "type": "address"
              }
            ],
            "name": "OwnershipTransferred",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": true,
                "internalType": "uint32",
                "name": "origin",
                "type": "uint32"
              },
              {
                "indexed": true,
                "internalType": "bytes32",
                "name": "recipient",
                "type": "bytes32"
              },
              {
                "indexed": false,
                "internalType": "uint256",
                "name": "amountOrId",
                "type": "uint256"
              }
            ],
            "name": "ReceivedTransferRemote",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": true,
                "internalType": "uint32",
                "name": "destination",
                "type": "uint32"
              },
              {
                "indexed": true,
                "internalType": "bytes32",
                "name": "recipient",
                "type": "bytes32"
              },
              {
                "indexed": false,
                "internalType": "uint256",
                "name": "amountOrId",
                "type": "uint256"
              }
            ],
            "name": "SentTransferRemote",
            "type": "event"
          },
          {
            "anonymous": false,
            "inputs": [
              {
                "indexed": true,
                "internalType": "address",
                "name": "from",
                "type": "address"
              },
              {
                "indexed": true,
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "indexed": false,
                "internalType": "uint256",
                "name": "value",
                "type": "uint256"
              }
            ],
            "name": "Transfer",
            "type": "event"
          },
          {
            "inputs": [],
            "name": "PACKAGE_VERSION",
            "outputs": [
              {
                "internalType": "string",
                "name": "",
                "type": "string"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "owner",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "spender",
                "type": "address"
              }
            ],
            "name": "allowance",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "spender",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "amount",
                "type": "uint256"
              }
            ],
            "name": "approve",
            "outputs": [
              {
                "internalType": "bool",
                "name": "",
                "type": "bool"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "account",
                "type": "address"
              }
            ],
            "name": "balanceOf",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "decimals",
            "outputs": [
              {
                "internalType": "uint8",
                "name": "",
                "type": "uint8"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "spender",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "subtractedValue",
                "type": "uint256"
              }
            ],
            "name": "decreaseAllowance",
            "outputs": [
              {
                "internalType": "bool",
                "name": "",
                "type": "bool"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "destinationDomain",
                "type": "uint32"
              }
            ],
            "name": "destinationGas",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "gasLimit",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "domains",
            "outputs": [
              {
                "internalType": "uint32[]",
                "name": "",
                "type": "uint32[]"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_domain",
                "type": "uint32"
              },
              {
                "internalType": "bytes32",
                "name": "_router",
                "type": "bytes32"
              }
            ],
            "name": "enrollRemoteRouter",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32[]",
                "name": "_domains",
                "type": "uint32[]"
              },
              {
                "internalType": "bytes32[]",
                "name": "_addresses",
                "type": "bytes32[]"
              }
            ],
            "name": "enrollRemoteRouters",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "feeHook",
            "outputs": [
              {
                "internalType": "address",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "feeRecipient",
            "outputs": [
              {
                "internalType": "address",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "feeToken",
            "outputs": [
              {
                "internalType": "address",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_origin",
                "type": "uint32"
              },
              {
                "internalType": "bytes32",
                "name": "_sender",
                "type": "bytes32"
              },
              {
                "internalType": "bytes",
                "name": "_message",
                "type": "bytes"
              }
            ],
            "name": "handle",
            "outputs": [],
            "stateMutability": "payable",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "hook",
            "outputs": [
              {
                "internalType": "contract IPostDispatchHook",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "spender",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "addedValue",
                "type": "uint256"
              }
            ],
            "name": "increaseAllowance",
            "outputs": [
              {
                "internalType": "bool",
                "name": "",
                "type": "bool"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint256",
                "name": "_totalSupply",
                "type": "uint256"
              },
              {
                "internalType": "string",
                "name": "_name",
                "type": "string"
              },
              {
                "internalType": "string",
                "name": "_symbol",
                "type": "string"
              },
              {
                "internalType": "address",
                "name": "_hook",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "_interchainSecurityModule",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "_owner",
                "type": "address"
              }
            ],
            "name": "initialize",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "interchainSecurityModule",
            "outputs": [
              {
                "internalType": "contract IInterchainSecurityModule",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "localDomain",
            "outputs": [
              {
                "internalType": "uint32",
                "name": "",
                "type": "uint32"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "mailbox",
            "outputs": [
              {
                "internalType": "contract IMailbox",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "name",
            "outputs": [
              {
                "internalType": "string",
                "name": "",
                "type": "string"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "owner",
            "outputs": [
              {
                "internalType": "address",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_destinationDomain",
                "type": "uint32"
              }
            ],
            "name": "quoteGasPayment",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_destination",
                "type": "uint32"
              },
              {
                "internalType": "bytes32",
                "name": "_recipient",
                "type": "bytes32"
              },
              {
                "internalType": "uint256",
                "name": "_amount",
                "type": "uint256"
              }
            ],
            "name": "quoteTransferRemote",
            "outputs": [
              {
                "components": [
                  {
                    "internalType": "address",
                    "name": "token",
                    "type": "address"
                  },
                  {
                    "internalType": "uint256",
                    "name": "amount",
                    "type": "uint256"
                  }
                ],
                "internalType": "struct Quote[]",
                "name": "quotes",
                "type": "tuple[]"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "renounceOwnership",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_domain",
                "type": "uint32"
              }
            ],
            "name": "routers",
            "outputs": [
              {
                "internalType": "bytes32",
                "name": "",
                "type": "bytes32"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "scaleDenominator",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "scaleNumerator",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "domain",
                "type": "uint32"
              },
              {
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              }
            ],
            "name": "setDestinationGas",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "components": [
                  {
                    "internalType": "uint32",
                    "name": "domain",
                    "type": "uint32"
                  },
                  {
                    "internalType": "uint256",
                    "name": "gas",
                    "type": "uint256"
                  }
                ],
                "internalType": "struct GasRouter.GasRouterConfig[]",
                "name": "gasConfigs",
                "type": "tuple[]"
              }
            ],
            "name": "setDestinationGas",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "_feeHook",
                "type": "address"
              }
            ],
            "name": "setFeeHook",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "recipient",
                "type": "address"
              }
            ],
            "name": "setFeeRecipient",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "_hook",
                "type": "address"
              }
            ],
            "name": "setHook",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "_module",
                "type": "address"
              }
            ],
            "name": "setInterchainSecurityModule",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "symbol",
            "outputs": [
              {
                "internalType": "string",
                "name": "",
                "type": "string"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "token",
            "outputs": [
              {
                "internalType": "address",
                "name": "",
                "type": "address"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [],
            "name": "totalSupply",
            "outputs": [
              {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
              }
            ],
            "stateMutability": "view",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "amount",
                "type": "uint256"
              }
            ],
            "name": "transfer",
            "outputs": [
              {
                "internalType": "bool",
                "name": "",
                "type": "bool"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "from",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "amount",
                "type": "uint256"
              }
            ],
            "name": "transferFrom",
            "outputs": [
              {
                "internalType": "bool",
                "name": "",
                "type": "bool"
              }
            ],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "address",
                "name": "newOwner",
                "type": "address"
              }
            ],
            "name": "transferOwnership",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_destination",
                "type": "uint32"
              },
              {
                "internalType": "bytes32",
                "name": "_recipient",
                "type": "bytes32"
              },
              {
                "internalType": "uint256",
                "name": "_amount",
                "type": "uint256"
              }
            ],
            "name": "transferRemote",
            "outputs": [
              {
                "internalType": "bytes32",
                "name": "messageId",
                "type": "bytes32"
              }
            ],
            "stateMutability": "payable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32",
                "name": "_domain",
                "type": "uint32"
              }
            ],
            "name": "unenrollRemoteRouter",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          },
          {
            "inputs": [
              {
                "internalType": "uint32[]",
                "name": "_domains",
                "type": "uint32[]"
              }
            ],
            "name": "unenrollRemoteRouters",
            "outputs": [],
            "stateMutability": "nonpayable",
            "type": "function"
          }
        ],
        "devdoc": {
          "author": "Abacus Works",
          "details": "Supply on each chain is not constant but the aggregate supply across all chains is.",
          "events": {
            "Approval(address,address,uint256)": {
              "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
            },
            "Initialized(uint8)": {
              "details": "Triggered when the contract has been initialized or reinitialized."
            },
            "ReceivedTransferRemote(uint32,bytes32,uint256)": {
              "details": "Emitted on `_handle` when a transfer message is processed.",
              "params": {
                "amountOrId": "The amount or ID of tokens received from the remote sender.",
                "origin": "The identifier of the origin chain.",
                "recipient": "The address of the recipient on the destination chain."
              }
            },
            "SentTransferRemote(uint32,bytes32,uint256)": {
              "details": "Emitted on `transferRemote` when a transfer message is dispatched.",
              "params": {
                "amountOrId": "The amount or ID of tokens sent in to the remote recipient.",
                "destination": "The identifier of the destination chain.",
                "recipient": "The address of the recipient on the destination chain."
              }
            },
            "Transfer(address,address,uint256)": {
              "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
            }
          },
          "kind": "dev",
          "methods": {
            "allowance(address,address)": {
              "details": "See {IERC20-allowance}."
            },
            "approve(address,uint256)": {
              "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address."
            },
            "balanceOf(address)": {
              "details": "See {IERC20-balanceOf}."
            },
            "decimals()": {
              "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}."
            },
            "decreaseAllowance(address,uint256)": {
              "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`."
            },
            "enrollRemoteRouter(uint32,bytes32)": {
              "params": {
                "_domain": "The domain of the remote Application Router",
                "_router": "The address of the remote Application Router"
              }
            },
            "enrollRemoteRouters(uint32[],bytes32[])": {
              "params": {
                "_addresses": "The addresses of the remote Application Routers",
                "_domains": "The domains of the remote Application Routers"
              }
            },
            "feeHook()": {
              "returns": {
                "_0": "The fee hook address."
              }
            },
            "feeRecipient()": {
              "details": "Returns address(0) if no fee recipient is set.Can be overridden with address(0) to disable fees entirely.",
              "returns": {
                "_0": "address of the fee recipient."
              }
            },
            "feeToken()": {
              "returns": {
                "_0": "The token address if a fee hook is configured, otherwise address(0) for native payments."
              }
            },
            "handle(uint32,bytes32,bytes)": {
              "params": {
                "_message": "The message",
                "_origin": "The origin domain",
                "_sender": "The sender address"
              }
            },
            "increaseAllowance(address,uint256)": {
              "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address."
            },
            "initialize(uint256,string,string,address,address,address)": {
              "params": {
                "_name": "The name of the token.",
                "_symbol": "The symbol of the token.",
                "_totalSupply": "The initial supply of the token."
              }
            },
            "name()": {
              "details": "Returns the name of the token."
            },
            "owner()": {
              "details": "Returns the address of the current owner."
            },
            "quoteGasPayment(uint32)": {
              "params": {
                "_destinationDomain": "The domain of the router."
              },
              "returns": {
                "_0": "_gasPayment Payment computed by the registered InterchainGasPaymaster."
              }
            },
            "quoteTransferRemote(uint32,bytes32,uint256)": {
              "details": "This function may return multiple quotes with the same denomination. Convention is to return:  [index 0] native fees charged by the mailbox dispatch  [index 1] then any internal warp route fees (amount bridged plus fee recipient)  [index 2] then any external bridging fees (if any, else 0) These are surfaced as separate elements to enable clients to interpret/render fees independently. There is a Quotes library with an extract function for onchain quoting in a specific denomination, but we discourage onchain quoting in favor of offchain quoting and overpaying with refunds.",
              "params": {
                "_amount": "The amount or identifier of tokens to be sent to the remote recipient",
                "_destination": "The identifier of the destination chain.",
                "_recipient": "The address of the recipient on the destination chain."
              },
              "returns": {
                "quotes": "An array of Quote structs representing the fees in different tokens."
              }
            },
            "renounceOwnership()": {
              "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
            },
            "routers(uint32)": {
              "details": "Returns 0 address if no router is enrolled for the given domain",
              "params": {
                "_domain": "The remote domain ID."
              },
              "returns": {
                "_0": "router The address of the Router contract for the given domain"
              }
            },
            "setDestinationGas((uint32,uint256)[])": {
              "params": {
                "gasConfigs": "The array of GasRouterConfig structs"
              }
            },
            "setDestinationGas(uint32,uint256)": {
              "params": {
                "domain": "The destination domain ID",
                "gas": "The gas limit"
              }
            },
            "setFeeHook(address)": {
              "params": {
                "_feeHook": "The fee hook address."
              }
            },
            "setFeeRecipient(address)": {
              "details": "Allows for address(0) to be set, which disables fees.",
              "params": {
                "recipient": "The address that receives fees."
              }
            },
            "setHook(address)": {
              "params": {
                "_hook": "The address of the hook contract."
              }
            },
            "setInterchainSecurityModule(address)": {
              "params": {
                "_module": "The address of the interchain security module contract."
              }
            },
            "symbol()": {
              "details": "Returns the symbol of the token, usually a shorter version of the name."
            },
            "token()": {
              "details": "This function must be implemented by derived contracts to specify the token address.",
              "returns": {
                "_0": "The address of the token contract."
              }
            },
            "totalSupply()": {
              "details": "See {IERC20-totalSupply}."
            },
            "transfer(address,uint256)": {
              "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`."
            },
            "transferFrom(address,address,uint256)": {
              "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`."
            },
            "transferOwnership(address)": {
              "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
            },
            "transferRemote(uint32,bytes32,uint256)": {
              "details": "Delegates transfer logic to `_transferFromSender` implementation. Emits `SentTransferRemote` event on the origin chain. Override with custom behavior for storing or forwarding tokens. Known overrides: - OPL2ToL1TokenBridgeNative: adds hook metadata for message dispatch. - EverclearTokenBridge: creates Everclear intent for cross-chain token transfer. - TokenBridgeCctpBase: adds CCTP-specific metadata for message dispatch. - HypERC4626Collateral: deposits into vault and handles shares. When overriding, mirror the general flow of this function for consistency: 1. Calculate fees and charge the sender. 2. Prepare the token message with recipient, amount, and any additional metadata. 3. Emit `SentTransferRemote` event. 4. Dispatch the message.",
              "params": {
                "_amount": "The amount or identifier of tokens to be sent to the remote recipient.",
                "_destination": "The identifier of the destination chain.",
                "_recipient": "The address of the recipient on the destination chain."
              },
              "returns": {
                "messageId": "The identifier of the dispatched message."
              }
            },
            "unenrollRemoteRouter(uint32)": {
              "params": {
                "_domain": "The domain of the remote Application Router"
              }
            },
            "unenrollRemoteRouters(uint32[])": {
              "params": {
                "_domains": "The domains of the remote Application Routers"
              }
            }
          },
          "title": "Hyperlane ERC20 Token Router that extends ERC20 with remote transfer functionality.",
          "version": 1
        },
        "userdoc": {
          "kind": "user",
          "methods": {
            "enrollRemoteRouter(uint32,bytes32)": {
              "notice": "Register the address of a Router contract for the same Application on a remote chain"
            },
            "enrollRemoteRouters(uint32[],bytes32[])": {
              "notice": "Batch version of `enrollRemoteRouter`"
            },
            "feeHook()": {
              "notice": "Returns the fee hook contract address."
            },
            "feeRecipient()": {
              "notice": "Returns the address of the fee recipient."
            },
            "feeToken()": {
              "notice": "Returns the fee token address for gas payments."
            },
            "handle(uint32,bytes32,bytes)": {
              "notice": "Handles an incoming message"
            },
            "initialize(uint256,string,string,address,address,address)": {
              "notice": "Initializes the Hyperlane router, ERC20 metadata, and mints initial supply to deployer."
            },
            "quoteGasPayment(uint32)": {
              "notice": "Returns the gas payment required to dispatch a message to the given domain's router."
            },
            "quoteTransferRemote(uint32,bytes32,uint256)": {
              "notice": "Implements the standardized fee quoting interface for token transfers based on overridable internal functions of _quoteGasPayment, _feeRecipientAndAmount, and _externalFeeAmount."
            },
            "routers(uint32)": {
              "notice": "Returns the address of the Router contract for the given domain"
            },
            "setDestinationGas((uint32,uint256)[])": {
              "notice": "Sets the gas amount dispatched for each configured domain."
            },
            "setDestinationGas(uint32,uint256)": {
              "notice": "Sets the gas amount dispatched for each configured domain."
            },
            "setFeeHook(address)": {
              "notice": "Sets the fee hook contract address."
            },
            "setFeeRecipient(address)": {
              "notice": "Sets the fee recipient for the router."
            },
            "setHook(address)": {
              "notice": "Sets the address of the application's custom hook."
            },
            "setInterchainSecurityModule(address)": {
              "notice": "Sets the address of the application's custom interchain security module."
            },
            "token()": {
              "notice": "Returns the address of the token managed by this router. It can be one of three options: - ERC20 token address for fungible tokens that are being collateralized (HypERC20Collateral, HypERC4626, etc.) - 0x0 address for native tokens (ETH, MATIC, etc.) (HypNative, etc.) - address(this) for synthetic ERC20 tokens (HypERC20, etc.) It is being used for quotes and fees from the fee recipient and pulling/push the tokens from the sender/receipient."
            },
            "transferRemote(uint32,bytes32,uint256)": {
              "notice": "Transfers `_amount` token to `_recipient` on the `_destination` domain."
            },
            "unenrollRemoteRouter(uint32)": {
              "notice": "Unregister the domain"
            },
            "unenrollRemoteRouters(uint32[])": {
              "notice": "Batch version of `unenrollRemoteRouter`"
            }
          },
          "version": 1
        }
      },
      "settings": {
        "compilationTarget": {
          "contracts/token/HypERC20.sol": "HypERC20"
        },
        "evmVersion": "cancun",
        "libraries": {},
        "metadata": {
          "bytecodeHash": "ipfs"
        },
        "optimizer": {
          "enabled": true,
          "runs": 10000
        },
        "remappings": []
      },
      "sources": {
        "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
          "keccak256": "0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98",
          "license": "MIT",
          "urls": [
            "bzz-raw://99c8cb3cd19a44bbfb6612605affb7d8b06cee1f6aa9362a37a8672b4f7eeaf8",
            "dweb:/ipfs/QmasyxFDBUp7k5KFgfDWEzM8PYSKEq7GVznzMJ1VxVRF4B"
          ]
        },
        "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
          "keccak256": "0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794",
          "license": "MIT",
          "urls": [
            "bzz-raw://f103ee2e4aecd37aac6ceefe670709cdd7613dee25fa2d4d9feaf7fc0aaa155e",
            "dweb:/ipfs/QmRiNZLoJk5k3HPMYGPGjZFd2ke1ZxjhJZkM45Ec9GH9hv"
          ]
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol": {
          "keccak256": "0xd14a627157b9a411d2410713e5dd3a377e9064bd5c194a90748bbf27ea625784",
          "license": "MIT",
          "urls": [
            "bzz-raw://29d6a502187e88fdb4ac51319b6cfc82e7ba886a435480e229e5f838d2da55ee",
            "dweb:/ipfs/QmQNWKr3axXvQowZi31ydXRdeZ7UnE7oN8XAz9FCkx1JhN"
          ]
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": {
          "keccak256": "0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f",
          "license": "MIT",
          "urls": [
            "bzz-raw://c25f742ff154998d19a669e2508c3597b363e123ce9144cd0fcf6521229f401f",
            "dweb:/ipfs/QmQXRuFzStEWqeEPbhQU6cAg9PaSowxJVo4PDKyRod7dco"
          ]
        },
        "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
          "keccak256": "0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb",
          "license": "MIT",
          "urls": [
            "bzz-raw://4c9c634f99dd02d73ce7498b03a6305e251c05eeebb71457306561c1fab0fa7d",
            "dweb:/ipfs/QmbYRBbZHy8YoaQKXdPryiL3CSS7uUaRfRYi1TUj9cTqJQ"
          ]
        },
        "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
          "keccak256": "0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422",
          "license": "MIT",
          "urls": [
            "bzz-raw://310136ad60820af4177a11a61d77a3686faf5fca4942b600e08fc940db38396b",
            "dweb:/ipfs/QmbCzMNSTL7Zi7M4UCSqBrkHtp4jjxUnGbkneCZKdR1qeq"
          ]
        },
        "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
          "keccak256": "0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149",
          "license": "MIT",
          "urls": [
            "bzz-raw://d6520943ea55fdf5f0bafb39ed909f64de17051bc954ff3e88c9e5621412c79c",
            "dweb:/ipfs/QmWZ4rAKTQbNG2HxGs46AcTXShsVytKeLs7CUCdCSv5N7a"
          ]
        },
        "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
          "keccak256": "0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305",
          "license": "MIT",
          "urls": [
            "bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5",
            "dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53"
          ]
        },
        "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
          "keccak256": "0xec63854014a5b4f2b3290ab9103a21bdf902a508d0f41a8573fea49e98bf571a",
          "license": "MIT",
          "urls": [
            "bzz-raw://bc5b5dc12fbc4002f282eaa7a5f06d8310ed62c1c77c5770f6283e058454c39a",
            "dweb:/ipfs/Qme9rE2wS3yBuyJq9GgbmzbsBQsW2M2sVFqYYLw7bosGrv"
          ]
        },
        "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
          "keccak256": "0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1",
          "license": "MIT",
          "urls": [
            "bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68",
            "dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS"
          ]
        },
        "@openzeppelin/contracts/utils/Address.sol": {
          "keccak256": "0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa",
          "license": "MIT",
          "urls": [
            "bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931",
            "dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm"
          ]
        },
        "@openzeppelin/contracts/utils/StorageSlot.sol": {
          "keccak256": "0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899",
          "license": "MIT",
          "urls": [
            "bzz-raw://e26daf81e2252dc1fe1ce0e4b55c2eb7c6d1ee84ae6558d1a9554432ea1d32da",
            "dweb:/ipfs/Qmb1UANWiWq5pCKbmHSu772hd4nt374dVaghGmwSVNuk8Q"
          ]
        },
        "@openzeppelin/contracts/utils/Strings.sol": {
          "keccak256": "0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0",
          "license": "MIT",
          "urls": [
            "bzz-raw://b81d9ff6559ea5c47fc573e17ece6d9ba5d6839e213e6ebc3b4c5c8fe4199d7f",
            "dweb:/ipfs/QmPCW1bFisUzJkyjroY3yipwfism9RRCigCcK1hbXtVM8n"
          ]
        },
        "@openzeppelin/contracts/utils/math/Math.sol": {
          "keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3",
          "license": "MIT",
          "urls": [
            "bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c",
            "dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS"
          ]
        },
        "@openzeppelin/contracts/utils/math/SignedMath.sol": {
          "keccak256": "0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc",
          "license": "MIT",
          "urls": [
            "bzz-raw://c50fcc459e49a9858b6d8ad5f911295cb7c9ab57567845a250bf0153f84a95c7",
            "dweb:/ipfs/QmcEW85JRzvDkQggxiBBLVAasXWdkhEysqypj9EaB6H2g6"
          ]
        },
        "@openzeppelin/contracts/utils/structs/EnumerableMap.sol": {
          "keccak256": "0x7ebfe2422bc571599c2ec20577d7848e1e7a0acf85fa7c2d9636618bbbdf6fca",
          "license": "MIT",
          "urls": [
            "bzz-raw://77fb3f64d470c92c3142e3c07d2f18ad78723a1f1e680a251dcde37e865d0636",
            "dweb:/ipfs/QmXAeNPRRGfNSRxi1d17QjkNTBZFemhiMzJVvEJgMWwqUW"
          ]
        },
        "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
          "keccak256": "0x9f4357008a8f7d8c8bf5d48902e789637538d8c016be5766610901b4bba81514",
          "license": "MIT",
          "urls": [
            "bzz-raw://20bf19b2b851f58a4c24543de80ae70b3e08621f9230eb335dc75e2d4f43f5df",
            "dweb:/ipfs/QmSYuH1AhvJkPK8hNvoPqtExBcgTB42pPRHgTHkS5c5zYW"
          ]
        },
        "contracts/PackageVersioned.sol": {
          "keccak256": "0x972f70a6053548a508c149506d5f18f9e7987dd1a0a198ca828182866ea6c2ba",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://fe9218b5df820326d9f2de0a0655a5657e06daca949253b913b5fc710bff90b1",
            "dweb:/ipfs/QmV4TawNXAUzx3HdDQ6tsReN45jvDoUpEbT5PnDMLqYqCw"
          ]
        },
        "contracts/client/GasRouter.sol": {
          "keccak256": "0xd1ee79d598b2f5f4230766d8c764ab9dc77b40d6f9da40e1d85262915e09b89f",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://3abb9530098ed116c3b19f68548f982d4acdecd5186d15fce7be9f1ec5d83a4c",
            "dweb:/ipfs/QmQmm8wWQEGJARU5376sRfCTrtN7cVJ3MVMPyv5fAwRsUX"
          ]
        },
        "contracts/client/MailboxClient.sol": {
          "keccak256": "0xe09c109dc8c4fad4fdf9a8198cab0caed183033ae228d4d87a5c5ea4b824a435",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://918439fdd0be8efa65a8b36938296e46353080fe6734dfc96e4cee0a8de3bf78",
            "dweb:/ipfs/QmVhxFx3FTMe3nrfk17xNi6LxJb7u2ZEjtChGy1oCULkZD"
          ]
        },
        "contracts/client/Router.sol": {
          "keccak256": "0x5e87e9ddbf0ed57f7fdc41d965e296bac2cb274dff0f394306e74ce1a7777b0b",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://d67020dc0fcb74db77aaa304ab0ce877f02a2d76149002bf19d080673aa3b9ac",
            "dweb:/ipfs/QmWNvjzcJVfaFuijNRGKT8pYwbAkH3wmZHtpmyRZyNeLX3"
          ]
        },
        "contracts/hooks/libs/StandardHookMetadata.sol": {
          "keccak256": "0x972e1023165a8fca7f09a62e4533e67317823a134a3190d689271fb897a41829",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://0633187fa56cdfaabaad04a25032ced809b031abb1d2ff8264dfa35c92c27f1e",
            "dweb:/ipfs/QmRQwJPnxCFUYJrkd5KuwK41qDsYSSEe72ukDUpM89rVFn"
          ]
        },
        "contracts/interfaces/IInterchainSecurityModule.sol": {
          "keccak256": "0x8688e0596eec175bb02180ceb7c0ef272ea1c46c01a32061dad1a7f6c672bdda",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://5ed68e8c0a667f69ca7ff53d83a07ca10d2c96cd38fa1498d4fa5c99c6c85f4b",
            "dweb:/ipfs/QmZ2eCeKmftZUEwfWfNfGPhE9FCo2a2RQXrhoEk9Ft8jtU"
          ]
        },
        "contracts/interfaces/IMailbox.sol": {
          "keccak256": "0x836c3b6125c963a97ab140b01a82f1bab135ff46b1964d18603dce417ed0e7fa",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://4472eb0ffdbed054b02fa5c10ac3ffa12d3506b19771cdd760603c4819f9ee50",
            "dweb:/ipfs/QmVjbVNtmiobLSLurDyMki1WNqw2LCN8trExb9m2kZ8rBf"
          ]
        },
        "contracts/interfaces/IMessageRecipient.sol": {
          "keccak256": "0x145e8332a91295a710deb3cb1ab689144262ef6ec66d9570c600b778e9dd964d",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://a22ad97b1d8d3a37e8b4ad1519b893ac7cdf718c3a340999ffef4fb04060f119",
            "dweb:/ipfs/QmXp3w8yPm1vHyNrrSLr4YtRMP44eLadHnXSAjSecqB7H6"
          ]
        },
        "contracts/interfaces/ITokenBridge.sol": {
          "keccak256": "0xf2d206e588408fb0a2ea48cbf9346a1227777d79a087eb6b22dddb599be332b4",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://139400456496d7ea4e60c1648f3bc3512845745d249caeb79e55858d7612de28",
            "dweb:/ipfs/QmUXCtH57mC1PPDAe6e8hw23CajmWYsBWZqDTFD4m6y8L4"
          ]
        },
        "contracts/interfaces/hooks/IPostDispatchHook.sol": {
          "keccak256": "0xa23968578650878f614f3eea742e1557bc07512053d484260672aa9895791c67",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://ffa5c14593f218f020857cef2fb3d2ae1a574d2b0f8ec42694fc5086b92a3cb0",
            "dweb:/ipfs/QmYq5pFDScp6Yjw6YxoWXxHCDgbxucfyZZ3vyMShzVFrnV"
          ]
        },
        "contracts/libs/EnumerableMapExtended.sol": {
          "keccak256": "0xbd661cdeba756caf35191b71a85461a9ff79c047ec98ec05063748dfc0419595",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://d88af58f2f47a6ad7c24abef9419d1474cba6e372830cc82794e37943dc3d9ce",
            "dweb:/ipfs/QmbaTGUtTbtxmVnZWTq5Kt6ATmHXmrUssXPXGd6F3NkEMc"
          ]
        },
        "contracts/libs/Message.sol": {
          "keccak256": "0x5319af5ade07bcb021d6373f0713f24f34431def78cda16fea6755f580fb5e78",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://f531eecebd22a535398def83b078aff4f72d88940a0e9474ad3244a555f00d53",
            "dweb:/ipfs/QmQjtjpf4qwaM9QVyWBsogRvZeokKESTVdsX3z9mt1wZFa"
          ]
        },
        "contracts/libs/TypeCasts.sol": {
          "keccak256": "0xa4329f368c22062ccc725593c5c552796ce923cf66191cb9681f4f17fea8631f",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://4e8c22116d69888bbda6db11f5dfafb362ac9da4226373c7162953de81f57229",
            "dweb:/ipfs/QmdvzDSFiftDgzDwbPBLMWdGBATbmkqCP5aKNdomm1cY33"
          ]
        },
        "contracts/token/HypERC20.sol": {
          "keccak256": "0xcf2379ebbc9de1d6c2d7b108c883094e06a3a6843e43efd850a4559c272c1031",
          "license": "Apache-2.0",
          "urls": [
            "bzz-raw://a37c06ce6dd256e0685eb17b06e97dcb80ed45e18550ee34475af19f2f588262",
            "dweb:/ipfs/QmPioJoe2gYkMA1dEnKsiFAEhJkKKnQZmdx3NLbgHRW9GU"
          ]
        },
        "contracts/token/libs/Quotes.sol": {
          "keccak256": "0x7988c30d300502fae65b6e45bbfe990910285ddb8eabed86e2b41d954f2eeafc",
          "license": "Apache-2.0",
          "urls": [
            "bzz-raw://4f591933d426563a1f7d469a9e87b94416da76090ae7c58d1a8dfee309cd15e8",
            "dweb:/ipfs/QmNkoE7Xpy32KN1FcZsSyKSVaAKE97SSzY4qXS7dQ34nyn"
          ]
        },
        "contracts/token/libs/TokenMessage.sol": {
          "keccak256": "0xb9dfb7844e1084a3a2f40f2bba764d8494325fa04dc3c70e0d30c30bc125996e",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://003d2a20fdd5ca2f46fe8f98b527bf284b0776c0a223bd3eebaafd467fe5e8d4",
            "dweb:/ipfs/QmfC1Erb7KVjLqvxKXn3NjPjFiTm4mXMAZXWNZ1gJKvGM1"
          ]
        },
        "contracts/token/libs/TokenRouter.sol": {
          "keccak256": "0x109495491f44a9b3e6b4cbfae46a12a8f3705eb2c0cf9992dff18c0239121fb5",
          "license": "MIT OR Apache-2.0",
          "urls": [
            "bzz-raw://e15b14c0976c40a378523b1ab6148234777348a22052dc0441e2bebc7b120e89",
            "dweb:/ipfs/QmPKbGAKC41QBzVSBkt46Ls1BqBbbhytgBkkPraQMkwPJZ"
          ]
        }
      },
      "version": 1
    }
  },
  "deployment": null
}