{"constructor_args":"0x000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b07624","is_partially_verified":true,"is_changed_bytecode":false,"abi":[{"inputs":[{"internalType":"address","name":"_stoneBTC","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"CapacityReached","type":"error"},{"inputs":[],"name":"DepositPaused","type":"error"},{"inputs":[],"name":"InvalidParameter","type":"error"},{"inputs":[],"name":"NoFeeRecipient","type":"error"},{"inputs":[],"name":"NonEmptySupportedToken","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[],"name":"TooHighFee","type":"error"},{"inputs":[],"name":"UnsupportedToken","type":"error"},{"inputs":[],"name":"WithdrawPaused","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"AddSupportedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeCharged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"RemoveSupportedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"SetDepositCapacity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"SetDepositFeeRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"SetDepositPause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"SetFeeRecipient","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"SetWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelistMode","type":"bool"}],"name":"SetWhitelistMode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"SetWithdrawFeeRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"SetWithdrawPause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"SetWithdrawWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelistMode","type":"bool"}],"name":"SetWithdrawWhitelistMode","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"stoneAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"CAPACITY_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSE_OPERATION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUPPORTED_TOKEN_OPERATION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_OPERATION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_supportedTokens","type":"address[]"}],"name":"addSupportedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositCapacity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"depositMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"depositWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDepositAmounts","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"removeSupportedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_maximum","type":"uint256"}],"name":"setDepositCapacity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setDepositFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_pause","type":"bool"}],"name":"setDepositPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"setWhitelistAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_applyWhitelist","type":"bool"}],"name":"setWhitelistMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setWithdrawFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_pause","type":"bool"}],"name":"setWithdrawPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"setWithdrawWhitelistAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_applyWhitelist","type":"bool"}],"name":"setWithdrawWhitelistMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stoneBTC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"supportedTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supportedTokensArray","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_stoneBTCAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_stoneBTCAmounts","type":"uint256[]"}],"name":"withdrawMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"withdrawWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawWhitelistMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"conflicting_implementations":null,"certified":false,"additional_sources":[],"is_verified_via_sourcify":true,"can_be_visualized_via_sol2uml":true,"evm_version":"paris","language":"solidity","is_verified_via_eth_bytecode_db":true,"is_fully_verified":false,"license_type":"none","is_blueprint":false,"name":"StoneBTCVault","creation_bytecode":"0x60a060405234801561001057600080fd5b50604051612b30380380612b3083398101604081905261002f916100f8565b61003a60003361004c565b506001600160a01b0316608052610128565b6000828152602081815260408083206001600160a01b038516845290915281205460ff166100ee576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100a63390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016100f2565b5060005b92915050565b60006020828403121561010a57600080fd5b81516001600160a01b038116811461012157600080fd5b9392505050565b6080516129ca610166600039600081816106210152818161093101528181610ee60152818161101d015281816111b90152611b8501526129ca6000f3fe608060405234801561001057600080fd5b506004361061027f5760003560e01c80638d7890e51161015c578063d9f19a3a116100ce578063effd529b11610087578063effd529b14610694578063f0071255146106a7578063f2431b06146106d5578063f3fef3a3146106e8578063f448b9e5146106fb578063f457b1b81461071b57600080fd5b8063d9f19a3a146105f9578063dd3ec6a41461061c578063e0d1264b14610643578063e74b981b14610663578063e934768314610676578063ecefc7051461068b57600080fd5b80639bed5a45116101205780639bed5a4514610567578063a217fddf1461057d578063a658308214610585578063a90255c414610598578063c1bc438a146105bf578063d547741f146105e657600080fd5b80638d7890e5146104d65780638ee573ac146105045780638fcc88711461053957806391d148541461054c57806392f6576e1461055f57600080fd5b806346904840116101f557806368c4ac26116101b957806368c4ac261461044057806372c1ab0c14610463578063797e566c1461047657806379c3ae88146104895780637d7d3ff7146104b05780638c7ac746146104c357600080fd5b806346904840146103d157806347e7ef24146103e45780634a34a55d146103f75780634acde4201461041a5780635e6d388b1461042d57600080fd5b80632e9b3201116102475780632e9b3201146103285780632f2ff15d1461035357806336568abe146103665780633942d15b146103795780633b00cf7a1461038e57806340ccf256146103ae57600080fd5b806301ffc9a71461028457806306011e83146102ac5780631486ed73146102cf578063248a9ca3146102e4578063252ca2b514610315575b600080fd5b6102976102923660046122e4565b61072e565b60405190151581526020015b60405180910390f35b6102976102ba366004612331565b600c6020526000908152604090205460ff1681565b6102e26102dd36600461235a565b610765565b005b6103076102f2366004612391565b60009081526020819052604090206001015490565b6040519081526020016102a3565b6102e261032336600461235a565b6107f0565b61033b610336366004612391565b610872565b6040516001600160a01b0390911681526020016102a3565b6102e26103613660046123aa565b61089c565b6102e26103743660046123aa565b6108c7565b61030760008051602061297583398151915281565b61030761039c366004612331565b60056020526000908152604090205481565b6102976103bc366004612331565b60086020526000908152604090205460ff1681565b60065461033b906001600160a01b031681565b6102e26103f23660046123d6565b6108ff565b610297610405366004612331565b60076020526000908152604090205460ff1681565b6102e2610428366004612400565b610b21565b6102e261043b3660046123d6565b610bb7565b61029761044e366004612331565b60016020526000908152604090205460ff1681565b6102e2610471366004612526565b610c75565b6102e2610484366004612526565b611005565b6103077faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa81565b6102e26104be3660046123d6565b611259565b6102e26104d13660046125ea565b611317565b6102976104e4366004612627565b600b60209081526000928352604080842090915290825290205460ff1681565b610527610512366004612331565b60026020526000908152604090205460ff1681565b60405160ff90911681526020016102a3565b6102e2610547366004612400565b6114d0565b61029761055a3660046123aa565b61155c565b610307606481565b61056f611585565b6040516102a3929190612696565b610307600081565b6102e2610593366004612331565b611716565b6103077f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2381565b6103077fb3c5930d5d9c2b6cd04d6659c775ca2da2d6d78e06e443601a84166091e6c39d81565b6102e26105f43660046123aa565b61191b565b610297610607366004612331565b600a6020526000908152604090205460ff1681565b61033b7f000000000000000000000000000000000000000000000000000000000000000081565b610307610651366004612331565b60096020526000908152604090205481565b6102e2610671366004612331565b611940565b61030760008051602061295583398151915281565b61030761271081565b6102e26106a236600461235a565b6119ad565b6102976106b5366004612627565b600d60209081526000928352604080842090915290825290205460ff1681565b6102e26106e336600461235a565b611a21565b6102e26106f63660046123d6565b611a95565b610307610709366004612331565b60046020526000908152604090205481565b6102e26107293660046123d6565b611d96565b60006001600160e01b03198216637965db0b60e01b148061075f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b7faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa61078f81611e0d565b6001600160a01b038316600090815260086020908152604091829020805460ff191685151590811790915591519182527f18c9cece4ead1b75442b5a27c0b45b5d7075084e926c6b13220e5af9d5b8418691015b60405180910390a1505050565b7faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa61081a81611e0d565b6001600160a01b038316600090815260076020908152604091829020805460ff191685151590811790915591519182527f0653e29fcca730c396a6099e174293ae6bd435437a5de4f8c461f7b5dc9e58f291016107e3565b6003818154811061088257600080fd5b6000918252602090912001546001600160a01b0316905081565b6000828152602081905260409020600101546108b781611e0d565b6108c18383611e1a565b50505050565b6001600160a01b03811633146108f05760405163334bd91960e11b815260040160405180910390fd5b6108fa8282611eac565b505050565b61090a828233611f17565b6109168233308461209c565b6001600160a01b0382166000908152600260205260408120547f000000000000000000000000000000000000000000000000000000000000000091906109609060ff166012612706565b61096b90600a612806565b6109759084612815565b6001600160a01b03808616600090815260056020526040902054600654929350911681158015906109ae57506001600160a01b03811615155b15610a765760006127106109c28486612815565b6109cc919061282c565b6040516340c10f1960e01b81529091506001600160a01b038616906340c10f19906109fd908590859060040161284e565b600060405180830381600087803b158015610a1757600080fd5b505af1158015610a2b573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18282604051610a6092919061284e565b60405180910390a1610a728185612867565b9350505b6040516340c10f1960e01b81526001600160a01b038516906340c10f1990610aa4903390879060040161284e565b600060405180830381600087803b158015610abe57600080fd5b505af1158015610ad2573d6000803e3d6000fd5b50505050336001600160a01b03167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f628787604051610b1192919061284e565b60405180910390a2505050505050565b600080516020612975833981519152610b3981611e0d565b6001600160a01b038481166000818152600b6020908152604080832094881680845294825291829020805460ff19168715159081179091558251938452908301939093528101919091527fa45211a1faa0b217e3982b8fb0ea784253379fd6c908fc7e0a659c1c5a54d13e906060015b60405180910390a150505050565b600080516020612955833981519152610bcf81611e0d565b600082118015610be857506006546001600160a01b0316155b15610c0657604051630ef97d8160e11b815260040160405180910390fd5b6064821115610c28576040516336d9f19760e11b815260040160405180910390fd5b6001600160a01b03831660009081526005602052604090819020839055517f13f488f23c338f374cdfef41e60e10100f7d6cac2c33a0bfdb034b8851875dbd906107e3908590859061284e565b600654825160009182916001600160a01b0390911690825b81811015610ed6576000878281518110610ca957610ca961287a565b6020908102919091018101516001600160a01b0381166000908152600890925260409091205490915060ff1615610cf35760405163e0a3980360e01b815260040160405180910390fd5b6001600160a01b03811660009081526001602052604081205460ff1615159003610d305760405163350b944160e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c602052604090205460ff168015610d7c57506001600160a01b0381166000908152600d6020908152604080832033845290915290205460ff16155b15610d9a57604051630b094f2760e31b815260040160405180910390fd5b6000878381518110610dae57610dae61287a565b602002602001015190508087610dc49190612890565b6001600160a01b038316600090815260046020526040902054909750818115801590610df857506001600160a01b03871615155b15610e32576000612710610e0c8486612815565b610e16919061282c565b9050610e22818a612890565b9850610e2e8185612867565b9150505b6001600160a01b038416600090815260026020526040812054610e599060ff166012612706565b610e6490600a612806565b610e6e908361282c565b9050610e7b8533836121ab565b604080518581526001600160a01b038716602082015290810182905233907f457f950b75085c30ff780acd57bde642ff1316cc4aad9f286af2c1ffc4163a789060600160405180910390a28560010195505050505050610c8d565b50604051632770a7eb60e21b81527f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03821690639dc29fac90610f27903390899060040161284e565b600060405180830381600087803b158015610f4157600080fd5b505af1158015610f55573d6000803e3d6000fd5b505050506000841115610ffc576040516340c10f1960e01b81526001600160a01b038216906340c10f1990610f90908690889060040161284e565b600060405180830381600087803b158015610faa57600080fd5b505af1158015610fbe573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18385604051610ff392919061284e565b60405180910390a15b50505050505050565b600654825160009182916001600160a01b03909116907f000000000000000000000000000000000000000000000000000000000000000090835b818110156111a157600088828151811061105b5761105b61287a565b6020026020010151905060008883815181106110795761107961287a565b6020026020010151905061108e828233611f17565b61109a8233308461209c565b6001600160a01b0382166000908152600260205260408120546110c19060ff166012612706565b6110cc90600a612806565b6110d69083612815565b6001600160a01b038416600090815260056020526040902054909150801580159061110957506001600160a01b03881615155b1561114357600061271061111d8385612815565b611127919061282c565b9050611133818b612890565b995061113f8184612867565b9250505b61114d828b612890565b9950336001600160a01b03167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62858560405161118a92919061284e565b60405180910390a28460010194505050505061103f565b506040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340c10f19906111f0903390899060040161284e565b600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b505050506000841115610ffc576040516340c10f1960e01b81526001600160a01b038316906340c10f1990610f90908690889060040161284e565b60008051602061295583398151915261127181611e0d565b60008211801561128a57506006546001600160a01b0316155b156112a857604051630ef97d8160e11b815260040160405180910390fd5b60648211156112ca576040516336d9f19760e11b815260040160405180910390fd5b6001600160a01b03831660009081526004602052604090819020839055517fbf132ce7f9926a04e8db0a20072c8b96a7bb974020af932a36318a60a6785bbe906107e3908590859061284e565b7f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2361134181611e0d565b815160005b818110156114a05760008482815181106113625761136261287a565b6020908102919091018101516001600160a01b0381166000908152600192839052604090205490925060ff16151590036113af57604051630309cb8760e51b815260040160405180910390fd5b6001600160a01b0381166000818152600160208181526040808420805460ff1916841790556003805493840181559093527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b03191684179055815163313ce56760e01b8152915163313ce5679260048082019392918290030181865afa158015611449573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146d91906128a3565b6001600160a01b03919091166000908152600260205260409020805460ff191660ff909216919091179055600101611346565b507fc4885347db5c13694e395f011a0d12b1c486280cf8a7ace00a586fcd071f939d836040516107e391906128c6565b6000805160206129758339815191526114e881611e0d565b6001600160a01b038481166000818152600d6020908152604080832094881680845294825291829020805460ff19168715159081179091558251938452908301939093528101919091527fe568f96b27ac53a40ffc20bf96bdd421ef45bf14b4dd2c2d7d8213685821750790606001610ba9565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600354606090819060008167ffffffffffffffff8111156115a8576115a8612447565b6040519080825280602002602001820160405280156115d1578160200160208202803683370190505b50905060008267ffffffffffffffff8111156115ef576115ef612447565b604051908082528060200260200182016040528015611618578160200160208202803683370190505b50905060005b8381101561170b5760006003828154811061163b5761163b61287a565b9060005260206000200160009054906101000a90046001600160a01b031690508084838151811061166e5761166e61287a565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b8152306004820152908216906370a0823190602401602060405180830381865afa1580156116c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e591906128d9565b8383815181106116f7576116f761287a565b60209081029190910101525060010161161e565b509094909350915050565b7f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2361174081611e0d565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906128d9565b156117c657604051636984206f60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600160205260408120805460ff19169055600354905b818110156118e157836001600160a01b0316600382815481106118105761181061287a565b6000918252602090912001546001600160a01b0316036118d9576003611837600184612867565b815481106118475761184761287a565b600091825260209091200154600380546001600160a01b0390921691839081106118735761187361287a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060038054806118b2576118b26128f2565b600082815260209020810160001990810180546001600160a01b03191690550190556118e1565b6001016117eb565b506040516001600160a01b03841681527f54139126c26c011ab30f3af9c69f05a3903dce52aa3ee4c6a1270686b71e88bb906020016107e3565b60008281526020819052604090206001015461193681611e0d565b6108c18383611eac565b60008051602061295583398151915261195881611e0d565b600680546001600160a01b0319166001600160a01b0384169081179091556040519081527f2e979f80fe4d43055c584cf4a8467c55875ea36728fc37176c05acd784eb7a739060200160405180910390a15050565b6000805160206129758339815191526119c581611e0d565b6001600160a01b0383166000818152600a6020908152604091829020805460ff19168615159081179091558251938452908301527f5fad9775e677916452d719f68d07ee2a9f503d5b8241f877283e9be79ad4307791016107e3565b600080516020612975833981519152611a3981611e0d565b6001600160a01b0383166000818152600c6020908152604091829020805460ff19168615159081179091558251938452908301527fd429198fc76a1c7635b1c65e94c233371f4b476fb8e2f40feaa1191ee9d5aeb991016107e3565b6001600160a01b03821660009081526008602052604090205460ff1615611acf5760405163e0a3980360e01b815260040160405180910390fd5b6001600160a01b03821660009081526001602052604081205460ff1615159003611b0c5760405163350b944160e11b815260040160405180910390fd5b6001600160a01b0382166000908152600c602052604090205460ff168015611b5857506001600160a01b0382166000908152600d6020908152604080832033845290915290205460ff16155b15611b7657604051630b094f2760e31b815260040160405180910390fd5b604051632770a7eb60e21b81527f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03821690639dc29fac90611bc6903390869060040161284e565b600060405180830381600087803b158015611be057600080fd5b505af1158015611bf4573d6000803e3d6000fd5b5050506001600160a01b038085166000908152600460205260409020546006549092508491168215801590611c3157506001600160a01b03811615155b15611cf9576000612710611c458588612815565b611c4f919061282c565b6040516340c10f1960e01b81529091506001600160a01b038616906340c10f1990611c80908590859060040161284e565b600060405180830381600087803b158015611c9a57600080fd5b505af1158015611cae573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18282604051611ce392919061284e565b60405180910390a1611cf58184612867565b9250505b6001600160a01b038616600090815260026020526040812054611d209060ff166012612706565b611d2b90600a612806565b611d35908461282c565b9050611d428733836121ab565b604080518781526001600160a01b038916602082015290810182905233907f457f950b75085c30ff780acd57bde642ff1316cc4aad9f286af2c1ffc4163a789060600160405180910390a250505050505050565b7fb3c5930d5d9c2b6cd04d6659c775ca2da2d6d78e06e443601a84166091e6c39d611dc081611e0d565b6001600160a01b03831660009081526009602052604090819020839055517f24e2c9489e03fde4cefdbeda85ffdd248ef2d83f226d0ba74e49e0c876f3bae5906107e3908590859061284e565b611e1781336122b5565b50565b6000611e26838361155c565b611ea4576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611e5c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161075f565b50600061075f565b6000611eb8838361155c565b15611ea4576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161075f565b6001600160a01b03831660009081526001602052604081205460ff1615159003611f545760405163350b944160e11b815260040160405180910390fd5b6001600160a01b03831660009081526007602052604090205460ff1615611f8e5760405163035edea360e41b815260040160405180910390fd5b6001600160a01b038316600081815260096020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa158015611fe4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200891906128d9565b6120129084612890565b111561203057604051628306a160e61b815260040160405180910390fd5b6001600160a01b0383166000908152600a602052604090205460ff16801561207e57506001600160a01b038084166000908152600b602090815260408083209385168352929052205460ff16155b156108fa57604051630b094f2760e31b815260040160405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916121009190612908565b6000604051808303816000865af19150503d806000811461213d576040519150601f19603f3d011682016040523d82523d6000602084013e612142565b606091505b509150915081801561216c57508051158061216c57508080602001905181019061216c9190612937565b6121a35760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b60448201526064015b60405180910390fd5b505050505050565b600080846001600160a01b031663a9059cbb60e01b85856040516024016121d392919061284e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516122119190612908565b6000604051808303816000865af19150503d806000811461224e576040519150601f19603f3d011682016040523d82523d6000602084013e612253565b606091505b509150915081801561227d57508051158061227d57508080602001905181019061227d9190612937565b6122ae5760405162461bcd60e51b815260206004820152600260248201526114d560f21b604482015260640161219a565b5050505050565b6122bf828261155c565b6122e057808260405163e2517d3f60e01b815260040161219a92919061284e565b5050565b6000602082840312156122f657600080fd5b81356001600160e01b03198116811461230e57600080fd5b9392505050565b80356001600160a01b038116811461232c57600080fd5b919050565b60006020828403121561234357600080fd5b61230e82612315565b8015158114611e1757600080fd5b6000806040838503121561236d57600080fd5b61237683612315565b915060208301356123868161234c565b809150509250929050565b6000602082840312156123a357600080fd5b5035919050565b600080604083850312156123bd57600080fd5b823591506123cd60208401612315565b90509250929050565b600080604083850312156123e957600080fd5b6123f283612315565b946020939093013593505050565b60008060006060848603121561241557600080fd5b61241e84612315565b925061242c60208501612315565b9150604084013561243c8161234c565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561248657612486612447565b604052919050565b600067ffffffffffffffff8211156124a8576124a8612447565b5060051b60200190565b600082601f8301126124c357600080fd5b81356124d66124d18261248e565b61245d565b8082825260208201915060208360051b8601019250858311156124f857600080fd5b602085015b8381101561251c5761250e81612315565b8352602092830192016124fd565b5095945050505050565b6000806040838503121561253957600080fd5b823567ffffffffffffffff81111561255057600080fd5b61255c858286016124b2565b925050602083013567ffffffffffffffff81111561257957600080fd5b8301601f8101851361258a57600080fd5b80356125986124d18261248e565b8082825260208201915060208360051b8501019250878311156125ba57600080fd5b6020840193505b828410156125dc5783358252602093840193909101906125c1565b809450505050509250929050565b6000602082840312156125fc57600080fd5b813567ffffffffffffffff81111561261357600080fd5b61261f848285016124b2565b949350505050565b6000806040838503121561263a57600080fd5b61264383612315565b91506123cd60208401612315565b600081518084526020840193506020830160005b8281101561268c5781516001600160a01b0316865260209586019590910190600101612665565b5093949350505050565b6040815260006126a96040830185612651565b828103602084015280845180835260208301915060208601925060005b818110156126e45783518352602093840193909201916001016126c6565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561075f5761075f6126f0565b6001815b600184111561275a5780850481111561273e5761273e6126f0565b600184161561274c57908102905b60019390931c928002612723565b935093915050565b6000826127715750600161075f565b8161277e5750600061075f565b8160018114612794576002811461279e576127ba565b600191505061075f565b60ff8411156127af576127af6126f0565b50506001821b61075f565b5060208310610133831016604e8410600b84101617156127dd575081810a61075f565b6127ea600019848461271f565b80600019048211156127fe576127fe6126f0565b029392505050565b600061230e60ff841683612762565b808202811582820484141761075f5761075f6126f0565b60008261284957634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03929092168252602082015260400190565b8181038181111561075f5761075f6126f0565b634e487b7160e01b600052603260045260246000fd5b8082018082111561075f5761075f6126f0565b6000602082840312156128b557600080fd5b815160ff8116811461230e57600080fd5b60208152600061230e6020830184612651565b6000602082840312156128eb57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b6000825160005b81811015612929576020818601810151858301520161290f565b506000920191825250919050565b60006020828403121561294957600080fd5b815161230e8161234c56fee6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f8818206015df3a627bc06ddfcc673648644239a40b603eb92648c972fc171056a9890e60a2646970667358221220ff547383aecb6b7dcc9143f1515ba858fb57888bf71fb316e53199c45d91237b64736f6c634300081a0033000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b07624","external_libraries":[],"proxy_type":null,"implementations":[],"verified_at":"2024-11-14T04:23:51.609737Z","is_verified_via_verifier_alliance":false,"compiler_version":"0.8.26+commit.8a97fa7a","decoded_constructor_args":[["0x094c0e36210634c3CfA25DC11B96b562E0b07624",{"internalType":"address","name":"_stoneBTC","type":"address"}]],"sourcify_repo_url":"https://repo.sourcify.dev/1/0x7dBAC0aA440A25D7FB43951f7b178FF7A809108D","optimization_runs":200,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":true,"deployed_bytecode":"0x608060405234801561001057600080fd5b506004361061027f5760003560e01c80638d7890e51161015c578063d9f19a3a116100ce578063effd529b11610087578063effd529b14610694578063f0071255146106a7578063f2431b06146106d5578063f3fef3a3146106e8578063f448b9e5146106fb578063f457b1b81461071b57600080fd5b8063d9f19a3a146105f9578063dd3ec6a41461061c578063e0d1264b14610643578063e74b981b14610663578063e934768314610676578063ecefc7051461068b57600080fd5b80639bed5a45116101205780639bed5a4514610567578063a217fddf1461057d578063a658308214610585578063a90255c414610598578063c1bc438a146105bf578063d547741f146105e657600080fd5b80638d7890e5146104d65780638ee573ac146105045780638fcc88711461053957806391d148541461054c57806392f6576e1461055f57600080fd5b806346904840116101f557806368c4ac26116101b957806368c4ac261461044057806372c1ab0c14610463578063797e566c1461047657806379c3ae88146104895780637d7d3ff7146104b05780638c7ac746146104c357600080fd5b806346904840146103d157806347e7ef24146103e45780634a34a55d146103f75780634acde4201461041a5780635e6d388b1461042d57600080fd5b80632e9b3201116102475780632e9b3201146103285780632f2ff15d1461035357806336568abe146103665780633942d15b146103795780633b00cf7a1461038e57806340ccf256146103ae57600080fd5b806301ffc9a71461028457806306011e83146102ac5780631486ed73146102cf578063248a9ca3146102e4578063252ca2b514610315575b600080fd5b6102976102923660046122e4565b61072e565b60405190151581526020015b60405180910390f35b6102976102ba366004612331565b600c6020526000908152604090205460ff1681565b6102e26102dd36600461235a565b610765565b005b6103076102f2366004612391565b60009081526020819052604090206001015490565b6040519081526020016102a3565b6102e261032336600461235a565b6107f0565b61033b610336366004612391565b610872565b6040516001600160a01b0390911681526020016102a3565b6102e26103613660046123aa565b61089c565b6102e26103743660046123aa565b6108c7565b61030760008051602061297583398151915281565b61030761039c366004612331565b60056020526000908152604090205481565b6102976103bc366004612331565b60086020526000908152604090205460ff1681565b60065461033b906001600160a01b031681565b6102e26103f23660046123d6565b6108ff565b610297610405366004612331565b60076020526000908152604090205460ff1681565b6102e2610428366004612400565b610b21565b6102e261043b3660046123d6565b610bb7565b61029761044e366004612331565b60016020526000908152604090205460ff1681565b6102e2610471366004612526565b610c75565b6102e2610484366004612526565b611005565b6103077faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa81565b6102e26104be3660046123d6565b611259565b6102e26104d13660046125ea565b611317565b6102976104e4366004612627565b600b60209081526000928352604080842090915290825290205460ff1681565b610527610512366004612331565b60026020526000908152604090205460ff1681565b60405160ff90911681526020016102a3565b6102e2610547366004612400565b6114d0565b61029761055a3660046123aa565b61155c565b610307606481565b61056f611585565b6040516102a3929190612696565b610307600081565b6102e2610593366004612331565b611716565b6103077f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2381565b6103077fb3c5930d5d9c2b6cd04d6659c775ca2da2d6d78e06e443601a84166091e6c39d81565b6102e26105f43660046123aa565b61191b565b610297610607366004612331565b600a6020526000908152604090205460ff1681565b61033b7f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b0762481565b610307610651366004612331565b60096020526000908152604090205481565b6102e2610671366004612331565b611940565b61030760008051602061295583398151915281565b61030761271081565b6102e26106a236600461235a565b6119ad565b6102976106b5366004612627565b600d60209081526000928352604080842090915290825290205460ff1681565b6102e26106e336600461235a565b611a21565b6102e26106f63660046123d6565b611a95565b610307610709366004612331565b60046020526000908152604090205481565b6102e26107293660046123d6565b611d96565b60006001600160e01b03198216637965db0b60e01b148061075f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b7faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa61078f81611e0d565b6001600160a01b038316600090815260086020908152604091829020805460ff191685151590811790915591519182527f18c9cece4ead1b75442b5a27c0b45b5d7075084e926c6b13220e5af9d5b8418691015b60405180910390a1505050565b7faeb3682ce22b96c24491c7d95d6526a9029d8983c8ab68b1c1da57f4aed400aa61081a81611e0d565b6001600160a01b038316600090815260076020908152604091829020805460ff191685151590811790915591519182527f0653e29fcca730c396a6099e174293ae6bd435437a5de4f8c461f7b5dc9e58f291016107e3565b6003818154811061088257600080fd5b6000918252602090912001546001600160a01b0316905081565b6000828152602081905260409020600101546108b781611e0d565b6108c18383611e1a565b50505050565b6001600160a01b03811633146108f05760405163334bd91960e11b815260040160405180910390fd5b6108fa8282611eac565b505050565b61090a828233611f17565b6109168233308461209c565b6001600160a01b0382166000908152600260205260408120547f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b0762491906109609060ff166012612706565b61096b90600a612806565b6109759084612815565b6001600160a01b03808616600090815260056020526040902054600654929350911681158015906109ae57506001600160a01b03811615155b15610a765760006127106109c28486612815565b6109cc919061282c565b6040516340c10f1960e01b81529091506001600160a01b038616906340c10f19906109fd908590859060040161284e565b600060405180830381600087803b158015610a1757600080fd5b505af1158015610a2b573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18282604051610a6092919061284e565b60405180910390a1610a728185612867565b9350505b6040516340c10f1960e01b81526001600160a01b038516906340c10f1990610aa4903390879060040161284e565b600060405180830381600087803b158015610abe57600080fd5b505af1158015610ad2573d6000803e3d6000fd5b50505050336001600160a01b03167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f628787604051610b1192919061284e565b60405180910390a2505050505050565b600080516020612975833981519152610b3981611e0d565b6001600160a01b038481166000818152600b6020908152604080832094881680845294825291829020805460ff19168715159081179091558251938452908301939093528101919091527fa45211a1faa0b217e3982b8fb0ea784253379fd6c908fc7e0a659c1c5a54d13e906060015b60405180910390a150505050565b600080516020612955833981519152610bcf81611e0d565b600082118015610be857506006546001600160a01b0316155b15610c0657604051630ef97d8160e11b815260040160405180910390fd5b6064821115610c28576040516336d9f19760e11b815260040160405180910390fd5b6001600160a01b03831660009081526005602052604090819020839055517f13f488f23c338f374cdfef41e60e10100f7d6cac2c33a0bfdb034b8851875dbd906107e3908590859061284e565b600654825160009182916001600160a01b0390911690825b81811015610ed6576000878281518110610ca957610ca961287a565b6020908102919091018101516001600160a01b0381166000908152600890925260409091205490915060ff1615610cf35760405163e0a3980360e01b815260040160405180910390fd5b6001600160a01b03811660009081526001602052604081205460ff1615159003610d305760405163350b944160e11b815260040160405180910390fd5b6001600160a01b0381166000908152600c602052604090205460ff168015610d7c57506001600160a01b0381166000908152600d6020908152604080832033845290915290205460ff16155b15610d9a57604051630b094f2760e31b815260040160405180910390fd5b6000878381518110610dae57610dae61287a565b602002602001015190508087610dc49190612890565b6001600160a01b038316600090815260046020526040902054909750818115801590610df857506001600160a01b03871615155b15610e32576000612710610e0c8486612815565b610e16919061282c565b9050610e22818a612890565b9850610e2e8185612867565b9150505b6001600160a01b038416600090815260026020526040812054610e599060ff166012612706565b610e6490600a612806565b610e6e908361282c565b9050610e7b8533836121ab565b604080518581526001600160a01b038716602082015290810182905233907f457f950b75085c30ff780acd57bde642ff1316cc4aad9f286af2c1ffc4163a789060600160405180910390a28560010195505050505050610c8d565b50604051632770a7eb60e21b81527f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b07624906001600160a01b03821690639dc29fac90610f27903390899060040161284e565b600060405180830381600087803b158015610f4157600080fd5b505af1158015610f55573d6000803e3d6000fd5b505050506000841115610ffc576040516340c10f1960e01b81526001600160a01b038216906340c10f1990610f90908690889060040161284e565b600060405180830381600087803b158015610faa57600080fd5b505af1158015610fbe573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18385604051610ff392919061284e565b60405180910390a15b50505050505050565b600654825160009182916001600160a01b03909116907f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b0762490835b818110156111a157600088828151811061105b5761105b61287a565b6020026020010151905060008883815181106110795761107961287a565b6020026020010151905061108e828233611f17565b61109a8233308461209c565b6001600160a01b0382166000908152600260205260408120546110c19060ff166012612706565b6110cc90600a612806565b6110d69083612815565b6001600160a01b038416600090815260056020526040902054909150801580159061110957506001600160a01b03881615155b1561114357600061271061111d8385612815565b611127919061282c565b9050611133818b612890565b995061113f8184612867565b9250505b61114d828b612890565b9950336001600160a01b03167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62858560405161118a92919061284e565b60405180910390a28460010194505050505061103f565b506040516340c10f1960e01b81526001600160a01b037f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b0762416906340c10f19906111f0903390899060040161284e565b600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b505050506000841115610ffc576040516340c10f1960e01b81526001600160a01b038316906340c10f1990610f90908690889060040161284e565b60008051602061295583398151915261127181611e0d565b60008211801561128a57506006546001600160a01b0316155b156112a857604051630ef97d8160e11b815260040160405180910390fd5b60648211156112ca576040516336d9f19760e11b815260040160405180910390fd5b6001600160a01b03831660009081526004602052604090819020839055517fbf132ce7f9926a04e8db0a20072c8b96a7bb974020af932a36318a60a6785bbe906107e3908590859061284e565b7f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2361134181611e0d565b815160005b818110156114a05760008482815181106113625761136261287a565b6020908102919091018101516001600160a01b0381166000908152600192839052604090205490925060ff16151590036113af57604051630309cb8760e51b815260040160405180910390fd5b6001600160a01b0381166000818152600160208181526040808420805460ff1916841790556003805493840181559093527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90910180546001600160a01b03191684179055815163313ce56760e01b8152915163313ce5679260048082019392918290030181865afa158015611449573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146d91906128a3565b6001600160a01b03919091166000908152600260205260409020805460ff191660ff909216919091179055600101611346565b507fc4885347db5c13694e395f011a0d12b1c486280cf8a7ace00a586fcd071f939d836040516107e391906128c6565b6000805160206129758339815191526114e881611e0d565b6001600160a01b038481166000818152600d6020908152604080832094881680845294825291829020805460ff19168715159081179091558251938452908301939093528101919091527fe568f96b27ac53a40ffc20bf96bdd421ef45bf14b4dd2c2d7d8213685821750790606001610ba9565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600354606090819060008167ffffffffffffffff8111156115a8576115a8612447565b6040519080825280602002602001820160405280156115d1578160200160208202803683370190505b50905060008267ffffffffffffffff8111156115ef576115ef612447565b604051908082528060200260200182016040528015611618578160200160208202803683370190505b50905060005b8381101561170b5760006003828154811061163b5761163b61287a565b9060005260206000200160009054906101000a90046001600160a01b031690508084838151811061166e5761166e61287a565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b8152306004820152908216906370a0823190602401602060405180830381865afa1580156116c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e591906128d9565b8383815181106116f7576116f761287a565b60209081029190910101525060010161161e565b509094909350915050565b7f34ce126d258e4c12f038d16ca6e5c12e441ad13c3146f5a99754dabb0dedbd2361174081611e0d565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906128d9565b156117c657604051636984206f60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600160205260408120805460ff19169055600354905b818110156118e157836001600160a01b0316600382815481106118105761181061287a565b6000918252602090912001546001600160a01b0316036118d9576003611837600184612867565b815481106118475761184761287a565b600091825260209091200154600380546001600160a01b0390921691839081106118735761187361287a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060038054806118b2576118b26128f2565b600082815260209020810160001990810180546001600160a01b03191690550190556118e1565b6001016117eb565b506040516001600160a01b03841681527f54139126c26c011ab30f3af9c69f05a3903dce52aa3ee4c6a1270686b71e88bb906020016107e3565b60008281526020819052604090206001015461193681611e0d565b6108c18383611eac565b60008051602061295583398151915261195881611e0d565b600680546001600160a01b0319166001600160a01b0384169081179091556040519081527f2e979f80fe4d43055c584cf4a8467c55875ea36728fc37176c05acd784eb7a739060200160405180910390a15050565b6000805160206129758339815191526119c581611e0d565b6001600160a01b0383166000818152600a6020908152604091829020805460ff19168615159081179091558251938452908301527f5fad9775e677916452d719f68d07ee2a9f503d5b8241f877283e9be79ad4307791016107e3565b600080516020612975833981519152611a3981611e0d565b6001600160a01b0383166000818152600c6020908152604091829020805460ff19168615159081179091558251938452908301527fd429198fc76a1c7635b1c65e94c233371f4b476fb8e2f40feaa1191ee9d5aeb991016107e3565b6001600160a01b03821660009081526008602052604090205460ff1615611acf5760405163e0a3980360e01b815260040160405180910390fd5b6001600160a01b03821660009081526001602052604081205460ff1615159003611b0c5760405163350b944160e11b815260040160405180910390fd5b6001600160a01b0382166000908152600c602052604090205460ff168015611b5857506001600160a01b0382166000908152600d6020908152604080832033845290915290205460ff16155b15611b7657604051630b094f2760e31b815260040160405180910390fd5b604051632770a7eb60e21b81527f000000000000000000000000094c0e36210634c3cfa25dc11b96b562e0b07624906001600160a01b03821690639dc29fac90611bc6903390869060040161284e565b600060405180830381600087803b158015611be057600080fd5b505af1158015611bf4573d6000803e3d6000fd5b5050506001600160a01b038085166000908152600460205260409020546006549092508491168215801590611c3157506001600160a01b03811615155b15611cf9576000612710611c458588612815565b611c4f919061282c565b6040516340c10f1960e01b81529091506001600160a01b038616906340c10f1990611c80908590859060040161284e565b600060405180830381600087803b158015611c9a57600080fd5b505af1158015611cae573d6000803e3d6000fd5b505050507f55bb3cade9d43b798a4fe5ffdd05024b2d7870df53920673bfc7e68047cd0ab18282604051611ce392919061284e565b60405180910390a1611cf58184612867565b9250505b6001600160a01b038616600090815260026020526040812054611d209060ff166012612706565b611d2b90600a612806565b611d35908461282c565b9050611d428733836121ab565b604080518781526001600160a01b038916602082015290810182905233907f457f950b75085c30ff780acd57bde642ff1316cc4aad9f286af2c1ffc4163a789060600160405180910390a250505050505050565b7fb3c5930d5d9c2b6cd04d6659c775ca2da2d6d78e06e443601a84166091e6c39d611dc081611e0d565b6001600160a01b03831660009081526009602052604090819020839055517f24e2c9489e03fde4cefdbeda85ffdd248ef2d83f226d0ba74e49e0c876f3bae5906107e3908590859061284e565b611e1781336122b5565b50565b6000611e26838361155c565b611ea4576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611e5c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161075f565b50600061075f565b6000611eb8838361155c565b15611ea4576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161075f565b6001600160a01b03831660009081526001602052604081205460ff1615159003611f545760405163350b944160e11b815260040160405180910390fd5b6001600160a01b03831660009081526007602052604090205460ff1615611f8e5760405163035edea360e41b815260040160405180910390fd5b6001600160a01b038316600081815260096020526040908190205490516370a0823160e01b81523060048201529091906370a0823190602401602060405180830381865afa158015611fe4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200891906128d9565b6120129084612890565b111561203057604051628306a160e61b815260040160405180910390fd5b6001600160a01b0383166000908152600a602052604090205460ff16801561207e57506001600160a01b038084166000908152600b602090815260408083209385168352929052205460ff16155b156108fa57604051630b094f2760e31b815260040160405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916121009190612908565b6000604051808303816000865af19150503d806000811461213d576040519150601f19603f3d011682016040523d82523d6000602084013e612142565b606091505b509150915081801561216c57508051158061216c57508080602001905181019061216c9190612937565b6121a35760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b60448201526064015b60405180910390fd5b505050505050565b600080846001600160a01b031663a9059cbb60e01b85856040516024016121d392919061284e565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516122119190612908565b6000604051808303816000865af19150503d806000811461224e576040519150601f19603f3d011682016040523d82523d6000602084013e612253565b606091505b509150915081801561227d57508051158061227d57508080602001905181019061227d9190612937565b6122ae5760405162461bcd60e51b815260206004820152600260248201526114d560f21b604482015260640161219a565b5050505050565b6122bf828261155c565b6122e057808260405163e2517d3f60e01b815260040161219a92919061284e565b5050565b6000602082840312156122f657600080fd5b81356001600160e01b03198116811461230e57600080fd5b9392505050565b80356001600160a01b038116811461232c57600080fd5b919050565b60006020828403121561234357600080fd5b61230e82612315565b8015158114611e1757600080fd5b6000806040838503121561236d57600080fd5b61237683612315565b915060208301356123868161234c565b809150509250929050565b6000602082840312156123a357600080fd5b5035919050565b600080604083850312156123bd57600080fd5b823591506123cd60208401612315565b90509250929050565b600080604083850312156123e957600080fd5b6123f283612315565b946020939093013593505050565b60008060006060848603121561241557600080fd5b61241e84612315565b925061242c60208501612315565b9150604084013561243c8161234c565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561248657612486612447565b604052919050565b600067ffffffffffffffff8211156124a8576124a8612447565b5060051b60200190565b600082601f8301126124c357600080fd5b81356124d66124d18261248e565b61245d565b8082825260208201915060208360051b8601019250858311156124f857600080fd5b602085015b8381101561251c5761250e81612315565b8352602092830192016124fd565b5095945050505050565b6000806040838503121561253957600080fd5b823567ffffffffffffffff81111561255057600080fd5b61255c858286016124b2565b925050602083013567ffffffffffffffff81111561257957600080fd5b8301601f8101851361258a57600080fd5b80356125986124d18261248e565b8082825260208201915060208360051b8501019250878311156125ba57600080fd5b6020840193505b828410156125dc5783358252602093840193909101906125c1565b809450505050509250929050565b6000602082840312156125fc57600080fd5b813567ffffffffffffffff81111561261357600080fd5b61261f848285016124b2565b949350505050565b6000806040838503121561263a57600080fd5b61264383612315565b91506123cd60208401612315565b600081518084526020840193506020830160005b8281101561268c5781516001600160a01b0316865260209586019590910190600101612665565b5093949350505050565b6040815260006126a96040830185612651565b828103602084015280845180835260208301915060208601925060005b818110156126e45783518352602093840193909201916001016126c6565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561075f5761075f6126f0565b6001815b600184111561275a5780850481111561273e5761273e6126f0565b600184161561274c57908102905b60019390931c928002612723565b935093915050565b6000826127715750600161075f565b8161277e5750600061075f565b8160018114612794576002811461279e576127ba565b600191505061075f565b60ff8411156127af576127af6126f0565b50506001821b61075f565b5060208310610133831016604e8410600b84101617156127dd575081810a61075f565b6127ea600019848461271f565b80600019048211156127fe576127fe6126f0565b029392505050565b600061230e60ff841683612762565b808202811582820484141761075f5761075f6126f0565b60008261284957634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03929092168252602082015260400190565b8181038181111561075f5761075f6126f0565b634e487b7160e01b600052603260045260246000fd5b8082018082111561075f5761075f6126f0565b6000602082840312156128b557600080fd5b815160ff8116811461230e57600080fd5b60208152600061230e6020830184612651565b6000602082840312156128eb57600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b6000825160005b81811015612929576020818601810151858301520161290f565b506000920191825250919050565b60006020828403121561294957600080fd5b815161230e8161234c56fee6ad9a47fbda1dc18de1eb5eeb7d935e5e81b4748f3cfc61e233e64f8818206015df3a627bc06ddfcc673648644239a40b603eb92648c972fc171056a9890e60a2646970667358221220ff547383aecb6b7dcc9143f1515ba858fb57888bf71fb316e53199c45d91237b64736f6c634300081a0033","source_code":"// SPDX-License-Identifier: BUSL-1.1\r\npragma solidity =0.8.26 >=0.6.0 ^0.8.20;\r\n\r\n// lib/openzeppelin-contracts/contracts/access/IAccessControl.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\r\n\r\n/**\r\n * @dev External interface of AccessControl declared to support ERC165 detection.\r\n */\r\ninterface IAccessControl {\r\n    /**\r\n     * @dev The `account` is missing a role.\r\n     */\r\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\r\n\r\n    /**\r\n     * @dev The caller of a function is not the expected one.\r\n     *\r\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\r\n     */\r\n    error AccessControlBadConfirmation();\r\n\r\n    /**\r\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\r\n     *\r\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\r\n     * {RoleAdminChanged} not being emitted signaling this.\r\n     */\r\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\r\n\r\n    /**\r\n     * @dev Emitted when `account` is granted `role`.\r\n     *\r\n     * `sender` is the account that originated the contract call, an admin role\r\n     * bearer except when using {AccessControl-_setupRole}.\r\n     */\r\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\r\n\r\n    /**\r\n     * @dev Emitted when `account` is revoked `role`.\r\n     *\r\n     * `sender` is the account that originated the contract call:\r\n     *   - if using `revokeRole`, it is the admin role bearer\r\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\r\n     */\r\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\r\n\r\n    /**\r\n     * @dev Returns `true` if `account` has been granted `role`.\r\n     */\r\n    function hasRole(bytes32 role, address account) external view returns (bool);\r\n\r\n    /**\r\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\r\n     * {revokeRole}.\r\n     *\r\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\r\n     */\r\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\r\n\r\n    /**\r\n     * @dev Grants `role` to `account`.\r\n     *\r\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\r\n     * event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have ``role``'s admin role.\r\n     */\r\n    function grantRole(bytes32 role, address account) external;\r\n\r\n    /**\r\n     * @dev Revokes `role` from `account`.\r\n     *\r\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have ``role``'s admin role.\r\n     */\r\n    function revokeRole(bytes32 role, address account) external;\r\n\r\n    /**\r\n     * @dev Revokes `role` from the calling account.\r\n     *\r\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\r\n     * purpose is to provide a mechanism for accounts to lose their privileges\r\n     * if they are compromised (such as when a trusted device is misplaced).\r\n     *\r\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\r\n     * event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must be `callerConfirmation`.\r\n     */\r\n    function renounceRole(bytes32 role, address callerConfirmation) external;\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\r\n\r\n/**\r\n * @dev Standard ERC20 Errors\r\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\r\n */\r\ninterface IERC20Errors {\r\n    /**\r\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     * @param balance Current balance for the interacting account.\r\n     * @param needed Minimum amount required to perform a transfer.\r\n     */\r\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     */\r\n    error ERC20InvalidSender(address sender);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\r\n     * @param receiver Address to which tokens are being transferred.\r\n     */\r\n    error ERC20InvalidReceiver(address receiver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\r\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\r\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\r\n     * @param needed Minimum amount required to perform a transfer.\r\n     */\r\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r\n     * @param approver Address initiating an approval operation.\r\n     */\r\n    error ERC20InvalidApprover(address approver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\r\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\r\n     */\r\n    error ERC20InvalidSpender(address spender);\r\n}\r\n\r\n/**\r\n * @dev Standard ERC721 Errors\r\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\r\n */\r\ninterface IERC721Errors {\r\n    /**\r\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\r\n     * Used in balance queries.\r\n     * @param owner Address of the current owner of a token.\r\n     */\r\n    error ERC721InvalidOwner(address owner);\r\n\r\n    /**\r\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\r\n     * @param tokenId Identifier number of a token.\r\n     */\r\n    error ERC721NonexistentToken(uint256 tokenId);\r\n\r\n    /**\r\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     * @param tokenId Identifier number of a token.\r\n     * @param owner Address of the current owner of a token.\r\n     */\r\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     */\r\n    error ERC721InvalidSender(address sender);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\r\n     * @param receiver Address to which tokens are being transferred.\r\n     */\r\n    error ERC721InvalidReceiver(address receiver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\r\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\r\n     * @param tokenId Identifier number of a token.\r\n     */\r\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r\n     * @param approver Address initiating an approval operation.\r\n     */\r\n    error ERC721InvalidApprover(address approver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\r\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\r\n     */\r\n    error ERC721InvalidOperator(address operator);\r\n}\r\n\r\n/**\r\n * @dev Standard ERC1155 Errors\r\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\r\n */\r\ninterface IERC1155Errors {\r\n    /**\r\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     * @param balance Current balance for the interacting account.\r\n     * @param needed Minimum amount required to perform a transfer.\r\n     * @param tokenId Identifier number of a token.\r\n     */\r\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\r\n     * @param sender Address whose tokens are being transferred.\r\n     */\r\n    error ERC1155InvalidSender(address sender);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\r\n     * @param receiver Address to which tokens are being transferred.\r\n     */\r\n    error ERC1155InvalidReceiver(address receiver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\r\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\r\n     * @param owner Address of the current owner of a token.\r\n     */\r\n    error ERC1155MissingApprovalForAll(address operator, address owner);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r\n     * @param approver Address initiating an approval operation.\r\n     */\r\n    error ERC1155InvalidApprover(address approver);\r\n\r\n    /**\r\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\r\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\r\n     */\r\n    error ERC1155InvalidOperator(address operator);\r\n\r\n    /**\r\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\r\n     * Used in batch transfers.\r\n     * @param idsLength Length of the array of token identifiers\r\n     * @param valuesLength Length of the array of token amounts\r\n     */\r\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n    /**\r\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n     * another (`to`).\r\n     *\r\n     * Note that `value` may be zero.\r\n     */\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n    /**\r\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n     * a call to {approve}. `value` is the new allowance.\r\n     */\r\n    event Approval(address indexed owner, address indexed spender, uint256 value);\r\n\r\n    /**\r\n     * @dev Returns the value of tokens in existence.\r\n     */\r\n    function totalSupply() external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Returns the value of tokens owned by `account`.\r\n     */\r\n    function balanceOf(address account) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transfer(address to, uint256 value) external returns (bool);\r\n\r\n    /**\r\n     * @dev Returns the remaining number of tokens that `spender` will be\r\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n     * zero by default.\r\n     *\r\n     * This value changes when {approve} or {transferFrom} are called.\r\n     */\r\n    function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n    /**\r\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\r\n     * caller's tokens.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n     * that someone may use both the old and the new allowance by unfortunate\r\n     * transaction ordering. One possible solution to mitigate this race\r\n     * condition is to first reduce the spender's allowance to 0 and set the\r\n     * desired value afterwards:\r\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n     *\r\n     * Emits an {Approval} event.\r\n     */\r\n    function approve(address spender, uint256 value) external returns (bool);\r\n\r\n    /**\r\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\r\n     * allowance mechanism. `value` is then deducted from the caller's\r\n     * allowance.\r\n     *\r\n     * Returns a boolean value indicating whether the operation succeeded.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/utils/Context.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\r\n\r\n/**\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n    function _msgSender() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n\r\n    function _msgData() internal view virtual returns (bytes calldata) {\r\n        return msg.data;\r\n    }\r\n\r\n    function _contextSuffixLength() internal view virtual returns (uint256) {\r\n        return 0;\r\n    }\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\r\n\r\n/**\r\n * @dev Interface of the ERC165 standard, as defined in the\r\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\r\n *\r\n * Implementers can declare support of contract interfaces, which can then be\r\n * queried by others ({ERC165Checker}).\r\n *\r\n * For an implementation, see {ERC165}.\r\n */\r\ninterface IERC165 {\r\n    /**\r\n     * @dev Returns true if this contract implements the interface defined by\r\n     * `interfaceId`. See the corresponding\r\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\r\n     * to learn more about how these ids are created.\r\n     *\r\n     * This function call must use less than 30 000 gas.\r\n     */\r\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\r\n}\r\n\r\n// src/Errors/Errors.sol\r\n\r\n/// @dev Error for unsupported token\r\nerror UnsupportedToken();\r\n\r\n/// @dev Error for invalid parameter\r\nerror InvalidParameter();\r\n\r\n/// @dev Error for trying to remove valuable supported token\r\nerror NonEmptySupportedToken();\r\n\r\n/// @dev Error for deposit function paused\r\nerror DepositPaused();\r\n\r\n/// @dev Error for withdraw function paused\r\nerror WithdrawPaused();\r\n\r\n/// @dev Error for Bridge Capacity exceeds\r\nerror ExceedCap();\r\n\r\n/// @dev Error for fee too high\r\nerror TooHighFee();\r\n\r\n/// @dev Error for no fee recipient\r\nerror NoFeeRecipient();\r\n\r\n/// @dev Error for maximum deposit capacity reached\r\nerror CapacityReached();\r\n\r\n/// @dev Error for user not in whitelist\r\nerror NotWhitelisted();\r\n\r\n// lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\r\n\r\n/**\r\n * @dev Interface for the optional metadata functions from the ERC20 standard.\r\n */\r\ninterface IERC20Metadata is IERC20 {\r\n    /**\r\n     * @dev Returns the name of the token.\r\n     */\r\n    function name() external view returns (string memory);\r\n\r\n    /**\r\n     * @dev Returns the symbol of the token.\r\n     */\r\n    function symbol() external view returns (string memory);\r\n\r\n    /**\r\n     * @dev Returns the decimals places of the token.\r\n     */\r\n    function decimals() external view returns (uint8);\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\r\n\r\n/**\r\n * @dev Implementation of the {IERC165} interface.\r\n *\r\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\r\n * for the additional interface id that will be supported. For example:\r\n *\r\n * ```solidity\r\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\r\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\r\n * }\r\n * ```\r\n */\r\nabstract contract ERC165 is IERC165 {\r\n    /**\r\n     * @dev See {IERC165-supportsInterface}.\r\n     */\r\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\r\n        return interfaceId == type(IERC165).interfaceId;\r\n    }\r\n}\r\n\r\n// lib/v3-periphery/contracts/libraries/TransferHelper.sol\r\n\r\nlibrary TransferHelper {\r\n    /// @notice Transfers tokens from the targeted address to the given destination\r\n    /// @notice Errors with 'STF' if transfer fails\r\n    /// @param token The contract address of the token to be transferred\r\n    /// @param from The originating address from which the tokens will be transferred\r\n    /// @param to The destination address of the transfer\r\n    /// @param value The amount to be transferred\r\n    function safeTransferFrom(\r\n        address token,\r\n        address from,\r\n        address to,\r\n        uint256 value\r\n    ) internal {\r\n        (bool success, bytes memory data) =\r\n            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));\r\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');\r\n    }\r\n\r\n    /// @notice Transfers tokens from msg.sender to a recipient\r\n    /// @dev Errors with ST if transfer fails\r\n    /// @param token The contract address of the token which will be transferred\r\n    /// @param to The recipient of the transfer\r\n    /// @param value The value of the transfer\r\n    function safeTransfer(\r\n        address token,\r\n        address to,\r\n        uint256 value\r\n    ) internal {\r\n        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));\r\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');\r\n    }\r\n\r\n    /// @notice Approves the stipulated contract to spend the given allowance in the given token\r\n    /// @dev Errors with 'SA' if transfer fails\r\n    /// @param token The contract address of the token to be approved\r\n    /// @param to The target of the approval\r\n    /// @param value The amount of the given token the target will be allowed to spend\r\n    function safeApprove(\r\n        address token,\r\n        address to,\r\n        uint256 value\r\n    ) internal {\r\n        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));\r\n        require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');\r\n    }\r\n\r\n    /// @notice Transfers ETH to the recipient address\r\n    /// @dev Fails with `STE`\r\n    /// @param to The destination of the transfer\r\n    /// @param value The value to be transferred\r\n    function safeTransferETH(address to, uint256 value) internal {\r\n        (bool success, ) = to.call{value: value}(new bytes(0));\r\n        require(success, 'STE');\r\n    }\r\n}\r\n\r\n// src/Interfaces/IStoneBTC.sol\r\n\r\ninterface IStoneBTC is IERC20Metadata {\r\n    function mint(address _to, uint256 _amount) external;\r\n    function burn(address _from, uint256 _amount) external;\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/access/AccessControl.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\r\n\r\n/**\r\n * @dev Contract module that allows children to implement role-based access\r\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\r\n * members except through off-chain means by accessing the contract event logs. Some\r\n * applications may benefit from on-chain enumerability, for those cases see\r\n * {AccessControlEnumerable}.\r\n *\r\n * Roles are referred to by their `bytes32` identifier. These should be exposed\r\n * in the external API and be unique. The best way to achieve this is by\r\n * using `public constant` hash digests:\r\n *\r\n * ```solidity\r\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\r\n * ```\r\n *\r\n * Roles can be used to represent a set of permissions. To restrict access to a\r\n * function call, use {hasRole}:\r\n *\r\n * ```solidity\r\n * function foo() public {\r\n *     require(hasRole(MY_ROLE, msg.sender));\r\n *     ...\r\n * }\r\n * ```\r\n *\r\n * Roles can be granted and revoked dynamically via the {grantRole} and\r\n * {revokeRole} functions. Each role has an associated admin role, and only\r\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\r\n *\r\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\r\n * that only accounts with this role will be able to grant or revoke other\r\n * roles. More complex role relationships can be created by using\r\n * {_setRoleAdmin}.\r\n *\r\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\r\n * grant and revoke this role. Extra precautions should be taken to secure\r\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\r\n * to enforce additional security measures for this role.\r\n */\r\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\r\n    struct RoleData {\r\n        mapping(address account => bool) hasRole;\r\n        bytes32 adminRole;\r\n    }\r\n\r\n    mapping(bytes32 role => RoleData) private _roles;\r\n\r\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\r\n\r\n    /**\r\n     * @dev Modifier that checks that an account has a specific role. Reverts\r\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\r\n     */\r\n    modifier onlyRole(bytes32 role) {\r\n        _checkRole(role);\r\n        _;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC165-supportsInterface}.\r\n     */\r\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\r\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\r\n    }\r\n\r\n    /**\r\n     * @dev Returns `true` if `account` has been granted `role`.\r\n     */\r\n    function hasRole(bytes32 role, address account) public view virtual returns (bool) {\r\n        return _roles[role].hasRole[account];\r\n    }\r\n\r\n    /**\r\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\r\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\r\n     */\r\n    function _checkRole(bytes32 role) internal view virtual {\r\n        _checkRole(role, _msgSender());\r\n    }\r\n\r\n    /**\r\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\r\n     * is missing `role`.\r\n     */\r\n    function _checkRole(bytes32 role, address account) internal view virtual {\r\n        if (!hasRole(role, account)) {\r\n            revert AccessControlUnauthorizedAccount(account, role);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\r\n     * {revokeRole}.\r\n     *\r\n     * To change a role's admin, use {_setRoleAdmin}.\r\n     */\r\n    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\r\n        return _roles[role].adminRole;\r\n    }\r\n\r\n    /**\r\n     * @dev Grants `role` to `account`.\r\n     *\r\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\r\n     * event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have ``role``'s admin role.\r\n     *\r\n     * May emit a {RoleGranted} event.\r\n     */\r\n    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\r\n        _grantRole(role, account);\r\n    }\r\n\r\n    /**\r\n     * @dev Revokes `role` from `account`.\r\n     *\r\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must have ``role``'s admin role.\r\n     *\r\n     * May emit a {RoleRevoked} event.\r\n     */\r\n    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\r\n        _revokeRole(role, account);\r\n    }\r\n\r\n    /**\r\n     * @dev Revokes `role` from the calling account.\r\n     *\r\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\r\n     * purpose is to provide a mechanism for accounts to lose their privileges\r\n     * if they are compromised (such as when a trusted device is misplaced).\r\n     *\r\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\r\n     * event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller must be `callerConfirmation`.\r\n     *\r\n     * May emit a {RoleRevoked} event.\r\n     */\r\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\r\n        if (callerConfirmation != _msgSender()) {\r\n            revert AccessControlBadConfirmation();\r\n        }\r\n\r\n        _revokeRole(role, callerConfirmation);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets `adminRole` as ``role``'s admin role.\r\n     *\r\n     * Emits a {RoleAdminChanged} event.\r\n     */\r\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\r\n        bytes32 previousAdminRole = getRoleAdmin(role);\r\n        _roles[role].adminRole = adminRole;\r\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\r\n    }\r\n\r\n    /**\r\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\r\n     *\r\n     * Internal function without access restriction.\r\n     *\r\n     * May emit a {RoleGranted} event.\r\n     */\r\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\r\n        if (!hasRole(role, account)) {\r\n            _roles[role].hasRole[account] = true;\r\n            emit RoleGranted(role, account, _msgSender());\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\r\n     *\r\n     * Internal function without access restriction.\r\n     *\r\n     * May emit a {RoleRevoked} event.\r\n     */\r\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\r\n        if (hasRole(role, account)) {\r\n            _roles[role].hasRole[account] = false;\r\n            emit RoleRevoked(role, account, _msgSender());\r\n            return true;\r\n        } else {\r\n            return false;\r\n        }\r\n    }\r\n}\r\n\r\n// lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol\r\n\r\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\r\n\r\n/**\r\n * @dev Implementation of the {IERC20} interface.\r\n *\r\n * This implementation is agnostic to the way tokens are created. This means\r\n * that a supply mechanism has to be added in a derived contract using {_mint}.\r\n *\r\n * TIP: For a detailed writeup see our guide\r\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\r\n * to implement supply mechanisms].\r\n *\r\n * The default value of {decimals} is 18. To change this, you should override\r\n * this function so it returns a different value.\r\n *\r\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\r\n * instead returning `false` on failure. This behavior is nonetheless\r\n * conventional and does not conflict with the expectations of ERC20\r\n * applications.\r\n *\r\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\r\n * This allows applications to reconstruct the allowance for all accounts just\r\n * by listening to said events. Other implementations of the EIP may not emit\r\n * these events, as it isn't required by the specification.\r\n */\r\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\r\n    mapping(address account => uint256) private _balances;\r\n\r\n    mapping(address account => mapping(address spender => uint256)) private _allowances;\r\n\r\n    uint256 private _totalSupply;\r\n\r\n    string private _name;\r\n    string private _symbol;\r\n\r\n    /**\r\n     * @dev Sets the values for {name} and {symbol}.\r\n     *\r\n     * All two of these values are immutable: they can only be set once during\r\n     * construction.\r\n     */\r\n    constructor(string memory name_, string memory symbol_) {\r\n        _name = name_;\r\n        _symbol = symbol_;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the name of the token.\r\n     */\r\n    function name() public view virtual returns (string memory) {\r\n        return _name;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the symbol of the token, usually a shorter version of the\r\n     * name.\r\n     */\r\n    function symbol() public view virtual returns (string memory) {\r\n        return _symbol;\r\n    }\r\n\r\n    /**\r\n     * @dev Returns the number of decimals used to get its user representation.\r\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\r\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\r\n     *\r\n     * Tokens usually opt for a value of 18, imitating the relationship between\r\n     * Ether and Wei. This is the default value returned by this function, unless\r\n     * it's overridden.\r\n     *\r\n     * NOTE: This information is only used for _display_ purposes: it in\r\n     * no way affects any of the arithmetic of the contract, including\r\n     * {IERC20-balanceOf} and {IERC20-transfer}.\r\n     */\r\n    function decimals() public view virtual returns (uint8) {\r\n        return 18;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-totalSupply}.\r\n     */\r\n    function totalSupply() public view virtual returns (uint256) {\r\n        return _totalSupply;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-balanceOf}.\r\n     */\r\n    function balanceOf(address account) public view virtual returns (uint256) {\r\n        return _balances[account];\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-transfer}.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `to` cannot be the zero address.\r\n     * - the caller must have a balance of at least `value`.\r\n     */\r\n    function transfer(address to, uint256 value) public virtual returns (bool) {\r\n        address owner = _msgSender();\r\n        _transfer(owner, to, value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-allowance}.\r\n     */\r\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\r\n        return _allowances[owner][spender];\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-approve}.\r\n     *\r\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\r\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `spender` cannot be the zero address.\r\n     */\r\n    function approve(address spender, uint256 value) public virtual returns (bool) {\r\n        address owner = _msgSender();\r\n        _approve(owner, spender, value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev See {IERC20-transferFrom}.\r\n     *\r\n     * Emits an {Approval} event indicating the updated allowance. This is not\r\n     * required by the EIP. See the note at the beginning of {ERC20}.\r\n     *\r\n     * NOTE: Does not update the allowance if the current allowance\r\n     * is the maximum `uint256`.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `from` and `to` cannot be the zero address.\r\n     * - `from` must have a balance of at least `value`.\r\n     * - the caller must have allowance for ``from``'s tokens of at least\r\n     * `value`.\r\n     */\r\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\r\n        address spender = _msgSender();\r\n        _spendAllowance(from, spender, value);\r\n        _transfer(from, to, value);\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\r\n     *\r\n     * This internal function is equivalent to {transfer}, and can be used to\r\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     *\r\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\r\n     */\r\n    function _transfer(address from, address to, uint256 value) internal {\r\n        if (from == address(0)) {\r\n            revert ERC20InvalidSender(address(0));\r\n        }\r\n        if (to == address(0)) {\r\n            revert ERC20InvalidReceiver(address(0));\r\n        }\r\n        _update(from, to, value);\r\n    }\r\n\r\n    /**\r\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\r\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\r\n     * this function.\r\n     *\r\n     * Emits a {Transfer} event.\r\n     */\r\n    function _update(address from, address to, uint256 value) internal virtual {\r\n        if (from == address(0)) {\r\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\r\n            _totalSupply += value;\r\n        } else {\r\n            uint256 fromBalance = _balances[from];\r\n            if (fromBalance < value) {\r\n                revert ERC20InsufficientBalance(from, fromBalance, value);\r\n            }\r\n            unchecked {\r\n                // Overflow not possible: value <= fromBalance <= totalSupply.\r\n                _balances[from] = fromBalance - value;\r\n            }\r\n        }\r\n\r\n        if (to == address(0)) {\r\n            unchecked {\r\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\r\n                _totalSupply -= value;\r\n            }\r\n        } else {\r\n            unchecked {\r\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\r\n                _balances[to] += value;\r\n            }\r\n        }\r\n\r\n        emit Transfer(from, to, value);\r\n    }\r\n\r\n    /**\r\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\r\n     * Relies on the `_update` mechanism\r\n     *\r\n     * Emits a {Transfer} event with `from` set to the zero address.\r\n     *\r\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\r\n     */\r\n    function _mint(address account, uint256 value) internal {\r\n        if (account == address(0)) {\r\n            revert ERC20InvalidReceiver(address(0));\r\n        }\r\n        _update(address(0), account, value);\r\n    }\r\n\r\n    /**\r\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\r\n     * Relies on the `_update` mechanism.\r\n     *\r\n     * Emits a {Transfer} event with `to` set to the zero address.\r\n     *\r\n     * NOTE: This function is not virtual, {_update} should be overridden instead\r\n     */\r\n    function _burn(address account, uint256 value) internal {\r\n        if (account == address(0)) {\r\n            revert ERC20InvalidSender(address(0));\r\n        }\r\n        _update(account, address(0), value);\r\n    }\r\n\r\n    /**\r\n     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\r\n     *\r\n     * This internal function is equivalent to `approve`, and can be used to\r\n     * e.g. set automatic allowances for certain subsystems, etc.\r\n     *\r\n     * Emits an {Approval} event.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - `owner` cannot be the zero address.\r\n     * - `spender` cannot be the zero address.\r\n     *\r\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\r\n     */\r\n    function _approve(address owner, address spender, uint256 value) internal {\r\n        _approve(owner, spender, value, true);\r\n    }\r\n\r\n    /**\r\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\r\n     *\r\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\r\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\r\n     * `Approval` event during `transferFrom` operations.\r\n     *\r\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\r\n     * true using the following override:\r\n     * ```\r\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\r\n     *     super._approve(owner, spender, value, true);\r\n     * }\r\n     * ```\r\n     *\r\n     * Requirements are the same as {_approve}.\r\n     */\r\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\r\n        if (owner == address(0)) {\r\n            revert ERC20InvalidApprover(address(0));\r\n        }\r\n        if (spender == address(0)) {\r\n            revert ERC20InvalidSpender(address(0));\r\n        }\r\n        _allowances[owner][spender] = value;\r\n        if (emitEvent) {\r\n            emit Approval(owner, spender, value);\r\n        }\r\n    }\r\n\r\n    /**\r\n     * @dev Updates `owner` s allowance for `spender` based on spent `value`.\r\n     *\r\n     * Does not update the allowance value in case of infinite allowance.\r\n     * Revert if not enough allowance is available.\r\n     *\r\n     * Does not emit an {Approval} event.\r\n     */\r\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\r\n        uint256 currentAllowance = allowance(owner, spender);\r\n        if (currentAllowance != type(uint256).max) {\r\n            if (currentAllowance < value) {\r\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\r\n            }\r\n            unchecked {\r\n                _approve(owner, spender, currentAllowance - value, false);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n// src/StoneBTCVault.sol\r\n\r\ncontract StoneBTCVault is AccessControl {\r\n    bytes32 public constant SUPPORTED_TOKEN_OPERATION_ROLE = keccak256(\"SUPPORTED_TOKEN_OPERATION_ROLE\");\r\n    bytes32 public constant FEE_SETTER_ROLE = keccak256(\"FEE_SETTER_ROLE\");\r\n    bytes32 public constant PAUSE_OPERATION_ROLE = keccak256(\"PAUSE_OPERATION_ROLE\");\r\n    bytes32 public constant CAPACITY_SETTER_ROLE = keccak256(\"CAPACITY_SETTER_ROLE\");\r\n    bytes32 public constant WHITELIST_OPERATION_ROLE = keccak256(\"WHITELIST_OPERATION_ROLE\");\r\n\r\n    address public immutable stoneBTC;\r\n    mapping(address => bool) public supportedTokens;\r\n    mapping(address => uint8) public tokenDecimals;\r\n    address[] public supportedTokensArray;\r\n    \r\n    uint256 public constant FEE_BASE = 10000;\r\n    uint256 public constant MAX_FEE_RATE = 100;\r\n    mapping(address => uint256) public withdrawFeeRate;\r\n    mapping(address => uint256) public depositFeeRate;\r\n    address public feeRecipient;\r\n\r\n    mapping(address => bool) public depositPaused;\r\n    mapping(address => bool) public withdrawPaused;\r\n\r\n    mapping(address => uint256) public depositCapacity;\r\n\r\n    mapping(address => bool) public whitelistMode;\r\n    mapping(address => mapping(address => bool)) public depositWhitelist;\r\n\r\n    mapping(address => bool) public withdrawWhitelistMode;\r\n    mapping(address => mapping(address => bool)) public withdrawWhitelist;\r\n\r\n    event AddSupportedTokens(address[] tokens);\r\n    event RemoveSupportedToken(address token);\r\n    event Deposit(address indexed account, address token, uint256 tokenAmount);\r\n    event Withdraw(address indexed account, uint256 stoneAmount, address token, uint256 tokenAmount);\r\n    event SetDepositPause(bool paused);\r\n    event SetWithdrawPause(bool paused);\r\n    event SetWithdrawFeeRate(address token, uint256 rate);\r\n    event SetDepositFeeRate(address token, uint256 rate);\r\n    event SetFeeRecipient(address recipient);\r\n    event FeeCharged(address recipient, uint256 amount);\r\n    event SetDepositCapacity(address token, uint256 maximum);\r\n    event SetWhitelistMode(address token, bool whitelistMode);\r\n    event SetWhitelist(address token, address user, bool allowed);\r\n    event SetWithdrawWhitelistMode(address token, bool whitelistMode);\r\n    event SetWithdrawWhitelist(address token, address user, bool allowed);\r\n\r\n    constructor(\r\n        address _stoneBTC\r\n    ) {\r\n        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\r\n        stoneBTC = _stoneBTC;\r\n    }\r\n\r\n    // public functions\r\n\r\n    function deposit(\r\n        address _token,\r\n        uint256 _amount\r\n    ) external {\r\n        _checkDepositAllowed(_token, _amount, msg.sender);\r\n\r\n        TransferHelper.safeTransferFrom(_token, msg.sender, address(this), _amount);\r\n\r\n        IStoneBTC stone = IStoneBTC(stoneBTC);\r\n        uint256 mintAmount = _amount * 10**(18-tokenDecimals[_token]);\r\n        uint256 feeRate = depositFeeRate[_token];\r\n        address recipient = feeRecipient;\r\n        if (feeRate > 0 && recipient != address(0)) {\r\n            uint256 feeAmount = mintAmount * feeRate / FEE_BASE;\r\n            stone.mint(recipient, feeAmount);\r\n            emit FeeCharged(recipient, feeAmount);\r\n            mintAmount = mintAmount - feeAmount;\r\n        }\r\n\r\n        stone.mint(msg.sender, mintAmount);\r\n        emit Deposit(msg.sender, _token, _amount);\r\n    }\r\n\r\n    function depositMultiple(\r\n        address[] memory _tokens,\r\n        uint256[] memory _amounts\r\n    ) external {\r\n        uint256 totalMintAmount;\r\n        uint256 totalFeeAmount;\r\n        address recipient = feeRecipient;\r\n        IStoneBTC stone = IStoneBTC(stoneBTC);\r\n        uint256 length = _tokens.length;\r\n        for (uint256 i; i < length;) {\r\n            address token = _tokens[i];\r\n            uint256 amount = _amounts[i];\r\n\r\n            _checkDepositAllowed(token, amount, msg.sender);\r\n            \r\n            TransferHelper.safeTransferFrom(token, msg.sender, address(this), amount);\r\n            uint256 mintAmount = amount * 10**(18-tokenDecimals[token]);\r\n\r\n            uint256 feeRate = depositFeeRate[token];\r\n            if (feeRate > 0 && recipient != address(0)) {\r\n                uint256 feeAmount = mintAmount * feeRate / FEE_BASE;\r\n                totalFeeAmount = totalFeeAmount + feeAmount;\r\n                mintAmount = mintAmount - feeAmount;\r\n            }\r\n            \r\n            totalMintAmount = totalMintAmount + mintAmount;\r\n            emit Deposit(msg.sender, token, amount);\r\n\r\n            unchecked { ++i; }\r\n        }\r\n        IStoneBTC(stoneBTC).mint(msg.sender, totalMintAmount);\r\n        if (totalFeeAmount > 0) {\r\n            stone.mint(recipient, totalFeeAmount);\r\n            emit FeeCharged(recipient, totalFeeAmount);\r\n        }\r\n    }\r\n\r\n    function withdraw(\r\n        address _token,\r\n        uint256 _stoneBTCAmount\r\n    ) external {\r\n        if (withdrawPaused[_token]) revert WithdrawPaused();\r\n        if (supportedTokens[_token] == false) revert UnsupportedToken();\r\n        if (withdrawWhitelistMode[_token] && !withdrawWhitelist[_token][msg.sender]) revert NotWhitelisted();\r\n\r\n        IStoneBTC stone = IStoneBTC(stoneBTC);\r\n        stone.burn(msg.sender, _stoneBTCAmount);\r\n        uint256 feeRate = withdrawFeeRate[_token];\r\n        uint256 remainingAmount = _stoneBTCAmount;\r\n        address recipient = feeRecipient;\r\n        if (feeRate > 0 && recipient != address(0)) {\r\n            uint256 feeAmount = _stoneBTCAmount * feeRate / FEE_BASE;\r\n            stone.mint(recipient, feeAmount);\r\n            emit FeeCharged(recipient, feeAmount);\r\n            remainingAmount = remainingAmount - feeAmount;\r\n        }\r\n        uint256 tokenAmount = remainingAmount / (10**(18-tokenDecimals[_token]));\r\n        TransferHelper.safeTransfer(_token, msg.sender, tokenAmount);\r\n        emit Withdraw(msg.sender, _stoneBTCAmount, _token, tokenAmount);\r\n    }\r\n\r\n    function withdrawMultiple(\r\n        address[] memory _tokens,\r\n        uint256[] memory _stoneBTCAmounts\r\n    ) external {\r\n        uint256 totalBurnAmount;\r\n        uint256 totalFeeAmount;\r\n        address recipient = feeRecipient;\r\n        uint256 length = _tokens.length;\r\n        for (uint256 i; i < length;) {\r\n            address token = _tokens[i];\r\n            if (withdrawPaused[token]) revert WithdrawPaused();\r\n            if (supportedTokens[token] == false) revert UnsupportedToken();\r\n            if (withdrawWhitelistMode[token] && !withdrawWhitelist[token][msg.sender]) revert NotWhitelisted();\r\n\r\n            uint256 stoneAmount = _stoneBTCAmounts[i];\r\n            totalBurnAmount = totalBurnAmount + stoneAmount;\r\n\r\n            uint256 feeRate = withdrawFeeRate[token];\r\n            uint256 remainingAmount = stoneAmount;\r\n            if (feeRate > 0 && recipient != address(0)) {\r\n                uint256 feeAmount = stoneAmount * feeRate / FEE_BASE;\r\n                totalFeeAmount = totalFeeAmount + feeAmount;\r\n                remainingAmount = stoneAmount - feeAmount;\r\n            }\r\n            uint256 tokenAmount = remainingAmount / (10**(18-tokenDecimals[token]));\r\n            TransferHelper.safeTransfer(token, msg.sender, tokenAmount);\r\n            emit Withdraw(msg.sender, stoneAmount, token, tokenAmount);\r\n\r\n            unchecked { ++i; }\r\n        }\r\n        IStoneBTC stone = IStoneBTC(stoneBTC);\r\n        stone.burn(msg.sender, totalBurnAmount);\r\n        if (totalFeeAmount > 0) {\r\n            stone.mint(recipient, totalFeeAmount);\r\n            emit FeeCharged(recipient, totalFeeAmount);\r\n        }\r\n    }\r\n\r\n    // internal functions\r\n\r\n    function _checkDepositAllowed(address _token, uint256 _amount, address _user) internal view {\r\n        if (supportedTokens[_token] == false) revert UnsupportedToken();\r\n        if (depositPaused[_token]) revert DepositPaused();\r\n        if (_amount + ERC20(_token).balanceOf(address(this)) > depositCapacity[_token]) revert CapacityReached();\r\n        if (whitelistMode[_token] && !depositWhitelist[_token][_user]) revert NotWhitelisted();\r\n    }\r\n\r\n    // view functions\r\n\r\n    function getDepositAmounts() external view returns (address[] memory, uint256[] memory) {\r\n        uint256 l = supportedTokensArray.length;\r\n        address[] memory tokens = new address[](l);\r\n        uint256[] memory amounts = new uint256[](l);\r\n\r\n        for (uint256 i; i < l;) {\r\n            address _token = supportedTokensArray[i];\r\n            tokens[i] = _token;\r\n            amounts[i] = ERC20(_token).balanceOf(address(this));\r\n            unchecked { ++i; }\r\n        }\r\n        return (tokens, amounts);\r\n    }\r\n\r\n    // owner functions\r\n\r\n    function addSupportedTokens(\r\n        address[] memory _supportedTokens\r\n    ) external onlyRole(SUPPORTED_TOKEN_OPERATION_ROLE) {\r\n        uint256 length = _supportedTokens.length;\r\n        for (uint256 i; i < length;) {\r\n            address token = _supportedTokens[i];\r\n            if (supportedTokens[token] == true) revert InvalidParameter(); \r\n            supportedTokens[token] = true;\r\n            supportedTokensArray.push(token);\r\n            tokenDecimals[token] = ERC20(token).decimals();\r\n            unchecked { ++i; }\r\n        }\r\n        emit AddSupportedTokens(_supportedTokens);\r\n    }\r\n\r\n    function removeSupportedTokens(\r\n        address _token\r\n    ) external onlyRole(SUPPORTED_TOKEN_OPERATION_ROLE) {\r\n\r\n        if (ERC20(_token).balanceOf(address(this)) != 0) revert NonEmptySupportedToken();\r\n\r\n        delete supportedTokens[_token];\r\n        uint256 length = supportedTokensArray.length;\r\n        for (uint256 i; i < length;) {\r\n            if (supportedTokensArray[i] == _token) {\r\n                supportedTokensArray[i] = supportedTokensArray[length-1];\r\n                supportedTokensArray.pop();\r\n                break;\r\n            }\r\n            unchecked { ++i; }\r\n        }\r\n        emit RemoveSupportedToken(_token);\r\n    }\r\n\r\n    function setWithdrawFeeRate(address _token, uint256 _rate) external onlyRole(FEE_SETTER_ROLE) {\r\n        if (_rate > 0 && feeRecipient == address(0)) revert NoFeeRecipient();\r\n        if (_rate > MAX_FEE_RATE) revert TooHighFee();\r\n        withdrawFeeRate[_token] = _rate;\r\n        emit SetWithdrawFeeRate(_token, _rate);\r\n    }\r\n\r\n    function setDepositFeeRate(address _token, uint256 _rate) external onlyRole(FEE_SETTER_ROLE) {\r\n        if (_rate > 0 && feeRecipient == address(0)) revert NoFeeRecipient();\r\n        if (_rate > MAX_FEE_RATE) revert TooHighFee();\r\n        depositFeeRate[_token] = _rate;\r\n        emit SetDepositFeeRate(_token, _rate);\r\n    }\r\n\r\n    function setFeeRecipient(address _address) external onlyRole(FEE_SETTER_ROLE) {\r\n        feeRecipient = _address;\r\n        emit SetFeeRecipient(_address);\r\n    }\r\n\r\n    function setDepositPause(address _token, bool _pause) external onlyRole(PAUSE_OPERATION_ROLE) {\r\n        depositPaused[_token] = _pause;\r\n        emit SetDepositPause(_pause);\r\n    }\r\n\r\n    function setWithdrawPause(address _token, bool _pause) external onlyRole(PAUSE_OPERATION_ROLE) {\r\n        withdrawPaused[_token] = _pause;\r\n        emit SetWithdrawPause(_pause);\r\n    }\r\n\r\n    function setDepositCapacity(address _token, uint256 _maximum) external onlyRole(CAPACITY_SETTER_ROLE) {\r\n        depositCapacity[_token] = _maximum;\r\n        emit SetDepositCapacity(_token, _maximum);\r\n    }\r\n\r\n    function setWhitelistMode(address _token, bool _applyWhitelist) external onlyRole(WHITELIST_OPERATION_ROLE) {\r\n        whitelistMode[_token] = _applyWhitelist;\r\n        emit SetWhitelistMode(_token, _applyWhitelist);\r\n    }\r\n\r\n    function setWhitelistAddress(address _token, address _minter, bool _allowed) external onlyRole(WHITELIST_OPERATION_ROLE) {\r\n        depositWhitelist[_token][_minter] = _allowed;\r\n        emit SetWhitelist(_token, _minter, _allowed);\r\n    }\r\n\r\n    function setWithdrawWhitelistMode(address _token, bool _applyWhitelist) external onlyRole(WHITELIST_OPERATION_ROLE) {\r\n        withdrawWhitelistMode[_token] = _applyWhitelist;\r\n        emit SetWithdrawWhitelistMode(_token, _applyWhitelist);\r\n    }\r\n\r\n    function setWithdrawWhitelistAddress(address _token, address _minter, bool _allowed) external onlyRole(WHITELIST_OPERATION_ROLE) {\r\n        withdrawWhitelist[_token][_minter] = _allowed;\r\n        emit SetWithdrawWhitelist(_token, _minter, _allowed);\r\n    }\r\n}","creation_status":"success","file_path":"StoneBTCVault.sol"}