From da7f19eb1978088723b84221fcc152ca611b087b Mon Sep 17 00:00:00 2001 From: ioay Date: Sun, 11 Feb 2024 20:15:29 +0100 Subject: [PATCH 01/11] AcreSDK: current position --- sdk/src/lib/contracts/index.ts | 3 +++ sdk/src/lib/contracts/stbtc.ts | 7 ++++++ sdk/src/lib/ethereum/index.ts | 4 +++- sdk/src/lib/ethereum/stbtc.ts | 39 ++++++++++++++++++++++++++++++++ sdk/src/modules/staking/index.ts | 8 +++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 sdk/src/lib/contracts/stbtc.ts create mode 100644 sdk/src/lib/ethereum/stbtc.ts diff --git a/sdk/src/lib/contracts/index.ts b/sdk/src/lib/contracts/index.ts index 72912b2b8..b54f81720 100644 --- a/sdk/src/lib/contracts/index.ts +++ b/sdk/src/lib/contracts/index.ts @@ -1,11 +1,14 @@ import { TBTCDepositor } from "./tbtc-depositor" +import { StBTC } from "./stbtc" export * from "./tbtc-depositor" export * from "./chain-identifier" +export * from "./stbtc" /** * Represents all contracts that allow interaction with the Acre network. */ export type AcreContracts = { tbtcDepositor: TBTCDepositor + stBTC: StBTC } diff --git a/sdk/src/lib/contracts/stbtc.ts b/sdk/src/lib/contracts/stbtc.ts new file mode 100644 index 000000000..55710eb3e --- /dev/null +++ b/sdk/src/lib/contracts/stbtc.ts @@ -0,0 +1,7 @@ +import { ChainIdentifier } from "./chain-identifier" + +export interface StBTC { + balanceOf(identifier: ChainIdentifier): Promise + + assetsBalanceOf(identifier: ChainIdentifier): Promise +} diff --git a/sdk/src/lib/ethereum/index.ts b/sdk/src/lib/ethereum/index.ts index 0ba72c581..dd1ffd487 100644 --- a/sdk/src/lib/ethereum/index.ts +++ b/sdk/src/lib/ethereum/index.ts @@ -2,6 +2,7 @@ import { AcreContracts } from "../contracts" import { EthereumSigner } from "./contract" import { EthereumTBTCDepositor } from "./tbtc-depositor" import { EthereumNetwork } from "./network" +import EtherumStBTC from "./stbtc" export * from "./eip712-signer" export * from "./address" @@ -12,8 +13,9 @@ function getEthereumContracts( network: EthereumNetwork, ): AcreContracts { const tbtcDepositor = new EthereumTBTCDepositor({ signer }, network) + const stBTC = new EtherumStBTC({ signer }, network) - return { tbtcDepositor } + return { tbtcDepositor, stBTC } } export { EthereumTBTCDepositor, getEthereumContracts, EthereumNetwork } diff --git a/sdk/src/lib/ethereum/stbtc.ts b/sdk/src/lib/ethereum/stbtc.ts new file mode 100644 index 000000000..f69802abd --- /dev/null +++ b/sdk/src/lib/ethereum/stbtc.ts @@ -0,0 +1,39 @@ +import { + EthersContractConfig, + EthersContractDeployment, + EthersContractWrapper, +} from "./contract" +import { ChainIdentifier, StBTC } from "../contracts" + +import SepoliaTbtcDepositor from "./artifacts/sepolia/TbtcDepositor.json" +import { EthereumNetwork } from "./network" + +export default class EtherumStBTC + // @ts-expect-error TODO: Figure out why type generated by typechain does not + // satisfy the constraint `Contract`. Error: `Property '[internal]' is missing + // in type 'StBTC' but required in type 'BaseContract'`. + extends EthersContractWrapper +{ + constructor(config: EthersContractConfig, network: EthereumNetwork) { + let artifact: EthersContractDeployment + + switch (network) { + case "sepolia": + artifact = SepoliaTbtcDepositor + break + case "mainnet": + default: + throw new Error("Unsupported network") + } + + super(config, artifact) + } + + balanceOf(identifier: ChainIdentifier): Promise { + return this.instance.balanceOf(identifier) + } + + assetsBalanceOf(identifier: ChainIdentifier): Promise { + return this.instance.assetsBalanceOf(identifier) + } +} diff --git a/sdk/src/modules/staking/index.ts b/sdk/src/modules/staking/index.ts index 610d57530..3d216d572 100644 --- a/sdk/src/modules/staking/index.ts +++ b/sdk/src/modules/staking/index.ts @@ -60,6 +60,14 @@ class StakingModule { deposit, ) } + + balanceOf(identifier: ChainIdentifier) { + return this.#contracts.stBTC.balanceOf(identifier) + } + + assetsBalanceOf(identifier: ChainIdentifier) { + return this.#contracts.stBTC.assetsBalanceOf(identifier) + } } export { StakingModule, StakeInitialization } From d058fa2a36e40ca121742811b7372fb300b01acd Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 14 Feb 2024 19:09:54 +0100 Subject: [PATCH 02/11] Updated EthereumStBTC class --- core/deployments/sepolia/stBTC.json | 1748 +++++++++++++++++++++++++++ sdk/src/lib/ethereum/index.ts | 4 +- sdk/src/lib/ethereum/stbtc.ts | 26 +- 3 files changed, 1769 insertions(+), 9 deletions(-) create mode 100644 core/deployments/sepolia/stBTC.json diff --git a/core/deployments/sepolia/stBTC.json b/core/deployments/sepolia/stBTC.json new file mode 100644 index 000000000..67cfa0e35 --- /dev/null +++ b/core/deployments/sepolia/stBTC.json @@ -0,0 +1,1748 @@ +{ + "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_tbtc", + "type": "address" + }, + { + "internalType": "address", + "name": "_treasury", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "DisallowedAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxRedeem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + } + ], + "name": "LessThanMinDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "MathOverflowedMulDiv", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minimumDepositAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maximumTotalAssets", + "type": "uint256" + } + ], + "name": "DepositParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldDispatcher", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newDispatcher", + "type": "address" + } + ], + "name": "DispatcherUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "entryFeeBasisPoints", + "type": "uint256" + } + ], + "name": "EntryFeeBasisPointsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "StakeReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "treasury", + "type": "address" + } + ], + "name": "TreasuryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "convertToAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "convertToShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depositParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dispatcher", + "outputs": [ + { + "internalType": "contract Dispatcher", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "entryFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "maxMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumTotalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumDepositAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "stake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumDepositAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maximumTotalAssets", + "type": "uint256" + } + ], + "name": "updateDepositParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Dispatcher", + "name": "newDispatcher", + "type": "address" + } + ], + "name": "updateDispatcher", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newEntryFeeBasisPoints", + "type": "uint256" + } + ], + "name": "updateEntryFeeBasisPoints", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasury", + "type": "address" + } + ], + "name": "updateTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "receipt": { + "to": null, + "from": "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8", + "contractAddress": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "transactionIndex": 82, + "gasUsed": "1951493", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000400000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000012000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e", + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "logs": [ + { + "transactionIndex": 82, + "blockNumber": 5206357, + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002d154a5c7ce9939274b89bbce9f5b069e57b09a8" + ], + "data": "0x", + "logIndex": 230, + "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e" + } + ], + "blockNumber": 5206357, + "cumulativeGasUsed": "13353873", + "status": 1, + "byzantium": true + }, + "args": [ + "0x517f2982701695D4E52f1ECFBEf3ba31Df470161", + "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8" + ], + "numDeployments": 1, + "solcInputHash": "b22c277b248ba02f9ec5bf62d176f9ce", + "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_tbtc\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisallowedAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"LessThanMinDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumDepositAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"DispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"EntryFeeBasisPointsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"StakeReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dispatcher\",\"outputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"entryFeeBasisPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTotalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumDepositAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"}],\"name\":\"stake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDepositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"updateDispatcher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newEntryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"updateEntryFeeBasisPoints\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"params\":{\"amount\":\"Amount to check.\",\"min\":\"Minimum amount to check 'amount' against.\"}}],\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DepositParametersUpdated(uint256,uint256)\":{\"params\":{\"maximumTotalAssets\":\"New value of the maximum total assets amount.\",\"minimumDepositAmount\":\"New value of the minimum deposit amount.\"}},\"DispatcherUpdated(address,address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\",\"oldDispatcher\":\"Address of the old dispatcher contract.\"}},\"EntryFeeBasisPointsUpdated(uint256)\":{\"params\":{\"entryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"StakeReferral(uint16,uint256)\":{\"params\":{\"assets\":\"Amount of tBTC tokens staked.\",\"referral\":\"Used for referral program.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"TreasuryUpdated(address)\":{\"params\":{\"treasury\":\"New treasury wallet address.\"}}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.\",\"receiver\":\"The address to which the shares will be minted.\"},\"returns\":{\"_0\":\"Minted shares adjusted for the fees taken by the treasury.\"}},\"depositParameters()\":{\"returns\":{\"_0\":\"Returns deposit parameters.\"}},\"maxDeposit(address)\":{\"returns\":{\"_0\":\"The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver.\"}},\"maxMint(address)\":{\"details\":\"Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.\",\"returns\":{\"_0\":\"The maximum amount of the vault shares.\"}},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.\",\"params\":{\"receiver\":\"The address to which the shares will be minted.\",\"shares\":\"Amount of shares to mint.\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"previewDeposit(uint256)\":{\"details\":\"Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\"},\"previewMint(uint256)\":{\"details\":\"Preview adding an entry fee on mint. See {IERC4626-previewMint}.\"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"stake(uint256,address,uint16)\":{\"details\":\"This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount for the transfer and stake.\",\"receiver\":\"The address to which the shares will be minted.\",\"referral\":\"Data used for referral program.\"},\"returns\":{\"_0\":\"shares Minted shares.\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateDepositParameters(uint256,uint256)\":{\"details\":\"To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).\",\"params\":{\"_maximumTotalAssets\":\"New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.\",\"_minimumDepositAmount\":\"New value of the minimum deposit amount. It is the minimum amount for a single deposit operation.\"}},\"updateDispatcher(address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\"}},\"updateEntryFeeBasisPoints(uint256)\":{\"params\":{\"newEntryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"updateTreasury(address)\":{\"params\":{\"newTreasury\":\"New treasury wallet address.\"}},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"stBTC\",\"version\":1},\"userdoc\":{\"errors\":{\"DisallowedAddress()\":[{\"notice\":\"Reverts if the address is disallowed.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"notice\":\"Reverts if the amount is less than the minimum deposit amount.\"}],\"ZeroAddress()\":[{\"notice\":\"Reverts if the address is zero.\"}]},\"events\":{\"DepositParametersUpdated(uint256,uint256)\":{\"notice\":\"Emitted when deposit parameters are updated.\"},\"DispatcherUpdated(address,address)\":{\"notice\":\"Emitted when the dispatcher contract is updated.\"},\"EntryFeeBasisPointsUpdated(uint256)\":{\"notice\":\"Emitted when the entry fee basis points are updated.\"},\"StakeReferral(uint16,uint256)\":{\"notice\":\"Emitted when a referral is used.\"},\"TreasuryUpdated(address)\":{\"notice\":\"Emitted when the treasury wallet address is updated.\"}},\"kind\":\"user\",\"methods\":{\"deposit(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing exactly amount of tBTC tokens.\"},\"dispatcher()\":{\"notice\":\"Dispatcher contract that routes tBTC from stBTC to a given vault and back.\"},\"entryFeeBasisPoints()\":{\"notice\":\"Entry fee basis points applied to entry fee calculation.\"},\"maxDeposit(address)\":{\"notice\":\"Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0.\"},\"maxMint(address)\":{\"notice\":\"Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call.\"},\"maximumTotalAssets()\":{\"notice\":\"Maximum total amount of tBTC token held by Acre protocol.\"},\"minimumDepositAmount()\":{\"notice\":\"Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract.\"},\"mint(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing tBTC tokens.\"},\"stake(uint256,address,uint16)\":{\"notice\":\"Stakes a given amount of tBTC token and mints shares to a receiver.\"},\"treasury()\":{\"notice\":\"Address of the treasury wallet, where fees should be transferred to.\"},\"updateDepositParameters(uint256,uint256)\":{\"notice\":\"Updates deposit parameters.\"},\"updateDispatcher(address)\":{\"notice\":\"Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC.\"},\"updateEntryFeeBasisPoints(uint256)\":{\"notice\":\"Update the entry fee basis points.\"},\"updateTreasury(address)\":{\"notice\":\"Updates treasury wallet address.\"}},\"notice\":\"This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \\\"shares\\\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/stBTC.sol\":\"stBTC\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"./extensions/IERC20Metadata.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n */\\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\\n mapping(address account => uint256) private _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n _totalSupply += value;\\n } else {\\n uint256 fromBalance = _balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n _balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n _totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n _balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n * ```\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n _allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3e1fa9d1987f8d349dfb4d6fe93bf2ca014b52ba335cfac30bfe71e357e6f80\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20, IERC20Metadata, ERC20} from \\\"../ERC20.sol\\\";\\nimport {SafeERC20} from \\\"../utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"../../../interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"../../../utils/math/Math.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\\n * expensive than it is profitable. More details about the underlying math can be found\\n * xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626 is ERC20, IERC4626 {\\n using Math for uint256;\\n\\n IERC20 private immutable _asset;\\n uint8 private immutable _underlyingDecimals;\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\\n */\\n constructor(IERC20 asset_) {\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n _underlyingDecimals = success ? assetDecimals : 18;\\n _asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {\\n return _underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n return address(_asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n return _asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}.\\n *\\n * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\\n * In this case, the shares will be minted without requiring any assets to be deposited.\\n */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer(_asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x1837547e04d5fe5334eeb77a345683c22995f1e7aa033020757ddf83a80fc72d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {FailedInnerCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\\n * unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {FailedInnerCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x75a4ee64c68dbd5f38bddd06e664a64c8271b4caa554fb6f0607dfd672bb4bf3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Muldiv operation overflow.\\n */\\n error MathOverflowedMulDiv();\\n\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n return a / b;\\n }\\n\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n revert MathOverflowedMulDiv();\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\"},\"contracts/Dispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport \\\"./Router.sol\\\";\\nimport \\\"./stBTC.sol\\\";\\n\\n/// @title Dispatcher\\n/// @notice Dispatcher is a contract that routes tBTC from stBTC to\\n/// yield vaults and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\ncontract Dispatcher is Router, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Struct holds information about a vault.\\n struct VaultInfo {\\n bool authorized;\\n }\\n\\n /// The main stBTC contract holding tBTC deposited by stakers.\\n stBTC public immutable stbtc;\\n /// tBTC token contract.\\n IERC20 public immutable tbtc;\\n /// Address of the maintainer bot.\\n address public maintainer;\\n\\n /// Authorized Yield Vaults that implement ERC4626 standard. These\\n /// vaults deposit assets to yield strategies, e.g. Uniswap V3\\n /// WBTC/TBTC pool. Vault can be a part of Acre ecosystem or can be\\n /// implemented externally. As long as it complies with ERC4626\\n /// standard and is authorized by the owner it can be plugged into\\n /// Acre.\\n address[] public vaults;\\n /// Mapping of vaults to their information.\\n mapping(address => VaultInfo) public vaultsInfo;\\n\\n /// Emitted when a vault is authorized.\\n /// @param vault Address of the vault.\\n event VaultAuthorized(address indexed vault);\\n\\n /// Emitted when a vault is deauthorized.\\n /// @param vault Address of the vault.\\n event VaultDeauthorized(address indexed vault);\\n\\n /// Emitted when tBTC is routed to a vault.\\n /// @param vault Address of the vault.\\n /// @param amount Amount of tBTC.\\n /// @param sharesOut Amount of received shares.\\n event DepositAllocated(\\n address indexed vault,\\n uint256 amount,\\n uint256 sharesOut\\n );\\n\\n /// Emitted when the maintainer address is updated.\\n /// @param maintainer Address of the new maintainer.\\n event MaintainerUpdated(address indexed maintainer);\\n\\n /// Reverts if the vault is already authorized.\\n error VaultAlreadyAuthorized();\\n\\n /// Reverts if the vault is not authorized.\\n error VaultUnauthorized();\\n\\n /// Reverts if the caller is not the maintainer.\\n error NotMaintainer();\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Modifier that reverts if the caller is not the maintainer.\\n modifier onlyMaintainer() {\\n if (msg.sender != maintainer) {\\n revert NotMaintainer();\\n }\\n _;\\n }\\n\\n constructor(stBTC _stbtc, IERC20 _tbtc) Ownable(msg.sender) {\\n stbtc = _stbtc;\\n tbtc = _tbtc;\\n }\\n\\n /// @notice Adds a vault to the list of authorized vaults.\\n /// @param vault Address of the vault to add.\\n function authorizeVault(address vault) external onlyOwner {\\n if (isVaultAuthorized(vault)) {\\n revert VaultAlreadyAuthorized();\\n }\\n\\n vaults.push(vault);\\n vaultsInfo[vault].authorized = true;\\n\\n emit VaultAuthorized(vault);\\n }\\n\\n /// @notice Removes a vault from the list of authorized vaults.\\n /// @param vault Address of the vault to remove.\\n function deauthorizeVault(address vault) external onlyOwner {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n vaultsInfo[vault].authorized = false;\\n\\n for (uint256 i = 0; i < vaults.length; i++) {\\n if (vaults[i] == vault) {\\n vaults[i] = vaults[vaults.length - 1];\\n // slither-disable-next-line costly-loop\\n vaults.pop();\\n break;\\n }\\n }\\n\\n emit VaultDeauthorized(vault);\\n }\\n\\n /// @notice Updates the maintainer address.\\n /// @param newMaintainer Address of the new maintainer.\\n function updateMaintainer(address newMaintainer) external onlyOwner {\\n if (newMaintainer == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n maintainer = newMaintainer;\\n\\n emit MaintainerUpdated(maintainer);\\n }\\n\\n /// TODO: make this function internal once the allocation distribution is\\n /// implemented\\n /// @notice Routes tBTC from stBTC to a vault. Can be called by the maintainer\\n /// only.\\n /// @param vault Address of the vault to route the assets to.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function depositToVault(\\n address vault,\\n uint256 amount,\\n uint256 minSharesOut\\n ) public onlyMaintainer {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n // slither-disable-next-line arbitrary-send-erc20\\n tbtc.safeTransferFrom(address(stbtc), address(this), amount);\\n tbtc.forceApprove(address(vault), amount);\\n\\n uint256 sharesOut = deposit(\\n IERC4626(vault),\\n address(stbtc),\\n amount,\\n minSharesOut\\n );\\n // slither-disable-next-line reentrancy-events\\n emit DepositAllocated(vault, amount, sharesOut);\\n }\\n\\n /// @notice Returns the list of authorized vaults.\\n function getVaults() public view returns (address[] memory) {\\n return vaults;\\n }\\n\\n /// @notice Returns true if the vault is authorized.\\n /// @param vault Address of the vault to check.\\n function isVaultAuthorized(address vault) public view returns (bool) {\\n return vaultsInfo[vault].authorized;\\n }\\n\\n /// TODO: implement redeem() / withdraw() functions\\n}\\n\",\"keccak256\":\"0x0dd77692ab8c6059afa7b4a90f26733560b53fb66192e9912a2064103c5d41fb\",\"license\":\"GPL-3.0-only\"},\"contracts/Router.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\n/// @title Router\\n/// @notice Router is a contract that routes tBTC from stBTC to\\n/// a given vault and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\nabstract contract Router {\\n /// Thrown when amount of shares received is below the min set by caller.\\n /// @param vault Address of the vault.\\n /// @param sharesOut Amount of received shares.\\n /// @param minSharesOut Minimum amount of shares expected to receive.\\n error MinSharesError(\\n address vault,\\n uint256 sharesOut,\\n uint256 minSharesOut\\n );\\n\\n /// @notice Routes funds from stBTC to a vault. The amount of tBTC to\\n /// Shares of deposited tBTC are minted to the stBTC contract.\\n /// @param vault Address of the vault to route the funds to.\\n /// @param receiver Address of the receiver of the shares.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function deposit(\\n IERC4626 vault,\\n address receiver,\\n uint256 amount,\\n uint256 minSharesOut\\n ) internal returns (uint256 sharesOut) {\\n if ((sharesOut = vault.deposit(amount, receiver)) < minSharesOut) {\\n revert MinSharesError(address(vault), sharesOut, minSharesOut);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x520e27c613f1234755c23402524b048a81abd15222d7f318504992d490248812\",\"license\":\"GPL-3.0-only\"},\"contracts/lib/ERC4626Fees.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// Inspired by https://docs.openzeppelin.com/contracts/5.x/erc4626#fees\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {ERC4626} from \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {Math} from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @dev ERC4626 vault with entry/exit fees expressed in https://en.wikipedia.org/wiki/Basis_point[basis point (bp)].\\nabstract contract ERC4626Fees is ERC4626 {\\n using Math for uint256;\\n\\n uint256 private constant _BASIS_POINT_SCALE = 1e4;\\n\\n // === Overrides ===\\n\\n /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\\n function previewDeposit(\\n uint256 assets\\n ) public view virtual override returns (uint256) {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n return super.previewDeposit(assets - fee);\\n }\\n\\n /// @dev Preview adding an entry fee on mint. See {IERC4626-previewMint}.\\n function previewMint(\\n uint256 shares\\n ) public view virtual override returns (uint256) {\\n uint256 assets = super.previewMint(shares);\\n return assets + _feeOnRaw(assets, _entryFeeBasisPoints());\\n }\\n\\n // TODO: add previewWithraw\\n\\n // TODO: add previewRedeem\\n\\n /// @dev Send entry fee to {_feeRecipient}. See {IERC4626-_deposit}.\\n function _deposit(\\n address caller,\\n address receiver,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual override {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n address recipient = _feeRecipient();\\n\\n super._deposit(caller, receiver, assets, shares);\\n\\n if (fee > 0 && recipient != address(this)) {\\n SafeERC20.safeTransfer(IERC20(asset()), recipient, fee);\\n }\\n }\\n\\n // TODO: add withdraw\\n\\n // === Fee configuration ===\\n\\n // slither-disable-next-line dead-code\\n function _entryFeeBasisPoints() internal view virtual returns (uint256);\\n\\n // TODO: add exitFeeBasisPoints\\n\\n // slither-disable-next-line dead-code\\n function _feeRecipient() internal view virtual returns (address);\\n\\n // === Fee operations ===\\n\\n /// @dev Calculates the fees that should be added to an amount `assets`\\n /// that does not already include fees.\\n /// Used in {IERC4626-mint} and {IERC4626-withdraw} operations.\\n function _feeOnRaw(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n\\n /// @dev Calculates the fee part of an amount `assets` that already includes fees.\\n /// Used in {IERC4626-deposit} and {IERC4626-redeem} operations.\\n function _feeOnTotal(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n feeBasisPoints + _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n}\\n\",\"keccak256\":\"0xccfc01be23cbc979745a6e7f3421c4d050dc2ad7ddb6d9e1543c8e681e91d596\",\"license\":\"MIT\"},\"contracts/stBTC.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Dispatcher.sol\\\";\\nimport \\\"./lib/ERC4626Fees.sol\\\";\\n\\n/// @title stBTC\\n/// @notice This contract implements the ERC-4626 tokenized vault standard. By\\n/// staking tBTC, users acquire a liquid staking token called stBTC,\\n/// commonly referred to as \\\"shares\\\". The staked tBTC is securely\\n/// deposited into Acre's vaults, where it generates yield over time.\\n/// Users have the flexibility to redeem stBTC, enabling them to\\n/// withdraw their staked tBTC along with the accrued yield.\\n/// @dev ERC-4626 is a standard to optimize and unify the technical parameters\\n/// of yield-bearing vaults. This contract facilitates the minting and\\n/// burning of shares (stBTC), which are represented as standard ERC20\\n/// tokens, providing a seamless exchange with tBTC tokens.\\ncontract stBTC is ERC4626Fees, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Dispatcher contract that routes tBTC from stBTC to a given vault and back.\\n Dispatcher public dispatcher;\\n\\n /// Address of the treasury wallet, where fees should be transferred to.\\n address public treasury;\\n\\n /// Entry fee basis points applied to entry fee calculation.\\n uint256 public entryFeeBasisPoints;\\n\\n /// Minimum amount for a single deposit operation. The value should be set\\n /// low enough so the deposits routed through TbtcDepositor contract won't\\n /// be rejected. It means that minimumDepositAmount should be lower than\\n /// tBTC protocol's depositDustThreshold reduced by all the minting fees taken\\n /// before depositing in the Acre contract.\\n uint256 public minimumDepositAmount;\\n\\n /// Maximum total amount of tBTC token held by Acre protocol.\\n uint256 public maximumTotalAssets;\\n\\n /// Emitted when a referral is used.\\n /// @param referral Used for referral program.\\n /// @param assets Amount of tBTC tokens staked.\\n event StakeReferral(uint16 indexed referral, uint256 assets);\\n\\n /// Emitted when the treasury wallet address is updated.\\n /// @param treasury New treasury wallet address.\\n event TreasuryUpdated(address treasury);\\n\\n /// Emitted when deposit parameters are updated.\\n /// @param minimumDepositAmount New value of the minimum deposit amount.\\n /// @param maximumTotalAssets New value of the maximum total assets amount.\\n event DepositParametersUpdated(\\n uint256 minimumDepositAmount,\\n uint256 maximumTotalAssets\\n );\\n\\n /// Emitted when the dispatcher contract is updated.\\n /// @param oldDispatcher Address of the old dispatcher contract.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n event DispatcherUpdated(address oldDispatcher, address newDispatcher);\\n\\n /// Emitted when the entry fee basis points are updated.\\n /// @param entryFeeBasisPoints New value of the fee basis points.\\n event EntryFeeBasisPointsUpdated(uint256 entryFeeBasisPoints);\\n\\n /// Reverts if the amount is less than the minimum deposit amount.\\n /// @param amount Amount to check.\\n /// @param min Minimum amount to check 'amount' against.\\n error LessThanMinDeposit(uint256 amount, uint256 min);\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Reverts if the address is disallowed.\\n error DisallowedAddress();\\n\\n constructor(\\n IERC20 _tbtc,\\n address _treasury\\n ) ERC4626(_tbtc) ERC20(\\\"Acre Staked Bitcoin\\\", \\\"stBTC\\\") Ownable(msg.sender) {\\n if (address(_treasury) == address(0)) {\\n revert ZeroAddress();\\n }\\n treasury = _treasury;\\n // TODO: Revisit the exact values closer to the launch.\\n minimumDepositAmount = 0.001 * 1e18; // 0.001 tBTC\\n maximumTotalAssets = 25 * 1e18; // 25 tBTC\\n entryFeeBasisPoints = 5; // 5bps == 0.05% == 0.0005\\n }\\n\\n /// @notice Updates treasury wallet address.\\n /// @param newTreasury New treasury wallet address.\\n function updateTreasury(address newTreasury) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n if (newTreasury == address(0)) {\\n revert ZeroAddress();\\n }\\n if (newTreasury == address(this)) {\\n revert DisallowedAddress();\\n }\\n treasury = newTreasury;\\n\\n emit TreasuryUpdated(newTreasury);\\n }\\n\\n /// @notice Updates deposit parameters.\\n /// @dev To disable the limit for deposits, set the maximum total assets to\\n /// maximum (`type(uint256).max`).\\n /// @param _minimumDepositAmount New value of the minimum deposit amount. It\\n /// is the minimum amount for a single deposit operation.\\n /// @param _maximumTotalAssets New value of the maximum total assets amount.\\n /// It is the maximum amount of the tBTC token that the Acre protocol\\n /// can hold.\\n function updateDepositParameters(\\n uint256 _minimumDepositAmount,\\n uint256 _maximumTotalAssets\\n ) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n minimumDepositAmount = _minimumDepositAmount;\\n maximumTotalAssets = _maximumTotalAssets;\\n\\n emit DepositParametersUpdated(\\n _minimumDepositAmount,\\n _maximumTotalAssets\\n );\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Updates the dispatcher contract and gives it an unlimited\\n /// allowance to transfer staked tBTC.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n function updateDispatcher(Dispatcher newDispatcher) external onlyOwner {\\n if (address(newDispatcher) == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n address oldDispatcher = address(dispatcher);\\n\\n emit DispatcherUpdated(oldDispatcher, address(newDispatcher));\\n dispatcher = newDispatcher;\\n\\n // TODO: Once withdrawal/rebalancing is implemented, we need to revoke the\\n // approval of the vaults share tokens from the old dispatcher and approve\\n // a new dispatcher to manage the share tokens.\\n\\n if (oldDispatcher != address(0)) {\\n // Setting allowance to zero for the old dispatcher\\n IERC20(asset()).forceApprove(oldDispatcher, 0);\\n }\\n\\n // Setting allowance to max for the new dispatcher\\n IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Update the entry fee basis points.\\n /// @param newEntryFeeBasisPoints New value of the fee basis points.\\n function updateEntryFeeBasisPoints(\\n uint256 newEntryFeeBasisPoints\\n ) external onlyOwner {\\n entryFeeBasisPoints = newEntryFeeBasisPoints;\\n\\n emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints);\\n }\\n\\n /// @notice Mints shares to receiver by depositing exactly amount of\\n /// tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// @param assets Approved amount of tBTC tokens to deposit. This includes\\n /// treasury fees for staking tBTC.\\n /// @param receiver The address to which the shares will be minted.\\n /// @return Minted shares adjusted for the fees taken by the treasury.\\n function deposit(\\n uint256 assets,\\n address receiver\\n ) public override returns (uint256) {\\n if (assets < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n\\n return super.deposit(assets, receiver);\\n }\\n\\n /// @notice Mints shares to receiver by depositing tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// The msg.sender is required to grant approval for the transfer of a\\n /// certain amount of tBTC, and in addition, approval for the associated\\n /// fee. Specifically, the total amount to be approved (amountToApprove)\\n /// should be equal to the sum of the deposited amount and the fee.\\n /// To determine the total assets amount necessary for approval\\n /// corresponding to a given share amount, use the `previewMint` function.\\n /// @param shares Amount of shares to mint.\\n /// @param receiver The address to which the shares will be minted.\\n function mint(\\n uint256 shares,\\n address receiver\\n ) public override returns (uint256 assets) {\\n if ((assets = super.mint(shares, receiver)) < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n }\\n\\n /// @notice Stakes a given amount of tBTC token and mints shares to a\\n /// receiver.\\n /// @dev This function calls `deposit` function from `ERC4626` contract. The\\n /// amount of the assets has to be pre-approved in the tBTC contract.\\n /// @param assets Approved amount for the transfer and stake.\\n /// @param receiver The address to which the shares will be minted.\\n /// @param referral Data used for referral program.\\n /// @return shares Minted shares.\\n function stake(\\n uint256 assets,\\n address receiver,\\n uint16 referral\\n ) public returns (uint256) {\\n // TODO: revisit the type of referral.\\n uint256 shares = deposit(assets, receiver);\\n\\n if (referral > 0) {\\n emit StakeReferral(referral, assets);\\n }\\n\\n return shares;\\n }\\n\\n /// @notice Returns the maximum amount of the tBTC token that can be\\n /// deposited into the vault for the receiver through a deposit\\n /// call. It takes into account the deposit parameter, maximum total\\n /// assets, which determines the total amount of tBTC token held by\\n /// Acre. This function always returns available limit for deposits,\\n /// but the fee is not taken into account. As a result of this, there\\n /// always will be some dust left. If the dust is lower than the\\n /// minimum deposit amount, this function will return 0.\\n /// @return The maximum amount of tBTC token that can be deposited into\\n /// Acre protocol for the receiver.\\n function maxDeposit(address) public view override returns (uint256) {\\n if (maximumTotalAssets == type(uint256).max) {\\n return type(uint256).max;\\n }\\n\\n uint256 currentTotalAssets = totalAssets();\\n if (currentTotalAssets >= maximumTotalAssets) return 0;\\n\\n // Max amount left for next deposits. If it is lower than the minimum\\n // deposit amount, return 0.\\n uint256 unusedLimit = maximumTotalAssets - currentTotalAssets;\\n\\n return minimumDepositAmount > unusedLimit ? 0 : unusedLimit;\\n }\\n\\n /// @notice Returns the maximum amount of the vault shares that can be\\n /// minted for the receiver, through a mint call.\\n /// @dev Since the stBTC contract limits the maximum total tBTC tokens this\\n /// function converts the maximum deposit amount to shares.\\n /// @return The maximum amount of the vault shares.\\n function maxMint(address receiver) public view override returns (uint256) {\\n uint256 _maxDeposit = maxDeposit(receiver);\\n\\n // slither-disable-next-line incorrect-equality\\n return\\n _maxDeposit == type(uint256).max\\n ? type(uint256).max\\n : convertToShares(_maxDeposit);\\n }\\n\\n /// @return Returns deposit parameters.\\n function depositParameters() public view returns (uint256, uint256) {\\n return (minimumDepositAmount, maximumTotalAssets);\\n }\\n\\n /// @notice Redeems shares for tBTC tokens.\\n function _entryFeeBasisPoints() internal view override returns (uint256) {\\n return entryFeeBasisPoints;\\n }\\n\\n /// @notice Returns the address of the treasury wallet, where fees should be\\n /// transferred to.\\n function _feeRecipient() internal view override returns (address) {\\n return treasury;\\n }\\n}\\n\",\"keccak256\":\"0x5e622d3cef791a39b7089c64cacd5c62f14c13af316e2e8a3141244f7f69324e\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b5060405162002459380380620024598339810160408190526200003491620002da565b33826040518060400160405280601381526020017f41637265205374616b656420426974636f696e0000000000000000000000000081525060405180604001604052806005815260200164737442544360d81b81525081600390816200009b9190620003be565b506004620000aa8282620003be565b505050600080620000c1836200018a60201b60201c565b9150915081620000d3576012620000d5565b805b60ff1660a05250506001600160a01b0390811660805281166200011257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011d816200026f565b506001600160a01b038116620001465760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03929092169190911790555066038d7ea4c6800060095568015af1d78b58c40000600a556005600855620004d5565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620001d3916200048a565b600060405180830381855afa9150503d806000811462000210576040519150601f19603f3d011682016040523d82523d6000602084013e62000215565b606091505b50915091508180156200022a57506020815110155b156200026257600081806020019051810190620002489190620004bb565b905060ff811162000260576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620002d757600080fd5b50565b60008060408385031215620002ee57600080fd5b8251620002fb81620002c1565b60208401519092506200030e81620002c1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200034457607f821691505b6020821081036200036557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003b957600081815260208120601f850160051c81016020861015620003945750805b601f850160051c820191505b81811015620003b557828155600101620003a0565b5050505b505050565b81516001600160401b03811115620003da57620003da62000319565b620003f281620003eb84546200032f565b846200036b565b602080601f8311600181146200042a5760008415620004115750858301515b600019600386901b1c1916600185901b178555620003b5565b600085815260208120601f198616915b828110156200045b578886015182559484019460019091019084016200043a565b50858210156200047a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b81811015620004ad576020818601810151858301520162000491565b506000920191825250919050565b600060208284031215620004ce57600080fd5b5051919050565b60805160a051611f3462000525600039600061077201526000818161036b01528181610602015281816108a9015281816108ee01528181611209015281816116bc015261186e0152611f346000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", + "devdoc": { + "details": "ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "AddressInsufficientBalance(address)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "ERC20InsufficientAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", + "params": { + "allowance": "Amount of tokens a `spender` is allowed to operate with.", + "needed": "Minimum amount required to perform a transfer.", + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC20InsufficientBalance(address,uint256,uint256)": [ + { + "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", + "params": { + "balance": "Current balance for the interacting account.", + "needed": "Minimum amount required to perform a transfer.", + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC20InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC20InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidSpender(address)": [ + { + "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", + "params": { + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC4626ExceededMaxDeposit(address,uint256,uint256)": [ + { + "details": "Attempted to deposit more assets than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxMint(address,uint256,uint256)": [ + { + "details": "Attempted to mint more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxRedeem(address,uint256,uint256)": [ + { + "details": "Attempted to redeem more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxWithdraw(address,uint256,uint256)": [ + { + "details": "Attempted to withdraw more assets than the max amount for `receiver`." + } + ], + "FailedInnerCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "LessThanMinDeposit(uint256,uint256)": [ + { + "params": { + "amount": "Amount to check.", + "min": "Minimum amount to check 'amount' against." + } + } + ], + "MathOverflowedMulDiv()": [ + { + "details": "Muldiv operation overflow." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC20 token failed." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "DepositParametersUpdated(uint256,uint256)": { + "params": { + "maximumTotalAssets": "New value of the maximum total assets amount.", + "minimumDepositAmount": "New value of the minimum deposit amount." + } + }, + "DispatcherUpdated(address,address)": { + "params": { + "newDispatcher": "Address of the new dispatcher contract.", + "oldDispatcher": "Address of the old dispatcher contract." + } + }, + "EntryFeeBasisPointsUpdated(uint256)": { + "params": { + "entryFeeBasisPoints": "New value of the fee basis points." + } + }, + "StakeReferral(uint16,uint256)": { + "params": { + "assets": "Amount of tBTC tokens staked.", + "referral": "Used for referral program." + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + }, + "TreasuryUpdated(address)": { + "params": { + "treasury": "New treasury wallet address." + } + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "asset()": { + "details": "See {IERC4626-asset}. " + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "convertToAssets(uint256)": { + "details": "See {IERC4626-convertToAssets}. " + }, + "convertToShares(uint256)": { + "details": "See {IERC4626-convertToShares}. " + }, + "decimals()": { + "details": "Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}." + }, + "deposit(uint256,address)": { + "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.", + "params": { + "assets": "Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.", + "receiver": "The address to which the shares will be minted." + }, + "returns": { + "_0": "Minted shares adjusted for the fees taken by the treasury." + } + }, + "depositParameters()": { + "returns": { + "_0": "Returns deposit parameters." + } + }, + "maxDeposit(address)": { + "returns": { + "_0": "The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver." + } + }, + "maxMint(address)": { + "details": "Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.", + "returns": { + "_0": "The maximum amount of the vault shares." + } + }, + "maxRedeem(address)": { + "details": "See {IERC4626-maxRedeem}. " + }, + "maxWithdraw(address)": { + "details": "See {IERC4626-maxWithdraw}. " + }, + "mint(uint256,address)": { + "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.", + "params": { + "receiver": "The address to which the shares will be minted.", + "shares": "Amount of shares to mint." + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "previewDeposit(uint256)": { + "details": "Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}." + }, + "previewMint(uint256)": { + "details": "Preview adding an entry fee on mint. See {IERC4626-previewMint}." + }, + "previewRedeem(uint256)": { + "details": "See {IERC4626-previewRedeem}. " + }, + "previewWithdraw(uint256)": { + "details": "See {IERC4626-previewWithdraw}. " + }, + "redeem(uint256,address,address)": { + "details": "See {IERC4626-redeem}. " + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "stake(uint256,address,uint16)": { + "details": "This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.", + "params": { + "assets": "Approved amount for the transfer and stake.", + "receiver": "The address to which the shares will be minted.", + "referral": "Data used for referral program." + }, + "returns": { + "_0": "shares Minted shares." + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalAssets()": { + "details": "See {IERC4626-totalAssets}. " + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateDepositParameters(uint256,uint256)": { + "details": "To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).", + "params": { + "_maximumTotalAssets": "New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.", + "_minimumDepositAmount": "New value of the minimum deposit amount. It is the minimum amount for a single deposit operation." + } + }, + "updateDispatcher(address)": { + "params": { + "newDispatcher": "Address of the new dispatcher contract." + } + }, + "updateEntryFeeBasisPoints(uint256)": { + "params": { + "newEntryFeeBasisPoints": "New value of the fee basis points." + } + }, + "updateTreasury(address)": { + "params": { + "newTreasury": "New treasury wallet address." + } + }, + "withdraw(uint256,address,address)": { + "details": "See {IERC4626-withdraw}. " + } + }, + "title": "stBTC", + "version": 1 + }, + "userdoc": { + "errors": { + "DisallowedAddress()": [ + { + "notice": "Reverts if the address is disallowed." + } + ], + "LessThanMinDeposit(uint256,uint256)": [ + { + "notice": "Reverts if the amount is less than the minimum deposit amount." + } + ], + "ZeroAddress()": [ + { + "notice": "Reverts if the address is zero." + } + ] + }, + "events": { + "DepositParametersUpdated(uint256,uint256)": { + "notice": "Emitted when deposit parameters are updated." + }, + "DispatcherUpdated(address,address)": { + "notice": "Emitted when the dispatcher contract is updated." + }, + "EntryFeeBasisPointsUpdated(uint256)": { + "notice": "Emitted when the entry fee basis points are updated." + }, + "StakeReferral(uint16,uint256)": { + "notice": "Emitted when a referral is used." + }, + "TreasuryUpdated(address)": { + "notice": "Emitted when the treasury wallet address is updated." + } + }, + "kind": "user", + "methods": { + "deposit(uint256,address)": { + "notice": "Mints shares to receiver by depositing exactly amount of tBTC tokens." + }, + "dispatcher()": { + "notice": "Dispatcher contract that routes tBTC from stBTC to a given vault and back." + }, + "entryFeeBasisPoints()": { + "notice": "Entry fee basis points applied to entry fee calculation." + }, + "maxDeposit(address)": { + "notice": "Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0." + }, + "maxMint(address)": { + "notice": "Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call." + }, + "maximumTotalAssets()": { + "notice": "Maximum total amount of tBTC token held by Acre protocol." + }, + "minimumDepositAmount()": { + "notice": "Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract." + }, + "mint(uint256,address)": { + "notice": "Mints shares to receiver by depositing tBTC tokens." + }, + "stake(uint256,address,uint16)": { + "notice": "Stakes a given amount of tBTC token and mints shares to a receiver." + }, + "treasury()": { + "notice": "Address of the treasury wallet, where fees should be transferred to." + }, + "updateDepositParameters(uint256,uint256)": { + "notice": "Updates deposit parameters." + }, + "updateDispatcher(address)": { + "notice": "Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC." + }, + "updateEntryFeeBasisPoints(uint256)": { + "notice": "Update the entry fee basis points." + }, + "updateTreasury(address)": { + "notice": "Updates treasury wallet address." + } + }, + "notice": "This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \"shares\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4066, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4072, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4074, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 4076, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 4078, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 3597, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_owner", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 8071, + "contract": "contracts/stBTC.sol:stBTC", + "label": "dispatcher", + "offset": 0, + "slot": "6", + "type": "t_contract(Dispatcher)7334" + }, + { + "astId": 8074, + "contract": "contracts/stBTC.sol:stBTC", + "label": "treasury", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 8077, + "contract": "contracts/stBTC.sol:stBTC", + "label": "entryFeeBasisPoints", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 8080, + "contract": "contracts/stBTC.sol:stBTC", + "label": "minimumDepositAmount", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 8083, + "contract": "contracts/stBTC.sol:stBTC", + "label": "maximumTotalAssets", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(Dispatcher)7334": { + "encoding": "inplace", + "label": "contract Dispatcher", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } + } \ No newline at end of file diff --git a/sdk/src/lib/ethereum/index.ts b/sdk/src/lib/ethereum/index.ts index dd1ffd487..6046770a8 100644 --- a/sdk/src/lib/ethereum/index.ts +++ b/sdk/src/lib/ethereum/index.ts @@ -2,7 +2,7 @@ import { AcreContracts } from "../contracts" import { EthereumSigner } from "./contract" import { EthereumTBTCDepositor } from "./tbtc-depositor" import { EthereumNetwork } from "./network" -import EtherumStBTC from "./stbtc" +import { EthereumStBTC } from "./stbtc" export * from "./eip712-signer" export * from "./address" @@ -13,7 +13,7 @@ function getEthereumContracts( network: EthereumNetwork, ): AcreContracts { const tbtcDepositor = new EthereumTBTCDepositor({ signer }, network) - const stBTC = new EtherumStBTC({ signer }, network) + const stBTC = new EthereumStBTC({ signer }, network) return { tbtcDepositor, stBTC } } diff --git a/sdk/src/lib/ethereum/stbtc.ts b/sdk/src/lib/ethereum/stbtc.ts index f69802abd..b33d2d0e0 100644 --- a/sdk/src/lib/ethereum/stbtc.ts +++ b/sdk/src/lib/ethereum/stbtc.ts @@ -1,25 +1,26 @@ +import { StBTC as StBTCTypechain } from "core/typechain/contracts/StBTC" +import SepoliaTbtcDepositor from "core/deployments/sepolia/stBTC.json" import { EthersContractConfig, EthersContractDeployment, EthersContractWrapper, } from "./contract" import { ChainIdentifier, StBTC } from "../contracts" - -import SepoliaTbtcDepositor from "./artifacts/sepolia/TbtcDepositor.json" import { EthereumNetwork } from "./network" -export default class EtherumStBTC +class EthereumStBTC // @ts-expect-error TODO: Figure out why type generated by typechain does not // satisfy the constraint `Contract`. Error: `Property '[internal]' is missing // in type 'StBTC' but required in type 'BaseContract'`. - extends EthersContractWrapper + extends EthersContractWrapper + implements StBTC { constructor(config: EthersContractConfig, network: EthereumNetwork) { let artifact: EthersContractDeployment switch (network) { case "sepolia": - artifact = SepoliaTbtcDepositor + artifact = SepoliaTbtcDepositor as EthersContractDeployment break case "mainnet": default: @@ -29,11 +30,22 @@ export default class EtherumStBTC super(config, artifact) } + /** + * Get a generic chain identifier + * @returns value of the basis for calculating final BTC balance + */ balanceOf(identifier: ChainIdentifier): Promise { - return this.instance.balanceOf(identifier) + return this.instance.balanceOf(identifier.identifierHex) } + /** + * Get a generic chain identifier + * @returns maximum withdraw value + */ assetsBalanceOf(identifier: ChainIdentifier): Promise { - return this.instance.assetsBalanceOf(identifier) + return this.instance.assetsBalanceOf(identifier.identifierHex) } } + +// eslint-disable-next-line import/prefer-default-export +export { EthereumStBTC } From 0c9727788337144e6eced878429b7d75e14d3d2d Mon Sep 17 00:00:00 2001 From: ioay Date: Mon, 19 Feb 2024 11:50:59 +0100 Subject: [PATCH 03/11] Removed stBTC.json from core --- core/deployments/sepolia/stBTC.json | 1748 --------------------------- 1 file changed, 1748 deletions(-) delete mode 100644 core/deployments/sepolia/stBTC.json diff --git a/core/deployments/sepolia/stBTC.json b/core/deployments/sepolia/stBTC.json deleted file mode 100644 index 67cfa0e35..000000000 --- a/core/deployments/sepolia/stBTC.json +++ /dev/null @@ -1,1748 +0,0 @@ -{ - "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "_tbtc", - "type": "address" - }, - { - "internalType": "address", - "name": "_treasury", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "AddressInsufficientBalance", - "type": "error" - }, - { - "inputs": [], - "name": "DisallowedAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "needed", - "type": "uint256" - } - ], - "name": "ERC20InsufficientAllowance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "needed", - "type": "uint256" - } - ], - "name": "ERC20InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "approver", - "type": "address" - } - ], - "name": "ERC20InvalidApprover", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "ERC20InvalidReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "ERC20InvalidSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "ERC20InvalidSpender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxMint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxRedeem", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ERC4626ExceededMaxWithdraw", - "type": "error" - }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - } - ], - "name": "LessThanMinDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "MathOverflowedMulDiv", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SafeERC20FailedOperation", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minimumDepositAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maximumTotalAssets", - "type": "uint256" - } - ], - "name": "DepositParametersUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldDispatcher", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newDispatcher", - "type": "address" - } - ], - "name": "DispatcherUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "entryFeeBasisPoints", - "type": "uint256" - } - ], - "name": "EntryFeeBasisPointsUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint16", - "name": "referral", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "StakeReferral", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "treasury", - "type": "address" - } - ], - "name": "TreasuryUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "asset", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "convertToAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "convertToShares", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "depositParameters", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dispatcher", - "outputs": [ - { - "internalType": "contract Dispatcher", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "entryFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "maxDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "maxMint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "maxRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "maxWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumTotalAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumDepositAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewMint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint16", - "name": "referral", - "type": "uint16" - } - ], - "name": "stake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "treasury", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_minimumDepositAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maximumTotalAssets", - "type": "uint256" - } - ], - "name": "updateDepositParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract Dispatcher", - "name": "newDispatcher", - "type": "address" - } - ], - "name": "updateDispatcher", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newEntryFeeBasisPoints", - "type": "uint256" - } - ], - "name": "updateEntryFeeBasisPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newTreasury", - "type": "address" - } - ], - "name": "updateTreasury", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "withdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", - "receipt": { - "to": null, - "from": "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8", - "contractAddress": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", - "transactionIndex": 82, - "gasUsed": "1951493", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000400000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000012000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e", - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", - "logs": [ - { - "transactionIndex": 82, - "blockNumber": 5206357, - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", - "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000002d154a5c7ce9939274b89bbce9f5b069e57b09a8" - ], - "data": "0x", - "logIndex": 230, - "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e" - } - ], - "blockNumber": 5206357, - "cumulativeGasUsed": "13353873", - "status": 1, - "byzantium": true - }, - "args": [ - "0x517f2982701695D4E52f1ECFBEf3ba31Df470161", - "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8" - ], - "numDeployments": 1, - "solcInputHash": "b22c277b248ba02f9ec5bf62d176f9ce", - "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_tbtc\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisallowedAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"LessThanMinDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumDepositAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"DispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"EntryFeeBasisPointsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"StakeReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dispatcher\",\"outputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"entryFeeBasisPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTotalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumDepositAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"}],\"name\":\"stake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDepositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"updateDispatcher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newEntryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"updateEntryFeeBasisPoints\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"params\":{\"amount\":\"Amount to check.\",\"min\":\"Minimum amount to check 'amount' against.\"}}],\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DepositParametersUpdated(uint256,uint256)\":{\"params\":{\"maximumTotalAssets\":\"New value of the maximum total assets amount.\",\"minimumDepositAmount\":\"New value of the minimum deposit amount.\"}},\"DispatcherUpdated(address,address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\",\"oldDispatcher\":\"Address of the old dispatcher contract.\"}},\"EntryFeeBasisPointsUpdated(uint256)\":{\"params\":{\"entryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"StakeReferral(uint16,uint256)\":{\"params\":{\"assets\":\"Amount of tBTC tokens staked.\",\"referral\":\"Used for referral program.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"TreasuryUpdated(address)\":{\"params\":{\"treasury\":\"New treasury wallet address.\"}}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.\",\"receiver\":\"The address to which the shares will be minted.\"},\"returns\":{\"_0\":\"Minted shares adjusted for the fees taken by the treasury.\"}},\"depositParameters()\":{\"returns\":{\"_0\":\"Returns deposit parameters.\"}},\"maxDeposit(address)\":{\"returns\":{\"_0\":\"The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver.\"}},\"maxMint(address)\":{\"details\":\"Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.\",\"returns\":{\"_0\":\"The maximum amount of the vault shares.\"}},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.\",\"params\":{\"receiver\":\"The address to which the shares will be minted.\",\"shares\":\"Amount of shares to mint.\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"previewDeposit(uint256)\":{\"details\":\"Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\"},\"previewMint(uint256)\":{\"details\":\"Preview adding an entry fee on mint. See {IERC4626-previewMint}.\"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"stake(uint256,address,uint16)\":{\"details\":\"This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount for the transfer and stake.\",\"receiver\":\"The address to which the shares will be minted.\",\"referral\":\"Data used for referral program.\"},\"returns\":{\"_0\":\"shares Minted shares.\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateDepositParameters(uint256,uint256)\":{\"details\":\"To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).\",\"params\":{\"_maximumTotalAssets\":\"New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.\",\"_minimumDepositAmount\":\"New value of the minimum deposit amount. It is the minimum amount for a single deposit operation.\"}},\"updateDispatcher(address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\"}},\"updateEntryFeeBasisPoints(uint256)\":{\"params\":{\"newEntryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"updateTreasury(address)\":{\"params\":{\"newTreasury\":\"New treasury wallet address.\"}},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"stBTC\",\"version\":1},\"userdoc\":{\"errors\":{\"DisallowedAddress()\":[{\"notice\":\"Reverts if the address is disallowed.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"notice\":\"Reverts if the amount is less than the minimum deposit amount.\"}],\"ZeroAddress()\":[{\"notice\":\"Reverts if the address is zero.\"}]},\"events\":{\"DepositParametersUpdated(uint256,uint256)\":{\"notice\":\"Emitted when deposit parameters are updated.\"},\"DispatcherUpdated(address,address)\":{\"notice\":\"Emitted when the dispatcher contract is updated.\"},\"EntryFeeBasisPointsUpdated(uint256)\":{\"notice\":\"Emitted when the entry fee basis points are updated.\"},\"StakeReferral(uint16,uint256)\":{\"notice\":\"Emitted when a referral is used.\"},\"TreasuryUpdated(address)\":{\"notice\":\"Emitted when the treasury wallet address is updated.\"}},\"kind\":\"user\",\"methods\":{\"deposit(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing exactly amount of tBTC tokens.\"},\"dispatcher()\":{\"notice\":\"Dispatcher contract that routes tBTC from stBTC to a given vault and back.\"},\"entryFeeBasisPoints()\":{\"notice\":\"Entry fee basis points applied to entry fee calculation.\"},\"maxDeposit(address)\":{\"notice\":\"Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0.\"},\"maxMint(address)\":{\"notice\":\"Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call.\"},\"maximumTotalAssets()\":{\"notice\":\"Maximum total amount of tBTC token held by Acre protocol.\"},\"minimumDepositAmount()\":{\"notice\":\"Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract.\"},\"mint(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing tBTC tokens.\"},\"stake(uint256,address,uint16)\":{\"notice\":\"Stakes a given amount of tBTC token and mints shares to a receiver.\"},\"treasury()\":{\"notice\":\"Address of the treasury wallet, where fees should be transferred to.\"},\"updateDepositParameters(uint256,uint256)\":{\"notice\":\"Updates deposit parameters.\"},\"updateDispatcher(address)\":{\"notice\":\"Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC.\"},\"updateEntryFeeBasisPoints(uint256)\":{\"notice\":\"Update the entry fee basis points.\"},\"updateTreasury(address)\":{\"notice\":\"Updates treasury wallet address.\"}},\"notice\":\"This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \\\"shares\\\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/stBTC.sol\":\"stBTC\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"./extensions/IERC20Metadata.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n */\\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\\n mapping(address account => uint256) private _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n _totalSupply += value;\\n } else {\\n uint256 fromBalance = _balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n _balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n _totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n _balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n * ```\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n _allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3e1fa9d1987f8d349dfb4d6fe93bf2ca014b52ba335cfac30bfe71e357e6f80\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20, IERC20Metadata, ERC20} from \\\"../ERC20.sol\\\";\\nimport {SafeERC20} from \\\"../utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"../../../interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"../../../utils/math/Math.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\\n * expensive than it is profitable. More details about the underlying math can be found\\n * xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626 is ERC20, IERC4626 {\\n using Math for uint256;\\n\\n IERC20 private immutable _asset;\\n uint8 private immutable _underlyingDecimals;\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\\n */\\n constructor(IERC20 asset_) {\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n _underlyingDecimals = success ? assetDecimals : 18;\\n _asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {\\n return _underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n return address(_asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n return _asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}.\\n *\\n * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\\n * In this case, the shares will be minted without requiring any assets to be deposited.\\n */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer(_asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x1837547e04d5fe5334eeb77a345683c22995f1e7aa033020757ddf83a80fc72d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {FailedInnerCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\\n * unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {FailedInnerCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x75a4ee64c68dbd5f38bddd06e664a64c8271b4caa554fb6f0607dfd672bb4bf3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Muldiv operation overflow.\\n */\\n error MathOverflowedMulDiv();\\n\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n return a / b;\\n }\\n\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n revert MathOverflowedMulDiv();\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\"},\"contracts/Dispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport \\\"./Router.sol\\\";\\nimport \\\"./stBTC.sol\\\";\\n\\n/// @title Dispatcher\\n/// @notice Dispatcher is a contract that routes tBTC from stBTC to\\n/// yield vaults and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\ncontract Dispatcher is Router, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Struct holds information about a vault.\\n struct VaultInfo {\\n bool authorized;\\n }\\n\\n /// The main stBTC contract holding tBTC deposited by stakers.\\n stBTC public immutable stbtc;\\n /// tBTC token contract.\\n IERC20 public immutable tbtc;\\n /// Address of the maintainer bot.\\n address public maintainer;\\n\\n /// Authorized Yield Vaults that implement ERC4626 standard. These\\n /// vaults deposit assets to yield strategies, e.g. Uniswap V3\\n /// WBTC/TBTC pool. Vault can be a part of Acre ecosystem or can be\\n /// implemented externally. As long as it complies with ERC4626\\n /// standard and is authorized by the owner it can be plugged into\\n /// Acre.\\n address[] public vaults;\\n /// Mapping of vaults to their information.\\n mapping(address => VaultInfo) public vaultsInfo;\\n\\n /// Emitted when a vault is authorized.\\n /// @param vault Address of the vault.\\n event VaultAuthorized(address indexed vault);\\n\\n /// Emitted when a vault is deauthorized.\\n /// @param vault Address of the vault.\\n event VaultDeauthorized(address indexed vault);\\n\\n /// Emitted when tBTC is routed to a vault.\\n /// @param vault Address of the vault.\\n /// @param amount Amount of tBTC.\\n /// @param sharesOut Amount of received shares.\\n event DepositAllocated(\\n address indexed vault,\\n uint256 amount,\\n uint256 sharesOut\\n );\\n\\n /// Emitted when the maintainer address is updated.\\n /// @param maintainer Address of the new maintainer.\\n event MaintainerUpdated(address indexed maintainer);\\n\\n /// Reverts if the vault is already authorized.\\n error VaultAlreadyAuthorized();\\n\\n /// Reverts if the vault is not authorized.\\n error VaultUnauthorized();\\n\\n /// Reverts if the caller is not the maintainer.\\n error NotMaintainer();\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Modifier that reverts if the caller is not the maintainer.\\n modifier onlyMaintainer() {\\n if (msg.sender != maintainer) {\\n revert NotMaintainer();\\n }\\n _;\\n }\\n\\n constructor(stBTC _stbtc, IERC20 _tbtc) Ownable(msg.sender) {\\n stbtc = _stbtc;\\n tbtc = _tbtc;\\n }\\n\\n /// @notice Adds a vault to the list of authorized vaults.\\n /// @param vault Address of the vault to add.\\n function authorizeVault(address vault) external onlyOwner {\\n if (isVaultAuthorized(vault)) {\\n revert VaultAlreadyAuthorized();\\n }\\n\\n vaults.push(vault);\\n vaultsInfo[vault].authorized = true;\\n\\n emit VaultAuthorized(vault);\\n }\\n\\n /// @notice Removes a vault from the list of authorized vaults.\\n /// @param vault Address of the vault to remove.\\n function deauthorizeVault(address vault) external onlyOwner {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n vaultsInfo[vault].authorized = false;\\n\\n for (uint256 i = 0; i < vaults.length; i++) {\\n if (vaults[i] == vault) {\\n vaults[i] = vaults[vaults.length - 1];\\n // slither-disable-next-line costly-loop\\n vaults.pop();\\n break;\\n }\\n }\\n\\n emit VaultDeauthorized(vault);\\n }\\n\\n /// @notice Updates the maintainer address.\\n /// @param newMaintainer Address of the new maintainer.\\n function updateMaintainer(address newMaintainer) external onlyOwner {\\n if (newMaintainer == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n maintainer = newMaintainer;\\n\\n emit MaintainerUpdated(maintainer);\\n }\\n\\n /// TODO: make this function internal once the allocation distribution is\\n /// implemented\\n /// @notice Routes tBTC from stBTC to a vault. Can be called by the maintainer\\n /// only.\\n /// @param vault Address of the vault to route the assets to.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function depositToVault(\\n address vault,\\n uint256 amount,\\n uint256 minSharesOut\\n ) public onlyMaintainer {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n // slither-disable-next-line arbitrary-send-erc20\\n tbtc.safeTransferFrom(address(stbtc), address(this), amount);\\n tbtc.forceApprove(address(vault), amount);\\n\\n uint256 sharesOut = deposit(\\n IERC4626(vault),\\n address(stbtc),\\n amount,\\n minSharesOut\\n );\\n // slither-disable-next-line reentrancy-events\\n emit DepositAllocated(vault, amount, sharesOut);\\n }\\n\\n /// @notice Returns the list of authorized vaults.\\n function getVaults() public view returns (address[] memory) {\\n return vaults;\\n }\\n\\n /// @notice Returns true if the vault is authorized.\\n /// @param vault Address of the vault to check.\\n function isVaultAuthorized(address vault) public view returns (bool) {\\n return vaultsInfo[vault].authorized;\\n }\\n\\n /// TODO: implement redeem() / withdraw() functions\\n}\\n\",\"keccak256\":\"0x0dd77692ab8c6059afa7b4a90f26733560b53fb66192e9912a2064103c5d41fb\",\"license\":\"GPL-3.0-only\"},\"contracts/Router.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\n/// @title Router\\n/// @notice Router is a contract that routes tBTC from stBTC to\\n/// a given vault and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\nabstract contract Router {\\n /// Thrown when amount of shares received is below the min set by caller.\\n /// @param vault Address of the vault.\\n /// @param sharesOut Amount of received shares.\\n /// @param minSharesOut Minimum amount of shares expected to receive.\\n error MinSharesError(\\n address vault,\\n uint256 sharesOut,\\n uint256 minSharesOut\\n );\\n\\n /// @notice Routes funds from stBTC to a vault. The amount of tBTC to\\n /// Shares of deposited tBTC are minted to the stBTC contract.\\n /// @param vault Address of the vault to route the funds to.\\n /// @param receiver Address of the receiver of the shares.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function deposit(\\n IERC4626 vault,\\n address receiver,\\n uint256 amount,\\n uint256 minSharesOut\\n ) internal returns (uint256 sharesOut) {\\n if ((sharesOut = vault.deposit(amount, receiver)) < minSharesOut) {\\n revert MinSharesError(address(vault), sharesOut, minSharesOut);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x520e27c613f1234755c23402524b048a81abd15222d7f318504992d490248812\",\"license\":\"GPL-3.0-only\"},\"contracts/lib/ERC4626Fees.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// Inspired by https://docs.openzeppelin.com/contracts/5.x/erc4626#fees\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {ERC4626} from \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {Math} from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @dev ERC4626 vault with entry/exit fees expressed in https://en.wikipedia.org/wiki/Basis_point[basis point (bp)].\\nabstract contract ERC4626Fees is ERC4626 {\\n using Math for uint256;\\n\\n uint256 private constant _BASIS_POINT_SCALE = 1e4;\\n\\n // === Overrides ===\\n\\n /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\\n function previewDeposit(\\n uint256 assets\\n ) public view virtual override returns (uint256) {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n return super.previewDeposit(assets - fee);\\n }\\n\\n /// @dev Preview adding an entry fee on mint. See {IERC4626-previewMint}.\\n function previewMint(\\n uint256 shares\\n ) public view virtual override returns (uint256) {\\n uint256 assets = super.previewMint(shares);\\n return assets + _feeOnRaw(assets, _entryFeeBasisPoints());\\n }\\n\\n // TODO: add previewWithraw\\n\\n // TODO: add previewRedeem\\n\\n /// @dev Send entry fee to {_feeRecipient}. See {IERC4626-_deposit}.\\n function _deposit(\\n address caller,\\n address receiver,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual override {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n address recipient = _feeRecipient();\\n\\n super._deposit(caller, receiver, assets, shares);\\n\\n if (fee > 0 && recipient != address(this)) {\\n SafeERC20.safeTransfer(IERC20(asset()), recipient, fee);\\n }\\n }\\n\\n // TODO: add withdraw\\n\\n // === Fee configuration ===\\n\\n // slither-disable-next-line dead-code\\n function _entryFeeBasisPoints() internal view virtual returns (uint256);\\n\\n // TODO: add exitFeeBasisPoints\\n\\n // slither-disable-next-line dead-code\\n function _feeRecipient() internal view virtual returns (address);\\n\\n // === Fee operations ===\\n\\n /// @dev Calculates the fees that should be added to an amount `assets`\\n /// that does not already include fees.\\n /// Used in {IERC4626-mint} and {IERC4626-withdraw} operations.\\n function _feeOnRaw(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n\\n /// @dev Calculates the fee part of an amount `assets` that already includes fees.\\n /// Used in {IERC4626-deposit} and {IERC4626-redeem} operations.\\n function _feeOnTotal(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n feeBasisPoints + _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n}\\n\",\"keccak256\":\"0xccfc01be23cbc979745a6e7f3421c4d050dc2ad7ddb6d9e1543c8e681e91d596\",\"license\":\"MIT\"},\"contracts/stBTC.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Dispatcher.sol\\\";\\nimport \\\"./lib/ERC4626Fees.sol\\\";\\n\\n/// @title stBTC\\n/// @notice This contract implements the ERC-4626 tokenized vault standard. By\\n/// staking tBTC, users acquire a liquid staking token called stBTC,\\n/// commonly referred to as \\\"shares\\\". The staked tBTC is securely\\n/// deposited into Acre's vaults, where it generates yield over time.\\n/// Users have the flexibility to redeem stBTC, enabling them to\\n/// withdraw their staked tBTC along with the accrued yield.\\n/// @dev ERC-4626 is a standard to optimize and unify the technical parameters\\n/// of yield-bearing vaults. This contract facilitates the minting and\\n/// burning of shares (stBTC), which are represented as standard ERC20\\n/// tokens, providing a seamless exchange with tBTC tokens.\\ncontract stBTC is ERC4626Fees, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Dispatcher contract that routes tBTC from stBTC to a given vault and back.\\n Dispatcher public dispatcher;\\n\\n /// Address of the treasury wallet, where fees should be transferred to.\\n address public treasury;\\n\\n /// Entry fee basis points applied to entry fee calculation.\\n uint256 public entryFeeBasisPoints;\\n\\n /// Minimum amount for a single deposit operation. The value should be set\\n /// low enough so the deposits routed through TbtcDepositor contract won't\\n /// be rejected. It means that minimumDepositAmount should be lower than\\n /// tBTC protocol's depositDustThreshold reduced by all the minting fees taken\\n /// before depositing in the Acre contract.\\n uint256 public minimumDepositAmount;\\n\\n /// Maximum total amount of tBTC token held by Acre protocol.\\n uint256 public maximumTotalAssets;\\n\\n /// Emitted when a referral is used.\\n /// @param referral Used for referral program.\\n /// @param assets Amount of tBTC tokens staked.\\n event StakeReferral(uint16 indexed referral, uint256 assets);\\n\\n /// Emitted when the treasury wallet address is updated.\\n /// @param treasury New treasury wallet address.\\n event TreasuryUpdated(address treasury);\\n\\n /// Emitted when deposit parameters are updated.\\n /// @param minimumDepositAmount New value of the minimum deposit amount.\\n /// @param maximumTotalAssets New value of the maximum total assets amount.\\n event DepositParametersUpdated(\\n uint256 minimumDepositAmount,\\n uint256 maximumTotalAssets\\n );\\n\\n /// Emitted when the dispatcher contract is updated.\\n /// @param oldDispatcher Address of the old dispatcher contract.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n event DispatcherUpdated(address oldDispatcher, address newDispatcher);\\n\\n /// Emitted when the entry fee basis points are updated.\\n /// @param entryFeeBasisPoints New value of the fee basis points.\\n event EntryFeeBasisPointsUpdated(uint256 entryFeeBasisPoints);\\n\\n /// Reverts if the amount is less than the minimum deposit amount.\\n /// @param amount Amount to check.\\n /// @param min Minimum amount to check 'amount' against.\\n error LessThanMinDeposit(uint256 amount, uint256 min);\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Reverts if the address is disallowed.\\n error DisallowedAddress();\\n\\n constructor(\\n IERC20 _tbtc,\\n address _treasury\\n ) ERC4626(_tbtc) ERC20(\\\"Acre Staked Bitcoin\\\", \\\"stBTC\\\") Ownable(msg.sender) {\\n if (address(_treasury) == address(0)) {\\n revert ZeroAddress();\\n }\\n treasury = _treasury;\\n // TODO: Revisit the exact values closer to the launch.\\n minimumDepositAmount = 0.001 * 1e18; // 0.001 tBTC\\n maximumTotalAssets = 25 * 1e18; // 25 tBTC\\n entryFeeBasisPoints = 5; // 5bps == 0.05% == 0.0005\\n }\\n\\n /// @notice Updates treasury wallet address.\\n /// @param newTreasury New treasury wallet address.\\n function updateTreasury(address newTreasury) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n if (newTreasury == address(0)) {\\n revert ZeroAddress();\\n }\\n if (newTreasury == address(this)) {\\n revert DisallowedAddress();\\n }\\n treasury = newTreasury;\\n\\n emit TreasuryUpdated(newTreasury);\\n }\\n\\n /// @notice Updates deposit parameters.\\n /// @dev To disable the limit for deposits, set the maximum total assets to\\n /// maximum (`type(uint256).max`).\\n /// @param _minimumDepositAmount New value of the minimum deposit amount. It\\n /// is the minimum amount for a single deposit operation.\\n /// @param _maximumTotalAssets New value of the maximum total assets amount.\\n /// It is the maximum amount of the tBTC token that the Acre protocol\\n /// can hold.\\n function updateDepositParameters(\\n uint256 _minimumDepositAmount,\\n uint256 _maximumTotalAssets\\n ) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n minimumDepositAmount = _minimumDepositAmount;\\n maximumTotalAssets = _maximumTotalAssets;\\n\\n emit DepositParametersUpdated(\\n _minimumDepositAmount,\\n _maximumTotalAssets\\n );\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Updates the dispatcher contract and gives it an unlimited\\n /// allowance to transfer staked tBTC.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n function updateDispatcher(Dispatcher newDispatcher) external onlyOwner {\\n if (address(newDispatcher) == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n address oldDispatcher = address(dispatcher);\\n\\n emit DispatcherUpdated(oldDispatcher, address(newDispatcher));\\n dispatcher = newDispatcher;\\n\\n // TODO: Once withdrawal/rebalancing is implemented, we need to revoke the\\n // approval of the vaults share tokens from the old dispatcher and approve\\n // a new dispatcher to manage the share tokens.\\n\\n if (oldDispatcher != address(0)) {\\n // Setting allowance to zero for the old dispatcher\\n IERC20(asset()).forceApprove(oldDispatcher, 0);\\n }\\n\\n // Setting allowance to max for the new dispatcher\\n IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Update the entry fee basis points.\\n /// @param newEntryFeeBasisPoints New value of the fee basis points.\\n function updateEntryFeeBasisPoints(\\n uint256 newEntryFeeBasisPoints\\n ) external onlyOwner {\\n entryFeeBasisPoints = newEntryFeeBasisPoints;\\n\\n emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints);\\n }\\n\\n /// @notice Mints shares to receiver by depositing exactly amount of\\n /// tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// @param assets Approved amount of tBTC tokens to deposit. This includes\\n /// treasury fees for staking tBTC.\\n /// @param receiver The address to which the shares will be minted.\\n /// @return Minted shares adjusted for the fees taken by the treasury.\\n function deposit(\\n uint256 assets,\\n address receiver\\n ) public override returns (uint256) {\\n if (assets < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n\\n return super.deposit(assets, receiver);\\n }\\n\\n /// @notice Mints shares to receiver by depositing tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// The msg.sender is required to grant approval for the transfer of a\\n /// certain amount of tBTC, and in addition, approval for the associated\\n /// fee. Specifically, the total amount to be approved (amountToApprove)\\n /// should be equal to the sum of the deposited amount and the fee.\\n /// To determine the total assets amount necessary for approval\\n /// corresponding to a given share amount, use the `previewMint` function.\\n /// @param shares Amount of shares to mint.\\n /// @param receiver The address to which the shares will be minted.\\n function mint(\\n uint256 shares,\\n address receiver\\n ) public override returns (uint256 assets) {\\n if ((assets = super.mint(shares, receiver)) < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n }\\n\\n /// @notice Stakes a given amount of tBTC token and mints shares to a\\n /// receiver.\\n /// @dev This function calls `deposit` function from `ERC4626` contract. The\\n /// amount of the assets has to be pre-approved in the tBTC contract.\\n /// @param assets Approved amount for the transfer and stake.\\n /// @param receiver The address to which the shares will be minted.\\n /// @param referral Data used for referral program.\\n /// @return shares Minted shares.\\n function stake(\\n uint256 assets,\\n address receiver,\\n uint16 referral\\n ) public returns (uint256) {\\n // TODO: revisit the type of referral.\\n uint256 shares = deposit(assets, receiver);\\n\\n if (referral > 0) {\\n emit StakeReferral(referral, assets);\\n }\\n\\n return shares;\\n }\\n\\n /// @notice Returns the maximum amount of the tBTC token that can be\\n /// deposited into the vault for the receiver through a deposit\\n /// call. It takes into account the deposit parameter, maximum total\\n /// assets, which determines the total amount of tBTC token held by\\n /// Acre. This function always returns available limit for deposits,\\n /// but the fee is not taken into account. As a result of this, there\\n /// always will be some dust left. If the dust is lower than the\\n /// minimum deposit amount, this function will return 0.\\n /// @return The maximum amount of tBTC token that can be deposited into\\n /// Acre protocol for the receiver.\\n function maxDeposit(address) public view override returns (uint256) {\\n if (maximumTotalAssets == type(uint256).max) {\\n return type(uint256).max;\\n }\\n\\n uint256 currentTotalAssets = totalAssets();\\n if (currentTotalAssets >= maximumTotalAssets) return 0;\\n\\n // Max amount left for next deposits. If it is lower than the minimum\\n // deposit amount, return 0.\\n uint256 unusedLimit = maximumTotalAssets - currentTotalAssets;\\n\\n return minimumDepositAmount > unusedLimit ? 0 : unusedLimit;\\n }\\n\\n /// @notice Returns the maximum amount of the vault shares that can be\\n /// minted for the receiver, through a mint call.\\n /// @dev Since the stBTC contract limits the maximum total tBTC tokens this\\n /// function converts the maximum deposit amount to shares.\\n /// @return The maximum amount of the vault shares.\\n function maxMint(address receiver) public view override returns (uint256) {\\n uint256 _maxDeposit = maxDeposit(receiver);\\n\\n // slither-disable-next-line incorrect-equality\\n return\\n _maxDeposit == type(uint256).max\\n ? type(uint256).max\\n : convertToShares(_maxDeposit);\\n }\\n\\n /// @return Returns deposit parameters.\\n function depositParameters() public view returns (uint256, uint256) {\\n return (minimumDepositAmount, maximumTotalAssets);\\n }\\n\\n /// @notice Redeems shares for tBTC tokens.\\n function _entryFeeBasisPoints() internal view override returns (uint256) {\\n return entryFeeBasisPoints;\\n }\\n\\n /// @notice Returns the address of the treasury wallet, where fees should be\\n /// transferred to.\\n function _feeRecipient() internal view override returns (address) {\\n return treasury;\\n }\\n}\\n\",\"keccak256\":\"0x5e622d3cef791a39b7089c64cacd5c62f14c13af316e2e8a3141244f7f69324e\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", - "bytecode": "0x60c06040523480156200001157600080fd5b5060405162002459380380620024598339810160408190526200003491620002da565b33826040518060400160405280601381526020017f41637265205374616b656420426974636f696e0000000000000000000000000081525060405180604001604052806005815260200164737442544360d81b81525081600390816200009b9190620003be565b506004620000aa8282620003be565b505050600080620000c1836200018a60201b60201c565b9150915081620000d3576012620000d5565b805b60ff1660a05250506001600160a01b0390811660805281166200011257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011d816200026f565b506001600160a01b038116620001465760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03929092169190911790555066038d7ea4c6800060095568015af1d78b58c40000600a556005600855620004d5565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620001d3916200048a565b600060405180830381855afa9150503d806000811462000210576040519150601f19603f3d011682016040523d82523d6000602084013e62000215565b606091505b50915091508180156200022a57506020815110155b156200026257600081806020019051810190620002489190620004bb565b905060ff811162000260576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620002d757600080fd5b50565b60008060408385031215620002ee57600080fd5b8251620002fb81620002c1565b60208401519092506200030e81620002c1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200034457607f821691505b6020821081036200036557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003b957600081815260208120601f850160051c81016020861015620003945750805b601f850160051c820191505b81811015620003b557828155600101620003a0565b5050505b505050565b81516001600160401b03811115620003da57620003da62000319565b620003f281620003eb84546200032f565b846200036b565b602080601f8311600181146200042a5760008415620004115750858301515b600019600386901b1c1916600185901b178555620003b5565b600085815260208120601f198616915b828110156200045b578886015182559484019460019091019084016200043a565b50858210156200047a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b81811015620004ad576020818601810151858301520162000491565b506000920191825250919050565b600060208284031215620004ce57600080fd5b5051919050565b60805160a051611f3462000525600039600061077201526000818161036b01528181610602015281816108a9015281816108ee01528181611209015281816116bc015261186e0152611f346000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", - "devdoc": { - "details": "ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.", - "errors": { - "AddressEmptyCode(address)": [ - { - "details": "There's no code at `target` (it is not a contract)." - } - ], - "AddressInsufficientBalance(address)": [ - { - "details": "The ETH balance of the account is not enough to perform the operation." - } - ], - "ERC20InsufficientAllowance(address,uint256,uint256)": [ - { - "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", - "params": { - "allowance": "Amount of tokens a `spender` is allowed to operate with.", - "needed": "Minimum amount required to perform a transfer.", - "spender": "Address that may be allowed to operate on tokens without being their owner." - } - } - ], - "ERC20InsufficientBalance(address,uint256,uint256)": [ - { - "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", - "params": { - "balance": "Current balance for the interacting account.", - "needed": "Minimum amount required to perform a transfer.", - "sender": "Address whose tokens are being transferred." - } - } - ], - "ERC20InvalidApprover(address)": [ - { - "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", - "params": { - "approver": "Address initiating an approval operation." - } - } - ], - "ERC20InvalidReceiver(address)": [ - { - "details": "Indicates a failure with the token `receiver`. Used in transfers.", - "params": { - "receiver": "Address to which tokens are being transferred." - } - } - ], - "ERC20InvalidSender(address)": [ - { - "details": "Indicates a failure with the token `sender`. Used in transfers.", - "params": { - "sender": "Address whose tokens are being transferred." - } - } - ], - "ERC20InvalidSpender(address)": [ - { - "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", - "params": { - "spender": "Address that may be allowed to operate on tokens without being their owner." - } - } - ], - "ERC4626ExceededMaxDeposit(address,uint256,uint256)": [ - { - "details": "Attempted to deposit more assets than the max amount for `receiver`." - } - ], - "ERC4626ExceededMaxMint(address,uint256,uint256)": [ - { - "details": "Attempted to mint more shares than the max amount for `receiver`." - } - ], - "ERC4626ExceededMaxRedeem(address,uint256,uint256)": [ - { - "details": "Attempted to redeem more shares than the max amount for `receiver`." - } - ], - "ERC4626ExceededMaxWithdraw(address,uint256,uint256)": [ - { - "details": "Attempted to withdraw more assets than the max amount for `receiver`." - } - ], - "FailedInnerCall()": [ - { - "details": "A call to an address target failed. The target may have reverted." - } - ], - "LessThanMinDeposit(uint256,uint256)": [ - { - "params": { - "amount": "Amount to check.", - "min": "Minimum amount to check 'amount' against." - } - } - ], - "MathOverflowedMulDiv()": [ - { - "details": "Muldiv operation overflow." - } - ], - "OwnableInvalidOwner(address)": [ - { - "details": "The owner is not a valid owner account. (eg. `address(0)`)" - } - ], - "OwnableUnauthorizedAccount(address)": [ - { - "details": "The caller account is not authorized to perform an operation." - } - ], - "SafeERC20FailedOperation(address)": [ - { - "details": "An operation with an ERC20 token failed." - } - ] - }, - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." - }, - "DepositParametersUpdated(uint256,uint256)": { - "params": { - "maximumTotalAssets": "New value of the maximum total assets amount.", - "minimumDepositAmount": "New value of the minimum deposit amount." - } - }, - "DispatcherUpdated(address,address)": { - "params": { - "newDispatcher": "Address of the new dispatcher contract.", - "oldDispatcher": "Address of the old dispatcher contract." - } - }, - "EntryFeeBasisPointsUpdated(uint256)": { - "params": { - "entryFeeBasisPoints": "New value of the fee basis points." - } - }, - "StakeReferral(uint16,uint256)": { - "params": { - "assets": "Amount of tBTC tokens staked.", - "referral": "Used for referral program." - } - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." - }, - "TreasuryUpdated(address)": { - "params": { - "treasury": "New treasury wallet address." - } - } - }, - "kind": "dev", - "methods": { - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "asset()": { - "details": "See {IERC4626-asset}. " - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "convertToAssets(uint256)": { - "details": "See {IERC4626-convertToAssets}. " - }, - "convertToShares(uint256)": { - "details": "See {IERC4626-convertToShares}. " - }, - "decimals()": { - "details": "Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}." - }, - "deposit(uint256,address)": { - "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.", - "params": { - "assets": "Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.", - "receiver": "The address to which the shares will be minted." - }, - "returns": { - "_0": "Minted shares adjusted for the fees taken by the treasury." - } - }, - "depositParameters()": { - "returns": { - "_0": "Returns deposit parameters." - } - }, - "maxDeposit(address)": { - "returns": { - "_0": "The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver." - } - }, - "maxMint(address)": { - "details": "Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.", - "returns": { - "_0": "The maximum amount of the vault shares." - } - }, - "maxRedeem(address)": { - "details": "See {IERC4626-maxRedeem}. " - }, - "maxWithdraw(address)": { - "details": "See {IERC4626-maxWithdraw}. " - }, - "mint(uint256,address)": { - "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.", - "params": { - "receiver": "The address to which the shares will be minted.", - "shares": "Amount of shares to mint." - } - }, - "name()": { - "details": "Returns the name of the token." - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "previewDeposit(uint256)": { - "details": "Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}." - }, - "previewMint(uint256)": { - "details": "Preview adding an entry fee on mint. See {IERC4626-previewMint}." - }, - "previewRedeem(uint256)": { - "details": "See {IERC4626-previewRedeem}. " - }, - "previewWithdraw(uint256)": { - "details": "See {IERC4626-previewWithdraw}. " - }, - "redeem(uint256,address,address)": { - "details": "See {IERC4626-redeem}. " - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." - }, - "stake(uint256,address,uint16)": { - "details": "This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.", - "params": { - "assets": "Approved amount for the transfer and stake.", - "receiver": "The address to which the shares will be minted.", - "referral": "Data used for referral program." - }, - "returns": { - "_0": "shares Minted shares." - } - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalAssets()": { - "details": "See {IERC4626-totalAssets}. " - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "updateDepositParameters(uint256,uint256)": { - "details": "To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).", - "params": { - "_maximumTotalAssets": "New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.", - "_minimumDepositAmount": "New value of the minimum deposit amount. It is the minimum amount for a single deposit operation." - } - }, - "updateDispatcher(address)": { - "params": { - "newDispatcher": "Address of the new dispatcher contract." - } - }, - "updateEntryFeeBasisPoints(uint256)": { - "params": { - "newEntryFeeBasisPoints": "New value of the fee basis points." - } - }, - "updateTreasury(address)": { - "params": { - "newTreasury": "New treasury wallet address." - } - }, - "withdraw(uint256,address,address)": { - "details": "See {IERC4626-withdraw}. " - } - }, - "title": "stBTC", - "version": 1 - }, - "userdoc": { - "errors": { - "DisallowedAddress()": [ - { - "notice": "Reverts if the address is disallowed." - } - ], - "LessThanMinDeposit(uint256,uint256)": [ - { - "notice": "Reverts if the amount is less than the minimum deposit amount." - } - ], - "ZeroAddress()": [ - { - "notice": "Reverts if the address is zero." - } - ] - }, - "events": { - "DepositParametersUpdated(uint256,uint256)": { - "notice": "Emitted when deposit parameters are updated." - }, - "DispatcherUpdated(address,address)": { - "notice": "Emitted when the dispatcher contract is updated." - }, - "EntryFeeBasisPointsUpdated(uint256)": { - "notice": "Emitted when the entry fee basis points are updated." - }, - "StakeReferral(uint16,uint256)": { - "notice": "Emitted when a referral is used." - }, - "TreasuryUpdated(address)": { - "notice": "Emitted when the treasury wallet address is updated." - } - }, - "kind": "user", - "methods": { - "deposit(uint256,address)": { - "notice": "Mints shares to receiver by depositing exactly amount of tBTC tokens." - }, - "dispatcher()": { - "notice": "Dispatcher contract that routes tBTC from stBTC to a given vault and back." - }, - "entryFeeBasisPoints()": { - "notice": "Entry fee basis points applied to entry fee calculation." - }, - "maxDeposit(address)": { - "notice": "Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0." - }, - "maxMint(address)": { - "notice": "Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call." - }, - "maximumTotalAssets()": { - "notice": "Maximum total amount of tBTC token held by Acre protocol." - }, - "minimumDepositAmount()": { - "notice": "Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract." - }, - "mint(uint256,address)": { - "notice": "Mints shares to receiver by depositing tBTC tokens." - }, - "stake(uint256,address,uint16)": { - "notice": "Stakes a given amount of tBTC token and mints shares to a receiver." - }, - "treasury()": { - "notice": "Address of the treasury wallet, where fees should be transferred to." - }, - "updateDepositParameters(uint256,uint256)": { - "notice": "Updates deposit parameters." - }, - "updateDispatcher(address)": { - "notice": "Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC." - }, - "updateEntryFeeBasisPoints(uint256)": { - "notice": "Update the entry fee basis points." - }, - "updateTreasury(address)": { - "notice": "Updates treasury wallet address." - } - }, - "notice": "This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \"shares\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 4066, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 4072, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 4074, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 4076, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 4078, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 3597, - "contract": "contracts/stBTC.sol:stBTC", - "label": "_owner", - "offset": 0, - "slot": "5", - "type": "t_address" - }, - { - "astId": 8071, - "contract": "contracts/stBTC.sol:stBTC", - "label": "dispatcher", - "offset": 0, - "slot": "6", - "type": "t_contract(Dispatcher)7334" - }, - { - "astId": 8074, - "contract": "contracts/stBTC.sol:stBTC", - "label": "treasury", - "offset": 0, - "slot": "7", - "type": "t_address" - }, - { - "astId": 8077, - "contract": "contracts/stBTC.sol:stBTC", - "label": "entryFeeBasisPoints", - "offset": 0, - "slot": "8", - "type": "t_uint256" - }, - { - "astId": 8080, - "contract": "contracts/stBTC.sol:stBTC", - "label": "minimumDepositAmount", - "offset": 0, - "slot": "9", - "type": "t_uint256" - }, - { - "astId": 8083, - "contract": "contracts/stBTC.sol:stBTC", - "label": "maximumTotalAssets", - "offset": 0, - "slot": "10", - "type": "t_uint256" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_contract(Dispatcher)7334": { - "encoding": "inplace", - "label": "contract Dispatcher", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } - } \ No newline at end of file From 2cbe08ae589089ce021d105b6d4131df8b621d97 Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 21 Feb 2024 01:36:49 +0100 Subject: [PATCH 04/11] Renamed methods for a staking module, updated docs, moved artifact to the sdk --- sdk/src/lib/contracts/stbtc.ts | 8 + .../lib/ethereum/artifacts/sepolia/stBTC.json | 1748 +++++++++++++++++ sdk/src/lib/ethereum/stbtc.ts | 18 +- sdk/src/modules/staking/index.ts | 4 +- sdk/test/utils/mock-acre-contracts.ts | 9 +- 5 files changed, 1776 insertions(+), 11 deletions(-) create mode 100644 sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json diff --git a/sdk/src/lib/contracts/stbtc.ts b/sdk/src/lib/contracts/stbtc.ts index 55710eb3e..5eac12c4f 100644 --- a/sdk/src/lib/contracts/stbtc.ts +++ b/sdk/src/lib/contracts/stbtc.ts @@ -1,7 +1,15 @@ import { ChainIdentifier } from "./chain-identifier" export interface StBTC { + /** + * @param identifier The generic chain identifier. + * @returns Value of the basis for calculating final BTC balance. + */ balanceOf(identifier: ChainIdentifier): Promise + /** + * @param identifier The generic chain identifier. + * @returns Maximum withdraw value. + */ assetsBalanceOf(identifier: ChainIdentifier): Promise } diff --git a/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json b/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json new file mode 100644 index 000000000..7242abda0 --- /dev/null +++ b/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json @@ -0,0 +1,1748 @@ +{ + "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "_tbtc", + "type": "address" + }, + { + "internalType": "address", + "name": "_treasury", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "DisallowedAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxRedeem", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ERC4626ExceededMaxWithdraw", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + } + ], + "name": "LessThanMinDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "MathOverflowedMulDiv", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "minimumDepositAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maximumTotalAssets", + "type": "uint256" + } + ], + "name": "DepositParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldDispatcher", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newDispatcher", + "type": "address" + } + ], + "name": "DispatcherUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "entryFeeBasisPoints", + "type": "uint256" + } + ], + "name": "EntryFeeBasisPointsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "StakeReferral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "treasury", + "type": "address" + } + ], + "name": "TreasuryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "asset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "convertToAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "convertToShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "depositParameters", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dispatcher", + "outputs": [ + { + "internalType": "contract Dispatcher", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "entryFeeBasisPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "maxDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "maxMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "maxWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumTotalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumDepositAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "name": "previewWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "stake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumDepositAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_maximumTotalAssets", + "type": "uint256" + } + ], + "name": "updateDepositParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Dispatcher", + "name": "newDispatcher", + "type": "address" + } + ], + "name": "updateDispatcher", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newEntryFeeBasisPoints", + "type": "uint256" + } + ], + "name": "updateEntryFeeBasisPoints", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasury", + "type": "address" + } + ], + "name": "updateTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "receipt": { + "to": null, + "from": "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8", + "contractAddress": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "transactionIndex": 82, + "gasUsed": "1951493", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000400000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000012000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e", + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "logs": [ + { + "transactionIndex": 82, + "blockNumber": 5206357, + "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002d154a5c7ce9939274b89bbce9f5b069e57b09a8" + ], + "data": "0x", + "logIndex": 230, + "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e" + } + ], + "blockNumber": 5206357, + "cumulativeGasUsed": "13353873", + "status": 1, + "byzantium": true + }, + "args": [ + "0x517f2982701695D4E52f1ECFBEf3ba31Df470161", + "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8" + ], + "numDeployments": 1, + "solcInputHash": "b22c277b248ba02f9ec5bf62d176f9ce", + "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_tbtc\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisallowedAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"LessThanMinDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumDepositAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"DispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"EntryFeeBasisPointsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"StakeReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dispatcher\",\"outputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"entryFeeBasisPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTotalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumDepositAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"}],\"name\":\"stake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDepositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"updateDispatcher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newEntryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"updateEntryFeeBasisPoints\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"params\":{\"amount\":\"Amount to check.\",\"min\":\"Minimum amount to check 'amount' against.\"}}],\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DepositParametersUpdated(uint256,uint256)\":{\"params\":{\"maximumTotalAssets\":\"New value of the maximum total assets amount.\",\"minimumDepositAmount\":\"New value of the minimum deposit amount.\"}},\"DispatcherUpdated(address,address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\",\"oldDispatcher\":\"Address of the old dispatcher contract.\"}},\"EntryFeeBasisPointsUpdated(uint256)\":{\"params\":{\"entryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"StakeReferral(uint16,uint256)\":{\"params\":{\"assets\":\"Amount of tBTC tokens staked.\",\"referral\":\"Used for referral program.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"TreasuryUpdated(address)\":{\"params\":{\"treasury\":\"New treasury wallet address.\"}}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.\",\"receiver\":\"The address to which the shares will be minted.\"},\"returns\":{\"_0\":\"Minted shares adjusted for the fees taken by the treasury.\"}},\"depositParameters()\":{\"returns\":{\"_0\":\"Returns deposit parameters.\"}},\"maxDeposit(address)\":{\"returns\":{\"_0\":\"The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver.\"}},\"maxMint(address)\":{\"details\":\"Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.\",\"returns\":{\"_0\":\"The maximum amount of the vault shares.\"}},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.\",\"params\":{\"receiver\":\"The address to which the shares will be minted.\",\"shares\":\"Amount of shares to mint.\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"previewDeposit(uint256)\":{\"details\":\"Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\"},\"previewMint(uint256)\":{\"details\":\"Preview adding an entry fee on mint. See {IERC4626-previewMint}.\"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"stake(uint256,address,uint16)\":{\"details\":\"This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount for the transfer and stake.\",\"receiver\":\"The address to which the shares will be minted.\",\"referral\":\"Data used for referral program.\"},\"returns\":{\"_0\":\"shares Minted shares.\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateDepositParameters(uint256,uint256)\":{\"details\":\"To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).\",\"params\":{\"_maximumTotalAssets\":\"New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.\",\"_minimumDepositAmount\":\"New value of the minimum deposit amount. It is the minimum amount for a single deposit operation.\"}},\"updateDispatcher(address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\"}},\"updateEntryFeeBasisPoints(uint256)\":{\"params\":{\"newEntryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"updateTreasury(address)\":{\"params\":{\"newTreasury\":\"New treasury wallet address.\"}},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"stBTC\",\"version\":1},\"userdoc\":{\"errors\":{\"DisallowedAddress()\":[{\"notice\":\"Reverts if the address is disallowed.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"notice\":\"Reverts if the amount is less than the minimum deposit amount.\"}],\"ZeroAddress()\":[{\"notice\":\"Reverts if the address is zero.\"}]},\"events\":{\"DepositParametersUpdated(uint256,uint256)\":{\"notice\":\"Emitted when deposit parameters are updated.\"},\"DispatcherUpdated(address,address)\":{\"notice\":\"Emitted when the dispatcher contract is updated.\"},\"EntryFeeBasisPointsUpdated(uint256)\":{\"notice\":\"Emitted when the entry fee basis points are updated.\"},\"StakeReferral(uint16,uint256)\":{\"notice\":\"Emitted when a referral is used.\"},\"TreasuryUpdated(address)\":{\"notice\":\"Emitted when the treasury wallet address is updated.\"}},\"kind\":\"user\",\"methods\":{\"deposit(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing exactly amount of tBTC tokens.\"},\"dispatcher()\":{\"notice\":\"Dispatcher contract that routes tBTC from stBTC to a given vault and back.\"},\"entryFeeBasisPoints()\":{\"notice\":\"Entry fee basis points applied to entry fee calculation.\"},\"maxDeposit(address)\":{\"notice\":\"Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0.\"},\"maxMint(address)\":{\"notice\":\"Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call.\"},\"maximumTotalAssets()\":{\"notice\":\"Maximum total amount of tBTC token held by Acre protocol.\"},\"minimumDepositAmount()\":{\"notice\":\"Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract.\"},\"mint(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing tBTC tokens.\"},\"stake(uint256,address,uint16)\":{\"notice\":\"Stakes a given amount of tBTC token and mints shares to a receiver.\"},\"treasury()\":{\"notice\":\"Address of the treasury wallet, where fees should be transferred to.\"},\"updateDepositParameters(uint256,uint256)\":{\"notice\":\"Updates deposit parameters.\"},\"updateDispatcher(address)\":{\"notice\":\"Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC.\"},\"updateEntryFeeBasisPoints(uint256)\":{\"notice\":\"Update the entry fee basis points.\"},\"updateTreasury(address)\":{\"notice\":\"Updates treasury wallet address.\"}},\"notice\":\"This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \\\"shares\\\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/stBTC.sol\":\"stBTC\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"./extensions/IERC20Metadata.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n */\\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\\n mapping(address account => uint256) private _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n _totalSupply += value;\\n } else {\\n uint256 fromBalance = _balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n _balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n _totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n _balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n * ```\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n _allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3e1fa9d1987f8d349dfb4d6fe93bf2ca014b52ba335cfac30bfe71e357e6f80\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20, IERC20Metadata, ERC20} from \\\"../ERC20.sol\\\";\\nimport {SafeERC20} from \\\"../utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"../../../interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"../../../utils/math/Math.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\\n * expensive than it is profitable. More details about the underlying math can be found\\n * xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626 is ERC20, IERC4626 {\\n using Math for uint256;\\n\\n IERC20 private immutable _asset;\\n uint8 private immutable _underlyingDecimals;\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\\n */\\n constructor(IERC20 asset_) {\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n _underlyingDecimals = success ? assetDecimals : 18;\\n _asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {\\n return _underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n return address(_asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n return _asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}.\\n *\\n * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\\n * In this case, the shares will be minted without requiring any assets to be deposited.\\n */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer(_asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x1837547e04d5fe5334eeb77a345683c22995f1e7aa033020757ddf83a80fc72d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {FailedInnerCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\\n * unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {FailedInnerCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x75a4ee64c68dbd5f38bddd06e664a64c8271b4caa554fb6f0607dfd672bb4bf3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Muldiv operation overflow.\\n */\\n error MathOverflowedMulDiv();\\n\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n return a / b;\\n }\\n\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n revert MathOverflowedMulDiv();\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\"},\"contracts/Dispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport \\\"./Router.sol\\\";\\nimport \\\"./stBTC.sol\\\";\\n\\n/// @title Dispatcher\\n/// @notice Dispatcher is a contract that routes tBTC from stBTC to\\n/// yield vaults and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\ncontract Dispatcher is Router, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Struct holds information about a vault.\\n struct VaultInfo {\\n bool authorized;\\n }\\n\\n /// The main stBTC contract holding tBTC deposited by stakers.\\n stBTC public immutable stbtc;\\n /// tBTC token contract.\\n IERC20 public immutable tbtc;\\n /// Address of the maintainer bot.\\n address public maintainer;\\n\\n /// Authorized Yield Vaults that implement ERC4626 standard. These\\n /// vaults deposit assets to yield strategies, e.g. Uniswap V3\\n /// WBTC/TBTC pool. Vault can be a part of Acre ecosystem or can be\\n /// implemented externally. As long as it complies with ERC4626\\n /// standard and is authorized by the owner it can be plugged into\\n /// Acre.\\n address[] public vaults;\\n /// Mapping of vaults to their information.\\n mapping(address => VaultInfo) public vaultsInfo;\\n\\n /// Emitted when a vault is authorized.\\n /// @param vault Address of the vault.\\n event VaultAuthorized(address indexed vault);\\n\\n /// Emitted when a vault is deauthorized.\\n /// @param vault Address of the vault.\\n event VaultDeauthorized(address indexed vault);\\n\\n /// Emitted when tBTC is routed to a vault.\\n /// @param vault Address of the vault.\\n /// @param amount Amount of tBTC.\\n /// @param sharesOut Amount of received shares.\\n event DepositAllocated(\\n address indexed vault,\\n uint256 amount,\\n uint256 sharesOut\\n );\\n\\n /// Emitted when the maintainer address is updated.\\n /// @param maintainer Address of the new maintainer.\\n event MaintainerUpdated(address indexed maintainer);\\n\\n /// Reverts if the vault is already authorized.\\n error VaultAlreadyAuthorized();\\n\\n /// Reverts if the vault is not authorized.\\n error VaultUnauthorized();\\n\\n /// Reverts if the caller is not the maintainer.\\n error NotMaintainer();\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Modifier that reverts if the caller is not the maintainer.\\n modifier onlyMaintainer() {\\n if (msg.sender != maintainer) {\\n revert NotMaintainer();\\n }\\n _;\\n }\\n\\n constructor(stBTC _stbtc, IERC20 _tbtc) Ownable(msg.sender) {\\n stbtc = _stbtc;\\n tbtc = _tbtc;\\n }\\n\\n /// @notice Adds a vault to the list of authorized vaults.\\n /// @param vault Address of the vault to add.\\n function authorizeVault(address vault) external onlyOwner {\\n if (isVaultAuthorized(vault)) {\\n revert VaultAlreadyAuthorized();\\n }\\n\\n vaults.push(vault);\\n vaultsInfo[vault].authorized = true;\\n\\n emit VaultAuthorized(vault);\\n }\\n\\n /// @notice Removes a vault from the list of authorized vaults.\\n /// @param vault Address of the vault to remove.\\n function deauthorizeVault(address vault) external onlyOwner {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n vaultsInfo[vault].authorized = false;\\n\\n for (uint256 i = 0; i < vaults.length; i++) {\\n if (vaults[i] == vault) {\\n vaults[i] = vaults[vaults.length - 1];\\n // slither-disable-next-line costly-loop\\n vaults.pop();\\n break;\\n }\\n }\\n\\n emit VaultDeauthorized(vault);\\n }\\n\\n /// @notice Updates the maintainer address.\\n /// @param newMaintainer Address of the new maintainer.\\n function updateMaintainer(address newMaintainer) external onlyOwner {\\n if (newMaintainer == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n maintainer = newMaintainer;\\n\\n emit MaintainerUpdated(maintainer);\\n }\\n\\n /// TODO: make this function internal once the allocation distribution is\\n /// implemented\\n /// @notice Routes tBTC from stBTC to a vault. Can be called by the maintainer\\n /// only.\\n /// @param vault Address of the vault to route the assets to.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function depositToVault(\\n address vault,\\n uint256 amount,\\n uint256 minSharesOut\\n ) public onlyMaintainer {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n // slither-disable-next-line arbitrary-send-erc20\\n tbtc.safeTransferFrom(address(stbtc), address(this), amount);\\n tbtc.forceApprove(address(vault), amount);\\n\\n uint256 sharesOut = deposit(\\n IERC4626(vault),\\n address(stbtc),\\n amount,\\n minSharesOut\\n );\\n // slither-disable-next-line reentrancy-events\\n emit DepositAllocated(vault, amount, sharesOut);\\n }\\n\\n /// @notice Returns the list of authorized vaults.\\n function getVaults() public view returns (address[] memory) {\\n return vaults;\\n }\\n\\n /// @notice Returns true if the vault is authorized.\\n /// @param vault Address of the vault to check.\\n function isVaultAuthorized(address vault) public view returns (bool) {\\n return vaultsInfo[vault].authorized;\\n }\\n\\n /// TODO: implement redeem() / withdraw() functions\\n}\\n\",\"keccak256\":\"0x0dd77692ab8c6059afa7b4a90f26733560b53fb66192e9912a2064103c5d41fb\",\"license\":\"GPL-3.0-only\"},\"contracts/Router.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\n/// @title Router\\n/// @notice Router is a contract that routes tBTC from stBTC to\\n/// a given vault and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\nabstract contract Router {\\n /// Thrown when amount of shares received is below the min set by caller.\\n /// @param vault Address of the vault.\\n /// @param sharesOut Amount of received shares.\\n /// @param minSharesOut Minimum amount of shares expected to receive.\\n error MinSharesError(\\n address vault,\\n uint256 sharesOut,\\n uint256 minSharesOut\\n );\\n\\n /// @notice Routes funds from stBTC to a vault. The amount of tBTC to\\n /// Shares of deposited tBTC are minted to the stBTC contract.\\n /// @param vault Address of the vault to route the funds to.\\n /// @param receiver Address of the receiver of the shares.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function deposit(\\n IERC4626 vault,\\n address receiver,\\n uint256 amount,\\n uint256 minSharesOut\\n ) internal returns (uint256 sharesOut) {\\n if ((sharesOut = vault.deposit(amount, receiver)) < minSharesOut) {\\n revert MinSharesError(address(vault), sharesOut, minSharesOut);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x520e27c613f1234755c23402524b048a81abd15222d7f318504992d490248812\",\"license\":\"GPL-3.0-only\"},\"contracts/lib/ERC4626Fees.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// Inspired by https://docs.openzeppelin.com/contracts/5.x/erc4626#fees\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {ERC4626} from \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {Math} from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @dev ERC4626 vault with entry/exit fees expressed in https://en.wikipedia.org/wiki/Basis_point[basis point (bp)].\\nabstract contract ERC4626Fees is ERC4626 {\\n using Math for uint256;\\n\\n uint256 private constant _BASIS_POINT_SCALE = 1e4;\\n\\n // === Overrides ===\\n\\n /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\\n function previewDeposit(\\n uint256 assets\\n ) public view virtual override returns (uint256) {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n return super.previewDeposit(assets - fee);\\n }\\n\\n /// @dev Preview adding an entry fee on mint. See {IERC4626-previewMint}.\\n function previewMint(\\n uint256 shares\\n ) public view virtual override returns (uint256) {\\n uint256 assets = super.previewMint(shares);\\n return assets + _feeOnRaw(assets, _entryFeeBasisPoints());\\n }\\n\\n // TODO: add previewWithraw\\n\\n // TODO: add previewRedeem\\n\\n /// @dev Send entry fee to {_feeRecipient}. See {IERC4626-_deposit}.\\n function _deposit(\\n address caller,\\n address receiver,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual override {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n address recipient = _feeRecipient();\\n\\n super._deposit(caller, receiver, assets, shares);\\n\\n if (fee > 0 && recipient != address(this)) {\\n SafeERC20.safeTransfer(IERC20(asset()), recipient, fee);\\n }\\n }\\n\\n // TODO: add withdraw\\n\\n // === Fee configuration ===\\n\\n // slither-disable-next-line dead-code\\n function _entryFeeBasisPoints() internal view virtual returns (uint256);\\n\\n // TODO: add exitFeeBasisPoints\\n\\n // slither-disable-next-line dead-code\\n function _feeRecipient() internal view virtual returns (address);\\n\\n // === Fee operations ===\\n\\n /// @dev Calculates the fees that should be added to an amount `assets`\\n /// that does not already include fees.\\n /// Used in {IERC4626-mint} and {IERC4626-withdraw} operations.\\n function _feeOnRaw(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n\\n /// @dev Calculates the fee part of an amount `assets` that already includes fees.\\n /// Used in {IERC4626-deposit} and {IERC4626-redeem} operations.\\n function _feeOnTotal(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n feeBasisPoints + _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n}\\n\",\"keccak256\":\"0xccfc01be23cbc979745a6e7f3421c4d050dc2ad7ddb6d9e1543c8e681e91d596\",\"license\":\"MIT\"},\"contracts/stBTC.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Dispatcher.sol\\\";\\nimport \\\"./lib/ERC4626Fees.sol\\\";\\n\\n/// @title stBTC\\n/// @notice This contract implements the ERC-4626 tokenized vault standard. By\\n/// staking tBTC, users acquire a liquid staking token called stBTC,\\n/// commonly referred to as \\\"shares\\\". The staked tBTC is securely\\n/// deposited into Acre's vaults, where it generates yield over time.\\n/// Users have the flexibility to redeem stBTC, enabling them to\\n/// withdraw their staked tBTC along with the accrued yield.\\n/// @dev ERC-4626 is a standard to optimize and unify the technical parameters\\n/// of yield-bearing vaults. This contract facilitates the minting and\\n/// burning of shares (stBTC), which are represented as standard ERC20\\n/// tokens, providing a seamless exchange with tBTC tokens.\\ncontract stBTC is ERC4626Fees, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Dispatcher contract that routes tBTC from stBTC to a given vault and back.\\n Dispatcher public dispatcher;\\n\\n /// Address of the treasury wallet, where fees should be transferred to.\\n address public treasury;\\n\\n /// Entry fee basis points applied to entry fee calculation.\\n uint256 public entryFeeBasisPoints;\\n\\n /// Minimum amount for a single deposit operation. The value should be set\\n /// low enough so the deposits routed through TbtcDepositor contract won't\\n /// be rejected. It means that minimumDepositAmount should be lower than\\n /// tBTC protocol's depositDustThreshold reduced by all the minting fees taken\\n /// before depositing in the Acre contract.\\n uint256 public minimumDepositAmount;\\n\\n /// Maximum total amount of tBTC token held by Acre protocol.\\n uint256 public maximumTotalAssets;\\n\\n /// Emitted when a referral is used.\\n /// @param referral Used for referral program.\\n /// @param assets Amount of tBTC tokens staked.\\n event StakeReferral(uint16 indexed referral, uint256 assets);\\n\\n /// Emitted when the treasury wallet address is updated.\\n /// @param treasury New treasury wallet address.\\n event TreasuryUpdated(address treasury);\\n\\n /// Emitted when deposit parameters are updated.\\n /// @param minimumDepositAmount New value of the minimum deposit amount.\\n /// @param maximumTotalAssets New value of the maximum total assets amount.\\n event DepositParametersUpdated(\\n uint256 minimumDepositAmount,\\n uint256 maximumTotalAssets\\n );\\n\\n /// Emitted when the dispatcher contract is updated.\\n /// @param oldDispatcher Address of the old dispatcher contract.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n event DispatcherUpdated(address oldDispatcher, address newDispatcher);\\n\\n /// Emitted when the entry fee basis points are updated.\\n /// @param entryFeeBasisPoints New value of the fee basis points.\\n event EntryFeeBasisPointsUpdated(uint256 entryFeeBasisPoints);\\n\\n /// Reverts if the amount is less than the minimum deposit amount.\\n /// @param amount Amount to check.\\n /// @param min Minimum amount to check 'amount' against.\\n error LessThanMinDeposit(uint256 amount, uint256 min);\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Reverts if the address is disallowed.\\n error DisallowedAddress();\\n\\n constructor(\\n IERC20 _tbtc,\\n address _treasury\\n ) ERC4626(_tbtc) ERC20(\\\"Acre Staked Bitcoin\\\", \\\"stBTC\\\") Ownable(msg.sender) {\\n if (address(_treasury) == address(0)) {\\n revert ZeroAddress();\\n }\\n treasury = _treasury;\\n // TODO: Revisit the exact values closer to the launch.\\n minimumDepositAmount = 0.001 * 1e18; // 0.001 tBTC\\n maximumTotalAssets = 25 * 1e18; // 25 tBTC\\n entryFeeBasisPoints = 5; // 5bps == 0.05% == 0.0005\\n }\\n\\n /// @notice Updates treasury wallet address.\\n /// @param newTreasury New treasury wallet address.\\n function updateTreasury(address newTreasury) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n if (newTreasury == address(0)) {\\n revert ZeroAddress();\\n }\\n if (newTreasury == address(this)) {\\n revert DisallowedAddress();\\n }\\n treasury = newTreasury;\\n\\n emit TreasuryUpdated(newTreasury);\\n }\\n\\n /// @notice Updates deposit parameters.\\n /// @dev To disable the limit for deposits, set the maximum total assets to\\n /// maximum (`type(uint256).max`).\\n /// @param _minimumDepositAmount New value of the minimum deposit amount. It\\n /// is the minimum amount for a single deposit operation.\\n /// @param _maximumTotalAssets New value of the maximum total assets amount.\\n /// It is the maximum amount of the tBTC token that the Acre protocol\\n /// can hold.\\n function updateDepositParameters(\\n uint256 _minimumDepositAmount,\\n uint256 _maximumTotalAssets\\n ) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n minimumDepositAmount = _minimumDepositAmount;\\n maximumTotalAssets = _maximumTotalAssets;\\n\\n emit DepositParametersUpdated(\\n _minimumDepositAmount,\\n _maximumTotalAssets\\n );\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Updates the dispatcher contract and gives it an unlimited\\n /// allowance to transfer staked tBTC.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n function updateDispatcher(Dispatcher newDispatcher) external onlyOwner {\\n if (address(newDispatcher) == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n address oldDispatcher = address(dispatcher);\\n\\n emit DispatcherUpdated(oldDispatcher, address(newDispatcher));\\n dispatcher = newDispatcher;\\n\\n // TODO: Once withdrawal/rebalancing is implemented, we need to revoke the\\n // approval of the vaults share tokens from the old dispatcher and approve\\n // a new dispatcher to manage the share tokens.\\n\\n if (oldDispatcher != address(0)) {\\n // Setting allowance to zero for the old dispatcher\\n IERC20(asset()).forceApprove(oldDispatcher, 0);\\n }\\n\\n // Setting allowance to max for the new dispatcher\\n IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Update the entry fee basis points.\\n /// @param newEntryFeeBasisPoints New value of the fee basis points.\\n function updateEntryFeeBasisPoints(\\n uint256 newEntryFeeBasisPoints\\n ) external onlyOwner {\\n entryFeeBasisPoints = newEntryFeeBasisPoints;\\n\\n emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints);\\n }\\n\\n /// @notice Mints shares to receiver by depositing exactly amount of\\n /// tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// @param assets Approved amount of tBTC tokens to deposit. This includes\\n /// treasury fees for staking tBTC.\\n /// @param receiver The address to which the shares will be minted.\\n /// @return Minted shares adjusted for the fees taken by the treasury.\\n function deposit(\\n uint256 assets,\\n address receiver\\n ) public override returns (uint256) {\\n if (assets < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n\\n return super.deposit(assets, receiver);\\n }\\n\\n /// @notice Mints shares to receiver by depositing tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// The msg.sender is required to grant approval for the transfer of a\\n /// certain amount of tBTC, and in addition, approval for the associated\\n /// fee. Specifically, the total amount to be approved (amountToApprove)\\n /// should be equal to the sum of the deposited amount and the fee.\\n /// To determine the total assets amount necessary for approval\\n /// corresponding to a given share amount, use the `previewMint` function.\\n /// @param shares Amount of shares to mint.\\n /// @param receiver The address to which the shares will be minted.\\n function mint(\\n uint256 shares,\\n address receiver\\n ) public override returns (uint256 assets) {\\n if ((assets = super.mint(shares, receiver)) < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n }\\n\\n /// @notice Stakes a given amount of tBTC token and mints shares to a\\n /// receiver.\\n /// @dev This function calls `deposit` function from `ERC4626` contract. The\\n /// amount of the assets has to be pre-approved in the tBTC contract.\\n /// @param assets Approved amount for the transfer and stake.\\n /// @param receiver The address to which the shares will be minted.\\n /// @param referral Data used for referral program.\\n /// @return shares Minted shares.\\n function stake(\\n uint256 assets,\\n address receiver,\\n uint16 referral\\n ) public returns (uint256) {\\n // TODO: revisit the type of referral.\\n uint256 shares = deposit(assets, receiver);\\n\\n if (referral > 0) {\\n emit StakeReferral(referral, assets);\\n }\\n\\n return shares;\\n }\\n\\n /// @notice Returns the maximum amount of the tBTC token that can be\\n /// deposited into the vault for the receiver through a deposit\\n /// call. It takes into account the deposit parameter, maximum total\\n /// assets, which determines the total amount of tBTC token held by\\n /// Acre. This function always returns available limit for deposits,\\n /// but the fee is not taken into account. As a result of this, there\\n /// always will be some dust left. If the dust is lower than the\\n /// minimum deposit amount, this function will return 0.\\n /// @return The maximum amount of tBTC token that can be deposited into\\n /// Acre protocol for the receiver.\\n function maxDeposit(address) public view override returns (uint256) {\\n if (maximumTotalAssets == type(uint256).max) {\\n return type(uint256).max;\\n }\\n\\n uint256 currentTotalAssets = totalAssets();\\n if (currentTotalAssets >= maximumTotalAssets) return 0;\\n\\n // Max amount left for next deposits. If it is lower than the minimum\\n // deposit amount, return 0.\\n uint256 unusedLimit = maximumTotalAssets - currentTotalAssets;\\n\\n return minimumDepositAmount > unusedLimit ? 0 : unusedLimit;\\n }\\n\\n /// @notice Returns the maximum amount of the vault shares that can be\\n /// minted for the receiver, through a mint call.\\n /// @dev Since the stBTC contract limits the maximum total tBTC tokens this\\n /// function converts the maximum deposit amount to shares.\\n /// @return The maximum amount of the vault shares.\\n function maxMint(address receiver) public view override returns (uint256) {\\n uint256 _maxDeposit = maxDeposit(receiver);\\n\\n // slither-disable-next-line incorrect-equality\\n return\\n _maxDeposit == type(uint256).max\\n ? type(uint256).max\\n : convertToShares(_maxDeposit);\\n }\\n\\n /// @return Returns deposit parameters.\\n function depositParameters() public view returns (uint256, uint256) {\\n return (minimumDepositAmount, maximumTotalAssets);\\n }\\n\\n /// @notice Redeems shares for tBTC tokens.\\n function _entryFeeBasisPoints() internal view override returns (uint256) {\\n return entryFeeBasisPoints;\\n }\\n\\n /// @notice Returns the address of the treasury wallet, where fees should be\\n /// transferred to.\\n function _feeRecipient() internal view override returns (address) {\\n return treasury;\\n }\\n}\\n\",\"keccak256\":\"0x5e622d3cef791a39b7089c64cacd5c62f14c13af316e2e8a3141244f7f69324e\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b5060405162002459380380620024598339810160408190526200003491620002da565b33826040518060400160405280601381526020017f41637265205374616b656420426974636f696e0000000000000000000000000081525060405180604001604052806005815260200164737442544360d81b81525081600390816200009b9190620003be565b506004620000aa8282620003be565b505050600080620000c1836200018a60201b60201c565b9150915081620000d3576012620000d5565b805b60ff1660a05250506001600160a01b0390811660805281166200011257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011d816200026f565b506001600160a01b038116620001465760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03929092169190911790555066038d7ea4c6800060095568015af1d78b58c40000600a556005600855620004d5565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620001d3916200048a565b600060405180830381855afa9150503d806000811462000210576040519150601f19603f3d011682016040523d82523d6000602084013e62000215565b606091505b50915091508180156200022a57506020815110155b156200026257600081806020019051810190620002489190620004bb565b905060ff811162000260576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620002d757600080fd5b50565b60008060408385031215620002ee57600080fd5b8251620002fb81620002c1565b60208401519092506200030e81620002c1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200034457607f821691505b6020821081036200036557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003b957600081815260208120601f850160051c81016020861015620003945750805b601f850160051c820191505b81811015620003b557828155600101620003a0565b5050505b505050565b81516001600160401b03811115620003da57620003da62000319565b620003f281620003eb84546200032f565b846200036b565b602080601f8311600181146200042a5760008415620004115750858301515b600019600386901b1c1916600185901b178555620003b5565b600085815260208120601f198616915b828110156200045b578886015182559484019460019091019084016200043a565b50858210156200047a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b81811015620004ad576020818601810151858301520162000491565b506000920191825250919050565b600060208284031215620004ce57600080fd5b5051919050565b60805160a051611f3462000525600039600061077201526000818161036b01528181610602015281816108a9015281816108ee01528181611209015281816116bc015261186e0152611f346000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", + "devdoc": { + "details": "ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "AddressInsufficientBalance(address)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "ERC20InsufficientAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", + "params": { + "allowance": "Amount of tokens a `spender` is allowed to operate with.", + "needed": "Minimum amount required to perform a transfer.", + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC20InsufficientBalance(address,uint256,uint256)": [ + { + "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", + "params": { + "balance": "Current balance for the interacting account.", + "needed": "Minimum amount required to perform a transfer.", + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC20InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC20InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidSpender(address)": [ + { + "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", + "params": { + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC4626ExceededMaxDeposit(address,uint256,uint256)": [ + { + "details": "Attempted to deposit more assets than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxMint(address,uint256,uint256)": [ + { + "details": "Attempted to mint more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxRedeem(address,uint256,uint256)": [ + { + "details": "Attempted to redeem more shares than the max amount for `receiver`." + } + ], + "ERC4626ExceededMaxWithdraw(address,uint256,uint256)": [ + { + "details": "Attempted to withdraw more assets than the max amount for `receiver`." + } + ], + "FailedInnerCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "LessThanMinDeposit(uint256,uint256)": [ + { + "params": { + "amount": "Amount to check.", + "min": "Minimum amount to check 'amount' against." + } + } + ], + "MathOverflowedMulDiv()": [ + { + "details": "Muldiv operation overflow." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC20 token failed." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "DepositParametersUpdated(uint256,uint256)": { + "params": { + "maximumTotalAssets": "New value of the maximum total assets amount.", + "minimumDepositAmount": "New value of the minimum deposit amount." + } + }, + "DispatcherUpdated(address,address)": { + "params": { + "newDispatcher": "Address of the new dispatcher contract.", + "oldDispatcher": "Address of the old dispatcher contract." + } + }, + "EntryFeeBasisPointsUpdated(uint256)": { + "params": { + "entryFeeBasisPoints": "New value of the fee basis points." + } + }, + "StakeReferral(uint16,uint256)": { + "params": { + "assets": "Amount of tBTC tokens staked.", + "referral": "Used for referral program." + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + }, + "TreasuryUpdated(address)": { + "params": { + "treasury": "New treasury wallet address." + } + } + }, + "kind": "dev", + "methods": { + "allowance(address,address)": { + "details": "See {IERC20-allowance}." + }, + "approve(address,uint256)": { + "details": "See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." + }, + "asset()": { + "details": "See {IERC4626-asset}. " + }, + "balanceOf(address)": { + "details": "See {IERC20-balanceOf}." + }, + "convertToAssets(uint256)": { + "details": "See {IERC4626-convertToAssets}. " + }, + "convertToShares(uint256)": { + "details": "See {IERC4626-convertToShares}. " + }, + "decimals()": { + "details": "Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}." + }, + "deposit(uint256,address)": { + "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.", + "params": { + "assets": "Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.", + "receiver": "The address to which the shares will be minted." + }, + "returns": { + "_0": "Minted shares adjusted for the fees taken by the treasury." + } + }, + "depositParameters()": { + "returns": { + "_0": "Returns deposit parameters." + } + }, + "maxDeposit(address)": { + "returns": { + "_0": "The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver." + } + }, + "maxMint(address)": { + "details": "Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.", + "returns": { + "_0": "The maximum amount of the vault shares." + } + }, + "maxRedeem(address)": { + "details": "See {IERC4626-maxRedeem}. " + }, + "maxWithdraw(address)": { + "details": "See {IERC4626-maxWithdraw}. " + }, + "mint(uint256,address)": { + "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.", + "params": { + "receiver": "The address to which the shares will be minted.", + "shares": "Amount of shares to mint." + } + }, + "name()": { + "details": "Returns the name of the token." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "previewDeposit(uint256)": { + "details": "Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}." + }, + "previewMint(uint256)": { + "details": "Preview adding an entry fee on mint. See {IERC4626-previewMint}." + }, + "previewRedeem(uint256)": { + "details": "See {IERC4626-previewRedeem}. " + }, + "previewWithdraw(uint256)": { + "details": "See {IERC4626-previewWithdraw}. " + }, + "redeem(uint256,address,address)": { + "details": "See {IERC4626-redeem}. " + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "stake(uint256,address,uint16)": { + "details": "This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.", + "params": { + "assets": "Approved amount for the transfer and stake.", + "receiver": "The address to which the shares will be minted.", + "referral": "Data used for referral program." + }, + "returns": { + "_0": "shares Minted shares." + } + }, + "symbol()": { + "details": "Returns the symbol of the token, usually a shorter version of the name." + }, + "totalAssets()": { + "details": "See {IERC4626-totalAssets}. " + }, + "totalSupply()": { + "details": "See {IERC20-totalSupply}." + }, + "transfer(address,uint256)": { + "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateDepositParameters(uint256,uint256)": { + "details": "To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).", + "params": { + "_maximumTotalAssets": "New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.", + "_minimumDepositAmount": "New value of the minimum deposit amount. It is the minimum amount for a single deposit operation." + } + }, + "updateDispatcher(address)": { + "params": { + "newDispatcher": "Address of the new dispatcher contract." + } + }, + "updateEntryFeeBasisPoints(uint256)": { + "params": { + "newEntryFeeBasisPoints": "New value of the fee basis points." + } + }, + "updateTreasury(address)": { + "params": { + "newTreasury": "New treasury wallet address." + } + }, + "withdraw(uint256,address,address)": { + "details": "See {IERC4626-withdraw}. " + } + }, + "title": "stBTC", + "version": 1 + }, + "userdoc": { + "errors": { + "DisallowedAddress()": [ + { + "notice": "Reverts if the address is disallowed." + } + ], + "LessThanMinDeposit(uint256,uint256)": [ + { + "notice": "Reverts if the amount is less than the minimum deposit amount." + } + ], + "ZeroAddress()": [ + { + "notice": "Reverts if the address is zero." + } + ] + }, + "events": { + "DepositParametersUpdated(uint256,uint256)": { + "notice": "Emitted when deposit parameters are updated." + }, + "DispatcherUpdated(address,address)": { + "notice": "Emitted when the dispatcher contract is updated." + }, + "EntryFeeBasisPointsUpdated(uint256)": { + "notice": "Emitted when the entry fee basis points are updated." + }, + "StakeReferral(uint16,uint256)": { + "notice": "Emitted when a referral is used." + }, + "TreasuryUpdated(address)": { + "notice": "Emitted when the treasury wallet address is updated." + } + }, + "kind": "user", + "methods": { + "deposit(uint256,address)": { + "notice": "Mints shares to receiver by depositing exactly amount of tBTC tokens." + }, + "dispatcher()": { + "notice": "Dispatcher contract that routes tBTC from stBTC to a given vault and back." + }, + "entryFeeBasisPoints()": { + "notice": "Entry fee basis points applied to entry fee calculation." + }, + "maxDeposit(address)": { + "notice": "Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0." + }, + "maxMint(address)": { + "notice": "Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call." + }, + "maximumTotalAssets()": { + "notice": "Maximum total amount of tBTC token held by Acre protocol." + }, + "minimumDepositAmount()": { + "notice": "Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract." + }, + "mint(uint256,address)": { + "notice": "Mints shares to receiver by depositing tBTC tokens." + }, + "stake(uint256,address,uint16)": { + "notice": "Stakes a given amount of tBTC token and mints shares to a receiver." + }, + "treasury()": { + "notice": "Address of the treasury wallet, where fees should be transferred to." + }, + "updateDepositParameters(uint256,uint256)": { + "notice": "Updates deposit parameters." + }, + "updateDispatcher(address)": { + "notice": "Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC." + }, + "updateEntryFeeBasisPoints(uint256)": { + "notice": "Update the entry fee basis points." + }, + "updateTreasury(address)": { + "notice": "Updates treasury wallet address." + } + }, + "notice": "This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \"shares\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 4066, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_balances", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4072, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_allowances", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 4074, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_totalSupply", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 4076, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 4078, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_symbol", + "offset": 0, + "slot": "4", + "type": "t_string_storage" + }, + { + "astId": 3597, + "contract": "contracts/stBTC.sol:stBTC", + "label": "_owner", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 8071, + "contract": "contracts/stBTC.sol:stBTC", + "label": "dispatcher", + "offset": 0, + "slot": "6", + "type": "t_contract(Dispatcher)7334" + }, + { + "astId": 8074, + "contract": "contracts/stBTC.sol:stBTC", + "label": "treasury", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 8077, + "contract": "contracts/stBTC.sol:stBTC", + "label": "entryFeeBasisPoints", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 8080, + "contract": "contracts/stBTC.sol:stBTC", + "label": "minimumDepositAmount", + "offset": 0, + "slot": "9", + "type": "t_uint256" + }, + { + "astId": 8083, + "contract": "contracts/stBTC.sol:stBTC", + "label": "maximumTotalAssets", + "offset": 0, + "slot": "10", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(Dispatcher)7334": { + "encoding": "inplace", + "label": "contract Dispatcher", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} diff --git a/sdk/src/lib/ethereum/stbtc.ts b/sdk/src/lib/ethereum/stbtc.ts index b33d2d0e0..6be09bb18 100644 --- a/sdk/src/lib/ethereum/stbtc.ts +++ b/sdk/src/lib/ethereum/stbtc.ts @@ -1,5 +1,5 @@ import { StBTC as StBTCTypechain } from "core/typechain/contracts/StBTC" -import SepoliaTbtcDepositor from "core/deployments/sepolia/stBTC.json" +import stBTC from "./artifacts/sepolia/stBTC.json" import { EthersContractConfig, EthersContractDeployment, @@ -20,7 +20,7 @@ class EthereumStBTC switch (network) { case "sepolia": - artifact = SepoliaTbtcDepositor as EthersContractDeployment + artifact = stBTC break case "mainnet": default: @@ -31,19 +31,21 @@ class EthereumStBTC } /** - * Get a generic chain identifier - * @returns value of the basis for calculating final BTC balance + * Get a generic chain identifier. + * @returns Value of the basis for calculating final BTC balance. + * @see {StBTCTypechain#balanceOf} */ balanceOf(identifier: ChainIdentifier): Promise { - return this.instance.balanceOf(identifier.identifierHex) + return this.instance.balanceOf(`0x${identifier.identifierHex}`) } /** - * Get a generic chain identifier - * @returns maximum withdraw value + * Get a generic chain identifier. + * @returns Maximum withdraw value. + * @see {StBTCTypechain#assetsBalanceOf} */ assetsBalanceOf(identifier: ChainIdentifier): Promise { - return this.instance.assetsBalanceOf(identifier.identifierHex) + return this.instance.assetsBalanceOf(`0x${identifier.identifierHex}`) } } diff --git a/sdk/src/modules/staking/index.ts b/sdk/src/modules/staking/index.ts index 3d216d572..6b4f891f8 100644 --- a/sdk/src/modules/staking/index.ts +++ b/sdk/src/modules/staking/index.ts @@ -61,11 +61,11 @@ class StakingModule { ) } - balanceOf(identifier: ChainIdentifier) { + sharesBalance(identifier: ChainIdentifier) { return this.#contracts.stBTC.balanceOf(identifier) } - assetsBalanceOf(identifier: ChainIdentifier) { + estimatedBitcoinBalance(identifier: ChainIdentifier) { return this.#contracts.stBTC.assetsBalanceOf(identifier) } } diff --git a/sdk/test/utils/mock-acre-contracts.ts b/sdk/test/utils/mock-acre-contracts.ts index 111554b39..31e462f70 100644 --- a/sdk/test/utils/mock-acre-contracts.ts +++ b/sdk/test/utils/mock-acre-contracts.ts @@ -1,9 +1,11 @@ -import { AcreContracts, TBTCDepositor } from "../../src/lib/contracts" +import { AcreContracts, StBTC, TBTCDepositor } from "../../src/lib/contracts" // eslint-disable-next-line import/prefer-default-export export class MockAcreContracts implements AcreContracts { public readonly tbtcDepositor: TBTCDepositor + public readonly stBTC: StBTC + constructor() { this.tbtcDepositor = { getChainIdentifier: jest.fn(), @@ -12,5 +14,10 @@ export class MockAcreContracts implements AcreContracts { encodeExtraData: jest.fn(), revealDeposit: jest.fn(), } as TBTCDepositor + + this.stBTC = { + balanceOf: jest.fn(), + assetsBalanceOf: jest.fn(), + } as StBTC } } From 5d37bf3c2d30d948e55feeb633fda77504d5e745 Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 21 Feb 2024 21:11:37 +0100 Subject: [PATCH 05/11] Docs comments update for stBTC --- sdk/src/lib/ethereum/stbtc.ts | 4 ---- sdk/src/modules/staking/index.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/src/lib/ethereum/stbtc.ts b/sdk/src/lib/ethereum/stbtc.ts index 6be09bb18..1a23bd1ef 100644 --- a/sdk/src/lib/ethereum/stbtc.ts +++ b/sdk/src/lib/ethereum/stbtc.ts @@ -31,8 +31,6 @@ class EthereumStBTC } /** - * Get a generic chain identifier. - * @returns Value of the basis for calculating final BTC balance. * @see {StBTCTypechain#balanceOf} */ balanceOf(identifier: ChainIdentifier): Promise { @@ -40,8 +38,6 @@ class EthereumStBTC } /** - * Get a generic chain identifier. - * @returns Maximum withdraw value. * @see {StBTCTypechain#assetsBalanceOf} */ assetsBalanceOf(identifier: ChainIdentifier): Promise { diff --git a/sdk/src/modules/staking/index.ts b/sdk/src/modules/staking/index.ts index 6b4f891f8..9f8636210 100644 --- a/sdk/src/modules/staking/index.ts +++ b/sdk/src/modules/staking/index.ts @@ -61,10 +61,18 @@ class StakingModule { ) } + /** + * @param identifier The generic chain identifier. + * @returns Value of the basis for calculating final BTC balance. + */ sharesBalance(identifier: ChainIdentifier) { return this.#contracts.stBTC.balanceOf(identifier) } + /** + * @param identifier The generic chain identifier. + * @returns Maximum withdraw value. + */ estimatedBitcoinBalance(identifier: ChainIdentifier) { return this.#contracts.stBTC.assetsBalanceOf(identifier) } From 43a91a55273d302f02ae0a53953eecfeab0784cf Mon Sep 17 00:00:00 2001 From: ioay Date: Thu, 22 Feb 2024 16:22:18 +0100 Subject: [PATCH 06/11] Added unit tests for staking module to handle current position --- sdk/test/modules/staking.test.ts | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sdk/test/modules/staking.test.ts b/sdk/test/modules/staking.test.ts index 47aa920f1..d396e0aba 100644 --- a/sdk/test/modules/staking.test.ts +++ b/sdk/test/modules/staking.test.ts @@ -227,4 +227,38 @@ describe("Staking", () => { }) }) }) + + describe("sharesBalance", () => { + const { staker } = stakingModuleData.initializeStake + + beforeAll(() => { + staking.sharesBalance = jest.fn().mockResolvedValue(4294967295) + }) + + it("should be defined", () => { + expect(staking.sharesBalance).toBeDefined() + }) + + it("should return final BTC balance", async () => { + const result = await staking.sharesBalance(staker) + expect(result).toEqual(4294967295) + }) + }) + + describe("estimatedBitcoinBalance", () => { + const { staker } = stakingModuleData.initializeStake + + beforeAll(() => { + staking.estimatedBitcoinBalance = jest.fn().mockResolvedValue(4294967295) + }) + + it("should be defined", () => { + expect(staking.estimatedBitcoinBalance).toBeDefined() + }) + + it("should return maximum withdraw value", async () => { + const result = await staking.estimatedBitcoinBalance(staker) + expect(result).toEqual(4294967295) + }) + }) }) From d807baaeebd3babc8dbe07cdba76dafbd62c4705 Mon Sep 17 00:00:00 2001 From: ioay Date: Thu, 22 Feb 2024 17:58:42 +0100 Subject: [PATCH 07/11] Added unit tests for stbtc depositor --- sdk/test/lib/ethereum/stbtc.test.ts | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sdk/test/lib/ethereum/stbtc.test.ts diff --git a/sdk/test/lib/ethereum/stbtc.test.ts b/sdk/test/lib/ethereum/stbtc.test.ts new file mode 100644 index 000000000..b350b9405 --- /dev/null +++ b/sdk/test/lib/ethereum/stbtc.test.ts @@ -0,0 +1,62 @@ +import ethers, { Contract } from "ethers" +import { EthereumStBTC } from "../../../src/lib/ethereum/stbtc" +import { EthereumAddress, EthereumSigner } from "../../../src" + +jest.mock("ethers", (): object => ({ + Contract: jest.fn(), + ...jest.requireActual("ethers"), +})) + +describe("stbtc", () => { + let depositor: EthereumStBTC + let depositorAddress: EthereumAddress + const vaultAddress = EthereumAddress.from( + ethers.Wallet.createRandom().address, + ) + const mockedContractInstance = { + tbtcVault: jest.fn().mockImplementation(() => vaultAddress.identifierHex), + initializeStakeRequest: jest.fn(), + } + + beforeEach(async () => { + jest + .spyOn(ethers, "Contract") + .mockImplementationOnce( + () => mockedContractInstance as unknown as Contract, + ) + + depositorAddress = EthereumAddress.from( + await ethers.Wallet.createRandom().getAddress(), + ) + + depositor = new EthereumStBTC( + { + signer: {} as EthereumSigner, + address: depositorAddress.identifierHex, + }, + "sepolia", + ) + }) + + describe("balanceOf", () => { + beforeAll(() => { + depositor.balanceOf = jest.fn().mockResolvedValue(4294967295) + }) + + it("should return final BTC balance", async () => { + const result = await depositor.balanceOf(vaultAddress) + expect(result).toEqual(4294967295) + }) + }) + + describe("assetsBalanceOf", () => { + beforeAll(() => { + depositor.assetsBalanceOf = jest.fn().mockResolvedValue(4294967295) + }) + + it("should return maximum withdraw value", async () => { + const result = await depositor.assetsBalanceOf(vaultAddress) + expect(result).toEqual(4294967295) + }) + }) +}) From 7333edc05c99a53faf6f8c91fc9ee6e3fed8c7a7 Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 27 Feb 2024 20:34:39 +0100 Subject: [PATCH 08/11] Updated unit tests for staking & stbtc --- sdk/src/lib/ethereum/stbtc.ts | 6 ++-- sdk/test/lib/ethereum/stbtc.test.ts | 48 +++++++++++++++++------------ sdk/test/modules/staking.test.ts | 28 +++++++++-------- 3 files changed, 47 insertions(+), 35 deletions(-) diff --git a/sdk/src/lib/ethereum/stbtc.ts b/sdk/src/lib/ethereum/stbtc.ts index 1a23bd1ef..a5087f2a6 100644 --- a/sdk/src/lib/ethereum/stbtc.ts +++ b/sdk/src/lib/ethereum/stbtc.ts @@ -1,4 +1,4 @@ -import { StBTC as StBTCTypechain } from "core/typechain/contracts/StBTC" +import { StBTC as StBTCTypechain } from "@acre-btc/core/typechain/contracts/StBTC" import stBTC from "./artifacts/sepolia/stBTC.json" import { EthersContractConfig, @@ -31,14 +31,14 @@ class EthereumStBTC } /** - * @see {StBTCTypechain#balanceOf} + * @see {StBTC#balanceOf} */ balanceOf(identifier: ChainIdentifier): Promise { return this.instance.balanceOf(`0x${identifier.identifierHex}`) } /** - * @see {StBTCTypechain#assetsBalanceOf} + * @see {StBTC#assetsBalanceOf} */ assetsBalanceOf(identifier: ChainIdentifier): Promise { return this.instance.assetsBalanceOf(`0x${identifier.identifierHex}`) diff --git a/sdk/test/lib/ethereum/stbtc.test.ts b/sdk/test/lib/ethereum/stbtc.test.ts index b350b9405..c004d169a 100644 --- a/sdk/test/lib/ethereum/stbtc.test.ts +++ b/sdk/test/lib/ethereum/stbtc.test.ts @@ -8,55 +8,63 @@ jest.mock("ethers", (): object => ({ })) describe("stbtc", () => { - let depositor: EthereumStBTC - let depositorAddress: EthereumAddress - const vaultAddress = EthereumAddress.from( - ethers.Wallet.createRandom().address, - ) + let stbtc: EthereumStBTC + const mockedContractInstance = { - tbtcVault: jest.fn().mockImplementation(() => vaultAddress.identifierHex), - initializeStakeRequest: jest.fn(), + balanceOf: jest.fn(), + assetsBalanceOf: jest.fn(), } - beforeEach(async () => { + beforeAll(() => { jest .spyOn(ethers, "Contract") .mockImplementationOnce( () => mockedContractInstance as unknown as Contract, ) - depositorAddress = EthereumAddress.from( - await ethers.Wallet.createRandom().getAddress(), - ) - - depositor = new EthereumStBTC( + stbtc = new EthereumStBTC( { signer: {} as EthereumSigner, - address: depositorAddress.identifierHex, }, "sepolia", ) }) describe("balanceOf", () => { + const expectedResult = 4294967295n + + const depositorAddress = EthereumAddress.from( + ethers.Wallet.createRandom().address, + ) + beforeAll(() => { - depositor.balanceOf = jest.fn().mockResolvedValue(4294967295) + mockedContractInstance.balanceOf = jest + .fn() + .mockResolvedValue(expectedResult) }) it("should return final BTC balance", async () => { - const result = await depositor.balanceOf(vaultAddress) - expect(result).toEqual(4294967295) + const result = await stbtc.balanceOf(depositorAddress) + expect(result).toEqual(expectedResult) }) }) describe("assetsBalanceOf", () => { + const expectedResult = 4294967295n + + const depositorAddress = EthereumAddress.from( + ethers.Wallet.createRandom().address, + ) + beforeAll(() => { - depositor.assetsBalanceOf = jest.fn().mockResolvedValue(4294967295) + mockedContractInstance.assetsBalanceOf = jest + .fn() + .mockResolvedValue(expectedResult) }) it("should return maximum withdraw value", async () => { - const result = await depositor.assetsBalanceOf(vaultAddress) - expect(result).toEqual(4294967295) + const result = await stbtc.assetsBalanceOf(depositorAddress) + expect(result).toEqual(expectedResult) }) }) }) diff --git a/sdk/test/modules/staking.test.ts b/sdk/test/modules/staking.test.ts index d396e0aba..e50935162 100644 --- a/sdk/test/modules/staking.test.ts +++ b/sdk/test/modules/staking.test.ts @@ -230,35 +230,39 @@ describe("Staking", () => { describe("sharesBalance", () => { const { staker } = stakingModuleData.initializeStake + const expectedResult = 4294967295n beforeAll(() => { - staking.sharesBalance = jest.fn().mockResolvedValue(4294967295) - }) - - it("should be defined", () => { - expect(staking.sharesBalance).toBeDefined() + contracts.stBTC.balanceOf = jest.fn().mockResolvedValue(expectedResult) }) it("should return final BTC balance", async () => { const result = await staking.sharesBalance(staker) - expect(result).toEqual(4294967295) + expect(result).toEqual(expectedResult) + }) + + it("should be called with proper param", () => { + expect(contracts.stBTC.balanceOf).toHaveBeenCalledWith(staker) }) }) describe("estimatedBitcoinBalance", () => { + const expectedResult = 4294967295n const { staker } = stakingModuleData.initializeStake beforeAll(() => { - staking.estimatedBitcoinBalance = jest.fn().mockResolvedValue(4294967295) - }) - - it("should be defined", () => { - expect(staking.estimatedBitcoinBalance).toBeDefined() + contracts.stBTC.assetsBalanceOf = jest + .fn() + .mockResolvedValue(expectedResult) }) it("should return maximum withdraw value", async () => { const result = await staking.estimatedBitcoinBalance(staker) - expect(result).toEqual(4294967295) + expect(result).toEqual(expectedResult) + }) + + it("should be called with proper param", () => { + expect(contracts.stBTC.assetsBalanceOf).toHaveBeenCalledWith(staker) }) }) }) From ae2b70b086491ebb9c366f798ee8c4cba6921e10 Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 28 Feb 2024 15:56:15 +0100 Subject: [PATCH 09/11] StBtc test update --- sdk/test/lib/ethereum/stbtc.test.ts | 39 ++++++++++++++++------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/sdk/test/lib/ethereum/stbtc.test.ts b/sdk/test/lib/ethereum/stbtc.test.ts index c004d169a..4d6fa531d 100644 --- a/sdk/test/lib/ethereum/stbtc.test.ts +++ b/sdk/test/lib/ethereum/stbtc.test.ts @@ -9,6 +9,7 @@ jest.mock("ethers", (): object => ({ describe("stbtc", () => { let stbtc: EthereumStBTC + const staker = EthereumAddress.from(ethers.Wallet.createRandom().address) const mockedContractInstance = { balanceOf: jest.fn(), @@ -32,38 +33,40 @@ describe("stbtc", () => { describe("balanceOf", () => { const expectedResult = 4294967295n + let result: bigint - const depositorAddress = EthereumAddress.from( - ethers.Wallet.createRandom().address, - ) + beforeAll(async () => { + mockedContractInstance.balanceOf.mockResolvedValue(expectedResult) + result = await stbtc.balanceOf(staker) + }) - beforeAll(() => { - mockedContractInstance.balanceOf = jest - .fn() - .mockResolvedValue(expectedResult) + it("should call ethers contract instance", () => { + expect(mockedContractInstance.balanceOf).toHaveBeenCalledWith( + `0x${staker.identifierHex}`, + ) }) - it("should return final BTC balance", async () => { - const result = await stbtc.balanceOf(depositorAddress) + it("should return balance of stBTC tokens", () => { expect(result).toEqual(expectedResult) }) }) describe("assetsBalanceOf", () => { const expectedResult = 4294967295n + let result: bigint - const depositorAddress = EthereumAddress.from( - ethers.Wallet.createRandom().address, - ) + beforeAll(async () => { + mockedContractInstance.assetsBalanceOf.mockResolvedValue(expectedResult) + result = await stbtc.assetsBalanceOf(staker) + }) - beforeAll(() => { - mockedContractInstance.assetsBalanceOf = jest - .fn() - .mockResolvedValue(expectedResult) + it("should call ethers contract instance", () => { + expect(mockedContractInstance.assetsBalanceOf).toHaveBeenCalledWith( + `0x${staker.identifierHex}`, + ) }) - it("should return maximum withdraw value", async () => { - const result = await stbtc.assetsBalanceOf(depositorAddress) + it("should return value of assets that would be exchanged for the amount of shares owned by the staker ", () => { expect(result).toEqual(expectedResult) }) }) From f73c81643e94751e5498d17e9d62480e722c0a47 Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 28 Feb 2024 15:59:43 +0100 Subject: [PATCH 10/11] Module staking test update --- sdk/test/modules/staking.test.ts | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sdk/test/modules/staking.test.ts b/sdk/test/modules/staking.test.ts index e50935162..e37f5d9ad 100644 --- a/sdk/test/modules/staking.test.ts +++ b/sdk/test/modules/staking.test.ts @@ -231,38 +231,39 @@ describe("Staking", () => { describe("sharesBalance", () => { const { staker } = stakingModuleData.initializeStake const expectedResult = 4294967295n + let result: bigint - beforeAll(() => { + beforeAll(async () => { contracts.stBTC.balanceOf = jest.fn().mockResolvedValue(expectedResult) + result = await staking.sharesBalance(staker) }) - it("should return final BTC balance", async () => { - const result = await staking.sharesBalance(staker) - expect(result).toEqual(expectedResult) + it("should get balance of stBTC", () => { + expect(contracts.stBTC.balanceOf).toHaveBeenCalledWith(staker) }) - it("should be called with proper param", () => { - expect(contracts.stBTC.balanceOf).toHaveBeenCalledWith(staker) + it("should return value of the basis for calculating final BTC balance", () => { + expect(result).toEqual(expectedResult) }) }) describe("estimatedBitcoinBalance", () => { const expectedResult = 4294967295n const { staker } = stakingModuleData.initializeStake - - beforeAll(() => { + let result: bigint + beforeAll(async () => { contracts.stBTC.assetsBalanceOf = jest .fn() .mockResolvedValue(expectedResult) + result = await staking.estimatedBitcoinBalance(staker) }) - it("should return maximum withdraw value", async () => { - const result = await staking.estimatedBitcoinBalance(staker) - expect(result).toEqual(expectedResult) + it("should get staker's balance of tBTC tokens in vault ", () => { + expect(contracts.stBTC.assetsBalanceOf).toHaveBeenCalledWith(staker) }) - it("should be called with proper param", () => { - expect(contracts.stBTC.assetsBalanceOf).toHaveBeenCalledWith(staker) + it("should return maximum withdraw value", () => { + expect(result).toEqual(expectedResult) }) }) }) From d1c8ef752734e2f2adee65a811d5340ad8a7a5ee Mon Sep 17 00:00:00 2001 From: ioay Date: Mon, 4 Mar 2024 16:15:52 +0100 Subject: [PATCH 11/11] Updated sepolia artifact: stBTC.json --- .../lib/ethereum/artifacts/sepolia/stBTC.json | 250 +++++------------- 1 file changed, 72 insertions(+), 178 deletions(-) diff --git a/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json b/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json index 7242abda0..ea1bf83ad 100644 --- a/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json +++ b/sdk/src/lib/ethereum/artifacts/sepolia/stBTC.json @@ -1,5 +1,5 @@ { - "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "address": "0x1265bDDDd268daf903551cAf52800D758F8930c4", "abi": [ { "inputs": [ @@ -372,19 +372,6 @@ "name": "DispatcherUpdated", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "entryFeeBasisPoints", - "type": "uint256" - } - ], - "name": "EntryFeeBasisPointsUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -404,25 +391,6 @@ "name": "OwnershipTransferred", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint16", - "name": "referral", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "StakeReferral", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -559,6 +527,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "assetsBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -684,19 +671,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "entryFeeBasisPoints", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -961,35 +935,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint16", - "name": "referral", - "type": "uint16" - } - ], - "name": "stake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [], "name": "symbol", @@ -1139,19 +1084,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newEntryFeeBasisPoints", - "type": "uint256" - } - ], - "name": "updateEntryFeeBasisPoints", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -1195,34 +1127,34 @@ "type": "function" } ], - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "transactionHash": "0x15d8cea2a1d7bc42ef13ac211cf8cc7c438c110432d8695f77b303b2eab1a1a1", "receipt": { "to": null, "from": "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8", - "contractAddress": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", - "transactionIndex": 82, - "gasUsed": "1951493", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001008000000000000000000000000000400000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000012000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e", - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", + "contractAddress": "0x1265bDDDd268daf903551cAf52800D758F8930c4", + "transactionIndex": 101, + "gasUsed": "1808006", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000001000000000000000000000000000000400000020000000000000000000800000000000400000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000420000012000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x77d0307f9267df860ef36c26a33209c98922ef1699e8b6f3ceaa76627632b61a", + "transactionHash": "0x15d8cea2a1d7bc42ef13ac211cf8cc7c438c110432d8695f77b303b2eab1a1a1", "logs": [ { - "transactionIndex": 82, - "blockNumber": 5206357, - "transactionHash": "0xe391d9f8196548e08172cd330bfe61a0c75e5825b29319f981a97854f5ee67b6", - "address": "0xF99139f09164B092bD9e8558984Becfb0d2eCb87", + "transactionIndex": 101, + "blockNumber": 5415166, + "transactionHash": "0x15d8cea2a1d7bc42ef13ac211cf8cc7c438c110432d8695f77b303b2eab1a1a1", + "address": "0x1265bDDDd268daf903551cAf52800D758F8930c4", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000002d154a5c7ce9939274b89bbce9f5b069e57b09a8" ], "data": "0x", - "logIndex": 230, - "blockHash": "0xb2d302740b02f4ae8a4b18dcdbfbcc9d608d5e8accbb33e3daa7f98fdccac21e" + "logIndex": 343, + "blockHash": "0x77d0307f9267df860ef36c26a33209c98922ef1699e8b6f3ceaa76627632b61a" } ], - "blockNumber": 5206357, - "cumulativeGasUsed": "13353873", + "blockNumber": 5415166, + "cumulativeGasUsed": "21174168", "status": 1, "byzantium": true }, @@ -1231,10 +1163,10 @@ "0x2d154A5c7cE9939274b89bbCe9f5B069E57b09A8" ], "numDeployments": 1, - "solcInputHash": "b22c277b248ba02f9ec5bf62d176f9ce", - "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_tbtc\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisallowedAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"LessThanMinDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumDepositAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"DispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"entryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"EntryFeeBasisPointsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"StakeReferral\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dispatcher\",\"outputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"entryFeeBasisPoints\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTotalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumDepositAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"referral\",\"type\":\"uint16\"}],\"name\":\"stake\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDepositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"updateDispatcher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newEntryFeeBasisPoints\",\"type\":\"uint256\"}],\"name\":\"updateEntryFeeBasisPoints\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"params\":{\"amount\":\"Amount to check.\",\"min\":\"Minimum amount to check 'amount' against.\"}}],\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DepositParametersUpdated(uint256,uint256)\":{\"params\":{\"maximumTotalAssets\":\"New value of the maximum total assets amount.\",\"minimumDepositAmount\":\"New value of the minimum deposit amount.\"}},\"DispatcherUpdated(address,address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\",\"oldDispatcher\":\"Address of the old dispatcher contract.\"}},\"EntryFeeBasisPointsUpdated(uint256)\":{\"params\":{\"entryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"StakeReferral(uint16,uint256)\":{\"params\":{\"assets\":\"Amount of tBTC tokens staked.\",\"referral\":\"Used for referral program.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"TreasuryUpdated(address)\":{\"params\":{\"treasury\":\"New treasury wallet address.\"}}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.\",\"receiver\":\"The address to which the shares will be minted.\"},\"returns\":{\"_0\":\"Minted shares adjusted for the fees taken by the treasury.\"}},\"depositParameters()\":{\"returns\":{\"_0\":\"Returns deposit parameters.\"}},\"maxDeposit(address)\":{\"returns\":{\"_0\":\"The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver.\"}},\"maxMint(address)\":{\"details\":\"Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.\",\"returns\":{\"_0\":\"The maximum amount of the vault shares.\"}},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.\",\"params\":{\"receiver\":\"The address to which the shares will be minted.\",\"shares\":\"Amount of shares to mint.\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"previewDeposit(uint256)\":{\"details\":\"Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\"},\"previewMint(uint256)\":{\"details\":\"Preview adding an entry fee on mint. See {IERC4626-previewMint}.\"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"stake(uint256,address,uint16)\":{\"details\":\"This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount for the transfer and stake.\",\"receiver\":\"The address to which the shares will be minted.\",\"referral\":\"Data used for referral program.\"},\"returns\":{\"_0\":\"shares Minted shares.\"}},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateDepositParameters(uint256,uint256)\":{\"details\":\"To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).\",\"params\":{\"_maximumTotalAssets\":\"New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.\",\"_minimumDepositAmount\":\"New value of the minimum deposit amount. It is the minimum amount for a single deposit operation.\"}},\"updateDispatcher(address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\"}},\"updateEntryFeeBasisPoints(uint256)\":{\"params\":{\"newEntryFeeBasisPoints\":\"New value of the fee basis points.\"}},\"updateTreasury(address)\":{\"params\":{\"newTreasury\":\"New treasury wallet address.\"}},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"stBTC\",\"version\":1},\"userdoc\":{\"errors\":{\"DisallowedAddress()\":[{\"notice\":\"Reverts if the address is disallowed.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"notice\":\"Reverts if the amount is less than the minimum deposit amount.\"}],\"ZeroAddress()\":[{\"notice\":\"Reverts if the address is zero.\"}]},\"events\":{\"DepositParametersUpdated(uint256,uint256)\":{\"notice\":\"Emitted when deposit parameters are updated.\"},\"DispatcherUpdated(address,address)\":{\"notice\":\"Emitted when the dispatcher contract is updated.\"},\"EntryFeeBasisPointsUpdated(uint256)\":{\"notice\":\"Emitted when the entry fee basis points are updated.\"},\"StakeReferral(uint16,uint256)\":{\"notice\":\"Emitted when a referral is used.\"},\"TreasuryUpdated(address)\":{\"notice\":\"Emitted when the treasury wallet address is updated.\"}},\"kind\":\"user\",\"methods\":{\"deposit(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing exactly amount of tBTC tokens.\"},\"dispatcher()\":{\"notice\":\"Dispatcher contract that routes tBTC from stBTC to a given vault and back.\"},\"entryFeeBasisPoints()\":{\"notice\":\"Entry fee basis points applied to entry fee calculation.\"},\"maxDeposit(address)\":{\"notice\":\"Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0.\"},\"maxMint(address)\":{\"notice\":\"Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call.\"},\"maximumTotalAssets()\":{\"notice\":\"Maximum total amount of tBTC token held by Acre protocol.\"},\"minimumDepositAmount()\":{\"notice\":\"Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract.\"},\"mint(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing tBTC tokens.\"},\"stake(uint256,address,uint16)\":{\"notice\":\"Stakes a given amount of tBTC token and mints shares to a receiver.\"},\"treasury()\":{\"notice\":\"Address of the treasury wallet, where fees should be transferred to.\"},\"updateDepositParameters(uint256,uint256)\":{\"notice\":\"Updates deposit parameters.\"},\"updateDispatcher(address)\":{\"notice\":\"Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC.\"},\"updateEntryFeeBasisPoints(uint256)\":{\"notice\":\"Update the entry fee basis points.\"},\"updateTreasury(address)\":{\"notice\":\"Updates treasury wallet address.\"}},\"notice\":\"This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \\\"shares\\\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/stBTC.sol\":\"stBTC\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"./extensions/IERC20Metadata.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n */\\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\\n mapping(address account => uint256) private _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n _totalSupply += value;\\n } else {\\n uint256 fromBalance = _balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n _balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n _totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n _balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n * ```\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n _allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3e1fa9d1987f8d349dfb4d6fe93bf2ca014b52ba335cfac30bfe71e357e6f80\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20, IERC20Metadata, ERC20} from \\\"../ERC20.sol\\\";\\nimport {SafeERC20} from \\\"../utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"../../../interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"../../../utils/math/Math.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\\n * expensive than it is profitable. More details about the underlying math can be found\\n * xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626 is ERC20, IERC4626 {\\n using Math for uint256;\\n\\n IERC20 private immutable _asset;\\n uint8 private immutable _underlyingDecimals;\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\\n */\\n constructor(IERC20 asset_) {\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n _underlyingDecimals = success ? assetDecimals : 18;\\n _asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {\\n return _underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n return address(_asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n return _asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}.\\n *\\n * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\\n * In this case, the shares will be minted without requiring any assets to be deposited.\\n */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer(_asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x1837547e04d5fe5334eeb77a345683c22995f1e7aa033020757ddf83a80fc72d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {FailedInnerCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\\n * unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {FailedInnerCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x75a4ee64c68dbd5f38bddd06e664a64c8271b4caa554fb6f0607dfd672bb4bf3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Muldiv operation overflow.\\n */\\n error MathOverflowedMulDiv();\\n\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n return a / b;\\n }\\n\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n revert MathOverflowedMulDiv();\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\"},\"contracts/Dispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport \\\"./Router.sol\\\";\\nimport \\\"./stBTC.sol\\\";\\n\\n/// @title Dispatcher\\n/// @notice Dispatcher is a contract that routes tBTC from stBTC to\\n/// yield vaults and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\ncontract Dispatcher is Router, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Struct holds information about a vault.\\n struct VaultInfo {\\n bool authorized;\\n }\\n\\n /// The main stBTC contract holding tBTC deposited by stakers.\\n stBTC public immutable stbtc;\\n /// tBTC token contract.\\n IERC20 public immutable tbtc;\\n /// Address of the maintainer bot.\\n address public maintainer;\\n\\n /// Authorized Yield Vaults that implement ERC4626 standard. These\\n /// vaults deposit assets to yield strategies, e.g. Uniswap V3\\n /// WBTC/TBTC pool. Vault can be a part of Acre ecosystem or can be\\n /// implemented externally. As long as it complies with ERC4626\\n /// standard and is authorized by the owner it can be plugged into\\n /// Acre.\\n address[] public vaults;\\n /// Mapping of vaults to their information.\\n mapping(address => VaultInfo) public vaultsInfo;\\n\\n /// Emitted when a vault is authorized.\\n /// @param vault Address of the vault.\\n event VaultAuthorized(address indexed vault);\\n\\n /// Emitted when a vault is deauthorized.\\n /// @param vault Address of the vault.\\n event VaultDeauthorized(address indexed vault);\\n\\n /// Emitted when tBTC is routed to a vault.\\n /// @param vault Address of the vault.\\n /// @param amount Amount of tBTC.\\n /// @param sharesOut Amount of received shares.\\n event DepositAllocated(\\n address indexed vault,\\n uint256 amount,\\n uint256 sharesOut\\n );\\n\\n /// Emitted when the maintainer address is updated.\\n /// @param maintainer Address of the new maintainer.\\n event MaintainerUpdated(address indexed maintainer);\\n\\n /// Reverts if the vault is already authorized.\\n error VaultAlreadyAuthorized();\\n\\n /// Reverts if the vault is not authorized.\\n error VaultUnauthorized();\\n\\n /// Reverts if the caller is not the maintainer.\\n error NotMaintainer();\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Modifier that reverts if the caller is not the maintainer.\\n modifier onlyMaintainer() {\\n if (msg.sender != maintainer) {\\n revert NotMaintainer();\\n }\\n _;\\n }\\n\\n constructor(stBTC _stbtc, IERC20 _tbtc) Ownable(msg.sender) {\\n stbtc = _stbtc;\\n tbtc = _tbtc;\\n }\\n\\n /// @notice Adds a vault to the list of authorized vaults.\\n /// @param vault Address of the vault to add.\\n function authorizeVault(address vault) external onlyOwner {\\n if (isVaultAuthorized(vault)) {\\n revert VaultAlreadyAuthorized();\\n }\\n\\n vaults.push(vault);\\n vaultsInfo[vault].authorized = true;\\n\\n emit VaultAuthorized(vault);\\n }\\n\\n /// @notice Removes a vault from the list of authorized vaults.\\n /// @param vault Address of the vault to remove.\\n function deauthorizeVault(address vault) external onlyOwner {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n vaultsInfo[vault].authorized = false;\\n\\n for (uint256 i = 0; i < vaults.length; i++) {\\n if (vaults[i] == vault) {\\n vaults[i] = vaults[vaults.length - 1];\\n // slither-disable-next-line costly-loop\\n vaults.pop();\\n break;\\n }\\n }\\n\\n emit VaultDeauthorized(vault);\\n }\\n\\n /// @notice Updates the maintainer address.\\n /// @param newMaintainer Address of the new maintainer.\\n function updateMaintainer(address newMaintainer) external onlyOwner {\\n if (newMaintainer == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n maintainer = newMaintainer;\\n\\n emit MaintainerUpdated(maintainer);\\n }\\n\\n /// TODO: make this function internal once the allocation distribution is\\n /// implemented\\n /// @notice Routes tBTC from stBTC to a vault. Can be called by the maintainer\\n /// only.\\n /// @param vault Address of the vault to route the assets to.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function depositToVault(\\n address vault,\\n uint256 amount,\\n uint256 minSharesOut\\n ) public onlyMaintainer {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n // slither-disable-next-line arbitrary-send-erc20\\n tbtc.safeTransferFrom(address(stbtc), address(this), amount);\\n tbtc.forceApprove(address(vault), amount);\\n\\n uint256 sharesOut = deposit(\\n IERC4626(vault),\\n address(stbtc),\\n amount,\\n minSharesOut\\n );\\n // slither-disable-next-line reentrancy-events\\n emit DepositAllocated(vault, amount, sharesOut);\\n }\\n\\n /// @notice Returns the list of authorized vaults.\\n function getVaults() public view returns (address[] memory) {\\n return vaults;\\n }\\n\\n /// @notice Returns true if the vault is authorized.\\n /// @param vault Address of the vault to check.\\n function isVaultAuthorized(address vault) public view returns (bool) {\\n return vaultsInfo[vault].authorized;\\n }\\n\\n /// TODO: implement redeem() / withdraw() functions\\n}\\n\",\"keccak256\":\"0x0dd77692ab8c6059afa7b4a90f26733560b53fb66192e9912a2064103c5d41fb\",\"license\":\"GPL-3.0-only\"},\"contracts/Router.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\n/// @title Router\\n/// @notice Router is a contract that routes tBTC from stBTC to\\n/// a given vault and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\nabstract contract Router {\\n /// Thrown when amount of shares received is below the min set by caller.\\n /// @param vault Address of the vault.\\n /// @param sharesOut Amount of received shares.\\n /// @param minSharesOut Minimum amount of shares expected to receive.\\n error MinSharesError(\\n address vault,\\n uint256 sharesOut,\\n uint256 minSharesOut\\n );\\n\\n /// @notice Routes funds from stBTC to a vault. The amount of tBTC to\\n /// Shares of deposited tBTC are minted to the stBTC contract.\\n /// @param vault Address of the vault to route the funds to.\\n /// @param receiver Address of the receiver of the shares.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function deposit(\\n IERC4626 vault,\\n address receiver,\\n uint256 amount,\\n uint256 minSharesOut\\n ) internal returns (uint256 sharesOut) {\\n if ((sharesOut = vault.deposit(amount, receiver)) < minSharesOut) {\\n revert MinSharesError(address(vault), sharesOut, minSharesOut);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x520e27c613f1234755c23402524b048a81abd15222d7f318504992d490248812\",\"license\":\"GPL-3.0-only\"},\"contracts/lib/ERC4626Fees.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// Inspired by https://docs.openzeppelin.com/contracts/5.x/erc4626#fees\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {ERC4626} from \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {Math} from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\n\\n/// @dev ERC4626 vault with entry/exit fees expressed in https://en.wikipedia.org/wiki/Basis_point[basis point (bp)].\\nabstract contract ERC4626Fees is ERC4626 {\\n using Math for uint256;\\n\\n uint256 private constant _BASIS_POINT_SCALE = 1e4;\\n\\n // === Overrides ===\\n\\n /// @dev Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}.\\n function previewDeposit(\\n uint256 assets\\n ) public view virtual override returns (uint256) {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n return super.previewDeposit(assets - fee);\\n }\\n\\n /// @dev Preview adding an entry fee on mint. See {IERC4626-previewMint}.\\n function previewMint(\\n uint256 shares\\n ) public view virtual override returns (uint256) {\\n uint256 assets = super.previewMint(shares);\\n return assets + _feeOnRaw(assets, _entryFeeBasisPoints());\\n }\\n\\n // TODO: add previewWithraw\\n\\n // TODO: add previewRedeem\\n\\n /// @dev Send entry fee to {_feeRecipient}. See {IERC4626-_deposit}.\\n function _deposit(\\n address caller,\\n address receiver,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual override {\\n uint256 fee = _feeOnTotal(assets, _entryFeeBasisPoints());\\n address recipient = _feeRecipient();\\n\\n super._deposit(caller, receiver, assets, shares);\\n\\n if (fee > 0 && recipient != address(this)) {\\n SafeERC20.safeTransfer(IERC20(asset()), recipient, fee);\\n }\\n }\\n\\n // TODO: add withdraw\\n\\n // === Fee configuration ===\\n\\n // slither-disable-next-line dead-code\\n function _entryFeeBasisPoints() internal view virtual returns (uint256);\\n\\n // TODO: add exitFeeBasisPoints\\n\\n // slither-disable-next-line dead-code\\n function _feeRecipient() internal view virtual returns (address);\\n\\n // === Fee operations ===\\n\\n /// @dev Calculates the fees that should be added to an amount `assets`\\n /// that does not already include fees.\\n /// Used in {IERC4626-mint} and {IERC4626-withdraw} operations.\\n function _feeOnRaw(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n\\n /// @dev Calculates the fee part of an amount `assets` that already includes fees.\\n /// Used in {IERC4626-deposit} and {IERC4626-redeem} operations.\\n function _feeOnTotal(\\n uint256 assets,\\n uint256 feeBasisPoints\\n ) private pure returns (uint256) {\\n return\\n assets.mulDiv(\\n feeBasisPoints,\\n feeBasisPoints + _BASIS_POINT_SCALE,\\n Math.Rounding.Ceil\\n );\\n }\\n}\\n\",\"keccak256\":\"0xccfc01be23cbc979745a6e7f3421c4d050dc2ad7ddb6d9e1543c8e681e91d596\",\"license\":\"MIT\"},\"contracts/stBTC.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Dispatcher.sol\\\";\\nimport \\\"./lib/ERC4626Fees.sol\\\";\\n\\n/// @title stBTC\\n/// @notice This contract implements the ERC-4626 tokenized vault standard. By\\n/// staking tBTC, users acquire a liquid staking token called stBTC,\\n/// commonly referred to as \\\"shares\\\". The staked tBTC is securely\\n/// deposited into Acre's vaults, where it generates yield over time.\\n/// Users have the flexibility to redeem stBTC, enabling them to\\n/// withdraw their staked tBTC along with the accrued yield.\\n/// @dev ERC-4626 is a standard to optimize and unify the technical parameters\\n/// of yield-bearing vaults. This contract facilitates the minting and\\n/// burning of shares (stBTC), which are represented as standard ERC20\\n/// tokens, providing a seamless exchange with tBTC tokens.\\ncontract stBTC is ERC4626Fees, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Dispatcher contract that routes tBTC from stBTC to a given vault and back.\\n Dispatcher public dispatcher;\\n\\n /// Address of the treasury wallet, where fees should be transferred to.\\n address public treasury;\\n\\n /// Entry fee basis points applied to entry fee calculation.\\n uint256 public entryFeeBasisPoints;\\n\\n /// Minimum amount for a single deposit operation. The value should be set\\n /// low enough so the deposits routed through TbtcDepositor contract won't\\n /// be rejected. It means that minimumDepositAmount should be lower than\\n /// tBTC protocol's depositDustThreshold reduced by all the minting fees taken\\n /// before depositing in the Acre contract.\\n uint256 public minimumDepositAmount;\\n\\n /// Maximum total amount of tBTC token held by Acre protocol.\\n uint256 public maximumTotalAssets;\\n\\n /// Emitted when a referral is used.\\n /// @param referral Used for referral program.\\n /// @param assets Amount of tBTC tokens staked.\\n event StakeReferral(uint16 indexed referral, uint256 assets);\\n\\n /// Emitted when the treasury wallet address is updated.\\n /// @param treasury New treasury wallet address.\\n event TreasuryUpdated(address treasury);\\n\\n /// Emitted when deposit parameters are updated.\\n /// @param minimumDepositAmount New value of the minimum deposit amount.\\n /// @param maximumTotalAssets New value of the maximum total assets amount.\\n event DepositParametersUpdated(\\n uint256 minimumDepositAmount,\\n uint256 maximumTotalAssets\\n );\\n\\n /// Emitted when the dispatcher contract is updated.\\n /// @param oldDispatcher Address of the old dispatcher contract.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n event DispatcherUpdated(address oldDispatcher, address newDispatcher);\\n\\n /// Emitted when the entry fee basis points are updated.\\n /// @param entryFeeBasisPoints New value of the fee basis points.\\n event EntryFeeBasisPointsUpdated(uint256 entryFeeBasisPoints);\\n\\n /// Reverts if the amount is less than the minimum deposit amount.\\n /// @param amount Amount to check.\\n /// @param min Minimum amount to check 'amount' against.\\n error LessThanMinDeposit(uint256 amount, uint256 min);\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Reverts if the address is disallowed.\\n error DisallowedAddress();\\n\\n constructor(\\n IERC20 _tbtc,\\n address _treasury\\n ) ERC4626(_tbtc) ERC20(\\\"Acre Staked Bitcoin\\\", \\\"stBTC\\\") Ownable(msg.sender) {\\n if (address(_treasury) == address(0)) {\\n revert ZeroAddress();\\n }\\n treasury = _treasury;\\n // TODO: Revisit the exact values closer to the launch.\\n minimumDepositAmount = 0.001 * 1e18; // 0.001 tBTC\\n maximumTotalAssets = 25 * 1e18; // 25 tBTC\\n entryFeeBasisPoints = 5; // 5bps == 0.05% == 0.0005\\n }\\n\\n /// @notice Updates treasury wallet address.\\n /// @param newTreasury New treasury wallet address.\\n function updateTreasury(address newTreasury) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n if (newTreasury == address(0)) {\\n revert ZeroAddress();\\n }\\n if (newTreasury == address(this)) {\\n revert DisallowedAddress();\\n }\\n treasury = newTreasury;\\n\\n emit TreasuryUpdated(newTreasury);\\n }\\n\\n /// @notice Updates deposit parameters.\\n /// @dev To disable the limit for deposits, set the maximum total assets to\\n /// maximum (`type(uint256).max`).\\n /// @param _minimumDepositAmount New value of the minimum deposit amount. It\\n /// is the minimum amount for a single deposit operation.\\n /// @param _maximumTotalAssets New value of the maximum total assets amount.\\n /// It is the maximum amount of the tBTC token that the Acre protocol\\n /// can hold.\\n function updateDepositParameters(\\n uint256 _minimumDepositAmount,\\n uint256 _maximumTotalAssets\\n ) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n minimumDepositAmount = _minimumDepositAmount;\\n maximumTotalAssets = _maximumTotalAssets;\\n\\n emit DepositParametersUpdated(\\n _minimumDepositAmount,\\n _maximumTotalAssets\\n );\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Updates the dispatcher contract and gives it an unlimited\\n /// allowance to transfer staked tBTC.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n function updateDispatcher(Dispatcher newDispatcher) external onlyOwner {\\n if (address(newDispatcher) == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n address oldDispatcher = address(dispatcher);\\n\\n emit DispatcherUpdated(oldDispatcher, address(newDispatcher));\\n dispatcher = newDispatcher;\\n\\n // TODO: Once withdrawal/rebalancing is implemented, we need to revoke the\\n // approval of the vaults share tokens from the old dispatcher and approve\\n // a new dispatcher to manage the share tokens.\\n\\n if (oldDispatcher != address(0)) {\\n // Setting allowance to zero for the old dispatcher\\n IERC20(asset()).forceApprove(oldDispatcher, 0);\\n }\\n\\n // Setting allowance to max for the new dispatcher\\n IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Update the entry fee basis points.\\n /// @param newEntryFeeBasisPoints New value of the fee basis points.\\n function updateEntryFeeBasisPoints(\\n uint256 newEntryFeeBasisPoints\\n ) external onlyOwner {\\n entryFeeBasisPoints = newEntryFeeBasisPoints;\\n\\n emit EntryFeeBasisPointsUpdated(newEntryFeeBasisPoints);\\n }\\n\\n /// @notice Mints shares to receiver by depositing exactly amount of\\n /// tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// @param assets Approved amount of tBTC tokens to deposit. This includes\\n /// treasury fees for staking tBTC.\\n /// @param receiver The address to which the shares will be minted.\\n /// @return Minted shares adjusted for the fees taken by the treasury.\\n function deposit(\\n uint256 assets,\\n address receiver\\n ) public override returns (uint256) {\\n if (assets < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n\\n return super.deposit(assets, receiver);\\n }\\n\\n /// @notice Mints shares to receiver by depositing tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// The msg.sender is required to grant approval for the transfer of a\\n /// certain amount of tBTC, and in addition, approval for the associated\\n /// fee. Specifically, the total amount to be approved (amountToApprove)\\n /// should be equal to the sum of the deposited amount and the fee.\\n /// To determine the total assets amount necessary for approval\\n /// corresponding to a given share amount, use the `previewMint` function.\\n /// @param shares Amount of shares to mint.\\n /// @param receiver The address to which the shares will be minted.\\n function mint(\\n uint256 shares,\\n address receiver\\n ) public override returns (uint256 assets) {\\n if ((assets = super.mint(shares, receiver)) < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n }\\n\\n /// @notice Stakes a given amount of tBTC token and mints shares to a\\n /// receiver.\\n /// @dev This function calls `deposit` function from `ERC4626` contract. The\\n /// amount of the assets has to be pre-approved in the tBTC contract.\\n /// @param assets Approved amount for the transfer and stake.\\n /// @param receiver The address to which the shares will be minted.\\n /// @param referral Data used for referral program.\\n /// @return shares Minted shares.\\n function stake(\\n uint256 assets,\\n address receiver,\\n uint16 referral\\n ) public returns (uint256) {\\n // TODO: revisit the type of referral.\\n uint256 shares = deposit(assets, receiver);\\n\\n if (referral > 0) {\\n emit StakeReferral(referral, assets);\\n }\\n\\n return shares;\\n }\\n\\n /// @notice Returns the maximum amount of the tBTC token that can be\\n /// deposited into the vault for the receiver through a deposit\\n /// call. It takes into account the deposit parameter, maximum total\\n /// assets, which determines the total amount of tBTC token held by\\n /// Acre. This function always returns available limit for deposits,\\n /// but the fee is not taken into account. As a result of this, there\\n /// always will be some dust left. If the dust is lower than the\\n /// minimum deposit amount, this function will return 0.\\n /// @return The maximum amount of tBTC token that can be deposited into\\n /// Acre protocol for the receiver.\\n function maxDeposit(address) public view override returns (uint256) {\\n if (maximumTotalAssets == type(uint256).max) {\\n return type(uint256).max;\\n }\\n\\n uint256 currentTotalAssets = totalAssets();\\n if (currentTotalAssets >= maximumTotalAssets) return 0;\\n\\n // Max amount left for next deposits. If it is lower than the minimum\\n // deposit amount, return 0.\\n uint256 unusedLimit = maximumTotalAssets - currentTotalAssets;\\n\\n return minimumDepositAmount > unusedLimit ? 0 : unusedLimit;\\n }\\n\\n /// @notice Returns the maximum amount of the vault shares that can be\\n /// minted for the receiver, through a mint call.\\n /// @dev Since the stBTC contract limits the maximum total tBTC tokens this\\n /// function converts the maximum deposit amount to shares.\\n /// @return The maximum amount of the vault shares.\\n function maxMint(address receiver) public view override returns (uint256) {\\n uint256 _maxDeposit = maxDeposit(receiver);\\n\\n // slither-disable-next-line incorrect-equality\\n return\\n _maxDeposit == type(uint256).max\\n ? type(uint256).max\\n : convertToShares(_maxDeposit);\\n }\\n\\n /// @return Returns deposit parameters.\\n function depositParameters() public view returns (uint256, uint256) {\\n return (minimumDepositAmount, maximumTotalAssets);\\n }\\n\\n /// @notice Redeems shares for tBTC tokens.\\n function _entryFeeBasisPoints() internal view override returns (uint256) {\\n return entryFeeBasisPoints;\\n }\\n\\n /// @notice Returns the address of the treasury wallet, where fees should be\\n /// transferred to.\\n function _feeRecipient() internal view override returns (address) {\\n return treasury;\\n }\\n}\\n\",\"keccak256\":\"0x5e622d3cef791a39b7089c64cacd5c62f14c13af316e2e8a3141244f7f69324e\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", - "bytecode": "0x60c06040523480156200001157600080fd5b5060405162002459380380620024598339810160408190526200003491620002da565b33826040518060400160405280601381526020017f41637265205374616b656420426974636f696e0000000000000000000000000081525060405180604001604052806005815260200164737442544360d81b81525081600390816200009b9190620003be565b506004620000aa8282620003be565b505050600080620000c1836200018a60201b60201c565b9150915081620000d3576012620000d5565b805b60ff1660a05250506001600160a01b0390811660805281166200011257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011d816200026f565b506001600160a01b038116620001465760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03929092169190911790555066038d7ea4c6800060095568015af1d78b58c40000600a556005600855620004d5565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620001d3916200048a565b600060405180830381855afa9150503d806000811462000210576040519150601f19603f3d011682016040523d82523d6000602084013e62000215565b606091505b50915091508180156200022a57506020815110155b156200026257600081806020019051810190620002489190620004bb565b905060ff811162000260576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620002d757600080fd5b50565b60008060408385031215620002ee57600080fd5b8251620002fb81620002c1565b60208401519092506200030e81620002c1565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200034457607f821691505b6020821081036200036557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003b957600081815260208120601f850160051c81016020861015620003945750805b601f850160051c820191505b81811015620003b557828155600101620003a0565b5050505b505050565b81516001600160401b03811115620003da57620003da62000319565b620003f281620003eb84546200032f565b846200036b565b602080601f8311600181146200042a5760008415620004115750858301515b600019600386901b1c1916600185901b178555620003b5565b600085815260208120601f198616915b828110156200045b578886015182559484019460019091019084016200043a565b50858210156200047a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b81811015620004ad576020818601810151858301520162000491565b506000920191825250919050565b600060208284031215620004ce57600080fd5b5051919050565b60805160a051611f3462000525600039600061077201526000818161036b01528181610602015281816108a9015281816108ee01528181611209015281816116bc015261186e0152611f346000f3fe608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ad5760003560e01c80638da5cb5b1161017b578063c6e6f592116100d8578063dc8c4ffe1161008c578063e9c092e311610071578063e9c092e314610598578063ef8b30f7146105ab578063f2fde38b146105be57600080fd5b8063dc8c4ffe1461054c578063dd62ed3e1461055f57600080fd5b8063ce96cb77116100bd578063ce96cb7714610513578063d57636c914610526578063d905777e1461053957600080fd5b8063c6e6f592146104ed578063cb7e90571461050057600080fd5b8063b460af941161012f578063ba0af7a911610114578063ba0af7a9146104b6578063c42b64d0146104bf578063c63d75b6146104da57600080fd5b8063b460af9414610490578063ba087652146104a357600080fd5b806395d89b411161016057806395d89b4114610462578063a9059cbb1461046a578063b3d7f6b91461047d57600080fd5b80638da5cb5b1461043e57806394bf804d1461044f57600080fd5b806338d52e0f1161022957806361d027b3116101dd57806370a08231116101c257806370a08231146103fa578063715018a6146104235780637f51bb1f1461042b57600080fd5b806361d027b3146103d45780636e553f65146103e757600080fd5b806342af11981161020e57806342af1198146103b65780634cdad506146102e2578063543bda75146103cb57600080fd5b806338d52e0f14610369578063402d267d146103a357600080fd5b8063095ea7b31161028057806318160ddd1161026557806318160ddd1461033457806323b872dd1461033c578063313ce5671461034f57600080fd5b8063095ea7b3146102fe5780630a28a4771461032157600080fd5b806301e1d114146102b257806306fdde03146102cd57806307a2d13a146102e2578063080c279a146102f5575b600080fd5b6102ba6105d1565b6040519081526020015b60405180910390f35b6102d561067a565b6040516102c49190611ade565b6102ba6102f0366004611b11565b61070c565b6102ba60095481565b61031161030c366004611b3f565b61071f565b60405190151581526020016102c4565b6102ba61032f366004611b11565b610737565b6002546102ba565b61031161034a366004611b6b565b610744565b61035761076a565b60405160ff90911681526020016102c4565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020016102c4565b6102ba6103b1366004611bac565b610796565b6103c96103c4366004611bac565b6107f6565b005b6102ba600a5481565b60075461038b906001600160a01b031681565b6102ba6103f5366004611bc9565b610916565b6102ba610408366004611bac565b6001600160a01b031660009081526020819052604090205490565b6103c961095c565b6103c9610439366004611bac565b610970565b6005546001600160a01b031661038b565b6102ba61045d366004611bc9565b610a43565b6102d5610a82565b610311610478366004611b3f565b610a91565b6102ba61048b366004611b11565b610a9f565b6102ba61049e366004611bf9565b610ac9565b6102ba6104b1366004611bf9565b610b4d565b6102ba60085481565b600954600a54604080519283526020830191909152016102c4565b6102ba6104e8366004611bac565b610bc8565b6102ba6104fb366004611b11565b610bf7565b60065461038b906001600160a01b031681565b6102ba610521366004611bac565b610c04565b6103c9610534366004611b11565b610c28565b6102ba610547366004611bac565b610c65565b6102ba61055a366004611c3b565b610c83565b6102ba61056d366004611c79565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103c96105a6366004611ca7565b610ce2565b6102ba6105b9366004611b11565b610d31565b6103c96105cc366004611bac565b610d55565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610651573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106759190611cc9565b905090565b60606003805461068990611ce2565b80601f01602080910402602001604051908101604052809291908181526020018280546106b590611ce2565b80156107025780601f106106d757610100808354040283529160200191610702565b820191906000526020600020905b8154815290600101906020018083116106e557829003601f168201915b5050505050905090565b6000610719826000610dac565b92915050565b60003361072d818585610de6565b5060019392505050565b6000610719826001610df8565b600033610752858285610e28565b61075d858585610ebf565b60019150505b9392505050565b6000610675817f0000000000000000000000000000000000000000000000000000000000000000611d32565b6000600019600a54036107ac5750600019919050565b60006107b66105d1565b9050600a5481106107ca5750600092915050565b600081600a546107da9190611d4b565b905080600954116107eb57806107ee565b60005b949350505050565b6107fe610f1e565b6001600160a01b0381166108255760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03848116919091179091558116156108d9576108d98160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610f64565b600654610912906001600160a01b03166000197f00000000000000000000000000000000000000000000000000000000000000006108c9565b5050565b6000600954831015610952576009546040516314d6e77b60e31b8152610949918591600401918252602082015260400190565b60405180910390fd5b6107638383611065565b610964610f1e565b61096e60006110df565b565b610978610f1e565b6001600160a01b03811661099f5760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b038216036109e1576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d1906020015b60405180910390a150565b6000600954610a52848461113e565b9150811015610719576009546040516314d6e77b60e31b8152610949918391600401918252602082015260400190565b60606004805461068990611ce2565b60003361072d818585610ebf565b600080610aab836111b8565b9050610abf81610aba60085490565b6111c5565b6107639082611d5e565b600080610ad583610c04565b905080851115610b2a576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610b3586610737565b9050610b4433868689856111d6565b95945050505050565b600080610b5983610c65565b905080851115610bae576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810186905260448101829052606401610949565b6000610bb98661070c565b9050610b44338686848a6111d6565b600080610bd483610796565b90506000198114610bed57610be881610bf7565b610763565b6000199392505050565b6000610719826000610df8565b6001600160a01b038116600090815260208190526040812054610719906000610dac565b610c30610f1e565b60088190556040518181527f5af127f521fefc539e7e224fd330591102c4288877cf9b83c5d8a100cbb88ceb90602001610a38565b6001600160a01b038116600090815260208190526040812054610719565b600080610c908585610916565b905061ffff8316156107ee578261ffff167f246e5dcdb71dfbdc1088d365e35a9f8e3aefefebf0b9bee103bf4f3a2edec12b86604051610cd291815260200190565b60405180910390a2949350505050565b610cea610f1e565b6009829055600a81905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b600080610d4683610d4160085490565b611296565b90506107636104fb8285611d4b565b610d5d610f1e565b6001600160a01b038116610da0576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b610da9816110df565b50565b6000610763610db96105d1565b610dc4906001611d5e565b610dd06000600a611e55565b600254610ddd9190611d5e565b859190856112ae565b610df383838360016112fd565b505050565b6000610763610e0882600a611e55565b600254610e159190611d5e565b610e1d6105d1565b610ddd906001611d5e565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eb95781811015610eaa576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610949565b610eb9848484840360006112fd565b50505050565b6001600160a01b038316610ee957604051634b637e8f60e11b815260006004820152602401610949565b6001600160a01b038216610f135760405163ec442f0560e01b815260006004820152602401610949565b610df3838383611404565b6005546001600160a01b0316331461096e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610949565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610fe38482611547565b610eb9576040516001600160a01b0384811660248301526000604483015261105b91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506115ea565b610eb984826115ea565b60008061107183610796565b9050808411156110c6576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006110d185610d31565b90506107ee33858784611666565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061114a83610bc8565b90508084111561119f576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810185905260448101829052606401610949565b60006111aa85610a9f565b90506107ee33858388611666565b6000610719826001610dac565b6000610763838361271060016112ae565b826001600160a01b0316856001600160a01b0316146111fa576111fa838683610e28565b61120483826116ea565b61122f7f00000000000000000000000000000000000000000000000000000000000000008584611720565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611287929190918252602082015260400190565b60405180910390a45050505050565b6000610763826112a861271082611d5e565b85919060015b6000806112bc868686611751565b90506112c78361182e565b80156112e35750600084806112de576112de611e64565b868809115b15610b44576112f3600182611d5e565b9695505050505050565b6001600160a01b038416611340576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b038316611383576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610949565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eb957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113f691815260200190565b60405180910390a350505050565b6001600160a01b03831661142f5780600260008282546114249190611d5e565b909155506114ba9050565b6001600160a01b0383166000908152602081905260409020548181101561149b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610949565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d6576002805482900390556114f5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153a91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516115649190611e7a565b6000604051808303816000865af19150503d80600081146115a1576040519150601f19603f3d011682016040523d82523d6000602084013e6115a6565b606091505b50915091508180156115d05750805115806115d05750808060200190518101906115d09190611e96565b8015610b445750505050506001600160a01b03163b151590565b60006115ff6001600160a01b0384168361185b565b905080516000141580156116245750808060200190518101906116229190611e96565b155b15610df3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610949565b600061167583610d4160085490565b9050600061168b6007546001600160a01b031690565b905061169986868686611869565b6000821180156116b257506001600160a01b0381163014155b156116e2576116e27f00000000000000000000000000000000000000000000000000000000000000008284611720565b505050505050565b6001600160a01b03821661171457604051634b637e8f60e11b815260006004820152602401610949565b61091282600083611404565b6040516001600160a01b03838116602483015260448201839052610df391859182169063a9059cbb90606401611014565b60008383028160001985870982811083820303915050806000036117885783828161177e5761177e611e64565b0492505050610763565b8084116117c1576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b6000600282600381111561184457611844611eb8565b61184e9190611ece565b60ff166001149050919050565b6060610763838360006118ed565b6118957f0000000000000000000000000000000000000000000000000000000000000000853085611999565b61189f83826119d2565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516113f6929190918252602082015260400190565b60608147101561192b576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610949565b600080856001600160a01b031684866040516119479190611e7a565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b50915091506112f3868383611a08565b6040516001600160a01b038481166024830152838116604483015260648201839052610eb99186918216906323b872dd90608401611014565b6001600160a01b0382166119fc5760405163ec442f0560e01b815260006004820152602401610949565b61091260008383611404565b606082611a1857610be882611a78565b8151158015611a2f57506001600160a01b0384163b155b15611a71576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610949565b5080610763565b805115611a885780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015611ad5578181015183820152602001611abd565b50506000910152565b6020815260008251806020840152611afd816040850160208701611aba565b601f01601f19169190910160400192915050565b600060208284031215611b2357600080fd5b5035919050565b6001600160a01b0381168114610da957600080fd5b60008060408385031215611b5257600080fd5b8235611b5d81611b2a565b946020939093013593505050565b600080600060608486031215611b8057600080fd5b8335611b8b81611b2a565b92506020840135611b9b81611b2a565b929592945050506040919091013590565b600060208284031215611bbe57600080fd5b813561076381611b2a565b60008060408385031215611bdc57600080fd5b823591506020830135611bee81611b2a565b809150509250929050565b600080600060608486031215611c0e57600080fd5b833592506020840135611c2081611b2a565b91506040840135611c3081611b2a565b809150509250925092565b600080600060608486031215611c5057600080fd5b833592506020840135611c6281611b2a565b9150604084013561ffff81168114611c3057600080fd5b60008060408385031215611c8c57600080fd5b8235611c9781611b2a565b91506020830135611bee81611b2a565b60008060408385031215611cba57600080fd5b50508035926020909101359150565b600060208284031215611cdb57600080fd5b5051919050565b600181811c90821680611cf657607f821691505b602082108103611d1657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561071957610719611d1c565b8181038181111561071957610719611d1c565b8082018082111561071957610719611d1c565b600181815b80851115611dac578160001904821115611d9257611d92611d1c565b80851615611d9f57918102915b93841c9390800290611d76565b509250929050565b600082611dc357506001610719565b81611dd057506000610719565b8160018114611de65760028114611df057611e0c565b6001915050610719565b60ff841115611e0157611e01611d1c565b50506001821b610719565b5060208310610133831016604e8410600b8410161715611e2f575081810a610719565b611e398383611d71565b8060001904821115611e4d57611e4d611d1c565b029392505050565b600061076360ff841683611db4565b634e487b7160e01b600052601260045260246000fd5b60008251611e8c818460208701611aba565b9190910192915050565b600060208284031215611ea857600080fd5b8151801515811461076357600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611eef57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea264697066735822122078be0d61f06be7b31d82934e38e0e01f533e761933d73e729a05ac0e4d4cba7164736f6c63430008150033", + "solcInputHash": "ca2ee42c4a116704dc3eb0bec6d11bc6", + "metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_tbtc\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisallowedAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxRedeem\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"name\":\"ERC4626ExceededMaxWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"}],\"name\":\"LessThanMinDeposit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MathOverflowedMulDiv\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"minimumDepositAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"DispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"asset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"assetsBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"convertToAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"convertToShares\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dispatcher\",\"outputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"maxDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"maxMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"maxWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maximumTotalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minimumDepositAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewMint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"}],\"name\":\"previewRedeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"}],\"name\":\"previewWithdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"shares\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_minimumDepositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maximumTotalAssets\",\"type\":\"uint256\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Dispatcher\",\"name\":\"newDispatcher\",\"type\":\"address\"}],\"name\":\"updateDispatcher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"assets\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC4626ExceededMaxDeposit(address,uint256,uint256)\":[{\"details\":\"Attempted to deposit more assets than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxMint(address,uint256,uint256)\":[{\"details\":\"Attempted to mint more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxRedeem(address,uint256,uint256)\":[{\"details\":\"Attempted to redeem more shares than the max amount for `receiver`.\"}],\"ERC4626ExceededMaxWithdraw(address,uint256,uint256)\":[{\"details\":\"Attempted to withdraw more assets than the max amount for `receiver`.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"params\":{\"amount\":\"Amount to check.\",\"min\":\"Minimum amount to check 'amount' against.\"}}],\"MathOverflowedMulDiv()\":[{\"details\":\"Muldiv operation overflow.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"DepositParametersUpdated(uint256,uint256)\":{\"params\":{\"maximumTotalAssets\":\"New value of the maximum total assets amount.\",\"minimumDepositAmount\":\"New value of the minimum deposit amount.\"}},\"DispatcherUpdated(address,address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\",\"oldDispatcher\":\"Address of the old dispatcher contract.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"},\"TreasuryUpdated(address)\":{\"params\":{\"treasury\":\"New treasury wallet address.\"}}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"asset()\":{\"details\":\"See {IERC4626-asset}. \"},\"assetsBalanceOf(address)\":{\"params\":{\"account\":\"Owner of shares.\"},\"returns\":{\"_0\":\"Assets amount.\"}},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"convertToAssets(uint256)\":{\"details\":\"See {IERC4626-convertToAssets}. \"},\"convertToShares(uint256)\":{\"details\":\"See {IERC4626-convertToShares}. \"},\"decimals()\":{\"details\":\"Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.\"},\"deposit(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.\",\"params\":{\"assets\":\"Approved amount of tBTC tokens to deposit.\",\"receiver\":\"The address to which the shares will be minted.\"},\"returns\":{\"_0\":\"Minted shares.\"}},\"depositParameters()\":{\"returns\":{\"_0\":\"Returns deposit parameters.\"}},\"maxDeposit(address)\":{\"details\":\"When the remaining amount of unused limit is less than the minimum deposit amount, this function returns 0.\",\"returns\":{\"_0\":\"The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver.\"}},\"maxMint(address)\":{\"details\":\"Since the stBTC contract limits the maximum total tBTC tokens this function converts the maximum deposit amount to shares.\",\"returns\":{\"_0\":\"The maximum amount of the vault shares.\"}},\"maxRedeem(address)\":{\"details\":\"See {IERC4626-maxRedeem}. \"},\"maxWithdraw(address)\":{\"details\":\"See {IERC4626-maxWithdraw}. \"},\"mint(uint256,address)\":{\"details\":\"Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for tBTC transfer. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.\",\"params\":{\"receiver\":\"The address to which the shares will be minted.\",\"shares\":\"Amount of shares to mint.\"}},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"previewDeposit(uint256)\":{\"details\":\"See {IERC4626-previewDeposit}. \"},\"previewMint(uint256)\":{\"details\":\"See {IERC4626-previewMint}. \"},\"previewRedeem(uint256)\":{\"details\":\"See {IERC4626-previewRedeem}. \"},\"previewWithdraw(uint256)\":{\"details\":\"See {IERC4626-previewWithdraw}. \"},\"redeem(uint256,address,address)\":{\"details\":\"See {IERC4626-redeem}. \"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalAssets()\":{\"details\":\"See {IERC4626-totalAssets}. \"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateDepositParameters(uint256,uint256)\":{\"details\":\"To disable the limit for deposits, set the maximum total assets to maximum (`type(uint256).max`).\",\"params\":{\"_maximumTotalAssets\":\"New value of the maximum total assets amount. It is the maximum amount of the tBTC token that the Acre protocol can hold.\",\"_minimumDepositAmount\":\"New value of the minimum deposit amount. It is the minimum amount for a single deposit operation.\"}},\"updateDispatcher(address)\":{\"params\":{\"newDispatcher\":\"Address of the new dispatcher contract.\"}},\"updateTreasury(address)\":{\"params\":{\"newTreasury\":\"New treasury wallet address.\"}},\"withdraw(uint256,address,address)\":{\"details\":\"See {IERC4626-withdraw}. \"}},\"title\":\"stBTC\",\"version\":1},\"userdoc\":{\"errors\":{\"DisallowedAddress()\":[{\"notice\":\"Reverts if the address is disallowed.\"}],\"LessThanMinDeposit(uint256,uint256)\":[{\"notice\":\"Reverts if the amount is less than the minimum deposit amount.\"}],\"ZeroAddress()\":[{\"notice\":\"Reverts if the address is zero.\"}]},\"events\":{\"DepositParametersUpdated(uint256,uint256)\":{\"notice\":\"Emitted when deposit parameters are updated.\"},\"DispatcherUpdated(address,address)\":{\"notice\":\"Emitted when the dispatcher contract is updated.\"},\"TreasuryUpdated(address)\":{\"notice\":\"Emitted when the treasury wallet address is updated.\"}},\"kind\":\"user\",\"methods\":{\"assetsBalanceOf(address)\":{\"notice\":\"Returns value of assets that would be exchanged for the amount of shares owned by the `account`.\"},\"deposit(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing exactly amount of tBTC tokens.\"},\"dispatcher()\":{\"notice\":\"Dispatcher contract that routes tBTC from stBTC to a given vault and back.\"},\"maxDeposit(address)\":{\"notice\":\"Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre protocol.\"},\"maxMint(address)\":{\"notice\":\"Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call.\"},\"maximumTotalAssets()\":{\"notice\":\"Maximum total amount of tBTC token held by Acre protocol.\"},\"minimumDepositAmount()\":{\"notice\":\"Minimum amount for a single deposit operation.\"},\"mint(uint256,address)\":{\"notice\":\"Mints shares to receiver by depositing tBTC tokens.\"},\"treasury()\":{\"notice\":\"Address of the treasury wallet, where fees should be transferred to.\"},\"updateDepositParameters(uint256,uint256)\":{\"notice\":\"Updates deposit parameters.\"},\"updateDispatcher(address)\":{\"notice\":\"Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC.\"},\"updateTreasury(address)\":{\"notice\":\"Updates treasury wallet address.\"}},\"notice\":\"This contract implements the ERC-4626 tokenized vault standard. By staking tBTC, users acquire a liquid staking token called stBTC, commonly referred to as \\\"shares\\\". The staked tBTC is securely deposited into Acre's vaults, where it generates yield over time. Users have the flexibility to redeem stBTC, enabling them to withdraw their staked tBTC along with the accrued yield.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/stBTC.sol\":\"stBTC\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"./IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"./extensions/IERC20Metadata.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n */\\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\\n mapping(address account => uint256) private _balances;\\n\\n mapping(address account => mapping(address spender => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the default value returned by this function, unless\\n * it's overridden.\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `value`.\\n */\\n function transfer(address to, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 value) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, value);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `value`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `value`.\\n */\\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, value);\\n _transfer(from, to, value);\\n return true;\\n }\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _transfer(address from, address to, uint256 value) internal {\\n if (from == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(from, to, value);\\n }\\n\\n /**\\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\\n * this function.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _update(address from, address to, uint256 value) internal virtual {\\n if (from == address(0)) {\\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\\n _totalSupply += value;\\n } else {\\n uint256 fromBalance = _balances[from];\\n if (fromBalance < value) {\\n revert ERC20InsufficientBalance(from, fromBalance, value);\\n }\\n unchecked {\\n // Overflow not possible: value <= fromBalance <= totalSupply.\\n _balances[from] = fromBalance - value;\\n }\\n }\\n\\n if (to == address(0)) {\\n unchecked {\\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\\n _totalSupply -= value;\\n }\\n } else {\\n unchecked {\\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\\n _balances[to] += value;\\n }\\n }\\n\\n emit Transfer(from, to, value);\\n }\\n\\n /**\\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\\n * Relies on the `_update` mechanism\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead.\\n */\\n function _mint(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidReceiver(address(0));\\n }\\n _update(address(0), account, value);\\n }\\n\\n /**\\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\\n * Relies on the `_update` mechanism.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * NOTE: This function is not virtual, {_update} should be overridden instead\\n */\\n function _burn(address account, uint256 value) internal {\\n if (account == address(0)) {\\n revert ERC20InvalidSender(address(0));\\n }\\n _update(account, address(0), value);\\n }\\n\\n /**\\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address owner, address spender, uint256 value) internal {\\n _approve(owner, spender, value, true);\\n }\\n\\n /**\\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\\n *\\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\\n * `Approval` event during `transferFrom` operations.\\n *\\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\\n * true using the following override:\\n * ```\\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\\n * super._approve(owner, spender, value, true);\\n * }\\n * ```\\n *\\n * Requirements are the same as {_approve}.\\n */\\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\\n if (owner == address(0)) {\\n revert ERC20InvalidApprover(address(0));\\n }\\n if (spender == address(0)) {\\n revert ERC20InvalidSpender(address(0));\\n }\\n _allowances[owner][spender] = value;\\n if (emitEvent) {\\n emit Approval(owner, spender, value);\\n }\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\\n *\\n * Does not update the allowance value in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Does not emit an {Approval} event.\\n */\\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n if (currentAllowance < value) {\\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\\n }\\n unchecked {\\n _approve(owner, spender, currentAllowance - value, false);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3e1fa9d1987f8d349dfb4d6fe93bf2ca014b52ba335cfac30bfe71e357e6f80\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20, IERC20Metadata, ERC20} from \\\"../ERC20.sol\\\";\\nimport {SafeERC20} from \\\"../utils/SafeERC20.sol\\\";\\nimport {IERC4626} from \\\"../../../interfaces/IERC4626.sol\\\";\\nimport {Math} from \\\"../../../utils/math/Math.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC4626 \\\"Tokenized Vault Standard\\\" as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[EIP-4626].\\n *\\n * This extension allows the minting and burning of \\\"shares\\\" (represented using the ERC20 inheritance) in exchange for\\n * underlying \\\"assets\\\" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends\\n * the ERC20 standard. Any additional extensions included along it would affect the \\\"shares\\\" token represented by this\\n * contract and not the \\\"assets\\\" token which is an independent contract.\\n *\\n * [CAUTION]\\n * ====\\n * In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning\\n * with a \\\"donation\\\" to the vault that inflates the price of a share. This is variously known as a donation or inflation\\n * attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial\\n * deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may\\n * similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by\\n * verifying the amount received is as expected, using a wrapper that performs these checks such as\\n * https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].\\n *\\n * Since v4.9, this implementation uses virtual assets and shares to mitigate that risk. The `_decimalsOffset()`\\n * corresponds to an offset in the decimal representation between the underlying asset's decimals and the vault\\n * decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which itself\\n * determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default offset\\n * (0) makes it non-profitable, as a result of the value being captured by the virtual shares (out of the attacker's\\n * donation) matching the attacker's expected gains. With a larger offset, the attack becomes orders of magnitude more\\n * expensive than it is profitable. More details about the underlying math can be found\\n * xref:erc4626.adoc#inflation-attack[here].\\n *\\n * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued\\n * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets\\n * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience\\n * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the\\n * `_convertToShares` and `_convertToAssets` functions.\\n *\\n * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].\\n * ====\\n */\\nabstract contract ERC4626 is ERC20, IERC4626 {\\n using Math for uint256;\\n\\n IERC20 private immutable _asset;\\n uint8 private immutable _underlyingDecimals;\\n\\n /**\\n * @dev Attempted to deposit more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to mint more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Attempted to withdraw more assets than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);\\n\\n /**\\n * @dev Attempted to redeem more shares than the max amount for `receiver`.\\n */\\n error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);\\n\\n /**\\n * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC20 or ERC777).\\n */\\n constructor(IERC20 asset_) {\\n (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);\\n _underlyingDecimals = success ? assetDecimals : 18;\\n _asset = asset_;\\n }\\n\\n /**\\n * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\\n */\\n function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool, uint8) {\\n (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(\\n abi.encodeCall(IERC20Metadata.decimals, ())\\n );\\n if (success && encodedDecimals.length >= 32) {\\n uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\\n if (returnedDecimals <= type(uint8).max) {\\n return (true, uint8(returnedDecimals));\\n }\\n }\\n return (false, 0);\\n }\\n\\n /**\\n * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\\n * \\\"original\\\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\\n * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\\n *\\n * See {IERC20Metadata-decimals}.\\n */\\n function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {\\n return _underlyingDecimals + _decimalsOffset();\\n }\\n\\n /** @dev See {IERC4626-asset}. */\\n function asset() public view virtual returns (address) {\\n return address(_asset);\\n }\\n\\n /** @dev See {IERC4626-totalAssets}. */\\n function totalAssets() public view virtual returns (uint256) {\\n return _asset.balanceOf(address(this));\\n }\\n\\n /** @dev See {IERC4626-convertToShares}. */\\n function convertToShares(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-convertToAssets}. */\\n function convertToAssets(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxDeposit}. */\\n function maxDeposit(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxMint}. */\\n function maxMint(address) public view virtual returns (uint256) {\\n return type(uint256).max;\\n }\\n\\n /** @dev See {IERC4626-maxWithdraw}. */\\n function maxWithdraw(address owner) public view virtual returns (uint256) {\\n return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-maxRedeem}. */\\n function maxRedeem(address owner) public view virtual returns (uint256) {\\n return balanceOf(owner);\\n }\\n\\n /** @dev See {IERC4626-previewDeposit}. */\\n function previewDeposit(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-previewMint}. */\\n function previewMint(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewWithdraw}. */\\n function previewWithdraw(uint256 assets) public view virtual returns (uint256) {\\n return _convertToShares(assets, Math.Rounding.Ceil);\\n }\\n\\n /** @dev See {IERC4626-previewRedeem}. */\\n function previewRedeem(uint256 shares) public view virtual returns (uint256) {\\n return _convertToAssets(shares, Math.Rounding.Floor);\\n }\\n\\n /** @dev See {IERC4626-deposit}. */\\n function deposit(uint256 assets, address receiver) public virtual returns (uint256) {\\n uint256 maxAssets = maxDeposit(receiver);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);\\n }\\n\\n uint256 shares = previewDeposit(assets);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-mint}.\\n *\\n * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero.\\n * In this case, the shares will be minted without requiring any assets to be deposited.\\n */\\n function mint(uint256 shares, address receiver) public virtual returns (uint256) {\\n uint256 maxShares = maxMint(receiver);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxMint(receiver, shares, maxShares);\\n }\\n\\n uint256 assets = previewMint(shares);\\n _deposit(_msgSender(), receiver, assets, shares);\\n\\n return assets;\\n }\\n\\n /** @dev See {IERC4626-withdraw}. */\\n function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxAssets = maxWithdraw(owner);\\n if (assets > maxAssets) {\\n revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);\\n }\\n\\n uint256 shares = previewWithdraw(assets);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return shares;\\n }\\n\\n /** @dev See {IERC4626-redeem}. */\\n function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {\\n uint256 maxShares = maxRedeem(owner);\\n if (shares > maxShares) {\\n revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);\\n }\\n\\n uint256 assets = previewRedeem(shares);\\n _withdraw(_msgSender(), receiver, owner, assets, shares);\\n\\n return assets;\\n }\\n\\n /**\\n * @dev Internal conversion function (from assets to shares) with support for rounding direction.\\n */\\n function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);\\n }\\n\\n /**\\n * @dev Internal conversion function (from shares to assets) with support for rounding direction.\\n */\\n function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {\\n return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\\n }\\n\\n /**\\n * @dev Deposit/mint common workflow.\\n */\\n function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {\\n // If _asset is ERC777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the\\n // `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the\\n // assets are transferred and before the shares are minted, which is a valid state.\\n // slither-disable-next-line reentrancy-no-eth\\n SafeERC20.safeTransferFrom(_asset, caller, address(this), assets);\\n _mint(receiver, shares);\\n\\n emit Deposit(caller, receiver, assets, shares);\\n }\\n\\n /**\\n * @dev Withdraw/redeem common workflow.\\n */\\n function _withdraw(\\n address caller,\\n address receiver,\\n address owner,\\n uint256 assets,\\n uint256 shares\\n ) internal virtual {\\n if (caller != owner) {\\n _spendAllowance(owner, caller, shares);\\n }\\n\\n // If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the\\n // `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,\\n // calls the vault, which is assumed not malicious.\\n //\\n // Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the\\n // shares are burned and after the assets are transferred, which is a valid state.\\n _burn(owner, shares);\\n SafeERC20.safeTransfer(_asset, receiver, assets);\\n\\n emit Withdraw(caller, receiver, owner, assets, shares);\\n }\\n\\n function _decimalsOffset() internal view virtual returns (uint8) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x1837547e04d5fe5334eeb77a345683c22995f1e7aa033020757ddf83a80fc72d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {FailedInnerCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert AddressInsufficientBalance(address(this));\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\\n * unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {FailedInnerCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x75a4ee64c68dbd5f38bddd06e664a64c8271b4caa554fb6f0607dfd672bb4bf3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n /**\\n * @dev Muldiv operation overflow.\\n */\\n error MathOverflowedMulDiv();\\n\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n return a / b;\\n }\\n\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0 = x * y; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n revert MathOverflowedMulDiv();\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x005ec64c6313f0555d59e278f9a7a5ab2db5bdc72a027f255a37c327af1ec02d\",\"license\":\"MIT\"},\"contracts/Dispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport \\\"./Router.sol\\\";\\nimport \\\"./stBTC.sol\\\";\\n\\n/// @title Dispatcher\\n/// @notice Dispatcher is a contract that routes tBTC from stBTC to\\n/// yield vaults and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\ncontract Dispatcher is Router, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Struct holds information about a vault.\\n struct VaultInfo {\\n bool authorized;\\n }\\n\\n /// The main stBTC contract holding tBTC deposited by stakers.\\n stBTC public immutable stbtc;\\n /// tBTC token contract.\\n IERC20 public immutable tbtc;\\n /// Address of the maintainer bot.\\n address public maintainer;\\n\\n /// Authorized Yield Vaults that implement ERC4626 standard. These\\n /// vaults deposit assets to yield strategies, e.g. Uniswap V3\\n /// WBTC/TBTC pool. Vault can be a part of Acre ecosystem or can be\\n /// implemented externally. As long as it complies with ERC4626\\n /// standard and is authorized by the owner it can be plugged into\\n /// Acre.\\n address[] public vaults;\\n /// Mapping of vaults to their information.\\n mapping(address => VaultInfo) public vaultsInfo;\\n\\n /// Emitted when a vault is authorized.\\n /// @param vault Address of the vault.\\n event VaultAuthorized(address indexed vault);\\n\\n /// Emitted when a vault is deauthorized.\\n /// @param vault Address of the vault.\\n event VaultDeauthorized(address indexed vault);\\n\\n /// Emitted when tBTC is routed to a vault.\\n /// @param vault Address of the vault.\\n /// @param amount Amount of tBTC.\\n /// @param sharesOut Amount of received shares.\\n event DepositAllocated(\\n address indexed vault,\\n uint256 amount,\\n uint256 sharesOut\\n );\\n\\n /// Emitted when the maintainer address is updated.\\n /// @param maintainer Address of the new maintainer.\\n event MaintainerUpdated(address indexed maintainer);\\n\\n /// Reverts if the vault is already authorized.\\n error VaultAlreadyAuthorized();\\n\\n /// Reverts if the vault is not authorized.\\n error VaultUnauthorized();\\n\\n /// Reverts if the caller is not the maintainer.\\n error NotMaintainer();\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Modifier that reverts if the caller is not the maintainer.\\n modifier onlyMaintainer() {\\n if (msg.sender != maintainer) {\\n revert NotMaintainer();\\n }\\n _;\\n }\\n\\n constructor(stBTC _stbtc, IERC20 _tbtc) Ownable(msg.sender) {\\n stbtc = _stbtc;\\n tbtc = _tbtc;\\n }\\n\\n /// @notice Adds a vault to the list of authorized vaults.\\n /// @param vault Address of the vault to add.\\n function authorizeVault(address vault) external onlyOwner {\\n if (isVaultAuthorized(vault)) {\\n revert VaultAlreadyAuthorized();\\n }\\n\\n vaults.push(vault);\\n vaultsInfo[vault].authorized = true;\\n\\n emit VaultAuthorized(vault);\\n }\\n\\n /// @notice Removes a vault from the list of authorized vaults.\\n /// @param vault Address of the vault to remove.\\n function deauthorizeVault(address vault) external onlyOwner {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n vaultsInfo[vault].authorized = false;\\n\\n for (uint256 i = 0; i < vaults.length; i++) {\\n if (vaults[i] == vault) {\\n vaults[i] = vaults[vaults.length - 1];\\n // slither-disable-next-line costly-loop\\n vaults.pop();\\n break;\\n }\\n }\\n\\n emit VaultDeauthorized(vault);\\n }\\n\\n /// @notice Updates the maintainer address.\\n /// @param newMaintainer Address of the new maintainer.\\n function updateMaintainer(address newMaintainer) external onlyOwner {\\n if (newMaintainer == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n maintainer = newMaintainer;\\n\\n emit MaintainerUpdated(maintainer);\\n }\\n\\n /// TODO: make this function internal once the allocation distribution is\\n /// implemented\\n /// @notice Routes tBTC from stBTC to a vault. Can be called by the maintainer\\n /// only.\\n /// @param vault Address of the vault to route the assets to.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function depositToVault(\\n address vault,\\n uint256 amount,\\n uint256 minSharesOut\\n ) public onlyMaintainer {\\n if (!isVaultAuthorized(vault)) {\\n revert VaultUnauthorized();\\n }\\n\\n // slither-disable-next-line arbitrary-send-erc20\\n tbtc.safeTransferFrom(address(stbtc), address(this), amount);\\n tbtc.forceApprove(address(vault), amount);\\n\\n uint256 sharesOut = deposit(\\n IERC4626(vault),\\n address(stbtc),\\n amount,\\n minSharesOut\\n );\\n // slither-disable-next-line reentrancy-events\\n emit DepositAllocated(vault, amount, sharesOut);\\n }\\n\\n /// @notice Returns the list of authorized vaults.\\n function getVaults() public view returns (address[] memory) {\\n return vaults;\\n }\\n\\n /// @notice Returns true if the vault is authorized.\\n /// @param vault Address of the vault to check.\\n function isVaultAuthorized(address vault) public view returns (bool) {\\n return vaultsInfo[vault].authorized;\\n }\\n\\n /// TODO: implement redeem() / withdraw() functions\\n}\\n\",\"keccak256\":\"0x0dd77692ab8c6059afa7b4a90f26733560b53fb66192e9912a2064103c5d41fb\",\"license\":\"GPL-3.0-only\"},\"contracts/Router.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\n/// @title Router\\n/// @notice Router is a contract that routes tBTC from stBTC to\\n/// a given vault and back. Vaults supply yield strategies with tBTC that\\n/// generate yield for Bitcoin holders.\\nabstract contract Router {\\n /// Thrown when amount of shares received is below the min set by caller.\\n /// @param vault Address of the vault.\\n /// @param sharesOut Amount of received shares.\\n /// @param minSharesOut Minimum amount of shares expected to receive.\\n error MinSharesError(\\n address vault,\\n uint256 sharesOut,\\n uint256 minSharesOut\\n );\\n\\n /// @notice Routes funds from stBTC to a vault. The amount of tBTC to\\n /// Shares of deposited tBTC are minted to the stBTC contract.\\n /// @param vault Address of the vault to route the funds to.\\n /// @param receiver Address of the receiver of the shares.\\n /// @param amount Amount of tBTC to deposit.\\n /// @param minSharesOut Minimum amount of shares to receive.\\n function deposit(\\n IERC4626 vault,\\n address receiver,\\n uint256 amount,\\n uint256 minSharesOut\\n ) internal returns (uint256 sharesOut) {\\n if ((sharesOut = vault.deposit(amount, receiver)) < minSharesOut) {\\n revert MinSharesError(address(vault), sharesOut, minSharesOut);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x520e27c613f1234755c23402524b048a81abd15222d7f318504992d490248812\",\"license\":\"GPL-3.0-only\"},\"contracts/stBTC.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\npragma solidity ^0.8.21;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"./Dispatcher.sol\\\";\\n\\n/// @title stBTC\\n/// @notice This contract implements the ERC-4626 tokenized vault standard. By\\n/// staking tBTC, users acquire a liquid staking token called stBTC,\\n/// commonly referred to as \\\"shares\\\". The staked tBTC is securely\\n/// deposited into Acre's vaults, where it generates yield over time.\\n/// Users have the flexibility to redeem stBTC, enabling them to\\n/// withdraw their staked tBTC along with the accrued yield.\\n/// @dev ERC-4626 is a standard to optimize and unify the technical parameters\\n/// of yield-bearing vaults. This contract facilitates the minting and\\n/// burning of shares (stBTC), which are represented as standard ERC20\\n/// tokens, providing a seamless exchange with tBTC tokens.\\ncontract stBTC is ERC4626, Ownable {\\n using SafeERC20 for IERC20;\\n\\n /// Dispatcher contract that routes tBTC from stBTC to a given vault and back.\\n Dispatcher public dispatcher;\\n\\n /// Address of the treasury wallet, where fees should be transferred to.\\n address public treasury;\\n\\n /// Minimum amount for a single deposit operation.\\n uint256 public minimumDepositAmount;\\n /// Maximum total amount of tBTC token held by Acre protocol.\\n uint256 public maximumTotalAssets;\\n\\n /// Emitted when the treasury wallet address is updated.\\n /// @param treasury New treasury wallet address.\\n event TreasuryUpdated(address treasury);\\n\\n /// Emitted when deposit parameters are updated.\\n /// @param minimumDepositAmount New value of the minimum deposit amount.\\n /// @param maximumTotalAssets New value of the maximum total assets amount.\\n event DepositParametersUpdated(\\n uint256 minimumDepositAmount,\\n uint256 maximumTotalAssets\\n );\\n\\n /// Emitted when the dispatcher contract is updated.\\n /// @param oldDispatcher Address of the old dispatcher contract.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n event DispatcherUpdated(address oldDispatcher, address newDispatcher);\\n\\n /// Reverts if the amount is less than the minimum deposit amount.\\n /// @param amount Amount to check.\\n /// @param min Minimum amount to check 'amount' against.\\n error LessThanMinDeposit(uint256 amount, uint256 min);\\n\\n /// Reverts if the address is zero.\\n error ZeroAddress();\\n\\n /// Reverts if the address is disallowed.\\n error DisallowedAddress();\\n\\n constructor(\\n IERC20 _tbtc,\\n address _treasury\\n ) ERC4626(_tbtc) ERC20(\\\"Acre Staked Bitcoin\\\", \\\"stBTC\\\") Ownable(msg.sender) {\\n if (address(_treasury) == address(0)) {\\n revert ZeroAddress();\\n }\\n treasury = _treasury;\\n // TODO: Revisit the exact values closer to the launch.\\n minimumDepositAmount = 0.001 * 1e18; // 0.001 tBTC\\n maximumTotalAssets = 25 * 1e18; // 25 tBTC\\n }\\n\\n /// @notice Updates treasury wallet address.\\n /// @param newTreasury New treasury wallet address.\\n function updateTreasury(address newTreasury) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n if (newTreasury == address(0)) {\\n revert ZeroAddress();\\n }\\n if (newTreasury == address(this)) {\\n revert DisallowedAddress();\\n }\\n treasury = newTreasury;\\n\\n emit TreasuryUpdated(newTreasury);\\n }\\n\\n /// @notice Updates deposit parameters.\\n /// @dev To disable the limit for deposits, set the maximum total assets to\\n /// maximum (`type(uint256).max`).\\n /// @param _minimumDepositAmount New value of the minimum deposit amount. It\\n /// is the minimum amount for a single deposit operation.\\n /// @param _maximumTotalAssets New value of the maximum total assets amount.\\n /// It is the maximum amount of the tBTC token that the Acre protocol\\n /// can hold.\\n function updateDepositParameters(\\n uint256 _minimumDepositAmount,\\n uint256 _maximumTotalAssets\\n ) external onlyOwner {\\n // TODO: Introduce a parameters update process.\\n minimumDepositAmount = _minimumDepositAmount;\\n maximumTotalAssets = _maximumTotalAssets;\\n\\n emit DepositParametersUpdated(\\n _minimumDepositAmount,\\n _maximumTotalAssets\\n );\\n }\\n\\n // TODO: Implement a governed upgrade process that initiates an update and\\n // then finalizes it after a delay.\\n /// @notice Updates the dispatcher contract and gives it an unlimited\\n /// allowance to transfer staked tBTC.\\n /// @param newDispatcher Address of the new dispatcher contract.\\n function updateDispatcher(Dispatcher newDispatcher) external onlyOwner {\\n if (address(newDispatcher) == address(0)) {\\n revert ZeroAddress();\\n }\\n\\n address oldDispatcher = address(dispatcher);\\n\\n emit DispatcherUpdated(oldDispatcher, address(newDispatcher));\\n dispatcher = newDispatcher;\\n\\n // TODO: Once withdrawal/rebalancing is implemented, we need to revoke the\\n // approval of the vaults share tokens from the old dispatcher and approve\\n // a new dispatcher to manage the share tokens.\\n\\n if (oldDispatcher != address(0)) {\\n // Setting allowance to zero for the old dispatcher\\n IERC20(asset()).forceApprove(oldDispatcher, 0);\\n }\\n\\n // Setting allowance to max for the new dispatcher\\n IERC20(asset()).forceApprove(address(dispatcher), type(uint256).max);\\n }\\n\\n /// @notice Mints shares to receiver by depositing exactly amount of\\n /// tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// @param assets Approved amount of tBTC tokens to deposit.\\n /// @param receiver The address to which the shares will be minted.\\n /// @return Minted shares.\\n function deposit(\\n uint256 assets,\\n address receiver\\n ) public override returns (uint256) {\\n if (assets < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n\\n return super.deposit(assets, receiver);\\n }\\n\\n /// @notice Mints shares to receiver by depositing tBTC tokens.\\n /// @dev Takes into account a deposit parameter, minimum deposit amount,\\n /// which determines the minimum amount for a single deposit operation.\\n /// The amount of the assets has to be pre-approved in the tBTC\\n /// contract.\\n /// The msg.sender is required to grant approval for tBTC transfer.\\n /// To determine the total assets amount necessary for approval\\n /// corresponding to a given share amount, use the `previewMint` function.\\n /// @param shares Amount of shares to mint.\\n /// @param receiver The address to which the shares will be minted.\\n function mint(\\n uint256 shares,\\n address receiver\\n ) public override returns (uint256 assets) {\\n if ((assets = super.mint(shares, receiver)) < minimumDepositAmount) {\\n revert LessThanMinDeposit(assets, minimumDepositAmount);\\n }\\n }\\n\\n /// @notice Returns value of assets that would be exchanged for the amount of\\n /// shares owned by the `account`.\\n /// @param account Owner of shares.\\n /// @return Assets amount.\\n function assetsBalanceOf(address account) public view returns (uint256) {\\n return convertToAssets(balanceOf(account));\\n }\\n\\n /// @notice Returns the maximum amount of the tBTC token that can be\\n /// deposited into the vault for the receiver through a deposit\\n /// call. It takes into account the deposit parameter, maximum total\\n /// assets, which determines the total amount of tBTC token held by\\n /// Acre protocol.\\n /// @dev When the remaining amount of unused limit is less than the minimum\\n /// deposit amount, this function returns 0.\\n /// @return The maximum amount of tBTC token that can be deposited into\\n /// Acre protocol for the receiver.\\n function maxDeposit(address) public view override returns (uint256) {\\n if (maximumTotalAssets == type(uint256).max) {\\n return type(uint256).max;\\n }\\n\\n uint256 _totalAssets = totalAssets();\\n\\n return\\n _totalAssets >= maximumTotalAssets\\n ? 0\\n : maximumTotalAssets - _totalAssets;\\n }\\n\\n /// @notice Returns the maximum amount of the vault shares that can be\\n /// minted for the receiver, through a mint call.\\n /// @dev Since the stBTC contract limits the maximum total tBTC tokens this\\n /// function converts the maximum deposit amount to shares.\\n /// @return The maximum amount of the vault shares.\\n function maxMint(address receiver) public view override returns (uint256) {\\n uint256 _maxDeposit = maxDeposit(receiver);\\n\\n // slither-disable-next-line incorrect-equality\\n return\\n _maxDeposit == type(uint256).max\\n ? type(uint256).max\\n : convertToShares(_maxDeposit);\\n }\\n\\n /// @return Returns deposit parameters.\\n function depositParameters() public view returns (uint256, uint256) {\\n return (minimumDepositAmount, maximumTotalAssets);\\n }\\n}\\n\",\"keccak256\":\"0x8fa5224df372d53f1d86ee41132cb614d45916ba0b715b967d8d308b67a2a855\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60c06040523480156200001157600080fd5b506040516200221a3803806200221a8339810160408190526200003491620002d5565b33826040518060400160405280601381526020017f41637265205374616b656420426974636f696e0000000000000000000000000081525060405180604001604052806005815260200164737442544360d81b81525081600390816200009b9190620003b9565b506004620000aa8282620003b9565b505050600080620000c1836200018560201b60201c565b9150915081620000d3576012620000d5565b805b60ff1660a05250506001600160a01b0390811660805281166200011257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200011d816200026a565b506001600160a01b038116620001465760405163d92e233d60e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b03929092169190911790555066038d7ea4c6800060085568015af1d78b58c40000600955620004d0565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290516000918291829182916001600160a01b03871691620001ce9162000485565b600060405180830381855afa9150503d80600081146200020b576040519150601f19603f3d011682016040523d82523d6000602084013e62000210565b606091505b50915091508180156200022557506020815110155b156200025d57600081806020019051810190620002439190620004b6565b905060ff81116200025b576001969095509350505050565b505b5060009485945092505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114620002d257600080fd5b50565b60008060408385031215620002e957600080fd5b8251620002f681620002bc565b60208401519092506200030981620002bc565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200033f57607f821691505b6020821081036200036057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003b457600081815260208120601f850160051c810160208610156200038f5750805b601f850160051c820191505b81811015620003b0578281556001016200039b565b5050505b505050565b81516001600160401b03811115620003d557620003d562000314565b620003ed81620003e684546200032a565b8462000366565b602080601f8311600181146200042557600084156200040c5750858301515b600019600386901b1c1916600185901b178555620003b0565b600085815260208120601f198616915b82811015620004565788860151825594840194600190910190840162000435565b5085821015620004755787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825160005b81811015620004a857602081860181015185830152016200048c565b506000920191825250919050565b600060208284031215620004c957600080fd5b5051919050565b60805160a051611d0162000519600039600061070d0152600081816103350152818161059d0152818161082c01528181610871015281816110b501526114ff0152611d016000f3fe608060405234801561001057600080fd5b50600436106102775760003560e01c80637f51bb1f11610160578063c42b64d0116100d8578063d905777e1161008c578063e9c092e311610071578063e9c092e314610546578063ef8b30f7146104c1578063f2fde38b1461055957600080fd5b8063d905777e146104fa578063dd62ed3e1461050d57600080fd5b8063c6e6f592116100bd578063c6e6f592146104c1578063cb7e9057146104d4578063ce96cb77146104e757600080fd5b8063c42b64d014610493578063c63d75b6146104ae57600080fd5b8063995bd0c11161012f578063b3d7f6b911610114578063b3d7f6b91461045a578063b460af941461046d578063ba0876521461048057600080fd5b8063995bd0c114610434578063a9059cbb1461044757600080fd5b80637f51bb1f146103f55780638da5cb5b1461040857806394bf804d1461041957806395d89b411461042c57600080fd5b806338d52e0f116101f3578063543bda75116101c25780636e553f65116101a75780636e553f65146103b157806370a08231146103c4578063715018a6146103ed57600080fd5b8063543bda751461039557806361d027b31461039e57600080fd5b806338d52e0f14610333578063402d267d1461036d57806342af1198146103805780634cdad506146102ac57600080fd5b8063095ea7b31161024a57806318160ddd1161022f57806318160ddd146102fe57806323b872dd14610306578063313ce5671461031957600080fd5b8063095ea7b3146102c85780630a28a477146102eb57600080fd5b806301e1d1141461027c57806306fdde031461029757806307a2d13a146102ac578063080c279a146102bf575b600080fd5b61028461056c565b6040519081526020015b60405180910390f35b61029f610615565b60405161028e91906118e9565b6102846102ba36600461191c565b6106a7565b61028460085481565b6102db6102d636600461194a565b6106ba565b604051901515815260200161028e565b6102846102f936600461191c565b6106d2565b600254610284565b6102db610314366004611976565b6106df565b610321610705565b60405160ff909116815260200161028e565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161028e565b61028461037b3660046119b7565b610731565b61039361038e3660046119b7565b610779565b005b61028460095481565b600754610355906001600160a01b031681565b6102846103bf3660046119d4565b610899565b6102846103d23660046119b7565b6001600160a01b031660009081526020819052604090205490565b6103936108df565b6103936104033660046119b7565b6108f3565b6005546001600160a01b0316610355565b6102846104273660046119d4565b6109c5565b61029f610a04565b6102846104423660046119b7565b610a13565b6102db61045536600461194a565b610a35565b61028461046836600461191c565b610a43565b61028461047b366004611a04565b610a50565b61028461048e366004611a04565b610ad4565b6008546009546040805192835260208301919091520161028e565b6102846104bc3660046119b7565b610b4f565b6102846104cf36600461191c565b610b79565b600654610355906001600160a01b031681565b6102846104f53660046119b7565b610b86565b6102846105083660046119b7565b610baa565b61028461051b366004611a46565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610393610554366004611a74565b610bc8565b6103936105673660046119b7565b610c17565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611a96565b905090565b60606003805461062490611aaf565b80601f016020809104026020016040519081016040528092919081815260200182805461065090611aaf565b801561069d5780601f106106725761010080835404028352916020019161069d565b820191906000526020600020905b81548152906001019060200180831161068057829003601f168201915b5050505050905090565b60006106b4826000610c6e565b92915050565b6000336106c8818585610ca8565b5060019392505050565b60006106b4826001610cba565b6000336106ed858285610cea565b6106f8858585610d81565b60019150505b9392505050565b6000610610817f0000000000000000000000000000000000000000000000000000000000000000611aff565b6000600019600954036107475750600019919050565b600061075161056c565b9050600954811015610770578060095461076b9190611b18565b6106fe565b60009392505050565b610781610de0565b6001600160a01b0381166107a85760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038481169190911790915581161561085c5761085c8160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610e26565b600654610895906001600160a01b03166000197f000000000000000000000000000000000000000000000000000000000000000061084c565b5050565b60006008548310156108d5576008546040516314d6e77b60e31b81526108cc918591600401918252602082015260400190565b60405180910390fd5b6106fe8383610f27565b6108e7610de0565b6108f16000610fa9565b565b6108fb610de0565b6001600160a01b0381166109225760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b03821603610964576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d19060200160405180910390a150565b60006008546109d48484611008565b91508110156106b4576008546040516314d6e77b60e31b81526108cc918391600401918252602082015260400190565b60606004805461062490611aaf565b6001600160a01b0381166000908152602081905260408120546106b4906106a7565b6000336106c8818585610d81565b60006106b4826001610c6e565b600080610a5c83610b86565b905080851115610ab1576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101869052604481018290526064016108cc565b6000610abc866106d2565b9050610acb3386868985611082565b95945050505050565b600080610ae083610baa565b905080851115610b35576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101869052604481018290526064016108cc565b6000610b40866106a7565b9050610acb338686848a611082565b600080610b5b83610731565b90506000198114610b6f5761076b81610b79565b6000199392505050565b60006106b4826000610cba565b6001600160a01b0381166000908152602081905260408120546106b4906000610c6e565b6001600160a01b0381166000908152602081905260408120546106b4565b610bd0610de0565b6008829055600981905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b610c1f610de0565b6001600160a01b038116610c62576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b610c6b81610fa9565b50565b60006106fe610c7b61056c565b610c86906001611b2b565b610c926000600a611c22565b600254610c9f9190611b2b565b85919085611142565b610cb58383836001611191565b505050565b60006106fe610cca82600a611c22565b600254610cd79190611b2b565b610cdf61056c565b610c9f906001611b2b565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610d7b5781811015610d6c576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064016108cc565b610d7b84848484036000611191565b50505050565b6001600160a01b038316610dab57604051634b637e8f60e11b8152600060048201526024016108cc565b6001600160a01b038216610dd55760405163ec442f0560e01b8152600060048201526024016108cc565b610cb5838383611298565b6005546001600160a01b031633146108f1576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016108cc565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610ea584826113db565b610d7b576040516001600160a01b03848116602483015260006044830152610f1d91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061147e565b610d7b848261147e565b600080610f3383610731565b905080841115610f88576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604481018290526064016108cc565b6000610f9385610b79565b9050610fa1338587846114fa565b949350505050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061101483610b4f565b905080841115611069576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604481018290526064016108cc565b600061107485610a43565b9050610fa1338583886114fa565b826001600160a01b0316856001600160a01b0316146110a6576110a6838683610cea565b6110b0838261157e565b6110db7f000000000000000000000000000000000000000000000000000000000000000085846115b4565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611133929190918252602082015260400190565b60405180910390a45050505050565b6000806111508686866115e5565b905061115b836116c2565b801561117757506000848061117257611172611c31565b868809115b15610acb57611187600182611b2b565b9695505050505050565b6001600160a01b0384166111d4576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b6001600160a01b038316611217576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610d7b57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161128a91815260200190565b60405180910390a350505050565b6001600160a01b0383166112c35780600260008282546112b89190611b2b565b9091555061134e9050565b6001600160a01b0383166000908152602081905260409020548181101561132f576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260248101829052604481018390526064016108cc565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661136a57600280548290039055611389565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113ce91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516113f89190611c47565b6000604051808303816000865af19150503d8060008114611435576040519150601f19603f3d011682016040523d82523d6000602084013e61143a565b606091505b50915091508180156114645750805115806114645750808060200190518101906114649190611c63565b8015610acb5750505050506001600160a01b03163b151590565b60006114936001600160a01b038416836116ef565b905080516000141580156114b85750808060200190518101906114b69190611c63565b155b15610cb5576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016108cc565b6115267f00000000000000000000000000000000000000000000000000000000000000008530856116fd565b6115308382611736565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7848460405161128a929190918252602082015260400190565b6001600160a01b0382166115a857604051634b637e8f60e11b8152600060048201526024016108cc565b61089582600083611298565b6040516001600160a01b03838116602483015260448201839052610cb591859182169063a9059cbb90606401610ed6565b600083830281600019858709828110838203039150508060000361161c5783828161161257611612611c31565b04925050506106fe565b808411611655576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600060028260038111156116d8576116d8611c85565b6116e29190611c9b565b60ff166001149050919050565b60606106fe8383600061176c565b6040516001600160a01b038481166024830152838116604483015260648201839052610d7b9186918216906323b872dd90608401610ed6565b6001600160a01b0382166117605760405163ec442f0560e01b8152600060048201526024016108cc565b61089560008383611298565b6060814710156117aa576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016108cc565b600080856001600160a01b031684866040516117c69190611c47565b60006040518083038185875af1925050503d8060008114611803576040519150601f19603f3d011682016040523d82523d6000602084013e611808565b606091505b50915091506111878683836060826118235761076b82611883565b815115801561183a57506001600160a01b0384163b155b1561187c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016108cc565b50806106fe565b8051156118935780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b838110156118e05781810151838201526020016118c8565b50506000910152565b60208152600082518060208401526119088160408501602087016118c5565b601f01601f19169190910160400192915050565b60006020828403121561192e57600080fd5b5035919050565b6001600160a01b0381168114610c6b57600080fd5b6000806040838503121561195d57600080fd5b823561196881611935565b946020939093013593505050565b60008060006060848603121561198b57600080fd5b833561199681611935565b925060208401356119a681611935565b929592945050506040919091013590565b6000602082840312156119c957600080fd5b81356106fe81611935565b600080604083850312156119e757600080fd5b8235915060208301356119f981611935565b809150509250929050565b600080600060608486031215611a1957600080fd5b833592506020840135611a2b81611935565b91506040840135611a3b81611935565b809150509250925092565b60008060408385031215611a5957600080fd5b8235611a6481611935565b915060208301356119f981611935565b60008060408385031215611a8757600080fd5b50508035926020909101359150565b600060208284031215611aa857600080fd5b5051919050565b600181811c90821680611ac357607f821691505b602082108103611ae357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff81811683821601908111156106b4576106b4611ae9565b818103818111156106b4576106b4611ae9565b808201808211156106b4576106b4611ae9565b600181815b80851115611b79578160001904821115611b5f57611b5f611ae9565b80851615611b6c57918102915b93841c9390800290611b43565b509250929050565b600082611b90575060016106b4565b81611b9d575060006106b4565b8160018114611bb35760028114611bbd57611bd9565b60019150506106b4565b60ff841115611bce57611bce611ae9565b50506001821b6106b4565b5060208310610133831016604e8410600b8410161715611bfc575081810a6106b4565b611c068383611b3e565b8060001904821115611c1a57611c1a611ae9565b029392505050565b60006106fe60ff841683611b81565b634e487b7160e01b600052601260045260246000fd5b60008251611c598184602087016118c5565b9190910192915050565b600060208284031215611c7557600080fd5b815180151581146106fe57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611cbc57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea2646970667358221220613e87e5d7e469eae628fc2f45b68eaf8d314fc3fbd6b5de50baf2a5e5c5a97664736f6c63430008150033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102775760003560e01c80637f51bb1f11610160578063c42b64d0116100d8578063d905777e1161008c578063e9c092e311610071578063e9c092e314610546578063ef8b30f7146104c1578063f2fde38b1461055957600080fd5b8063d905777e146104fa578063dd62ed3e1461050d57600080fd5b8063c6e6f592116100bd578063c6e6f592146104c1578063cb7e9057146104d4578063ce96cb77146104e757600080fd5b8063c42b64d014610493578063c63d75b6146104ae57600080fd5b8063995bd0c11161012f578063b3d7f6b911610114578063b3d7f6b91461045a578063b460af941461046d578063ba0876521461048057600080fd5b8063995bd0c114610434578063a9059cbb1461044757600080fd5b80637f51bb1f146103f55780638da5cb5b1461040857806394bf804d1461041957806395d89b411461042c57600080fd5b806338d52e0f116101f3578063543bda75116101c25780636e553f65116101a75780636e553f65146103b157806370a08231146103c4578063715018a6146103ed57600080fd5b8063543bda751461039557806361d027b31461039e57600080fd5b806338d52e0f14610333578063402d267d1461036d57806342af1198146103805780634cdad506146102ac57600080fd5b8063095ea7b31161024a57806318160ddd1161022f57806318160ddd146102fe57806323b872dd14610306578063313ce5671461031957600080fd5b8063095ea7b3146102c85780630a28a477146102eb57600080fd5b806301e1d1141461027c57806306fdde031461029757806307a2d13a146102ac578063080c279a146102bf575b600080fd5b61028461056c565b6040519081526020015b60405180910390f35b61029f610615565b60405161028e91906118e9565b6102846102ba36600461191c565b6106a7565b61028460085481565b6102db6102d636600461194a565b6106ba565b604051901515815260200161028e565b6102846102f936600461191c565b6106d2565b600254610284565b6102db610314366004611976565b6106df565b610321610705565b60405160ff909116815260200161028e565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161028e565b61028461037b3660046119b7565b610731565b61039361038e3660046119b7565b610779565b005b61028460095481565b600754610355906001600160a01b031681565b6102846103bf3660046119d4565b610899565b6102846103d23660046119b7565b6001600160a01b031660009081526020819052604090205490565b6103936108df565b6103936104033660046119b7565b6108f3565b6005546001600160a01b0316610355565b6102846104273660046119d4565b6109c5565b61029f610a04565b6102846104423660046119b7565b610a13565b6102db61045536600461194a565b610a35565b61028461046836600461191c565b610a43565b61028461047b366004611a04565b610a50565b61028461048e366004611a04565b610ad4565b6008546009546040805192835260208301919091520161028e565b6102846104bc3660046119b7565b610b4f565b6102846104cf36600461191c565b610b79565b600654610355906001600160a01b031681565b6102846104f53660046119b7565b610b86565b6102846105083660046119b7565b610baa565b61028461051b366004611a46565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610393610554366004611a74565b610bc8565b6103936105673660046119b7565b610c17565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190611a96565b905090565b60606003805461062490611aaf565b80601f016020809104026020016040519081016040528092919081815260200182805461065090611aaf565b801561069d5780601f106106725761010080835404028352916020019161069d565b820191906000526020600020905b81548152906001019060200180831161068057829003601f168201915b5050505050905090565b60006106b4826000610c6e565b92915050565b6000336106c8818585610ca8565b5060019392505050565b60006106b4826001610cba565b6000336106ed858285610cea565b6106f8858585610d81565b60019150505b9392505050565b6000610610817f0000000000000000000000000000000000000000000000000000000000000000611aff565b6000600019600954036107475750600019919050565b600061075161056c565b9050600954811015610770578060095461076b9190611b18565b6106fe565b60009392505050565b610781610de0565b6001600160a01b0381166107a85760405163d92e233d60e01b815260040160405180910390fd5b600654604080516001600160a01b0392831680825292841660208201527ff6e490308a0c67484cf1082cb89a68053c7a7bbf474247e8b634957e2ce2f296910160405180910390a16006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038481169190911790915581161561085c5761085c8160007f00000000000000000000000000000000000000000000000000000000000000005b6001600160a01b03169190610e26565b600654610895906001600160a01b03166000197f000000000000000000000000000000000000000000000000000000000000000061084c565b5050565b60006008548310156108d5576008546040516314d6e77b60e31b81526108cc918591600401918252602082015260400190565b60405180910390fd5b6106fe8383610f27565b6108e7610de0565b6108f16000610fa9565b565b6108fb610de0565b6001600160a01b0381166109225760405163d92e233d60e01b815260040160405180910390fd5b306001600160a01b03821603610964576040517f593230f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d19060200160405180910390a150565b60006008546109d48484611008565b91508110156106b4576008546040516314d6e77b60e31b81526108cc918391600401918252602082015260400190565b60606004805461062490611aaf565b6001600160a01b0381166000908152602081905260408120546106b4906106a7565b6000336106c8818585610d81565b60006106b4826001610c6e565b600080610a5c83610b86565b905080851115610ab1576040517ffe9cceec0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101869052604481018290526064016108cc565b6000610abc866106d2565b9050610acb3386868985611082565b95945050505050565b600080610ae083610baa565b905080851115610b35576040517fb94abeec0000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101869052604481018290526064016108cc565b6000610b40866106a7565b9050610acb338686848a611082565b600080610b5b83610731565b90506000198114610b6f5761076b81610b79565b6000199392505050565b60006106b4826000610cba565b6001600160a01b0381166000908152602081905260408120546106b4906000610c6e565b6001600160a01b0381166000908152602081905260408120546106b4565b610bd0610de0565b6008829055600981905560408051838152602081018390527f5543b97d9277fef57d70edac6c4c10f4426957b886dfe97286c01d2218a53280910160405180910390a15050565b610c1f610de0565b6001600160a01b038116610c62576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b610c6b81610fa9565b50565b60006106fe610c7b61056c565b610c86906001611b2b565b610c926000600a611c22565b600254610c9f9190611b2b565b85919085611142565b610cb58383836001611191565b505050565b60006106fe610cca82600a611c22565b600254610cd79190611b2b565b610cdf61056c565b610c9f906001611b2b565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610d7b5781811015610d6c576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064016108cc565b610d7b84848484036000611191565b50505050565b6001600160a01b038316610dab57604051634b637e8f60e11b8152600060048201526024016108cc565b6001600160a01b038216610dd55760405163ec442f0560e01b8152600060048201526024016108cc565b610cb5838383611298565b6005546001600160a01b031633146108f1576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016108cc565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052610ea584826113db565b610d7b576040516001600160a01b03848116602483015260006044830152610f1d91869182169063095ea7b3906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061147e565b610d7b848261147e565b600080610f3383610731565b905080841115610f88576040517f79012fb20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604481018290526064016108cc565b6000610f9385610b79565b9050610fa1338587846114fa565b949350505050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008061101483610b4f565b905080841115611069576040517f284ff6670000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101859052604481018290526064016108cc565b600061107485610a43565b9050610fa1338583886114fa565b826001600160a01b0316856001600160a01b0316146110a6576110a6838683610cea565b6110b0838261157e565b6110db7f000000000000000000000000000000000000000000000000000000000000000085846115b4565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611133929190918252602082015260400190565b60405180910390a45050505050565b6000806111508686866115e5565b905061115b836116c2565b801561117757506000848061117257611172611c31565b868809115b15610acb57611187600182611b2b565b9695505050505050565b6001600160a01b0384166111d4576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b6001600160a01b038316611217576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016108cc565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610d7b57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161128a91815260200190565b60405180910390a350505050565b6001600160a01b0383166112c35780600260008282546112b89190611b2b565b9091555061134e9050565b6001600160a01b0383166000908152602081905260409020548181101561132f576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260248101829052604481018390526064016108cc565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661136a57600280548290039055611389565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113ce91815260200190565b60405180910390a3505050565b6000806000846001600160a01b0316846040516113f89190611c47565b6000604051808303816000865af19150503d8060008114611435576040519150601f19603f3d011682016040523d82523d6000602084013e61143a565b606091505b50915091508180156114645750805115806114645750808060200190518101906114649190611c63565b8015610acb5750505050506001600160a01b03163b151590565b60006114936001600160a01b038416836116ef565b905080516000141580156114b85750808060200190518101906114b69190611c63565b155b15610cb5576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016108cc565b6115267f00000000000000000000000000000000000000000000000000000000000000008530856116fd565b6115308382611736565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7848460405161128a929190918252602082015260400190565b6001600160a01b0382166115a857604051634b637e8f60e11b8152600060048201526024016108cc565b61089582600083611298565b6040516001600160a01b03838116602483015260448201839052610cb591859182169063a9059cbb90606401610ed6565b600083830281600019858709828110838203039150508060000361161c5783828161161257611612611c31565b04925050506106fe565b808411611655576040517f227bc15300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600060028260038111156116d8576116d8611c85565b6116e29190611c9b565b60ff166001149050919050565b60606106fe8383600061176c565b6040516001600160a01b038481166024830152838116604483015260648201839052610d7b9186918216906323b872dd90608401610ed6565b6001600160a01b0382166117605760405163ec442f0560e01b8152600060048201526024016108cc565b61089560008383611298565b6060814710156117aa576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016108cc565b600080856001600160a01b031684866040516117c69190611c47565b60006040518083038185875af1925050503d8060008114611803576040519150601f19603f3d011682016040523d82523d6000602084013e611808565b606091505b50915091506111878683836060826118235761076b82611883565b815115801561183a57506001600160a01b0384163b155b1561187c576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016108cc565b50806106fe565b8051156118935780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b838110156118e05781810151838201526020016118c8565b50506000910152565b60208152600082518060208401526119088160408501602087016118c5565b601f01601f19169190910160400192915050565b60006020828403121561192e57600080fd5b5035919050565b6001600160a01b0381168114610c6b57600080fd5b6000806040838503121561195d57600080fd5b823561196881611935565b946020939093013593505050565b60008060006060848603121561198b57600080fd5b833561199681611935565b925060208401356119a681611935565b929592945050506040919091013590565b6000602082840312156119c957600080fd5b81356106fe81611935565b600080604083850312156119e757600080fd5b8235915060208301356119f981611935565b809150509250929050565b600080600060608486031215611a1957600080fd5b833592506020840135611a2b81611935565b91506040840135611a3b81611935565b809150509250925092565b60008060408385031215611a5957600080fd5b8235611a6481611935565b915060208301356119f981611935565b60008060408385031215611a8757600080fd5b50508035926020909101359150565b600060208284031215611aa857600080fd5b5051919050565b600181811c90821680611ac357607f821691505b602082108103611ae357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff81811683821601908111156106b4576106b4611ae9565b818103818111156106b4576106b4611ae9565b808201808211156106b4576106b4611ae9565b600181815b80851115611b79578160001904821115611b5f57611b5f611ae9565b80851615611b6c57918102915b93841c9390800290611b43565b509250929050565b600082611b90575060016106b4565b81611b9d575060006106b4565b8160018114611bb35760028114611bbd57611bd9565b60019150506106b4565b60ff841115611bce57611bce611ae9565b50506001821b6106b4565b5060208310610133831016604e8410600b8410161715611bfc575081810a6106b4565b611c068383611b3e565b8060001904821115611c1a57611c1a611ae9565b029392505050565b60006106fe60ff841683611b81565b634e487b7160e01b600052601260045260246000fd5b60008251611c598184602087016118c5565b9190910192915050565b600060208284031215611c7557600080fd5b815180151581146106fe57600080fd5b634e487b7160e01b600052602160045260246000fd5b600060ff831680611cbc57634e487b7160e01b600052601260045260246000fd5b8060ff8416069150509291505056fea2646970667358221220613e87e5d7e469eae628fc2f45b68eaf8d314fc3fbd6b5de50baf2a5e5c5a97664736f6c63430008150033", "devdoc": { "details": "ERC-4626 is a standard to optimize and unify the technical parameters of yield-bearing vaults. This contract facilitates the minting and burning of shares (stBTC), which are represented as standard ERC20 tokens, providing a seamless exchange with tBTC tokens.", "errors": { @@ -1370,17 +1302,6 @@ "oldDispatcher": "Address of the old dispatcher contract." } }, - "EntryFeeBasisPointsUpdated(uint256)": { - "params": { - "entryFeeBasisPoints": "New value of the fee basis points." - } - }, - "StakeReferral(uint16,uint256)": { - "params": { - "assets": "Amount of tBTC tokens staked.", - "referral": "Used for referral program." - } - }, "Transfer(address,address,uint256)": { "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." }, @@ -1401,6 +1322,14 @@ "asset()": { "details": "See {IERC4626-asset}. " }, + "assetsBalanceOf(address)": { + "params": { + "account": "Owner of shares." + }, + "returns": { + "_0": "Assets amount." + } + }, "balanceOf(address)": { "details": "See {IERC20-balanceOf}." }, @@ -1416,11 +1345,11 @@ "deposit(uint256,address)": { "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract.", "params": { - "assets": "Approved amount of tBTC tokens to deposit. This includes treasury fees for staking tBTC.", + "assets": "Approved amount of tBTC tokens to deposit.", "receiver": "The address to which the shares will be minted." }, "returns": { - "_0": "Minted shares adjusted for the fees taken by the treasury." + "_0": "Minted shares." } }, "depositParameters()": { @@ -1429,6 +1358,7 @@ } }, "maxDeposit(address)": { + "details": "When the remaining amount of unused limit is less than the minimum deposit amount, this function returns 0.", "returns": { "_0": "The maximum amount of tBTC token that can be deposited into Acre protocol for the receiver." } @@ -1446,7 +1376,7 @@ "details": "See {IERC4626-maxWithdraw}. " }, "mint(uint256,address)": { - "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for the transfer of a certain amount of tBTC, and in addition, approval for the associated fee. Specifically, the total amount to be approved (amountToApprove) should be equal to the sum of the deposited amount and the fee. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.", + "details": "Takes into account a deposit parameter, minimum deposit amount, which determines the minimum amount for a single deposit operation. The amount of the assets has to be pre-approved in the tBTC contract. The msg.sender is required to grant approval for tBTC transfer. To determine the total assets amount necessary for approval corresponding to a given share amount, use the `previewMint` function.", "params": { "receiver": "The address to which the shares will be minted.", "shares": "Amount of shares to mint." @@ -1459,10 +1389,10 @@ "details": "Returns the address of the current owner." }, "previewDeposit(uint256)": { - "details": "Preview taking an entry fee on deposit. See {IERC4626-previewDeposit}." + "details": "See {IERC4626-previewDeposit}. " }, "previewMint(uint256)": { - "details": "Preview adding an entry fee on mint. See {IERC4626-previewMint}." + "details": "See {IERC4626-previewMint}. " }, "previewRedeem(uint256)": { "details": "See {IERC4626-previewRedeem}. " @@ -1476,17 +1406,6 @@ "renounceOwnership()": { "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." }, - "stake(uint256,address,uint16)": { - "details": "This function calls `deposit` function from `ERC4626` contract. The amount of the assets has to be pre-approved in the tBTC contract.", - "params": { - "assets": "Approved amount for the transfer and stake.", - "receiver": "The address to which the shares will be minted.", - "referral": "Data used for referral program." - }, - "returns": { - "_0": "shares Minted shares." - } - }, "symbol()": { "details": "Returns the symbol of the token, usually a shorter version of the name." }, @@ -1517,11 +1436,6 @@ "newDispatcher": "Address of the new dispatcher contract." } }, - "updateEntryFeeBasisPoints(uint256)": { - "params": { - "newEntryFeeBasisPoints": "New value of the fee basis points." - } - }, "updateTreasury(address)": { "params": { "newTreasury": "New treasury wallet address." @@ -1559,29 +1473,23 @@ "DispatcherUpdated(address,address)": { "notice": "Emitted when the dispatcher contract is updated." }, - "EntryFeeBasisPointsUpdated(uint256)": { - "notice": "Emitted when the entry fee basis points are updated." - }, - "StakeReferral(uint16,uint256)": { - "notice": "Emitted when a referral is used." - }, "TreasuryUpdated(address)": { "notice": "Emitted when the treasury wallet address is updated." } }, "kind": "user", "methods": { + "assetsBalanceOf(address)": { + "notice": "Returns value of assets that would be exchanged for the amount of shares owned by the `account`." + }, "deposit(uint256,address)": { "notice": "Mints shares to receiver by depositing exactly amount of tBTC tokens." }, "dispatcher()": { "notice": "Dispatcher contract that routes tBTC from stBTC to a given vault and back." }, - "entryFeeBasisPoints()": { - "notice": "Entry fee basis points applied to entry fee calculation." - }, "maxDeposit(address)": { - "notice": "Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre. This function always returns available limit for deposits, but the fee is not taken into account. As a result of this, there always will be some dust left. If the dust is lower than the minimum deposit amount, this function will return 0." + "notice": "Returns the maximum amount of the tBTC token that can be deposited into the vault for the receiver through a deposit call. It takes into account the deposit parameter, maximum total assets, which determines the total amount of tBTC token held by Acre protocol." }, "maxMint(address)": { "notice": "Returns the maximum amount of the vault shares that can be minted for the receiver, through a mint call." @@ -1590,14 +1498,11 @@ "notice": "Maximum total amount of tBTC token held by Acre protocol." }, "minimumDepositAmount()": { - "notice": "Minimum amount for a single deposit operation. The value should be set low enough so the deposits routed through TbtcDepositor contract won't be rejected. It means that minimumDepositAmount should be lower than tBTC protocol's depositDustThreshold reduced by all the minting fees taken before depositing in the Acre contract." + "notice": "Minimum amount for a single deposit operation." }, "mint(uint256,address)": { "notice": "Mints shares to receiver by depositing tBTC tokens." }, - "stake(uint256,address,uint16)": { - "notice": "Stakes a given amount of tBTC token and mints shares to a receiver." - }, "treasury()": { "notice": "Address of the treasury wallet, where fees should be transferred to." }, @@ -1607,9 +1512,6 @@ "updateDispatcher(address)": { "notice": "Updates the dispatcher contract and gives it an unlimited allowance to transfer staked tBTC." }, - "updateEntryFeeBasisPoints(uint256)": { - "notice": "Update the entry fee basis points." - }, "updateTreasury(address)": { "notice": "Updates treasury wallet address." } @@ -1620,7 +1522,7 @@ "storageLayout": { "storage": [ { - "astId": 4066, + "astId": 3600, "contract": "contracts/stBTC.sol:stBTC", "label": "_balances", "offset": 0, @@ -1628,7 +1530,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 4072, + "astId": 3606, "contract": "contracts/stBTC.sol:stBTC", "label": "_allowances", "offset": 0, @@ -1636,7 +1538,7 @@ "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" }, { - "astId": 4074, + "astId": 3608, "contract": "contracts/stBTC.sol:stBTC", "label": "_totalSupply", "offset": 0, @@ -1644,7 +1546,7 @@ "type": "t_uint256" }, { - "astId": 4076, + "astId": 3610, "contract": "contracts/stBTC.sol:stBTC", "label": "_name", "offset": 0, @@ -1652,7 +1554,7 @@ "type": "t_string_storage" }, { - "astId": 4078, + "astId": 3612, "contract": "contracts/stBTC.sol:stBTC", "label": "_symbol", "offset": 0, @@ -1660,7 +1562,7 @@ "type": "t_string_storage" }, { - "astId": 3597, + "astId": 3131, "contract": "contracts/stBTC.sol:stBTC", "label": "_owner", "offset": 0, @@ -1668,15 +1570,15 @@ "type": "t_address" }, { - "astId": 8071, + "astId": 6958, "contract": "contracts/stBTC.sol:stBTC", "label": "dispatcher", "offset": 0, "slot": "6", - "type": "t_contract(Dispatcher)7334" + "type": "t_contract(Dispatcher)6868" }, { - "astId": 8074, + "astId": 6961, "contract": "contracts/stBTC.sol:stBTC", "label": "treasury", "offset": 0, @@ -1684,27 +1586,19 @@ "type": "t_address" }, { - "astId": 8077, - "contract": "contracts/stBTC.sol:stBTC", - "label": "entryFeeBasisPoints", - "offset": 0, - "slot": "8", - "type": "t_uint256" - }, - { - "astId": 8080, + "astId": 6964, "contract": "contracts/stBTC.sol:stBTC", "label": "minimumDepositAmount", "offset": 0, - "slot": "9", + "slot": "8", "type": "t_uint256" }, { - "astId": 8083, + "astId": 6967, "contract": "contracts/stBTC.sol:stBTC", "label": "maximumTotalAssets", "offset": 0, - "slot": "10", + "slot": "9", "type": "t_uint256" } ], @@ -1714,7 +1608,7 @@ "label": "address", "numberOfBytes": "20" }, - "t_contract(Dispatcher)7334": { + "t_contract(Dispatcher)6868": { "encoding": "inplace", "label": "contract Dispatcher", "numberOfBytes": "20"