@keep-network/tbtc-v2 0.1.1-dev.88 → 0.1.1-dev.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/Bank.json +3 -3
- package/artifacts/Bridge.json +5 -5
- package/artifacts/Deposit.json +2 -2
- package/artifacts/DepositSweep.json +2 -2
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +2 -2
- package/artifacts/Fraud.json +2 -2
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/MovingFunds.json +2 -2
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeaconStub.json +1 -1
- package/artifacts/Redemption.json +2 -2
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/Relay.json +2 -2
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TBTCVault.json +12 -12
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +3 -3
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +2 -2
- package/artifacts/solcInputs/{27ac4a57be279323111e8884efd59d76.json → 00e4740299c76687f54267cd49adc9d5.json} +1 -1
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
- package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +2 -2
- package/contracts/vault/TBTCVault.sol +4 -2
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\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"
|
|
18
18
|
},
|
|
19
19
|
"contracts/vault/TBTCVault.sol": {
|
|
20
|
-
"content": "// SPDX-License-Identifier: MIT\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity ^0.8.9;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./IVault.sol\";\nimport \"../bank/Bank.sol\";\nimport \"../token/TBTC.sol\";\nimport \"../GovernanceUtils.sol\";\n\n/// @title TBTC application vault\n/// @notice TBTC is a fully Bitcoin-backed ERC-20 token pegged to the price of\n/// Bitcoin. It facilitates Bitcoin holders to act on the Ethereum\n/// blockchain and access the decentralized finance (DeFi) ecosystem.\n/// TBTC Vault mints and unmints TBTC based on Bitcoin balances in the\n/// Bank.\n/// @dev TBTC Vault is the owner of TBTC token contract and is the only contract\n/// minting the token.\ncontract TBTCVault is IVault, Ownable {\n using SafeERC20 for IERC20;\n\n /// @notice The time delay that needs to pass between initializing and\n /// finalizing upgrade to a new vault. The time delay forces the\n /// upgrading party to reflect on the vault address it is upgrading\n /// to and lets all TBTC holders notice the planned\n /// upgrade.\n uint256 public constant UPGRADE_GOVERNANCE_DELAY = 24 hours;\n\n Bank public bank;\n TBTC public tbtcToken;\n\n /// @notice The address of a new TBTC vault. Set only when the upgrade\n /// process is pending. Once the upgrade gets finalized, the new\n /// TBTC vault will become an owner of TBTC token.\n address public newVault;\n /// @notice The timestamp at which an upgrade to a new TBTC vault was\n /// initiated. Set only when the upgrade process is pending.\n uint256 public upgradeInitiatedTimestamp;\n\n event Minted(address indexed to, uint256 amount);\n event Unminted(address indexed from, uint256 amount);\n\n event UpgradeInitiated(address newVault, uint256 timestamp);\n event UpgradeFinalized(address newVault);\n\n modifier onlyBank() {\n require(msg.sender == address(bank), \"Caller is not the Bank\");\n _;\n }\n\n modifier onlyAfterUpgradeGovernanceDelay() {\n GovernanceUtils.onlyAfterGovernanceDelay(\n upgradeInitiatedTimestamp,\n UPGRADE_GOVERNANCE_DELAY\n );\n _;\n }\n\n constructor(Bank _bank, TBTC _tbtcToken) {\n require(\n address(_bank) != address(0),\n \"Bank can not be the zero address\"\n );\n\n require(\n address(_tbtcToken) != address(0),\n \"TBTC token can not be the zero address\"\n );\n\n bank = _bank;\n tbtcToken = _tbtcToken;\n }\n\n /// @notice Transfers the given `amount` of the Bank balance from caller\n /// to TBTC Vault, and mints `amount` of TBTC to the caller.\n /// @dev TBTC Vault must have an allowance for caller's balance in the Bank\n /// for at least `amount`.\n /// @param amount Amount of TBTC to mint.\n function mint(uint256 amount) external {\n address minter = msg.sender;\n require(\n bank.balanceOf(minter) >= amount,\n \"Amount exceeds balance in the bank\"\n );\n _mint(minter, amount);\n bank.transferBalanceFrom(minter, address(this), amount);\n }\n\n /// @notice Transfers the given `amount` of the Bank balance from the caller\n /// to TBTC Vault and mints `amount` of TBTC to the caller.\n /// @dev Can only be called by the Bank via `approveBalanceAndCall`.\n /// @param owner The owner who approved their Bank balance.\n /// @param amount Amount of TBTC to mint.\n function receiveBalanceApproval(\n address owner,\n uint256 amount,\n bytes calldata\n ) external override onlyBank {\n require(\n bank.balanceOf(owner) >= amount,\n \"Amount exceeds balance in the bank\"\n );\n _mint(owner, amount);\n bank.transferBalanceFrom(owner, address(this), amount);\n }\n\n /// @notice Mints the same amount of TBTC as the deposited amount for each\n /// depositor in the array. Can only be called by the Bank after the\n /// Bridge swept deposits and Bank increased balance for the\n /// vault.\n /// @dev Fails if `depositors` array is empty. Expects the length of\n /// `depositors` and `depositedAmounts` is the same.\n function receiveBalanceIncrease(\n address[] calldata depositors,\n uint256[] calldata depositedAmounts\n ) external override onlyBank {\n require(depositors.length != 0, \"No depositors specified\");\n for (uint256 i = 0; i < depositors.length; i++) {\n _mint(depositors[i], depositedAmounts[i]);\n }\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance and transfers\n /// `amount` back to the caller's balance in the Bank.\n /// @dev Caller must have at least `amount` of TBTC approved to\n /// TBTC Vault.\n /// @param amount Amount of TBTC to unmint.\n function unmint(uint256 amount) external {\n _unmint(msg.sender, amount);\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance and transfers\n /// `amount` of Bank balance to the Bridge requesting redemption\n /// based on the provided `redemptionData`.\n /// @dev Caller must have at least `amount` of TBTC approved to\n /// TBTC Vault.\n /// @param amount Amount of TBTC to unmint and request to redeem in Bridge.\n /// @param redemptionData Redemption data in a format expected from\n /// `redemptionData` parameter of Bridge's `receiveBalanceApproval`\n /// function.\n function unmintAndRedeem(uint256 amount, bytes calldata redemptionData)\n external\n {\n _unmintAndRedeem(msg.sender, amount, redemptionData);\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance. If `extraData`\n /// is empty, transfers `amount` back to the caller's balance in the\n /// Bank. If `extraData` is not empty, requests redemption in the\n /// Bridge using the `extraData` as a `redemptionData` parameter to\n /// Bridge's `receiveBalanceApproval` function.\n /// @dev This function is doing the same as `unmint` or `unmintAndRedeem`\n /// (depending on `extraData` parameter) but it allows to execute\n /// unminting without a separate approval transaction. The function can\n /// be called only via `approveAndCall` of TBTC token.\n /// @param from TBTC token holder executing unminting.\n /// @param amount Amount of TBTC to unmint.\n /// @param token TBTC token address.\n /// @param extraData Redemption data in a format expected from\n /// `redemptionData` parameter of Bridge's `receiveBalanceApproval`\n /// function. If empty, `receiveApproval` is not requesting a\n /// redemption of Bank balance but is instead performing just TBTC\n /// unminting to a Bank balance.\n function receiveApproval(\n address from,\n uint256 amount,\n address token,\n bytes calldata extraData\n ) external {\n require(token == address(tbtcToken), \"Token is not TBTC\");\n require(msg.sender == token, \"Only TBTC caller allowed\");\n if (extraData.length == 0) {\n _unmint(from, amount);\n } else {\n _unmintAndRedeem(from, amount, extraData);\n }\n }\n\n /// @notice Initiates vault upgrade process. The upgrade process needs to be\n /// finalized with a call to `finalizeUpgrade` function after the\n /// `UPGRADE_GOVERNANCE_DELAY` passes. Only the governance can\n /// initiate the upgrade.\n /// @param _newVault The new vault address.\n function initiateUpgrade(address _newVault) external onlyOwner {\n require(_newVault != address(0), \"New vault address cannot be zero\");\n /* solhint-disable-next-line not-rely-on-time */\n emit UpgradeInitiated(_newVault, block.timestamp);\n /* solhint-disable-next-line not-rely-on-time */\n upgradeInitiatedTimestamp = block.timestamp;\n newVault = _newVault;\n }\n\n /// @notice Allows the governance to finalize vault upgrade process. The\n /// upgrade process needs to be first initiated with a call to\n /// `initiateUpgrade` and the `UPGRADE_GOVERNANCE_DELAY` needs to\n /// pass. Once the upgrade is finalized, the new vault will become\n /// an owner of TBTC token.\n function finalizeUpgrade()\n external\n onlyOwner\n onlyAfterUpgradeGovernanceDelay\n {\n emit UpgradeFinalized(newVault);\n // slither-disable-next-line reentrancy-no-eth\n tbtcToken.transferOwnership(newVault);\n newVault = address(0);\n upgradeInitiatedTimestamp = 0;\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC20\n /// token sent mistakenly to the TBTC token contract address.\n /// @param token Address of the recovered ERC20 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param amount Recovered amount.\n function recoverERC20FromToken(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyOwner {\n tbtcToken.recoverERC20(token, recipient, amount);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC721\n /// token sent mistakenly to the TBTC token contract address.\n /// @param token Address of the recovered ERC721 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param tokenId Identifier of the recovered token.\n /// @param data Additional data.\n function recoverERC721FromToken(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyOwner {\n tbtcToken.recoverERC721(token, recipient, tokenId, data);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC20\n /// token sent - mistakenly or not - to the vault address. This\n /// function should be used to withdraw TBTC v1 tokens transferred\n /// to TBTCVault as a result of VendingMachine > TBTCVault upgrade.\n /// @param token Address of the recovered ERC20 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param amount Recovered amount.\n function recoverERC20(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyOwner {\n token.safeTransfer(recipient, amount);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC721\n /// token sent mistakenly to the vault address.\n /// @param token Address of the recovered ERC721 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param tokenId Identifier of the recovered token.\n /// @param data Additional data.\n function recoverERC721(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyOwner {\n token.safeTransferFrom(address(this), recipient, tokenId, data);\n }\n\n // slither-disable-next-line calls-loop\n function _mint(address minter, uint256 amount) internal {\n emit Minted(minter, amount);\n tbtcToken.mint(minter, amount);\n }\n\n function _unmint(address unminter, uint256 amount) internal {\n emit Unminted(unminter, amount);\n tbtcToken.burnFrom(unminter, amount);\n bank.transferBalance(unminter, amount);\n }\n\n function _unmintAndRedeem(\n address redeemer,\n uint256 amount,\n bytes calldata redemptionData\n ) internal {\n emit Unminted(redeemer, amount);\n tbtcToken.burnFrom(redeemer, amount);\n bank.approveBalanceAndCall(bank.bridge(), amount, redemptionData);\n }\n}\n"
|
|
20
|
+
"content": "// SPDX-License-Identifier: MIT\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity ^0.8.9;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./IVault.sol\";\nimport \"../bank/Bank.sol\";\nimport \"../token/TBTC.sol\";\nimport \"../GovernanceUtils.sol\";\n\n/// @title TBTC application vault\n/// @notice TBTC is a fully Bitcoin-backed ERC-20 token pegged to the price of\n/// Bitcoin. It facilitates Bitcoin holders to act on the Ethereum\n/// blockchain and access the decentralized finance (DeFi) ecosystem.\n/// TBTC Vault mints and unmints TBTC based on Bitcoin balances in the\n/// Bank.\n/// @dev TBTC Vault is the owner of TBTC token contract and is the only contract\n/// minting the token.\ncontract TBTCVault is IVault, Ownable {\n using SafeERC20 for IERC20;\n\n /// @notice The time delay that needs to pass between initializing and\n /// finalizing upgrade to a new vault. The time delay forces the\n /// upgrading party to reflect on the vault address it is upgrading\n /// to and lets all TBTC holders notice the planned\n /// upgrade.\n uint256 public constant UPGRADE_GOVERNANCE_DELAY = 24 hours;\n\n Bank public bank;\n TBTC public tbtcToken;\n\n /// @notice The address of a new TBTC vault. Set only when the upgrade\n /// process is pending. Once the upgrade gets finalized, the new\n /// TBTC vault will become an owner of TBTC token.\n address public newVault;\n /// @notice The timestamp at which an upgrade to a new TBTC vault was\n /// initiated. Set only when the upgrade process is pending.\n uint256 public upgradeInitiatedTimestamp;\n\n event Minted(address indexed to, uint256 amount);\n event Unminted(address indexed from, uint256 amount);\n\n event UpgradeInitiated(address newVault, uint256 timestamp);\n event UpgradeFinalized(address newVault);\n\n modifier onlyBank() {\n require(msg.sender == address(bank), \"Caller is not the Bank\");\n _;\n }\n\n modifier onlyAfterUpgradeGovernanceDelay() {\n GovernanceUtils.onlyAfterGovernanceDelay(\n upgradeInitiatedTimestamp,\n UPGRADE_GOVERNANCE_DELAY\n );\n _;\n }\n\n constructor(Bank _bank, TBTC _tbtcToken) {\n require(\n address(_bank) != address(0),\n \"Bank can not be the zero address\"\n );\n\n require(\n address(_tbtcToken) != address(0),\n \"TBTC token can not be the zero address\"\n );\n\n bank = _bank;\n tbtcToken = _tbtcToken;\n }\n\n /// @notice Transfers the given `amount` of the Bank balance from caller\n /// to TBTC Vault, and mints `amount` of TBTC to the caller.\n /// @dev TBTC Vault must have an allowance for caller's balance in the Bank\n /// for at least `amount`.\n /// @param amount Amount of TBTC to mint.\n function mint(uint256 amount) external {\n address minter = msg.sender;\n require(\n bank.balanceOf(minter) >= amount,\n \"Amount exceeds balance in the bank\"\n );\n _mint(minter, amount);\n bank.transferBalanceFrom(minter, address(this), amount);\n }\n\n /// @notice Transfers the given `amount` of the Bank balance from the caller\n /// to TBTC Vault and mints `amount` of TBTC to the caller.\n /// @dev Can only be called by the Bank via `approveBalanceAndCall`.\n /// @param owner The owner who approved their Bank balance.\n /// @param amount Amount of TBTC to mint.\n function receiveBalanceApproval(\n address owner,\n uint256 amount,\n bytes calldata\n ) external override onlyBank {\n require(\n bank.balanceOf(owner) >= amount,\n \"Amount exceeds balance in the bank\"\n );\n _mint(owner, amount);\n bank.transferBalanceFrom(owner, address(this), amount);\n }\n\n /// @notice Mints the same amount of TBTC as the deposited amount for each\n /// depositor in the array. Can only be called by the Bank after the\n /// Bridge swept deposits and Bank increased balance for the\n /// vault.\n /// @dev Fails if `depositors` array is empty. Expects the length of\n /// `depositors` and `depositedAmounts` is the same.\n function receiveBalanceIncrease(\n address[] calldata depositors,\n uint256[] calldata depositedAmounts\n ) external override onlyBank {\n require(depositors.length != 0, \"No depositors specified\");\n for (uint256 i = 0; i < depositors.length; i++) {\n _mint(depositors[i], depositedAmounts[i]);\n }\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance and transfers\n /// `amount` back to the caller's balance in the Bank.\n /// @dev Caller must have at least `amount` of TBTC approved to\n /// TBTC Vault.\n /// @param amount Amount of TBTC to unmint.\n function unmint(uint256 amount) external {\n _unmint(msg.sender, amount);\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance and transfers\n /// `amount` of Bank balance to the Bridge requesting redemption\n /// based on the provided `redemptionData`.\n /// @dev Caller must have at least `amount` of TBTC approved to\n /// TBTC Vault.\n /// @param amount Amount of TBTC to unmint and request to redeem in Bridge.\n /// @param redemptionData Redemption data in a format expected from\n /// `redemptionData` parameter of Bridge's `receiveBalanceApproval`\n /// function.\n function unmintAndRedeem(uint256 amount, bytes calldata redemptionData)\n external\n {\n _unmintAndRedeem(msg.sender, amount, redemptionData);\n }\n\n /// @notice Burns `amount` of TBTC from the caller's balance. If `extraData`\n /// is empty, transfers `amount` back to the caller's balance in the\n /// Bank. If `extraData` is not empty, requests redemption in the\n /// Bridge using the `extraData` as a `redemptionData` parameter to\n /// Bridge's `receiveBalanceApproval` function.\n /// @dev This function is doing the same as `unmint` or `unmintAndRedeem`\n /// (depending on `extraData` parameter) but it allows to execute\n /// unminting without a separate approval transaction. The function can\n /// be called only via `approveAndCall` of TBTC token.\n /// @param from TBTC token holder executing unminting.\n /// @param amount Amount of TBTC to unmint.\n /// @param token TBTC token address.\n /// @param extraData Redemption data in a format expected from\n /// `redemptionData` parameter of Bridge's `receiveBalanceApproval`\n /// function. If empty, `receiveApproval` is not requesting a\n /// redemption of Bank balance but is instead performing just TBTC\n /// unminting to a Bank balance.\n function receiveApproval(\n address from,\n uint256 amount,\n address token,\n bytes calldata extraData\n ) external {\n require(token == address(tbtcToken), \"Token is not TBTC\");\n require(msg.sender == token, \"Only TBTC caller allowed\");\n if (extraData.length == 0) {\n _unmint(from, amount);\n } else {\n _unmintAndRedeem(from, amount, extraData);\n }\n }\n\n /// @notice Initiates vault upgrade process. The upgrade process needs to be\n /// finalized with a call to `finalizeUpgrade` function after the\n /// `UPGRADE_GOVERNANCE_DELAY` passes. Only the governance can\n /// initiate the upgrade.\n /// @param _newVault The new vault address.\n function initiateUpgrade(address _newVault) external onlyOwner {\n require(_newVault != address(0), \"New vault address cannot be zero\");\n /* solhint-disable-next-line not-rely-on-time */\n emit UpgradeInitiated(_newVault, block.timestamp);\n /* solhint-disable-next-line not-rely-on-time */\n upgradeInitiatedTimestamp = block.timestamp;\n newVault = _newVault;\n }\n\n /// @notice Allows the governance to finalize vault upgrade process. The\n /// upgrade process needs to be first initiated with a call to\n /// `initiateUpgrade` and the `UPGRADE_GOVERNANCE_DELAY` needs to\n /// pass. Once the upgrade is finalized, the new vault becomes the\n /// owner of the TBTC token and receives the whole Bank balance of\n /// this vault.\n function finalizeUpgrade()\n external\n onlyOwner\n onlyAfterUpgradeGovernanceDelay\n {\n emit UpgradeFinalized(newVault);\n // slither-disable-next-line reentrancy-no-eth\n tbtcToken.transferOwnership(newVault);\n bank.transferBalance(newVault, bank.balanceOf(address(this)));\n newVault = address(0);\n upgradeInitiatedTimestamp = 0;\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC20\n /// token sent mistakenly to the TBTC token contract address.\n /// @param token Address of the recovered ERC20 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param amount Recovered amount.\n function recoverERC20FromToken(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyOwner {\n tbtcToken.recoverERC20(token, recipient, amount);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC721\n /// token sent mistakenly to the TBTC token contract address.\n /// @param token Address of the recovered ERC721 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param tokenId Identifier of the recovered token.\n /// @param data Additional data.\n function recoverERC721FromToken(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyOwner {\n tbtcToken.recoverERC721(token, recipient, tokenId, data);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC20\n /// token sent - mistakenly or not - to the vault address. This\n /// function should be used to withdraw TBTC v1 tokens transferred\n /// to TBTCVault as a result of VendingMachine > TBTCVault upgrade.\n /// @param token Address of the recovered ERC20 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param amount Recovered amount.\n function recoverERC20(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyOwner {\n token.safeTransfer(recipient, amount);\n }\n\n /// @notice Allows the governance of the TBTCVault to recover any ERC721\n /// token sent mistakenly to the vault address.\n /// @param token Address of the recovered ERC721 token contract.\n /// @param recipient Address the recovered token should be sent to.\n /// @param tokenId Identifier of the recovered token.\n /// @param data Additional data.\n function recoverERC721(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyOwner {\n token.safeTransferFrom(address(this), recipient, tokenId, data);\n }\n\n // slither-disable-next-line calls-loop\n function _mint(address minter, uint256 amount) internal {\n emit Minted(minter, amount);\n tbtcToken.mint(minter, amount);\n }\n\n function _unmint(address unminter, uint256 amount) internal {\n emit Unminted(unminter, amount);\n tbtcToken.burnFrom(unminter, amount);\n bank.transferBalance(unminter, amount);\n }\n\n function _unmintAndRedeem(\n address redeemer,\n uint256 amount,\n bytes calldata redemptionData\n ) internal {\n emit Unminted(redeemer, amount);\n tbtcToken.burnFrom(redeemer, amount);\n bank.approveBalanceAndCall(bank.bridge(), amount, redemptionData);\n }\n}\n"
|
|
21
21
|
},
|
|
22
22
|
"contracts/token/TBTC.sol": {
|
|
23
23
|
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.9;\n\nimport \"@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol\";\nimport \"@thesis/solidity-contracts/contracts/token/MisfundRecovery.sol\";\n\ncontract TBTC is ERC20WithPermit, MisfundRecovery {\n constructor() ERC20WithPermit(\"tBTC v2\", \"tBTC\") {}\n}\n"
|
|
@@ -442,8 +442,8 @@
|
|
|
442
442
|
"type": "function"
|
|
443
443
|
}
|
|
444
444
|
],
|
|
445
|
-
"bytecode": "0x60806040523480156200001157600080fd5b5060405162001c5d38038062001c5d83398101604081905262000034916200019d565b6200003f3362000134565b6001600160a01b0382166200009b5760405162461bcd60e51b815260206004820181905260248201527f42616e6b2063616e206e6f7420626520746865207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b038116620001025760405162461bcd60e51b815260206004820152602660248201527f5442544320746f6b656e2063616e206e6f7420626520746865207a65726f206160448201526564647265737360d01b606482015260840162000092565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055620001dc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200019a57600080fd5b50565b60008060408385031215620001b157600080fd5b8251620001be8162000184565b6020840151909250620001d18162000184565b809150509250929050565b611a7180620001ec6000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806388aaf0c8116100cd578063a0712d6811610081578063e5d3d71411610066578063e5d3d714146102b6578063f2fde38b146102c9578063fc4e51f6146102dc57600080fd5b8063a0712d6814610299578063cfce0816146102ac57600080fd5b80638f4ffcb1116100b25780638f4ffcb114610267578063951315261461027a5780639a508c8e1461029157600080fd5b806388aaf0c8146102435780638da5cb5b1461025657600080fd5b8063479aa9271161012457806364e779b11161010957806364e779b1146101f8578063715018a61461020b57806376cdb03b1461021357600080fd5b8063479aa927146101d257806353dce4df146101e557600080fd5b8063317dfa7611610155578063317dfa7614610199578063461c6373146101ac578063475d0570146101bf57600080fd5b80631171bda9146101715780632e73e39814610186575b600080fd5b61018461017f3660046115a1565b6102ef565b005b61018461019436600461162b565b610367565b6101846101a73660046115a1565b61044b565b6101846101ba3660046116e3565b610531565b6101846101cd36600461174f565b610644565b6101846101e036600461179f565b6107f1565b6101846101f33660046117bc565b610915565b610184610206366004611808565b610921565b61018461092e565b600154610226906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600354610226906001600160a01b031681565b6000546001600160a01b0316610226565b610184610275366004611821565b610994565b61028360045481565b60405190815260200161023a565b610184610a69565b6101846102a7366004611808565b610bb0565b6102836201518081565b600254610226906001600160a01b031681565b6101846102d736600461179f565b610d04565b6101846102ea36600461162b565b610de3565b6000546001600160a01b0316331461034e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103626001600160a01b0384168383610e8a565b505050565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f69061041290889088908890889088906004016118a0565b600060405180830381600087803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050505050565b6000546001600160a01b031633146104a55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461058b5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b826105d85760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610345565b60005b8381101561063d5761062b8585838181106105f8576105f86118d3565b905060200201602081019061060d919061179f565b84848481811061061f5761061f6118d3565b90506020020135610f0a565b80610635816118ff565b9150506105db565b5050505050565b6001546001600160a01b0316331461069e5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b6001546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b919061191a565b10156107745760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b61077e8484610f0a565b600154604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b0381166108a15760405162461bcd60e51b815260206004820181905260248201527f4e6577207661756c7420616464726573732063616e6e6f74206265207a65726f6044820152606401610345565b604080516001600160a01b03831681524260208201527f5cc842cab066489e13292128663547c68705dbf476f0131e0107f155719c6124910160405180910390a1426004556003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b61036233848484610f9f565b61092b3382611108565b50565b6000546001600160a01b031633146109885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6109926000611203565b565b6002546001600160a01b038481169116146109f15760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610345565b336001600160a01b03841614610a495760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610345565b80610a5d57610a588585611108565b61063d565b61063d85858484610f9f565b6000546001600160a01b03163314610ac35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b610ad260045462015180611260565b6003546040516001600160a01b0390911681527f81a9bb8030ed4116b405800280e065110a37afb57b69948e714c97fab23475ec9060200160405180910390a16002546003546040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015291169063f2fde38b90602401600060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916905550506000600455565b6001546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610bf857600080fd5b505afa158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c30919061191a565b1015610c895760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b610c938183610f0a565b600154604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b158015610ce857600080fd5b505af1158015610cfc573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610d5e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b038116610dda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610345565b61092b81611203565b6000546001600160a01b03163314610e3d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6040517fb88d4fde0000000000000000000000000000000000000000000000000000000081526001600160a01b0386169063b88d4fde9061041290309088908890889088906004016118a0565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261036290849061130d565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82604051610f4591815260200190565b60405180910390a26002546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610cce565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b884604051610fda91815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b15801561103057600080fd5b505af1158015611044573d6000803e3d6000fd5b5050600154604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190611933565b8585856040518563ffffffff1660e01b81526004016107b99493929190611950565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b88260405161114391815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561119957600080fd5b505af11580156111ad573d6000803e3d6000fd5b50506001546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610cce565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082116112b05760405162461bcd60e51b815260206004820152601460248201527f4368616e6765206e6f7420696e697469617465640000000000000000000000006044820152606401610345565b806112bb8342611983565b10156113095760405162461bcd60e51b815260206004820181905260248201527f476f7665726e616e63652064656c617920686173206e6f7420656c61707365646044820152606401610345565b5050565b6000611362826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113f29092919063ffffffff16565b8051909150156103625780806020019051810190611380919061199a565b6103625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610345565b6060611401848460008561140b565b90505b9392505050565b6060824710156114835760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610345565b6001600160a01b0385163b6114da5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610345565b600080866001600160a01b031685876040516114f691906119ec565b60006040518083038185875af1925050503d8060008114611533576040519150601f19603f3d011682016040523d82523d6000602084013e611538565b606091505b5091509150611548828286611553565b979650505050505050565b60608315611562575081611404565b8251156115725782518084602001fd5b8160405162461bcd60e51b81526004016103459190611a08565b6001600160a01b038116811461092b57600080fd5b6000806000606084860312156115b657600080fd5b83356115c18161158c565b925060208401356115d18161158c565b929592945050506040919091013590565b60008083601f8401126115f457600080fd5b50813567ffffffffffffffff81111561160c57600080fd5b60208301915083602082850101111561162457600080fd5b9250929050565b60008060008060006080868803121561164357600080fd5b853561164e8161158c565b9450602086013561165e8161158c565b935060408601359250606086013567ffffffffffffffff81111561168157600080fd5b61168d888289016115e2565b969995985093965092949392505050565b60008083601f8401126116b057600080fd5b50813567ffffffffffffffff8111156116c857600080fd5b6020830191508360208260051b850101111561162457600080fd5b600080600080604085870312156116f957600080fd5b843567ffffffffffffffff8082111561171157600080fd5b61171d8883890161169e565b9096509450602087013591508082111561173657600080fd5b506117438782880161169e565b95989497509550505050565b6000806000806060858703121561176557600080fd5b84356117708161158c565b935060208501359250604085013567ffffffffffffffff81111561179357600080fd5b611743878288016115e2565b6000602082840312156117b157600080fd5b81356114048161158c565b6000806000604084860312156117d157600080fd5b83359250602084013567ffffffffffffffff8111156117ef57600080fd5b6117fb868287016115e2565b9497909650939450505050565b60006020828403121561181a57600080fd5b5035919050565b60008060008060006080868803121561183957600080fd5b85356118448161158c565b945060208601359350604086013561185b8161158c565b9250606086013567ffffffffffffffff81111561168157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808816835280871660208401525084604083015260806060830152611548608083018486611877565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611913576119136118e9565b5060010190565b60006020828403121561192c57600080fd5b5051919050565b60006020828403121561194557600080fd5b81516114048161158c565b6001600160a01b0385168152836020820152606060408201526000611979606083018486611877565b9695505050505050565b600082821015611995576119956118e9565b500390565b6000602082840312156119ac57600080fd5b8151801515811461140457600080fd5b60005b838110156119d75781810151838201526020016119bf565b838111156119e6576000848401525b50505050565b600082516119fe8184602087016119bc565b9190910192915050565b6020815260008251806020840152611a278160408501602087016119bc565b601f01601f1916919091016040019291505056fea2646970667358221220b25f70f065fa45b053182561fc58e689b52346977f98f6199f89521a9050ab6964736f6c63430008090033",
|
|
446
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806388aaf0c8116100cd578063a0712d6811610081578063e5d3d71411610066578063e5d3d714146102b6578063f2fde38b146102c9578063fc4e51f6146102dc57600080fd5b8063a0712d6814610299578063cfce0816146102ac57600080fd5b80638f4ffcb1116100b25780638f4ffcb114610267578063951315261461027a5780639a508c8e1461029157600080fd5b806388aaf0c8146102435780638da5cb5b1461025657600080fd5b8063479aa9271161012457806364e779b11161010957806364e779b1146101f8578063715018a61461020b57806376cdb03b1461021357600080fd5b8063479aa927146101d257806353dce4df146101e557600080fd5b8063317dfa7611610155578063317dfa7614610199578063461c6373146101ac578063475d0570146101bf57600080fd5b80631171bda9146101715780632e73e39814610186575b600080fd5b61018461017f3660046115a1565b6102ef565b005b61018461019436600461162b565b610367565b6101846101a73660046115a1565b61044b565b6101846101ba3660046116e3565b610531565b6101846101cd36600461174f565b610644565b6101846101e036600461179f565b6107f1565b6101846101f33660046117bc565b610915565b610184610206366004611808565b610921565b61018461092e565b600154610226906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600354610226906001600160a01b031681565b6000546001600160a01b0316610226565b610184610275366004611821565b610994565b61028360045481565b60405190815260200161023a565b610184610a69565b6101846102a7366004611808565b610bb0565b6102836201518081565b600254610226906001600160a01b031681565b6101846102d736600461179f565b610d04565b6101846102ea36600461162b565b610de3565b6000546001600160a01b0316331461034e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103626001600160a01b0384168383610e8a565b505050565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f69061041290889088908890889088906004016118a0565b600060405180830381600087803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050505050565b6000546001600160a01b031633146104a55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461058b5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b826105d85760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610345565b60005b8381101561063d5761062b8585838181106105f8576105f86118d3565b905060200201602081019061060d919061179f565b84848481811061061f5761061f6118d3565b90506020020135610f0a565b80610635816118ff565b9150506105db565b5050505050565b6001546001600160a01b0316331461069e5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b6001546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b919061191a565b10156107745760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b61077e8484610f0a565b600154604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b0381166108a15760405162461bcd60e51b815260206004820181905260248201527f4e6577207661756c7420616464726573732063616e6e6f74206265207a65726f6044820152606401610345565b604080516001600160a01b03831681524260208201527f5cc842cab066489e13292128663547c68705dbf476f0131e0107f155719c6124910160405180910390a1426004556003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b61036233848484610f9f565b61092b3382611108565b50565b6000546001600160a01b031633146109885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6109926000611203565b565b6002546001600160a01b038481169116146109f15760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610345565b336001600160a01b03841614610a495760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610345565b80610a5d57610a588585611108565b61063d565b61063d85858484610f9f565b6000546001600160a01b03163314610ac35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b610ad260045462015180611260565b6003546040516001600160a01b0390911681527f81a9bb8030ed4116b405800280e065110a37afb57b69948e714c97fab23475ec9060200160405180910390a16002546003546040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015291169063f2fde38b90602401600060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916905550506000600455565b6001546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610bf857600080fd5b505afa158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c30919061191a565b1015610c895760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b610c938183610f0a565b600154604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b158015610ce857600080fd5b505af1158015610cfc573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610d5e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b038116610dda5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610345565b61092b81611203565b6000546001600160a01b03163314610e3d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6040517fb88d4fde0000000000000000000000000000000000000000000000000000000081526001600160a01b0386169063b88d4fde9061041290309088908890889088906004016118a0565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261036290849061130d565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82604051610f4591815260200190565b60405180910390a26002546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610cce565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b884604051610fda91815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b15801561103057600080fd5b505af1158015611044573d6000803e3d6000fd5b5050600154604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b1580156110ae57600080fd5b505afa1580156110c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e69190611933565b8585856040518563ffffffff1660e01b81526004016107b99493929190611950565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b88260405161114391815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561119957600080fd5b505af11580156111ad573d6000803e3d6000fd5b50506001546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610cce565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082116112b05760405162461bcd60e51b815260206004820152601460248201527f4368616e6765206e6f7420696e697469617465640000000000000000000000006044820152606401610345565b806112bb8342611983565b10156113095760405162461bcd60e51b815260206004820181905260248201527f476f7665726e616e63652064656c617920686173206e6f7420656c61707365646044820152606401610345565b5050565b6000611362826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113f29092919063ffffffff16565b8051909150156103625780806020019051810190611380919061199a565b6103625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610345565b6060611401848460008561140b565b90505b9392505050565b6060824710156114835760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610345565b6001600160a01b0385163b6114da5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610345565b600080866001600160a01b031685876040516114f691906119ec565b60006040518083038185875af1925050503d8060008114611533576040519150601f19603f3d011682016040523d82523d6000602084013e611538565b606091505b5091509150611548828286611553565b979650505050505050565b60608315611562575081611404565b8251156115725782518084602001fd5b8160405162461bcd60e51b81526004016103459190611a08565b6001600160a01b038116811461092b57600080fd5b6000806000606084860312156115b657600080fd5b83356115c18161158c565b925060208401356115d18161158c565b929592945050506040919091013590565b60008083601f8401126115f457600080fd5b50813567ffffffffffffffff81111561160c57600080fd5b60208301915083602082850101111561162457600080fd5b9250929050565b60008060008060006080868803121561164357600080fd5b853561164e8161158c565b9450602086013561165e8161158c565b935060408601359250606086013567ffffffffffffffff81111561168157600080fd5b61168d888289016115e2565b969995985093965092949392505050565b60008083601f8401126116b057600080fd5b50813567ffffffffffffffff8111156116c857600080fd5b6020830191508360208260051b850101111561162457600080fd5b600080600080604085870312156116f957600080fd5b843567ffffffffffffffff8082111561171157600080fd5b61171d8883890161169e565b9096509450602087013591508082111561173657600080fd5b506117438782880161169e565b95989497509550505050565b6000806000806060858703121561176557600080fd5b84356117708161158c565b935060208501359250604085013567ffffffffffffffff81111561179357600080fd5b611743878288016115e2565b6000602082840312156117b157600080fd5b81356114048161158c565b6000806000604084860312156117d157600080fd5b83359250602084013567ffffffffffffffff8111156117ef57600080fd5b6117fb868287016115e2565b9497909650939450505050565b60006020828403121561181a57600080fd5b5035919050565b60008060008060006080868803121561183957600080fd5b85356118448161158c565b945060208601359350604086013561185b8161158c565b9250606086013567ffffffffffffffff81111561168157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808816835280871660208401525084604083015260806060830152611548608083018486611877565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611913576119136118e9565b5060010190565b60006020828403121561192c57600080fd5b5051919050565b60006020828403121561194557600080fd5b81516114048161158c565b6001600160a01b0385168152836020820152606060408201526000611979606083018486611877565b9695505050505050565b600082821015611995576119956118e9565b500390565b6000602082840312156119ac57600080fd5b8151801515811461140457600080fd5b60005b838110156119d75781810151838201526020016119bf565b838111156119e6576000848401525b50505050565b600082516119fe8184602087016119bc565b9190910192915050565b6020815260008251806020840152611a278160408501602087016119bc565b601f01601f1916919091016040019291505056fea2646970667358221220b25f70f065fa45b053182561fc58e689b52346977f98f6199f89521a9050ab6964736f6c63430008090033",
|
|
445
|
+
"bytecode": "0x60806040523480156200001157600080fd5b5060405162001d5c38038062001d5c83398101604081905262000034916200019d565b6200003f3362000134565b6001600160a01b0382166200009b5760405162461bcd60e51b815260206004820181905260248201527f42616e6b2063616e206e6f7420626520746865207a65726f206164647265737360448201526064015b60405180910390fd5b6001600160a01b038116620001025760405162461bcd60e51b815260206004820152602660248201527f5442544320746f6b656e2063616e206e6f7420626520746865207a65726f206160448201526564647265737360d01b606482015260840162000092565b600180546001600160a01b039384166001600160a01b03199182161790915560028054929093169116179055620001dc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200019a57600080fd5b50565b60008060408385031215620001b157600080fd5b8251620001be8162000184565b6020840151909250620001d18162000184565b809150509250929050565b611b7080620001ec6000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806388aaf0c8116100cd578063a0712d6811610081578063e5d3d71411610066578063e5d3d714146102b6578063f2fde38b146102c9578063fc4e51f6146102dc57600080fd5b8063a0712d6814610299578063cfce0816146102ac57600080fd5b80638f4ffcb1116100b25780638f4ffcb114610267578063951315261461027a5780639a508c8e1461029157600080fd5b806388aaf0c8146102435780638da5cb5b1461025657600080fd5b8063479aa9271161012457806364e779b11161010957806364e779b1146101f8578063715018a61461020b57806376cdb03b1461021357600080fd5b8063479aa927146101d257806353dce4df146101e557600080fd5b8063317dfa7611610155578063317dfa7614610199578063461c6373146101ac578063475d0570146101bf57600080fd5b80631171bda9146101715780632e73e39814610186575b600080fd5b61018461017f3660046116a0565b6102ef565b005b61018461019436600461172a565b610367565b6101846101a73660046116a0565b61044b565b6101846101ba3660046117e2565b610531565b6101846101cd36600461184e565b610644565b6101846101e036600461189e565b6107f1565b6101846101f33660046118bb565b610915565b610184610206366004611907565b610921565b61018461092e565b600154610226906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600354610226906001600160a01b031681565b6000546001600160a01b0316610226565b610184610275366004611920565b610994565b61028360045481565b60405190815260200161023a565b610184610a69565b6101846102a7366004611907565b610caf565b6102836201518081565b600254610226906001600160a01b031681565b6101846102d736600461189e565b610e03565b6101846102ea36600461172a565b610ee2565b6000546001600160a01b0316331461034e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103626001600160a01b0384168383610f89565b505050565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f690610412908890889088908890889060040161199f565b600060405180830381600087803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050505050565b6000546001600160a01b031633146104a55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461058b5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b826105d85760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610345565b60005b8381101561063d5761062b8585838181106105f8576105f86119d2565b905060200201602081019061060d919061189e565b84848481811061061f5761061f6119d2565b90506020020135611009565b80610635816119fe565b9150506105db565b5050505050565b6001546001600160a01b0316331461069e5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b6001546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b9190611a19565b10156107745760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b61077e8484611009565b600154604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b0381166108a15760405162461bcd60e51b815260206004820181905260248201527f4e6577207661756c7420616464726573732063616e6e6f74206265207a65726f6044820152606401610345565b604080516001600160a01b03831681524260208201527f5cc842cab066489e13292128663547c68705dbf476f0131e0107f155719c6124910160405180910390a1426004556003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6103623384848461109e565b61092b3382611207565b50565b6000546001600160a01b031633146109885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6109926000611302565b565b6002546001600160a01b038481169116146109f15760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610345565b336001600160a01b03841614610a495760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610345565b80610a5d57610a588585611207565b61063d565b61063d8585848461109e565b6000546001600160a01b03163314610ac35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b610ad26004546201518061135f565b6003546040516001600160a01b0390911681527f81a9bb8030ed4116b405800280e065110a37afb57b69948e714c97fab23475ec9060200160405180910390a16002546003546040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015291169063f2fde38b90602401600060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b50506001546003546040516370a0823160e01b81523060048201526001600160a01b0392831694506356a6d9ef935091169083906370a082319060240160206040518083038186803b158015610bdd57600080fd5b505afa158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c159190611a19565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610c7357600080fd5b505af1158015610c87573d6000803e3d6000fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916905550506000600455565b6001546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610cf757600080fd5b505afa158015610d0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2f9190611a19565b1015610d885760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b610d928183611009565b600154604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610e5d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b038116610ed95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610345565b61092b81611302565b6000546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6040517fb88d4fde0000000000000000000000000000000000000000000000000000000081526001600160a01b0386169063b88d4fde90610412903090889088908890889060040161199f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261036290849061140c565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe8260405161104491815260200190565b60405180910390a26002546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610dcd565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b8846040516110d991815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b15801561112f57600080fd5b505af1158015611143573d6000803e3d6000fd5b5050600154604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b1580156111ad57600080fd5b505afa1580156111c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e59190611a32565b8585856040518563ffffffff1660e01b81526004016107b99493929190611a4f565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b88260405161124291815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561129857600080fd5b505af11580156112ac573d6000803e3d6000fd5b50506001546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610dcd565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082116113af5760405162461bcd60e51b815260206004820152601460248201527f4368616e6765206e6f7420696e697469617465640000000000000000000000006044820152606401610345565b806113ba8342611a82565b10156114085760405162461bcd60e51b815260206004820181905260248201527f476f7665726e616e63652064656c617920686173206e6f7420656c61707365646044820152606401610345565b5050565b6000611461826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114f19092919063ffffffff16565b805190915015610362578080602001905181019061147f9190611a99565b6103625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610345565b6060611500848460008561150a565b90505b9392505050565b6060824710156115825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610345565b6001600160a01b0385163b6115d95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610345565b600080866001600160a01b031685876040516115f59190611aeb565b60006040518083038185875af1925050503d8060008114611632576040519150601f19603f3d011682016040523d82523d6000602084013e611637565b606091505b5091509150611647828286611652565b979650505050505050565b60608315611661575081611503565b8251156116715782518084602001fd5b8160405162461bcd60e51b81526004016103459190611b07565b6001600160a01b038116811461092b57600080fd5b6000806000606084860312156116b557600080fd5b83356116c08161168b565b925060208401356116d08161168b565b929592945050506040919091013590565b60008083601f8401126116f357600080fd5b50813567ffffffffffffffff81111561170b57600080fd5b60208301915083602082850101111561172357600080fd5b9250929050565b60008060008060006080868803121561174257600080fd5b853561174d8161168b565b9450602086013561175d8161168b565b935060408601359250606086013567ffffffffffffffff81111561178057600080fd5b61178c888289016116e1565b969995985093965092949392505050565b60008083601f8401126117af57600080fd5b50813567ffffffffffffffff8111156117c757600080fd5b6020830191508360208260051b850101111561172357600080fd5b600080600080604085870312156117f857600080fd5b843567ffffffffffffffff8082111561181057600080fd5b61181c8883890161179d565b9096509450602087013591508082111561183557600080fd5b506118428782880161179d565b95989497509550505050565b6000806000806060858703121561186457600080fd5b843561186f8161168b565b935060208501359250604085013567ffffffffffffffff81111561189257600080fd5b611842878288016116e1565b6000602082840312156118b057600080fd5b81356115038161168b565b6000806000604084860312156118d057600080fd5b83359250602084013567ffffffffffffffff8111156118ee57600080fd5b6118fa868287016116e1565b9497909650939450505050565b60006020828403121561191957600080fd5b5035919050565b60008060008060006080868803121561193857600080fd5b85356119438161168b565b945060208601359350604086013561195a8161168b565b9250606086013567ffffffffffffffff81111561178057600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808816835280871660208401525084604083015260806060830152611647608083018486611976565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a1257611a126119e8565b5060010190565b600060208284031215611a2b57600080fd5b5051919050565b600060208284031215611a4457600080fd5b81516115038161168b565b6001600160a01b0385168152836020820152606060408201526000611a78606083018486611976565b9695505050505050565b600082821015611a9457611a946119e8565b500390565b600060208284031215611aab57600080fd5b8151801515811461150357600080fd5b60005b83811015611ad6578181015183820152602001611abe565b83811115611ae5576000848401525b50505050565b60008251611afd818460208701611abb565b9190910192915050565b6020815260008251806020840152611b26816040850160208701611abb565b601f01601f1916919091016040019291505056fea26469706673582212202f0ac7db0281ac8c0004326c7e746d4b696bcf247bcd9c4847c3d196e8ecc35464736f6c63430008090033",
|
|
446
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806388aaf0c8116100cd578063a0712d6811610081578063e5d3d71411610066578063e5d3d714146102b6578063f2fde38b146102c9578063fc4e51f6146102dc57600080fd5b8063a0712d6814610299578063cfce0816146102ac57600080fd5b80638f4ffcb1116100b25780638f4ffcb114610267578063951315261461027a5780639a508c8e1461029157600080fd5b806388aaf0c8146102435780638da5cb5b1461025657600080fd5b8063479aa9271161012457806364e779b11161010957806364e779b1146101f8578063715018a61461020b57806376cdb03b1461021357600080fd5b8063479aa927146101d257806353dce4df146101e557600080fd5b8063317dfa7611610155578063317dfa7614610199578063461c6373146101ac578063475d0570146101bf57600080fd5b80631171bda9146101715780632e73e39814610186575b600080fd5b61018461017f3660046116a0565b6102ef565b005b61018461019436600461172a565b610367565b6101846101a73660046116a0565b61044b565b6101846101ba3660046117e2565b610531565b6101846101cd36600461184e565b610644565b6101846101e036600461189e565b6107f1565b6101846101f33660046118bb565b610915565b610184610206366004611907565b610921565b61018461092e565b600154610226906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600354610226906001600160a01b031681565b6000546001600160a01b0316610226565b610184610275366004611920565b610994565b61028360045481565b60405190815260200161023a565b610184610a69565b6101846102a7366004611907565b610caf565b6102836201518081565b600254610226906001600160a01b031681565b6101846102d736600461189e565b610e03565b6101846102ea36600461172a565b610ee2565b6000546001600160a01b0316331461034e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6103626001600160a01b0384168383610f89565b505050565b6000546001600160a01b031633146103c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517ffc4e51f60000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063fc4e51f690610412908890889088908890889060040161199f565b600060405180830381600087803b15801561042c57600080fd5b505af1158015610440573d6000803e3d6000fd5b505050505050505050565b6000546001600160a01b031633146104a55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6002546040517f1171bda90000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301526044820184905290911690631171bda990606401600060405180830381600087803b15801561051457600080fd5b505af1158015610528573d6000803e3d6000fd5b50505050505050565b6001546001600160a01b0316331461058b5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b826105d85760405162461bcd60e51b815260206004820152601760248201527f4e6f206465706f7369746f7273207370656369666965640000000000000000006044820152606401610345565b60005b8381101561063d5761062b8585838181106105f8576105f86119d2565b905060200201602081019061060d919061189e565b84848481811061061f5761061f6119d2565b90506020020135611009565b80610635816119fe565b9150506105db565b5050505050565b6001546001600160a01b0316331461069e5760405162461bcd60e51b815260206004820152601660248201527f43616c6c6572206973206e6f74207468652042616e6b000000000000000000006044820152606401610345565b6001546040516370a0823160e01b81526001600160a01b038681166004830152859216906370a082319060240160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071b9190611a19565b10156107745760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b61077e8484611009565b600154604051631f1b6d2760e21b81526001600160a01b0386811660048301523060248301526044820186905290911690637c6db49c906064015b600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b0381166108a15760405162461bcd60e51b815260206004820181905260248201527f4e6577207661756c7420616464726573732063616e6e6f74206265207a65726f6044820152606401610345565b604080516001600160a01b03831681524260208201527f5cc842cab066489e13292128663547c68705dbf476f0131e0107f155719c6124910160405180910390a1426004556003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6103623384848461109e565b61092b3382611207565b50565b6000546001600160a01b031633146109885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6109926000611302565b565b6002546001600160a01b038481169116146109f15760405162461bcd60e51b815260206004820152601160248201527f546f6b656e206973206e6f7420544254430000000000000000000000000000006044820152606401610345565b336001600160a01b03841614610a495760405162461bcd60e51b815260206004820152601860248201527f4f6e6c7920544254432063616c6c657220616c6c6f77656400000000000000006044820152606401610345565b80610a5d57610a588585611207565b61063d565b61063d8585848461109e565b6000546001600160a01b03163314610ac35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b610ad26004546201518061135f565b6003546040516001600160a01b0390911681527f81a9bb8030ed4116b405800280e065110a37afb57b69948e714c97fab23475ec9060200160405180910390a16002546003546040517ff2fde38b0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015291169063f2fde38b90602401600060405180830381600087803b158015610b7457600080fd5b505af1158015610b88573d6000803e3d6000fd5b50506001546003546040516370a0823160e01b81523060048201526001600160a01b0392831694506356a6d9ef935091169083906370a082319060240160206040518083038186803b158015610bdd57600080fd5b505afa158015610bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c159190611a19565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610c7357600080fd5b505af1158015610c87573d6000803e3d6000fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916905550506000600455565b6001546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015610cf757600080fd5b505afa158015610d0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2f9190611a19565b1015610d885760405162461bcd60e51b815260206004820152602260248201527f416d6f756e7420657863656564732062616c616e636520696e207468652062616044820152616e6b60f01b6064820152608401610345565b610d928183611009565b600154604051631f1b6d2760e21b81526001600160a01b0383811660048301523060248301526044820185905290911690637c6db49c906064015b600060405180830381600087803b158015610de757600080fd5b505af1158015610dfb573d6000803e3d6000fd5b505050505050565b6000546001600160a01b03163314610e5d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6001600160a01b038116610ed95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610345565b61092b81611302565b6000546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610345565b6040517fb88d4fde0000000000000000000000000000000000000000000000000000000081526001600160a01b0386169063b88d4fde90610412903090889088908890889060040161199f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261036290849061140c565b816001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe8260405161104491815260200190565b60405180910390a26002546040517f40c10f190000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015260248201849052909116906340c10f1990604401610dcd565b836001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b8846040516110d991815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03868116600483015260248201869052909116906379cc679090604401600060405180830381600087803b15801561112f57600080fd5b505af1158015611143573d6000803e3d6000fd5b5050600154604080517fe78cea9200000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169350634a38757e9250839163e78cea9291600480820192602092909190829003018186803b1580156111ad57600080fd5b505afa1580156111c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e59190611a32565b8585856040518563ffffffff1660e01b81526004016107b99493929190611a4f565b816001600160a01b03167f68751a4c3821398cb63d11609eca2440742ef19446f0c0261bfa8a13dd0748b88260405161124291815260200190565b60405180910390a260025460405163079cc67960e41b81526001600160a01b03848116600483015260248201849052909116906379cc679090604401600060405180830381600087803b15801561129857600080fd5b505af11580156112ac573d6000803e3d6000fd5b50506001546040517f56a6d9ef0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301526024820186905290911692506356a6d9ef9150604401610dcd565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082116113af5760405162461bcd60e51b815260206004820152601460248201527f4368616e6765206e6f7420696e697469617465640000000000000000000000006044820152606401610345565b806113ba8342611a82565b10156114085760405162461bcd60e51b815260206004820181905260248201527f476f7665726e616e63652064656c617920686173206e6f7420656c61707365646044820152606401610345565b5050565b6000611461826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114f19092919063ffffffff16565b805190915015610362578080602001905181019061147f9190611a99565b6103625760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610345565b6060611500848460008561150a565b90505b9392505050565b6060824710156115825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610345565b6001600160a01b0385163b6115d95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610345565b600080866001600160a01b031685876040516115f59190611aeb565b60006040518083038185875af1925050503d8060008114611632576040519150601f19603f3d011682016040523d82523d6000602084013e611637565b606091505b5091509150611647828286611652565b979650505050505050565b60608315611661575081611503565b8251156116715782518084602001fd5b8160405162461bcd60e51b81526004016103459190611b07565b6001600160a01b038116811461092b57600080fd5b6000806000606084860312156116b557600080fd5b83356116c08161168b565b925060208401356116d08161168b565b929592945050506040919091013590565b60008083601f8401126116f357600080fd5b50813567ffffffffffffffff81111561170b57600080fd5b60208301915083602082850101111561172357600080fd5b9250929050565b60008060008060006080868803121561174257600080fd5b853561174d8161168b565b9450602086013561175d8161168b565b935060408601359250606086013567ffffffffffffffff81111561178057600080fd5b61178c888289016116e1565b969995985093965092949392505050565b60008083601f8401126117af57600080fd5b50813567ffffffffffffffff8111156117c757600080fd5b6020830191508360208260051b850101111561172357600080fd5b600080600080604085870312156117f857600080fd5b843567ffffffffffffffff8082111561181057600080fd5b61181c8883890161179d565b9096509450602087013591508082111561183557600080fd5b506118428782880161179d565b95989497509550505050565b6000806000806060858703121561186457600080fd5b843561186f8161168b565b935060208501359250604085013567ffffffffffffffff81111561189257600080fd5b611842878288016116e1565b6000602082840312156118b057600080fd5b81356115038161168b565b6000806000604084860312156118d057600080fd5b83359250602084013567ffffffffffffffff8111156118ee57600080fd5b6118fa868287016116e1565b9497909650939450505050565b60006020828403121561191957600080fd5b5035919050565b60008060008060006080868803121561193857600080fd5b85356119438161168b565b945060208601359350604086013561195a8161168b565b9250606086013567ffffffffffffffff81111561178057600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808816835280871660208401525084604083015260806060830152611647608083018486611976565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a1257611a126119e8565b5060010190565b600060208284031215611a2b57600080fd5b5051919050565b600060208284031215611a4457600080fd5b81516115038161168b565b6001600160a01b0385168152836020820152606060408201526000611a78606083018486611976565b9695505050505050565b600082821015611a9457611a946119e8565b500390565b600060208284031215611aab57600080fd5b8151801515811461150357600080fd5b60005b83811015611ad6578181015183820152602001611abe565b83811115611ae5576000848401525b50505050565b60008251611afd818460208701611abb565b9190910192915050565b6020815260008251806020840152611b26816040850160208701611abb565b601f01601f1916919091016040019291505056fea26469706673582212202f0ac7db0281ac8c0004326c7e746d4b696bcf247bcd9c4847c3d196e8ecc35464736f6c63430008090033",
|
|
447
447
|
"linkReferences": {},
|
|
448
448
|
"deployedLinkReferences": {}
|
|
449
449
|
}
|
|
@@ -207,8 +207,9 @@ contract TBTCVault is IVault, Ownable {
|
|
|
207
207
|
/// @notice Allows the governance to finalize vault upgrade process. The
|
|
208
208
|
/// upgrade process needs to be first initiated with a call to
|
|
209
209
|
/// `initiateUpgrade` and the `UPGRADE_GOVERNANCE_DELAY` needs to
|
|
210
|
-
/// pass. Once the upgrade is finalized, the new vault
|
|
211
|
-
///
|
|
210
|
+
/// pass. Once the upgrade is finalized, the new vault becomes the
|
|
211
|
+
/// owner of the TBTC token and receives the whole Bank balance of
|
|
212
|
+
/// this vault.
|
|
212
213
|
function finalizeUpgrade()
|
|
213
214
|
external
|
|
214
215
|
onlyOwner
|
|
@@ -217,6 +218,7 @@ contract TBTCVault is IVault, Ownable {
|
|
|
217
218
|
emit UpgradeFinalized(newVault);
|
|
218
219
|
// slither-disable-next-line reentrancy-no-eth
|
|
219
220
|
tbtcToken.transferOwnership(newVault);
|
|
221
|
+
bank.transferBalance(newVault, bank.balanceOf(address(this)));
|
|
220
222
|
newVault = address(0);
|
|
221
223
|
upgradeInitiatedTimestamp = 0;
|
|
222
224
|
}
|