@keep-network/tbtc-v2 0.1.1-dev.83 → 0.1.1-dev.84
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 +11 -11
- package/artifacts/Bridge.json +11 -11
- package/artifacts/Deposit.json +7 -7
- package/artifacts/DepositSweep.json +7 -7
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +2 -2
- package/artifacts/Fraud.json +7 -7
- 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 +9 -9
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeaconStub.json +1 -1
- package/artifacts/Redemption.json +7 -7
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/Relay.json +7 -7
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TBTCVault.json +44 -15
- 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 +7 -7
- package/artifacts/solcInputs/{21fcfd91cc383ddf1b3799814408151d.json → 0f79d51f4c2e0d6bf7d919933c677b91.json} +3 -3
- 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/Bank.sol/Bank.json +2 -2
- 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/BitcoinTx.sol/BitcoinTx.json +2 -2
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +2 -2
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +2 -2
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.json +2 -2
- 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/Fraud.sol/Fraud.json +2 -2
- 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/MovingFunds.sol/MovingFunds.json +2 -2
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
- 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/bridge/Wallets.sol/Wallets.json +2 -2
- 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/DonationVault.sol/DonationVault.json +2 -2
- 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 +21 -3
- package/contracts/bank/Bank.sol +1 -1
- package/contracts/bank/IReceiveBalanceApproval.sol +2 -2
- package/contracts/vault/TBTCVault.sol +47 -9
- package/export.json +19 -1
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"language": "Solidity",
|
|
3
3
|
"sources": {
|
|
4
4
|
"contracts/bank/Bank.sol": {
|
|
5
|
-
"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 \"./IReceiveBalanceApproval.sol\";\nimport \"../vault/IVault.sol\";\n\n/// @title Bitcoin Bank\n/// @notice Bank is a central component tracking Bitcoin balances. Balances can\n/// be transferred between balance owners, and balance owners can\n/// approve their balances to be spent by others. Balances in the Bank\n/// are updated for depositors who deposited their Bitcoin into the\n/// Bridge and only the Bridge can increase balances.\n/// @dev Bank is a governable contract and the Governance can upgrade the Bridge\n/// address.\ncontract Bank is Ownable {\n address public bridge;\n\n /// @notice The balance of the given account in the Bank. Zero by default.\n mapping(address => uint256) public balanceOf;\n\n /// @notice The remaining amount of balance a spender will be\n /// allowed to transfer on behalf of an owner using\n /// `transferBalanceFrom`. Zero by default.\n mapping(address => mapping(address => uint256)) public allowance;\n\n /// @notice Returns the current nonce for an EIP2612 permission for the\n /// provided balance owner to protect against replay attacks. Used\n /// to construct an EIP2612 signature provided to the `permit`\n /// function.\n mapping(address => uint256) public nonce;\n\n uint256 public immutable cachedChainId;\n bytes32 public immutable cachedDomainSeparator;\n\n /// @notice Returns an EIP2612 Permit message hash. Used to construct\n /// an EIP2612 signature provided to the `permit` function.\n bytes32 public constant PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n\n event BalanceTransferred(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n\n event BalanceApproved(\n address indexed owner,\n address indexed spender,\n uint256 amount\n );\n\n event BalanceIncreased(address indexed owner, uint256 amount);\n\n event BalanceDecreased(address indexed owner, uint256 amount);\n\n event BridgeUpdated(address newBridge);\n\n modifier onlyBridge() {\n require(msg.sender == address(bridge), \"Caller is not the bridge\");\n _;\n }\n\n constructor() {\n cachedChainId = block.chainid;\n cachedDomainSeparator = buildDomainSeparator();\n }\n\n /// @notice Allows the Governance to upgrade the Bridge address.\n /// @dev The function does not implement any governance delay and does not\n /// check the status of the Bridge. The Governance implementation needs\n /// to ensure all requirements for the upgrade are satisfied before\n /// executing this function.\n /// Requirements:\n /// - The new Bridge address must not be zero.\n /// @param _bridge The new Bridge address.\n function updateBridge(address _bridge) external onlyOwner {\n require(_bridge != address(0), \"Bridge address must not be 0x0\");\n bridge = _bridge;\n emit BridgeUpdated(_bridge);\n }\n\n /// @notice Moves the given `amount` of balance from the caller to\n /// `recipient`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - the caller must have a balance of at least `amount`.\n /// @param recipient The recipient of the balance.\n /// @param amount The amount of the balance transferred.\n function transferBalance(address recipient, uint256 amount) external {\n _transferBalance(msg.sender, recipient, amount);\n }\n\n /// @notice Sets `amount` as the allowance of `spender` over the caller's\n /// balance.\n /// @dev If the `amount` is set to `type(uint256).max`,\n /// `transferBalanceFrom` will not reduce an allowance.\n /// Beware that changing an allowance with this function brings the\n /// risk that someone may use both the old and the new allowance by\n /// unfortunate transaction ordering. Please use\n /// `increaseBalanceAllowance` and `decreaseBalanceAllowance` to\n /// eliminate the risk.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n function approveBalance(address spender, uint256 amount) external {\n _approveBalance(msg.sender, spender, amount);\n }\n\n /// @notice Sets the `amount` as an allowance of a smart contract `spender`\n /// over the caller's balance and calls the `spender` via\n /// `receiveBalanceApproval`.\n /// @dev If the `amount` is set to `type(uint256).max`, the potential\n /// `transferBalanceFrom` executed in `receiveBalanceApproval` of\n /// `spender` will not reduce an allowance. Beware that changing an\n /// allowance with this function brings the risk that `spender` may use\n /// both the old and the new allowance by unfortunate transaction\n /// ordering. Please use `increaseBalanceAllowance` and\n /// `decreaseBalanceAllowance` to eliminate the risk.\n /// @param spender The smart contract that will be allowed to spend the\n /// balance.\n /// @param amount The amount the spender contract is allowed to spend.\n /// @param extraData Extra data passed to the `spender` contract via\n /// `receiveBalanceApproval` call.\n function approveBalanceAndCall(\n address spender,\n uint256 amount,\n bytes memory extraData\n ) external {\n _approveBalance(msg.sender, spender, amount);\n IReceiveBalanceApproval(spender).receiveBalanceApproval(\n msg.sender,\n amount,\n extraData\n );\n }\n\n /// @notice Atomically increases the caller's balance allowance granted to\n /// `spender` by the given `addedValue`.\n /// @param spender The spender address for which the allowance is increased.\n /// @param addedValue The amount by which the allowance is increased.\n function increaseBalanceAllowance(address spender, uint256 addedValue)\n external\n {\n _approveBalance(\n msg.sender,\n spender,\n allowance[msg.sender][spender] + addedValue\n );\n }\n\n /// @notice Atomically decreases the caller's balance allowance granted to\n /// `spender` by the given `subtractedValue`.\n /// @dev Requirements:\n /// - `spender` must not be the zero address,\n /// - the current allowance for `spender` must not be lower than\n /// the `subtractedValue`.\n /// @param spender The spender address for which the allowance is decreased.\n /// @param subtractedValue The amount by which the allowance is decreased.\n function decreaseBalanceAllowance(address spender, uint256 subtractedValue)\n external\n {\n uint256 currentAllowance = allowance[msg.sender][spender];\n require(\n currentAllowance >= subtractedValue,\n \"Can not decrease balance allowance below zero\"\n );\n unchecked {\n _approveBalance(\n msg.sender,\n spender,\n currentAllowance - subtractedValue\n );\n }\n }\n\n /// @notice Moves `amount` of balance from `spender` to `recipient` using the\n /// allowance mechanism. `amount` is then deducted from the caller's\n /// allowance unless the allowance was made for `type(uint256).max`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - `spender` must have a balance of at least `amount`,\n /// - the caller must have an allowance for `spender`'s balance of at\n /// least `amount`.\n /// @param spender The address from which the balance is transferred.\n /// @param recipient The address to which the balance is transferred.\n /// @param amount The amount of balance that is transferred.\n function transferBalanceFrom(\n address spender,\n address recipient,\n uint256 amount\n ) external {\n uint256 currentAllowance = allowance[spender][msg.sender];\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"Transfer amount exceeds allowance\"\n );\n unchecked {\n _approveBalance(spender, msg.sender, currentAllowance - amount);\n }\n }\n _transferBalance(spender, recipient, amount);\n }\n\n /// @notice An EIP2612 approval made with secp256k1 signature. Users can\n /// authorize a transfer of their balance with a signature\n /// conforming to the EIP712 standard, rather than an on-chain\n /// transaction from their address. Anyone can submit this signature\n /// on the user's behalf by calling the `permit` function, paying\n /// gas fees, and possibly performing other actions in the same\n /// transaction.\n /// @dev The deadline argument can be set to `type(uint256).max to create\n /// permits that effectively never expire. If the `amount` is set\n /// to `type(uint256).max` then `transferBalanceFrom` will not\n /// reduce an allowance. Beware that changing an allowance with this\n /// function brings the risk that someone may use both the old and the\n /// new allowance by unfortunate transaction ordering. Please use\n /// `increaseBalanceAllowance` and `decreaseBalanceAllowance` to\n /// eliminate the risk.\n /// @param owner The balance owner who signed the permission.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n /// @param deadline The UNIX time until which the permit is valid.\n /// @param v V part of the permit signature.\n /// @param r R part of the permit signature.\n /// @param s S part of the permit signature.\n function permit(\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n /* solhint-disable-next-line not-rely-on-time */\n require(deadline >= block.timestamp, \"Permission expired\");\n\n // Validate `s` and `v` values for a malleability concern described in EIP2.\n // Only signatures with `s` value in the lower half of the secp256k1\n // curve's order and `v` value of 27 or 28 are considered valid.\n require(\n uint256(s) <=\n 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,\n \"Invalid signature 's' value\"\n );\n require(v == 27 || v == 28, \"Invalid signature 'v' value\");\n\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR(),\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n amount,\n nonce[owner]++,\n deadline\n )\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(\n recoveredAddress != address(0) && recoveredAddress == owner,\n \"Invalid signature\"\n );\n _approveBalance(owner, spender, amount);\n }\n\n /// @notice Increases balances of the provided `recipients` by the provided\n /// `amounts`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - length of `recipients` and `amounts` must be the same,\n /// - none of `recipients` addresses must point to the Bank.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalances(\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n for (uint256 i = 0; i < recipients.length; i++) {\n _increaseBalance(recipients[i], amounts[i]);\n }\n }\n\n /// @notice Increases balance of the provided `recipient` by the provided\n /// `amount`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - `recipient` address must not point to the Bank.\n /// @param recipient Balance increase recipient.\n /// @param amount Amount by which the balance is increased.\n function increaseBalance(address recipient, uint256 amount)\n external\n onlyBridge\n {\n _increaseBalance(recipient, amount);\n }\n\n /// @notice Increases the given smart contract `vault`'s balance and\n /// notifies the `vault` contract about it.\n /// Can be called only by the Bridge.\n /// @dev Requirements:\n /// - `vault` must implement `IVault` interface,\n /// - length of `recipients` and `amounts` must be the same.\n /// @param vault Address of `IVault` recipient contract.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalanceAndCall(\n address vault,\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < amounts.length; i++) {\n totalAmount += amounts[i];\n }\n _increaseBalance(vault, totalAmount);\n IVault(vault).receiveBalanceIncrease(recipients, amounts);\n }\n\n /// @notice Decreases caller's balance by the provided `amount`. There is no\n /// way to restore the balance so do not call this function unless\n /// you really know what you are doing!\n /// @dev Requirements:\n /// - The caller must have a balance of at least `amount`.\n /// @param amount The amount by which the balance is decreased.\n function decreaseBalance(uint256 amount) external {\n balanceOf[msg.sender] -= amount;\n emit BalanceDecreased(msg.sender, amount);\n }\n\n /// @notice Returns hash of EIP712 Domain struct with `TBTC Bank` as\n /// a signing domain and Bank contract as a verifying contract.\n /// Used to construct an EIP2612 signature provided to the `permit`\n /// function.\n /* solhint-disable-next-line func-name-mixedcase */\n function DOMAIN_SEPARATOR() public view returns (bytes32) {\n // As explained in EIP-2612, if the DOMAIN_SEPARATOR contains the\n // chainId and is defined at contract deployment instead of\n // reconstructed for every signature, there is a risk of possible replay\n // attacks between chains in the event of a future chain split.\n // To address this issue, we check the cached chain ID against the\n // current one and in case they are different, we build domain separator\n // from scratch.\n if (block.chainid == cachedChainId) {\n return cachedDomainSeparator;\n } else {\n return buildDomainSeparator();\n }\n }\n\n function _increaseBalance(address recipient, uint256 amount) internal {\n require(\n recipient != address(this),\n \"Can not increase balance for Bank\"\n );\n balanceOf[recipient] += amount;\n emit BalanceIncreased(recipient, amount);\n }\n\n function _transferBalance(\n address spender,\n address recipient,\n uint256 amount\n ) private {\n require(\n recipient != address(0),\n \"Can not transfer to the zero address\"\n );\n require(\n recipient != address(this),\n \"Can not transfer to the Bank address\"\n );\n\n uint256 spenderBalance = balanceOf[spender];\n require(spenderBalance >= amount, \"Transfer amount exceeds balance\");\n unchecked {\n balanceOf[spender] = spenderBalance - amount;\n }\n balanceOf[recipient] += amount;\n emit BalanceTransferred(spender, recipient, amount);\n }\n\n function _approveBalance(\n address owner,\n address spender,\n uint256 amount\n ) private {\n require(spender != address(0), \"Can not approve to the zero address\");\n allowance[owner][spender] = amount;\n emit BalanceApproved(owner, spender, amount);\n }\n\n function buildDomainSeparator() private view returns (bytes32) {\n return\n keccak256(\n abi.encode(\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n ),\n keccak256(bytes(\"TBTC Bank\")),\n keccak256(bytes(\"1\")),\n block.chainid,\n address(this)\n )\n );\n }\n}\n"
|
|
5
|
+
"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 \"./IReceiveBalanceApproval.sol\";\nimport \"../vault/IVault.sol\";\n\n/// @title Bitcoin Bank\n/// @notice Bank is a central component tracking Bitcoin balances. Balances can\n/// be transferred between balance owners, and balance owners can\n/// approve their balances to be spent by others. Balances in the Bank\n/// are updated for depositors who deposited their Bitcoin into the\n/// Bridge and only the Bridge can increase balances.\n/// @dev Bank is a governable contract and the Governance can upgrade the Bridge\n/// address.\ncontract Bank is Ownable {\n address public bridge;\n\n /// @notice The balance of the given account in the Bank. Zero by default.\n mapping(address => uint256) public balanceOf;\n\n /// @notice The remaining amount of balance a spender will be\n /// allowed to transfer on behalf of an owner using\n /// `transferBalanceFrom`. Zero by default.\n mapping(address => mapping(address => uint256)) public allowance;\n\n /// @notice Returns the current nonce for an EIP2612 permission for the\n /// provided balance owner to protect against replay attacks. Used\n /// to construct an EIP2612 signature provided to the `permit`\n /// function.\n mapping(address => uint256) public nonce;\n\n uint256 public immutable cachedChainId;\n bytes32 public immutable cachedDomainSeparator;\n\n /// @notice Returns an EIP2612 Permit message hash. Used to construct\n /// an EIP2612 signature provided to the `permit` function.\n bytes32 public constant PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n\n event BalanceTransferred(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n\n event BalanceApproved(\n address indexed owner,\n address indexed spender,\n uint256 amount\n );\n\n event BalanceIncreased(address indexed owner, uint256 amount);\n\n event BalanceDecreased(address indexed owner, uint256 amount);\n\n event BridgeUpdated(address newBridge);\n\n modifier onlyBridge() {\n require(msg.sender == address(bridge), \"Caller is not the bridge\");\n _;\n }\n\n constructor() {\n cachedChainId = block.chainid;\n cachedDomainSeparator = buildDomainSeparator();\n }\n\n /// @notice Allows the Governance to upgrade the Bridge address.\n /// @dev The function does not implement any governance delay and does not\n /// check the status of the Bridge. The Governance implementation needs\n /// to ensure all requirements for the upgrade are satisfied before\n /// executing this function.\n /// Requirements:\n /// - The new Bridge address must not be zero.\n /// @param _bridge The new Bridge address.\n function updateBridge(address _bridge) external onlyOwner {\n require(_bridge != address(0), \"Bridge address must not be 0x0\");\n bridge = _bridge;\n emit BridgeUpdated(_bridge);\n }\n\n /// @notice Moves the given `amount` of balance from the caller to\n /// `recipient`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - the caller must have a balance of at least `amount`.\n /// @param recipient The recipient of the balance.\n /// @param amount The amount of the balance transferred.\n function transferBalance(address recipient, uint256 amount) external {\n _transferBalance(msg.sender, recipient, amount);\n }\n\n /// @notice Sets `amount` as the allowance of `spender` over the caller's\n /// balance.\n /// @dev If the `amount` is set to `type(uint256).max`,\n /// `transferBalanceFrom` will not reduce an allowance.\n /// Beware that changing an allowance with this function brings the\n /// risk that someone may use both the old and the new allowance by\n /// unfortunate transaction ordering. Please use\n /// `increaseBalanceAllowance` and `decreaseBalanceAllowance` to\n /// eliminate the risk.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n function approveBalance(address spender, uint256 amount) external {\n _approveBalance(msg.sender, spender, amount);\n }\n\n /// @notice Sets the `amount` as an allowance of a smart contract `spender`\n /// over the caller's balance and calls the `spender` via\n /// `receiveBalanceApproval`.\n /// @dev If the `amount` is set to `type(uint256).max`, the potential\n /// `transferBalanceFrom` executed in `receiveBalanceApproval` of\n /// `spender` will not reduce an allowance. Beware that changing an\n /// allowance with this function brings the risk that `spender` may use\n /// both the old and the new allowance by unfortunate transaction\n /// ordering. Please use `increaseBalanceAllowance` and\n /// `decreaseBalanceAllowance` to eliminate the risk.\n /// @param spender The smart contract that will be allowed to spend the\n /// balance.\n /// @param amount The amount the spender contract is allowed to spend.\n /// @param extraData Extra data passed to the `spender` contract via\n /// `receiveBalanceApproval` call.\n function approveBalanceAndCall(\n address spender,\n uint256 amount,\n bytes calldata extraData\n ) external {\n _approveBalance(msg.sender, spender, amount);\n IReceiveBalanceApproval(spender).receiveBalanceApproval(\n msg.sender,\n amount,\n extraData\n );\n }\n\n /// @notice Atomically increases the caller's balance allowance granted to\n /// `spender` by the given `addedValue`.\n /// @param spender The spender address for which the allowance is increased.\n /// @param addedValue The amount by which the allowance is increased.\n function increaseBalanceAllowance(address spender, uint256 addedValue)\n external\n {\n _approveBalance(\n msg.sender,\n spender,\n allowance[msg.sender][spender] + addedValue\n );\n }\n\n /// @notice Atomically decreases the caller's balance allowance granted to\n /// `spender` by the given `subtractedValue`.\n /// @dev Requirements:\n /// - `spender` must not be the zero address,\n /// - the current allowance for `spender` must not be lower than\n /// the `subtractedValue`.\n /// @param spender The spender address for which the allowance is decreased.\n /// @param subtractedValue The amount by which the allowance is decreased.\n function decreaseBalanceAllowance(address spender, uint256 subtractedValue)\n external\n {\n uint256 currentAllowance = allowance[msg.sender][spender];\n require(\n currentAllowance >= subtractedValue,\n \"Can not decrease balance allowance below zero\"\n );\n unchecked {\n _approveBalance(\n msg.sender,\n spender,\n currentAllowance - subtractedValue\n );\n }\n }\n\n /// @notice Moves `amount` of balance from `spender` to `recipient` using the\n /// allowance mechanism. `amount` is then deducted from the caller's\n /// allowance unless the allowance was made for `type(uint256).max`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - `spender` must have a balance of at least `amount`,\n /// - the caller must have an allowance for `spender`'s balance of at\n /// least `amount`.\n /// @param spender The address from which the balance is transferred.\n /// @param recipient The address to which the balance is transferred.\n /// @param amount The amount of balance that is transferred.\n function transferBalanceFrom(\n address spender,\n address recipient,\n uint256 amount\n ) external {\n uint256 currentAllowance = allowance[spender][msg.sender];\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"Transfer amount exceeds allowance\"\n );\n unchecked {\n _approveBalance(spender, msg.sender, currentAllowance - amount);\n }\n }\n _transferBalance(spender, recipient, amount);\n }\n\n /// @notice An EIP2612 approval made with secp256k1 signature. Users can\n /// authorize a transfer of their balance with a signature\n /// conforming to the EIP712 standard, rather than an on-chain\n /// transaction from their address. Anyone can submit this signature\n /// on the user's behalf by calling the `permit` function, paying\n /// gas fees, and possibly performing other actions in the same\n /// transaction.\n /// @dev The deadline argument can be set to `type(uint256).max to create\n /// permits that effectively never expire. If the `amount` is set\n /// to `type(uint256).max` then `transferBalanceFrom` will not\n /// reduce an allowance. Beware that changing an allowance with this\n /// function brings the risk that someone may use both the old and the\n /// new allowance by unfortunate transaction ordering. Please use\n /// `increaseBalanceAllowance` and `decreaseBalanceAllowance` to\n /// eliminate the risk.\n /// @param owner The balance owner who signed the permission.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n /// @param deadline The UNIX time until which the permit is valid.\n /// @param v V part of the permit signature.\n /// @param r R part of the permit signature.\n /// @param s S part of the permit signature.\n function permit(\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n /* solhint-disable-next-line not-rely-on-time */\n require(deadline >= block.timestamp, \"Permission expired\");\n\n // Validate `s` and `v` values for a malleability concern described in EIP2.\n // Only signatures with `s` value in the lower half of the secp256k1\n // curve's order and `v` value of 27 or 28 are considered valid.\n require(\n uint256(s) <=\n 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,\n \"Invalid signature 's' value\"\n );\n require(v == 27 || v == 28, \"Invalid signature 'v' value\");\n\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR(),\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n amount,\n nonce[owner]++,\n deadline\n )\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(\n recoveredAddress != address(0) && recoveredAddress == owner,\n \"Invalid signature\"\n );\n _approveBalance(owner, spender, amount);\n }\n\n /// @notice Increases balances of the provided `recipients` by the provided\n /// `amounts`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - length of `recipients` and `amounts` must be the same,\n /// - none of `recipients` addresses must point to the Bank.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalances(\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n for (uint256 i = 0; i < recipients.length; i++) {\n _increaseBalance(recipients[i], amounts[i]);\n }\n }\n\n /// @notice Increases balance of the provided `recipient` by the provided\n /// `amount`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - `recipient` address must not point to the Bank.\n /// @param recipient Balance increase recipient.\n /// @param amount Amount by which the balance is increased.\n function increaseBalance(address recipient, uint256 amount)\n external\n onlyBridge\n {\n _increaseBalance(recipient, amount);\n }\n\n /// @notice Increases the given smart contract `vault`'s balance and\n /// notifies the `vault` contract about it.\n /// Can be called only by the Bridge.\n /// @dev Requirements:\n /// - `vault` must implement `IVault` interface,\n /// - length of `recipients` and `amounts` must be the same.\n /// @param vault Address of `IVault` recipient contract.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalanceAndCall(\n address vault,\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < amounts.length; i++) {\n totalAmount += amounts[i];\n }\n _increaseBalance(vault, totalAmount);\n IVault(vault).receiveBalanceIncrease(recipients, amounts);\n }\n\n /// @notice Decreases caller's balance by the provided `amount`. There is no\n /// way to restore the balance so do not call this function unless\n /// you really know what you are doing!\n /// @dev Requirements:\n /// - The caller must have a balance of at least `amount`.\n /// @param amount The amount by which the balance is decreased.\n function decreaseBalance(uint256 amount) external {\n balanceOf[msg.sender] -= amount;\n emit BalanceDecreased(msg.sender, amount);\n }\n\n /// @notice Returns hash of EIP712 Domain struct with `TBTC Bank` as\n /// a signing domain and Bank contract as a verifying contract.\n /// Used to construct an EIP2612 signature provided to the `permit`\n /// function.\n /* solhint-disable-next-line func-name-mixedcase */\n function DOMAIN_SEPARATOR() public view returns (bytes32) {\n // As explained in EIP-2612, if the DOMAIN_SEPARATOR contains the\n // chainId and is defined at contract deployment instead of\n // reconstructed for every signature, there is a risk of possible replay\n // attacks between chains in the event of a future chain split.\n // To address this issue, we check the cached chain ID against the\n // current one and in case they are different, we build domain separator\n // from scratch.\n if (block.chainid == cachedChainId) {\n return cachedDomainSeparator;\n } else {\n return buildDomainSeparator();\n }\n }\n\n function _increaseBalance(address recipient, uint256 amount) internal {\n require(\n recipient != address(this),\n \"Can not increase balance for Bank\"\n );\n balanceOf[recipient] += amount;\n emit BalanceIncreased(recipient, amount);\n }\n\n function _transferBalance(\n address spender,\n address recipient,\n uint256 amount\n ) private {\n require(\n recipient != address(0),\n \"Can not transfer to the zero address\"\n );\n require(\n recipient != address(this),\n \"Can not transfer to the Bank address\"\n );\n\n uint256 spenderBalance = balanceOf[spender];\n require(spenderBalance >= amount, \"Transfer amount exceeds balance\");\n unchecked {\n balanceOf[spender] = spenderBalance - amount;\n }\n balanceOf[recipient] += amount;\n emit BalanceTransferred(spender, recipient, amount);\n }\n\n function _approveBalance(\n address owner,\n address spender,\n uint256 amount\n ) private {\n require(spender != address(0), \"Can not approve to the zero address\");\n allowance[owner][spender] = amount;\n emit BalanceApproved(owner, spender, amount);\n }\n\n function buildDomainSeparator() private view returns (bytes32) {\n return\n keccak256(\n abi.encode(\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n ),\n keccak256(bytes(\"TBTC Bank\")),\n keccak256(bytes(\"1\")),\n block.chainid,\n address(this)\n )\n );\n }\n}\n"
|
|
6
6
|
},
|
|
7
7
|
"@openzeppelin/contracts/access/Ownable.sol": {
|
|
8
8
|
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../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 * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\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 called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
|
|
9
9
|
},
|
|
10
10
|
"contracts/bank/IReceiveBalanceApproval.sol": {
|
|
11
|
-
"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\n/// @title IReceiveBalanceApproval\n/// @notice `IReceiveBalanceApproval` is an interface for a smart contract\n/// consuming Bank balances approved to them in the same transaction by\n/// other contracts or externally owned accounts (EOA).\ninterface IReceiveBalanceApproval {\n /// @notice Called by the Bank in `approveBalanceAndCall` function after\n /// the balance `owner` approved `amount` of their balance in the\n /// Bank for the contract. This way, the depositor can approve\n /// balance and call the contract to use the approved balance in\n /// a single transaction.\n /// @param owner Address of the Bank balance owner who approved their\n /// balance to be used by the contract.\n /// @param amount The amount of the Bank balance approved by the owner\n /// to be used by the contract.\n /// @param extraData The `extraData` passed to `Bank.approveBalanceAndCall`.\n
|
|
11
|
+
"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\n/// @title IReceiveBalanceApproval\n/// @notice `IReceiveBalanceApproval` is an interface for a smart contract\n/// consuming Bank balances approved to them in the same transaction by\n/// other contracts or externally owned accounts (EOA).\ninterface IReceiveBalanceApproval {\n /// @notice Called by the Bank in `approveBalanceAndCall` function after\n /// the balance `owner` approved `amount` of their balance in the\n /// Bank for the contract. This way, the depositor can approve\n /// balance and call the contract to use the approved balance in\n /// a single transaction.\n /// @param owner Address of the Bank balance owner who approved their\n /// balance to be used by the contract.\n /// @param amount The amount of the Bank balance approved by the owner\n /// to be used by the contract.\n /// @param extraData The `extraData` passed to `Bank.approveBalanceAndCall`.\n /// @dev The implementation must ensure this function can only be called\n /// by the Bank. The Bank does _not_ guarantee that the `amount`\n /// approved by the `owner` currently exists on their balance. That is,\n /// the `owner` could approve more balance than they currently have.\n /// This works the same as `Bank.approve` function. The contract must\n /// ensure the actual balance is checked before performing any action\n /// based on it.\n function receiveBalanceApproval(\n address owner,\n uint256 amount,\n bytes calldata extraData\n ) external;\n}\n"
|
|
12
12
|
},
|
|
13
13
|
"contracts/vault/IVault.sol": {
|
|
14
14
|
"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 \"../bank/IReceiveBalanceApproval.sol\";\n\n/// @title Bank Vault interface\n/// @notice `IVault` is an interface for a smart contract consuming Bank\n/// balances of other contracts or externally owned accounts (EOA).\ninterface IVault is IReceiveBalanceApproval {\n /// @notice Called by the Bank in `increaseBalanceAndCall` function after\n /// increasing the balance in the Bank for the vault. It happens in\n /// the same transaction in which deposits were swept by the Bridge.\n /// This allows the depositor to route their deposit revealed to the\n /// Bridge to the particular smart contract (vault) in the same\n /// transaction in which the deposit is revealed. This way, the\n /// depositor does not have to execute additional transaction after\n /// the deposit gets swept by the Bridge to approve and transfer\n /// their balance to the vault.\n /// @param depositors Addresses of depositors whose deposits have been swept.\n /// @param depositedAmounts Amounts deposited by individual depositors and\n /// swept.\n /// @dev The implementation must ensure this function can only be called\n /// by the Bank. The Bank guarantees that the vault's balance was\n /// increased by the sum of all deposited amounts before this function\n /// is called, in the same transaction.\n function receiveBalanceIncrease(\n address[] calldata depositors,\n uint256[] calldata depositedAmounts\n ) external;\n}\n"
|
|
@@ -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 \"@keep-network/random-beacon/contracts/Governable.sol\";\n\nimport \"./IVault.sol\";\nimport \"../bank/Bank.sol\";\nimport \"../token/TBTC.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, Governable {\n Bank public bank;\n TBTC public tbtcToken;\n\n event Minted(address indexed to, uint256 amount);\n\n event Unminted(address indexed from, uint256 amount);\n\n modifier onlyBank() {\n require(msg.sender == address(bank), \"Caller is not the Bank\");\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 _transferGovernance(msg.sender);\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 recoverERC20(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyGovernance {\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 recoverERC721(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyGovernance {\n tbtcToken.recoverERC721(token, recipient, tokenId, data);\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
|
|
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 \"@keep-network/random-beacon/contracts/Governable.sol\";\n\nimport \"./IVault.sol\";\nimport \"../bank/Bank.sol\";\nimport \"../token/TBTC.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, Governable {\n Bank public bank;\n TBTC public tbtcToken;\n\n event Minted(address indexed to, uint256 amount);\n\n event Unminted(address indexed from, uint256 amount);\n\n modifier onlyBank() {\n require(msg.sender == address(bank), \"Caller is not the Bank\");\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 _transferGovernance(msg.sender);\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 recoverERC20(\n IERC20 token,\n address recipient,\n uint256 amount\n ) external onlyGovernance {\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 recoverERC721(\n IERC721 token,\n address recipient,\n uint256 tokenId,\n bytes calldata data\n ) external onlyGovernance {\n tbtcToken.recoverERC721(token, recipient, tokenId, data);\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 // 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
|
"@keep-network/random-beacon/contracts/Governable.sol": {
|
|
23
23
|
"content": "// SPDX-License-Identifier: MIT\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity ^0.8.9;\n\n/// @notice Governable contract.\n/// @dev A constructor is not defined, which makes the contract compatible with\n/// upgradable proxies. This requires calling explicitly `_transferGovernance`\n/// function in a child contract.\nabstract contract Governable {\n // Governance of the contract\n // The variable should be initialized by the implementing contract.\n // slither-disable-next-line uninitialized-state\n address public governance;\n\n // Reserved storage space in case we need to add more variables,\n // since there are upgradeable contracts that inherit from this one.\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n // slither-disable-next-line unused-state\n uint256[49] private __gap;\n\n event GovernanceTransferred(address oldGovernance, address newGovernance);\n\n modifier onlyGovernance() virtual {\n require(governance == msg.sender, \"Caller is not the governance\");\n _;\n }\n\n /// @notice Transfers governance of the contract to `newGovernance`.\n function transferGovernance(address newGovernance)\n external\n virtual\n onlyGovernance\n {\n require(\n newGovernance != address(0),\n \"New governance is the zero address\"\n );\n _transferGovernance(newGovernance);\n }\n\n function _transferGovernance(address newGovernance) internal virtual {\n address oldGovernance = governance;\n governance = newGovernance;\n emit GovernanceTransferred(oldGovernance, newGovernance);\n }\n}\n"
|
|
@@ -535,8 +535,8 @@
|
|
|
535
535
|
"type": "function"
|
|
536
536
|
}
|
|
537
537
|
],
|
|
538
|
-
"bytecode": "0x60c060405234801561001057600080fd5b5061001a336100f9565b466080526100f16040805180820182526009815268544254432042616e6b60b81b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b60a052610149565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805160a05161193d61017c6000396000818161032d01526105b90152600081816102ce0152610590015261193d6000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806370a08231116100e3578063b4f94b2e1161008c578063dd62ed3e11610066578063dd62ed3e14610375578063e78cea92146103a0578063f2fde38b146103b357600080fd5b8063b4f94b2e14610328578063bb7e61bc1461034f578063d505accf1461036257600080fd5b8063771da5c5116100bd578063771da5c5146102c95780637c6db49c146102f05780638da5cb5b1461030357600080fd5b806370a082311461028157806370ae92d2146102a1578063715018a6146102c157600080fd5b806346b05e09116101455780635b86f5991161011f5780635b86f599146102485780635bfd99b91461025b5780636eb382121461026e57600080fd5b806346b05e091461020f5780634a38757e1461022257806356a6d9ef1461023557600080fd5b806330adf81f1161017657806330adf81f146101ba5780633644e515146101f4578063392aee43146101fc57600080fd5b80630b6d324c14610192578063266a123a146101a7575b600080fd5b6101a56101a0366004611428565b6103c6565b005b6101a56101b536600461149e565b610477565b6101e17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040519081526020015b60405180910390f35b6101e161058c565b6101a561020a36600461150a565b6106dc565b6101a561021d366004611428565b610738565b6101a5610230366004611539565b610747565b6101a5610243366004611428565b6107d2565b6101a5610256366004611428565b6107dd565b6101a5610269366004611428565b610841565b6101a561027c366004611604565b61087c565b6101e161028f366004611604565b60026020526000908152604090205481565b6101e16102af366004611604565b60046020526000908152604090205481565b6101a561098d565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a56102fe366004611626565b6109f3565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101eb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a561035d366004611662565b610ab4565b6101a56103703660046116e3565b610c31565b6101e1610383366004611756565b600360209081526000928352604080842090915290825290205481565b600154610310906001600160a01b031681565b6101a56103c1366004611604565b610f41565b3360009081526003602090815260408083206001600160a01b0386168452909152902054818110156104655760405162461bcd60e51b815260206004820152602d60248201527f43616e206e6f742064656372656173652062616c616e636520616c6c6f77616e60448201527f63652062656c6f77207a65726f0000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104723384848403611023565b505050565b6001546001600160a01b031633146104d15760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b8281146105205760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b60005b838110156105855761057385858381811061054057610540611789565b90506020020160208101906105559190611604565b84848481811061056757610567611789565b90506020020135611100565b8061057d816117b5565b915050610523565b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156105db57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080518082018252600981527f544254432042616e6b000000000000000000000000000000000000000000000060209182015281518083018352600181527f31000000000000000000000000000000000000000000000000000000000000009082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b33600090815260026020526040812080548392906106fb9084906117d0565b909155505060405181815233907f9c6be7c4260e52ea2e41d7f17932147ab78756f1bb2247a2554796d969741aff9060200160405180910390a250565b610743338383611023565b5050565b610752338484611023565b6040517f475d05700000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063475d05709061079b903390869086906004016117e7565b600060405180830381600087803b1580156107b557600080fd5b505af11580156107c9573d6000803e3d6000fd5b50505050505050565b6107433383836111ee565b6001546001600160a01b031633146108375760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b6107438282611100565b3360008181526003602090815260408083206001600160a01b038716845290915290205461074391908490610877908590611854565b611023565b6000546001600160a01b031633146108d65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661092c5760405162461bcd60e51b815260206004820152601e60248201527f4272696467652061646472657373206d757374206e6f74206265203078300000604482015260640161045c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe1694c0b21fdceff6411daed547c7463c2341b9695387bc82595b5b9b1851d4a9060200160405180910390a150565b6000546001600160a01b031633146109e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6109f160006113af565b565b6001600160a01b03831660009081526003602090815260408083203384529091529020546000198114610aa35781811015610a965760405162461bcd60e51b815260206004820152602160248201527f5472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6360448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b610aa38433848403611023565b610aae8484846111ee565b50505050565b6001546001600160a01b03163314610b0e5760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b828114610b5d5760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b6000805b82811015610ba157838382818110610b7b57610b7b611789565b9050602002013582610b8d9190611854565b915080610b99816117b5565b915050610b61565b50610bac8682611100565b6040517f461c63730000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063461c637390610bf790889088908890889060040161186c565b600060405180830381600087803b158015610c1157600080fd5b505af1158015610c25573d6000803e3d6000fd5b50505050505050505050565b42841015610c815760405162461bcd60e51b815260206004820152601260248201527f5065726d697373696f6e20657870697265640000000000000000000000000000604482015260640161045c565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0811115610cf15760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202773272076616c75650000000000604482015260640161045c565b8260ff16601b1480610d0657508260ff16601c145b610d525760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202776272076616c75650000000000604482015260640161045c565b6000610d5c61058c565b6001600160a01b038916600090815260046020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92909190610daa836117b5565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610e3e9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610ea9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610edf5750886001600160a01b0316816001600160a01b0316145b610f2b5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161045c565b610f36898989611023565b505050505050505050565b6000546001600160a01b03163314610f9b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b0381166110175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161045c565b611020816113af565b50565b6001600160a01b03821661109f5760405162461bcd60e51b815260206004820152602360248201527f43616e206e6f7420617070726f766520746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f2fe5e8e7796010737e636f63b35a0383dc160b68483984f2df987c78e842b405910160405180910390a3505050565b6001600160a01b03821630141561117f5760405162461bcd60e51b815260206004820152602160248201527f43616e206e6f7420696e6372656173652062616c616e636520666f722042616e60448201527f6b00000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b038216600090815260026020526040812080548392906111a7908490611854565b90915550506040518181526001600160a01b038316907f7a702e80a9c183a6ce9d6732991df2e914555ba35a364a70aed2433984e7544b9060200160405180910390a25050565b6001600160a01b0382166112505760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0382163014156112b55760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f207468652042616e6b206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0383166000908152600260205260409020548181101561131e5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161045c565b6001600160a01b03808516600090815260026020526040808220858503905591851681529081208054849290611355908490611854565b92505081905550826001600160a01b0316846001600160a01b03167f4163d0b06696468b3d7903f482bcd0097bd38a9a9086157479fd6c6561d24261846040516113a191815260200190565b60405180910390a350505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461142357600080fd5b919050565b6000806040838503121561143b57600080fd5b6114448361140c565b946020939093013593505050565b60008083601f84011261146457600080fd5b50813567ffffffffffffffff81111561147c57600080fd5b6020830191508360208260051b850101111561149757600080fd5b9250929050565b600080600080604085870312156114b457600080fd5b843567ffffffffffffffff808211156114cc57600080fd5b6114d888838901611452565b909650945060208701359150808211156114f157600080fd5b506114fe87828801611452565b95989497509550505050565b60006020828403121561151c57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561154e57600080fd5b6115578461140c565b925060208401359150604084013567ffffffffffffffff8082111561157b57600080fd5b818601915086601f83011261158f57600080fd5b8135818111156115a1576115a1611523565b604051601f8201601f19908116603f011681019083821181831017156115c9576115c9611523565b816040528281528960208487010111156115e257600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561161657600080fd5b61161f8261140c565b9392505050565b60008060006060848603121561163b57600080fd5b6116448461140c565b92506116526020850161140c565b9150604084013590509250925092565b60008060008060006060868803121561167a57600080fd5b6116838661140c565b9450602086013567ffffffffffffffff808211156116a057600080fd5b6116ac89838a01611452565b909650945060408801359150808211156116c557600080fd5b506116d288828901611452565b969995985093965092949392505050565b600080600080600080600060e0888a0312156116fe57600080fd5b6117078861140c565b96506117156020890161140c565b95506040880135945060608801359350608088013560ff8116811461173957600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561176957600080fd5b6117728361140c565b91506117806020840161140c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156117c9576117c961179f565b5060010190565b6000828210156117e2576117e261179f565b500390565b6001600160a01b038416815260006020848184015260606040840152835180606085015260005b8181101561182a5785810183015185820160800152820161180e565b8181111561183c576000608083870101525b50601f01601f19169290920160800195945050505050565b600082198211156118675761186761179f565b500190565b6040808252810184905260008560608301825b878110156118ad576001600160a01b036118988461140c565b1682526020928301929091019060010161187f565b5083810360208501528481527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8511156118e657600080fd5b8460051b91508186602083013760009101602001908152969550505050505056fea2646970667358221220cae4704685d99aebff9177755447341bf548e84a5ef0b127660f1cba3c4536ea64736f6c63430008090033",
|
|
539
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c806370a08231116100e3578063b4f94b2e1161008c578063dd62ed3e11610066578063dd62ed3e14610375578063e78cea92146103a0578063f2fde38b146103b357600080fd5b8063b4f94b2e14610328578063bb7e61bc1461034f578063d505accf1461036257600080fd5b8063771da5c5116100bd578063771da5c5146102c95780637c6db49c146102f05780638da5cb5b1461030357600080fd5b806370a082311461028157806370ae92d2146102a1578063715018a6146102c157600080fd5b806346b05e09116101455780635b86f5991161011f5780635b86f599146102485780635bfd99b91461025b5780636eb382121461026e57600080fd5b806346b05e091461020f5780634a38757e1461022257806356a6d9ef1461023557600080fd5b806330adf81f1161017657806330adf81f146101ba5780633644e515146101f4578063392aee43146101fc57600080fd5b80630b6d324c14610192578063266a123a146101a7575b600080fd5b6101a56101a0366004611428565b6103c6565b005b6101a56101b536600461149e565b610477565b6101e17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040519081526020015b60405180910390f35b6101e161058c565b6101a561020a36600461150a565b6106dc565b6101a561021d366004611428565b610738565b6101a5610230366004611539565b610747565b6101a5610243366004611428565b6107d2565b6101a5610256366004611428565b6107dd565b6101a5610269366004611428565b610841565b6101a561027c366004611604565b61087c565b6101e161028f366004611604565b60026020526000908152604090205481565b6101e16102af366004611604565b60046020526000908152604090205481565b6101a561098d565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a56102fe366004611626565b6109f3565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101eb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a561035d366004611662565b610ab4565b6101a56103703660046116e3565b610c31565b6101e1610383366004611756565b600360209081526000928352604080842090915290825290205481565b600154610310906001600160a01b031681565b6101a56103c1366004611604565b610f41565b3360009081526003602090815260408083206001600160a01b0386168452909152902054818110156104655760405162461bcd60e51b815260206004820152602d60248201527f43616e206e6f742064656372656173652062616c616e636520616c6c6f77616e60448201527f63652062656c6f77207a65726f0000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104723384848403611023565b505050565b6001546001600160a01b031633146104d15760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b8281146105205760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b60005b838110156105855761057385858381811061054057610540611789565b90506020020160208101906105559190611604565b84848481811061056757610567611789565b90506020020135611100565b8061057d816117b5565b915050610523565b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156105db57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080518082018252600981527f544254432042616e6b000000000000000000000000000000000000000000000060209182015281518083018352600181527f31000000000000000000000000000000000000000000000000000000000000009082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b33600090815260026020526040812080548392906106fb9084906117d0565b909155505060405181815233907f9c6be7c4260e52ea2e41d7f17932147ab78756f1bb2247a2554796d969741aff9060200160405180910390a250565b610743338383611023565b5050565b610752338484611023565b6040517f475d05700000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063475d05709061079b903390869086906004016117e7565b600060405180830381600087803b1580156107b557600080fd5b505af11580156107c9573d6000803e3d6000fd5b50505050505050565b6107433383836111ee565b6001546001600160a01b031633146108375760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b6107438282611100565b3360008181526003602090815260408083206001600160a01b038716845290915290205461074391908490610877908590611854565b611023565b6000546001600160a01b031633146108d65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661092c5760405162461bcd60e51b815260206004820152601e60248201527f4272696467652061646472657373206d757374206e6f74206265203078300000604482015260640161045c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe1694c0b21fdceff6411daed547c7463c2341b9695387bc82595b5b9b1851d4a9060200160405180910390a150565b6000546001600160a01b031633146109e75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6109f160006113af565b565b6001600160a01b03831660009081526003602090815260408083203384529091529020546000198114610aa35781811015610a965760405162461bcd60e51b815260206004820152602160248201527f5472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6360448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b610aa38433848403611023565b610aae8484846111ee565b50505050565b6001546001600160a01b03163314610b0e5760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b828114610b5d5760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b6000805b82811015610ba157838382818110610b7b57610b7b611789565b9050602002013582610b8d9190611854565b915080610b99816117b5565b915050610b61565b50610bac8682611100565b6040517f461c63730000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063461c637390610bf790889088908890889060040161186c565b600060405180830381600087803b158015610c1157600080fd5b505af1158015610c25573d6000803e3d6000fd5b50505050505050505050565b42841015610c815760405162461bcd60e51b815260206004820152601260248201527f5065726d697373696f6e20657870697265640000000000000000000000000000604482015260640161045c565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0811115610cf15760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202773272076616c75650000000000604482015260640161045c565b8260ff16601b1480610d0657508260ff16601c145b610d525760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202776272076616c75650000000000604482015260640161045c565b6000610d5c61058c565b6001600160a01b038916600090815260046020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92909190610daa836117b5565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610e3e9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610ea9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610edf5750886001600160a01b0316816001600160a01b0316145b610f2b5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161045c565b610f36898989611023565b505050505050505050565b6000546001600160a01b03163314610f9b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b0381166110175760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161045c565b611020816113af565b50565b6001600160a01b03821661109f5760405162461bcd60e51b815260206004820152602360248201527f43616e206e6f7420617070726f766520746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f2fe5e8e7796010737e636f63b35a0383dc160b68483984f2df987c78e842b405910160405180910390a3505050565b6001600160a01b03821630141561117f5760405162461bcd60e51b815260206004820152602160248201527f43616e206e6f7420696e6372656173652062616c616e636520666f722042616e60448201527f6b00000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b038216600090815260026020526040812080548392906111a7908490611854565b90915550506040518181526001600160a01b038316907f7a702e80a9c183a6ce9d6732991df2e914555ba35a364a70aed2433984e7544b9060200160405180910390a25050565b6001600160a01b0382166112505760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0382163014156112b55760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f207468652042616e6b206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0383166000908152600260205260409020548181101561131e5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161045c565b6001600160a01b03808516600090815260026020526040808220858503905591851681529081208054849290611355908490611854565b92505081905550826001600160a01b0316846001600160a01b03167f4163d0b06696468b3d7903f482bcd0097bd38a9a9086157479fd6c6561d24261846040516113a191815260200190565b60405180910390a350505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461142357600080fd5b919050565b6000806040838503121561143b57600080fd5b6114448361140c565b946020939093013593505050565b60008083601f84011261146457600080fd5b50813567ffffffffffffffff81111561147c57600080fd5b6020830191508360208260051b850101111561149757600080fd5b9250929050565b600080600080604085870312156114b457600080fd5b843567ffffffffffffffff808211156114cc57600080fd5b6114d888838901611452565b909650945060208701359150808211156114f157600080fd5b506114fe87828801611452565b95989497509550505050565b60006020828403121561151c57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561154e57600080fd5b6115578461140c565b925060208401359150604084013567ffffffffffffffff8082111561157b57600080fd5b818601915086601f83011261158f57600080fd5b8135818111156115a1576115a1611523565b604051601f8201601f19908116603f011681019083821181831017156115c9576115c9611523565b816040528281528960208487010111156115e257600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561161657600080fd5b61161f8261140c565b9392505050565b60008060006060848603121561163b57600080fd5b6116448461140c565b92506116526020850161140c565b9150604084013590509250925092565b60008060008060006060868803121561167a57600080fd5b6116838661140c565b9450602086013567ffffffffffffffff808211156116a057600080fd5b6116ac89838a01611452565b909650945060408801359150808211156116c557600080fd5b506116d288828901611452565b969995985093965092949392505050565b600080600080600080600060e0888a0312156116fe57600080fd5b6117078861140c565b96506117156020890161140c565b95506040880135945060608801359350608088013560ff8116811461173957600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561176957600080fd5b6117728361140c565b91506117806020840161140c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156117c9576117c961179f565b5060010190565b6000828210156117e2576117e261179f565b500390565b6001600160a01b038416815260006020848184015260606040840152835180606085015260005b8181101561182a5785810183015185820160800152820161180e565b8181111561183c576000608083870101525b50601f01601f19169290920160800195945050505050565b600082198211156118675761186761179f565b500190565b6040808252810184905260008560608301825b878110156118ad576001600160a01b036118988461140c565b1682526020928301929091019060010161187f565b5083810360208501528481527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8511156118e657600080fd5b8460051b91508186602083013760009101602001908152969550505050505056fea2646970667358221220cae4704685d99aebff9177755447341bf548e84a5ef0b127660f1cba3c4536ea64736f6c63430008090033",
|
|
538
|
+
"bytecode": "0x60c060405234801561001057600080fd5b5061001a336100f9565b466080526100f16040805180820182526009815268544254432042616e6b60b81b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b60a052610149565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805160a0516118bf61017c6000396000818161032d01526105b90152600081816102ce015261059001526118bf6000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806370a08231116100e3578063b4f94b2e1161008c578063dd62ed3e11610066578063dd62ed3e14610375578063e78cea92146103a0578063f2fde38b146103b357600080fd5b8063b4f94b2e14610328578063bb7e61bc1461034f578063d505accf1461036257600080fd5b8063771da5c5116100bd578063771da5c5146102c95780637c6db49c146102f05780638da5cb5b1461030357600080fd5b806370a082311461028157806370ae92d2146102a1578063715018a6146102c157600080fd5b806346b05e09116101455780635b86f5991161011f5780635b86f599146102485780635bfd99b91461025b5780636eb382121461026e57600080fd5b806346b05e091461020f5780634a38757e1461022257806356a6d9ef1461023557600080fd5b806330adf81f1161017657806330adf81f146101ba5780633644e515146101f4578063392aee43146101fc57600080fd5b80630b6d324c14610192578063266a123a146101a7575b600080fd5b6101a56101a036600461142b565b6103c6565b005b6101a56101b53660046114a1565b610477565b6101e17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040519081526020015b60405180910390f35b6101e161058c565b6101a561020a36600461150d565b6106dc565b6101a561021d36600461142b565b610738565b6101a5610230366004611526565b610747565b6101a561024336600461142b565b6107d5565b6101a561025636600461142b565b6107e0565b6101a561026936600461142b565b610844565b6101a561027c3660046115ad565b61087f565b6101e161028f3660046115ad565b60026020526000908152604090205481565b6101e16102af3660046115ad565b60046020526000908152604090205481565b6101a5610990565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a56102fe3660046115cf565b6109f6565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101eb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a561035d36600461160b565b610ab7565b6101a561037036600461168c565b610c34565b6101e16103833660046116ff565b600360209081526000928352604080842090915290825290205481565b600154610310906001600160a01b031681565b6101a56103c13660046115ad565b610f44565b3360009081526003602090815260408083206001600160a01b0386168452909152902054818110156104655760405162461bcd60e51b815260206004820152602d60248201527f43616e206e6f742064656372656173652062616c616e636520616c6c6f77616e60448201527f63652062656c6f77207a65726f0000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104723384848403611026565b505050565b6001546001600160a01b031633146104d15760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b8281146105205760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b60005b838110156105855761057385858381811061054057610540611732565b905060200201602081019061055591906115ad565b84848481811061056757610567611732565b90506020020135611103565b8061057d8161175e565b915050610523565b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156105db57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080518082018252600981527f544254432042616e6b000000000000000000000000000000000000000000000060209182015281518083018352600181527f31000000000000000000000000000000000000000000000000000000000000009082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b33600090815260026020526040812080548392906106fb908490611779565b909155505060405181815233907f9c6be7c4260e52ea2e41d7f17932147ab78756f1bb2247a2554796d969741aff9060200160405180910390a250565b610743338383611026565b5050565b610752338585611026565b6040517f475d05700000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063475d05709061079d903390879087908790600401611790565b600060405180830381600087803b1580156107b757600080fd5b505af11580156107cb573d6000803e3d6000fd5b5050505050505050565b6107433383836111f1565b6001546001600160a01b0316331461083a5760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b6107438282611103565b3360008181526003602090815260408083206001600160a01b03871684529091529020546107439190849061087a9085906117d6565b611026565b6000546001600160a01b031633146108d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661092f5760405162461bcd60e51b815260206004820152601e60248201527f4272696467652061646472657373206d757374206e6f74206265203078300000604482015260640161045c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe1694c0b21fdceff6411daed547c7463c2341b9695387bc82595b5b9b1851d4a9060200160405180910390a150565b6000546001600160a01b031633146109ea5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6109f460006113b2565b565b6001600160a01b03831660009081526003602090815260408083203384529091529020546000198114610aa65781811015610a995760405162461bcd60e51b815260206004820152602160248201527f5472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6360448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b610aa68433848403611026565b610ab18484846111f1565b50505050565b6001546001600160a01b03163314610b115760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b828114610b605760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b6000805b82811015610ba457838382818110610b7e57610b7e611732565b9050602002013582610b9091906117d6565b915080610b9c8161175e565b915050610b64565b50610baf8682611103565b6040517f461c63730000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063461c637390610bfa9088908890889088906004016117ee565b600060405180830381600087803b158015610c1457600080fd5b505af1158015610c28573d6000803e3d6000fd5b50505050505050505050565b42841015610c845760405162461bcd60e51b815260206004820152601260248201527f5065726d697373696f6e20657870697265640000000000000000000000000000604482015260640161045c565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0811115610cf45760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202773272076616c75650000000000604482015260640161045c565b8260ff16601b1480610d0957508260ff16601c145b610d555760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202776272076616c75650000000000604482015260640161045c565b6000610d5f61058c565b6001600160a01b038916600090815260046020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92909190610dad8361175e565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610e419291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610eac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610ee25750886001600160a01b0316816001600160a01b0316145b610f2e5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161045c565b610f39898989611026565b505050505050505050565b6000546001600160a01b03163314610f9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661101a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161045c565b611023816113b2565b50565b6001600160a01b0382166110a25760405162461bcd60e51b815260206004820152602360248201527f43616e206e6f7420617070726f766520746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f2fe5e8e7796010737e636f63b35a0383dc160b68483984f2df987c78e842b405910160405180910390a3505050565b6001600160a01b0382163014156111825760405162461bcd60e51b815260206004820152602160248201527f43616e206e6f7420696e6372656173652062616c616e636520666f722042616e60448201527f6b00000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b038216600090815260026020526040812080548392906111aa9084906117d6565b90915550506040518181526001600160a01b038316907f7a702e80a9c183a6ce9d6732991df2e914555ba35a364a70aed2433984e7544b9060200160405180910390a25050565b6001600160a01b0382166112535760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0382163014156112b85760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f207468652042616e6b206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b038316600090815260026020526040902054818110156113215760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161045c565b6001600160a01b038085166000908152600260205260408082208585039055918516815290812080548492906113589084906117d6565b92505081905550826001600160a01b0316846001600160a01b03167f4163d0b06696468b3d7903f482bcd0097bd38a9a9086157479fd6c6561d24261846040516113a491815260200190565b60405180910390a350505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461142657600080fd5b919050565b6000806040838503121561143e57600080fd5b6114478361140f565b946020939093013593505050565b60008083601f84011261146757600080fd5b50813567ffffffffffffffff81111561147f57600080fd5b6020830191508360208260051b850101111561149a57600080fd5b9250929050565b600080600080604085870312156114b757600080fd5b843567ffffffffffffffff808211156114cf57600080fd5b6114db88838901611455565b909650945060208701359150808211156114f457600080fd5b5061150187828801611455565b95989497509550505050565b60006020828403121561151f57600080fd5b5035919050565b6000806000806060858703121561153c57600080fd5b6115458561140f565b935060208501359250604085013567ffffffffffffffff8082111561156957600080fd5b818701915087601f83011261157d57600080fd5b81358181111561158c57600080fd5b88602082850101111561159e57600080fd5b95989497505060200194505050565b6000602082840312156115bf57600080fd5b6115c88261140f565b9392505050565b6000806000606084860312156115e457600080fd5b6115ed8461140f565b92506115fb6020850161140f565b9150604084013590509250925092565b60008060008060006060868803121561162357600080fd5b61162c8661140f565b9450602086013567ffffffffffffffff8082111561164957600080fd5b61165589838a01611455565b9096509450604088013591508082111561166e57600080fd5b5061167b88828901611455565b969995985093965092949392505050565b600080600080600080600060e0888a0312156116a757600080fd5b6116b08861140f565b96506116be6020890161140f565b95506040880135945060608801359350608088013560ff811681146116e257600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561171257600080fd5b61171b8361140f565b91506117296020840161140f565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561177257611772611748565b5060010190565b60008282101561178b5761178b611748565b500390565b6001600160a01b038516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b600082198211156117e9576117e9611748565b500190565b6040808252810184905260008560608301825b8781101561182f576001600160a01b0361181a8461140f565b16825260209283019290910190600101611801565b5083810360208501528481527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85111561186857600080fd5b8460051b91508186602083013760009101602001908152969550505050505056fea264697066735822122073c4472895358b2938892bf5f89f9928607594b2bd51aada78b5cdf9216fe04864736f6c63430008090033",
|
|
539
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c806370a08231116100e3578063b4f94b2e1161008c578063dd62ed3e11610066578063dd62ed3e14610375578063e78cea92146103a0578063f2fde38b146103b357600080fd5b8063b4f94b2e14610328578063bb7e61bc1461034f578063d505accf1461036257600080fd5b8063771da5c5116100bd578063771da5c5146102c95780637c6db49c146102f05780638da5cb5b1461030357600080fd5b806370a082311461028157806370ae92d2146102a1578063715018a6146102c157600080fd5b806346b05e09116101455780635b86f5991161011f5780635b86f599146102485780635bfd99b91461025b5780636eb382121461026e57600080fd5b806346b05e091461020f5780634a38757e1461022257806356a6d9ef1461023557600080fd5b806330adf81f1161017657806330adf81f146101ba5780633644e515146101f4578063392aee43146101fc57600080fd5b80630b6d324c14610192578063266a123a146101a7575b600080fd5b6101a56101a036600461142b565b6103c6565b005b6101a56101b53660046114a1565b610477565b6101e17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6040519081526020015b60405180910390f35b6101e161058c565b6101a561020a36600461150d565b6106dc565b6101a561021d36600461142b565b610738565b6101a5610230366004611526565b610747565b6101a561024336600461142b565b6107d5565b6101a561025636600461142b565b6107e0565b6101a561026936600461142b565b610844565b6101a561027c3660046115ad565b61087f565b6101e161028f3660046115ad565b60026020526000908152604090205481565b6101e16102af3660046115ad565b60046020526000908152604090205481565b6101a5610990565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a56102fe3660046115cf565b6109f6565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101eb565b6101e17f000000000000000000000000000000000000000000000000000000000000000081565b6101a561035d36600461160b565b610ab7565b6101a561037036600461168c565b610c34565b6101e16103833660046116ff565b600360209081526000928352604080842090915290825290205481565b600154610310906001600160a01b031681565b6101a56103c13660046115ad565b610f44565b3360009081526003602090815260408083206001600160a01b0386168452909152902054818110156104655760405162461bcd60e51b815260206004820152602d60248201527f43616e206e6f742064656372656173652062616c616e636520616c6c6f77616e60448201527f63652062656c6f77207a65726f0000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104723384848403611026565b505050565b6001546001600160a01b031633146104d15760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b8281146105205760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b60005b838110156105855761057385858381811061054057610540611732565b905060200201602081019061055591906115ad565b84848481811061056757610567611732565b90506020020135611103565b8061057d8161175e565b915050610523565b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614156105db57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080518082018252600981527f544254432042616e6b000000000000000000000000000000000000000000000060209182015281518083018352600181527f31000000000000000000000000000000000000000000000000000000000000009082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fa1cc9cffb2f2444066e5c95caef7925ee7ef97efc6002db29d3637e98e2f0dd2818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b33600090815260026020526040812080548392906106fb908490611779565b909155505060405181815233907f9c6be7c4260e52ea2e41d7f17932147ab78756f1bb2247a2554796d969741aff9060200160405180910390a250565b610743338383611026565b5050565b610752338585611026565b6040517f475d05700000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063475d05709061079d903390879087908790600401611790565b600060405180830381600087803b1580156107b757600080fd5b505af11580156107cb573d6000803e3d6000fd5b5050505050505050565b6107433383836111f1565b6001546001600160a01b0316331461083a5760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b6107438282611103565b3360008181526003602090815260408083206001600160a01b03871684529091529020546107439190849061087a9085906117d6565b611026565b6000546001600160a01b031633146108d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661092f5760405162461bcd60e51b815260206004820152601e60248201527f4272696467652061646472657373206d757374206e6f74206265203078300000604482015260640161045c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fe1694c0b21fdceff6411daed547c7463c2341b9695387bc82595b5b9b1851d4a9060200160405180910390a150565b6000546001600160a01b031633146109ea5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6109f460006113b2565b565b6001600160a01b03831660009081526003602090815260408083203384529091529020546000198114610aa65781811015610a995760405162461bcd60e51b815260206004820152602160248201527f5472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6360448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b610aa68433848403611026565b610ab18484846111f1565b50505050565b6001546001600160a01b03163314610b115760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420746865206272696467650000000000000000604482015260640161045c565b828114610b605760405162461bcd60e51b815260206004820181905260248201527f417272617973206d7573742068617665207468652073616d65206c656e677468604482015260640161045c565b6000805b82811015610ba457838382818110610b7e57610b7e611732565b9050602002013582610b9091906117d6565b915080610b9c8161175e565b915050610b64565b50610baf8682611103565b6040517f461c63730000000000000000000000000000000000000000000000000000000081526001600160a01b0387169063461c637390610bfa9088908890889088906004016117ee565b600060405180830381600087803b158015610c1457600080fd5b505af1158015610c28573d6000803e3d6000fd5b50505050505050505050565b42841015610c845760405162461bcd60e51b815260206004820152601260248201527f5065726d697373696f6e20657870697265640000000000000000000000000000604482015260640161045c565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0811115610cf45760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202773272076616c75650000000000604482015260640161045c565b8260ff16601b1480610d0957508260ff16601c145b610d555760405162461bcd60e51b815260206004820152601b60248201527f496e76616c6964207369676e6174757265202776272076616c75650000000000604482015260640161045c565b6000610d5f61058c565b6001600160a01b038916600090815260046020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928c928c928c92909190610dad8361175e565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610e419291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610eac573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610ee25750886001600160a01b0316816001600160a01b0316145b610f2e5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161045c565b610f39898989611026565b505050505050505050565b6000546001600160a01b03163314610f9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811661101a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161045c565b611023816113b2565b50565b6001600160a01b0382166110a25760405162461bcd60e51b815260206004820152602360248201527f43616e206e6f7420617070726f766520746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f2fe5e8e7796010737e636f63b35a0383dc160b68483984f2df987c78e842b405910160405180910390a3505050565b6001600160a01b0382163014156111825760405162461bcd60e51b815260206004820152602160248201527f43616e206e6f7420696e6372656173652062616c616e636520666f722042616e60448201527f6b00000000000000000000000000000000000000000000000000000000000000606482015260840161045c565b6001600160a01b038216600090815260026020526040812080548392906111aa9084906117d6565b90915550506040518181526001600160a01b038316907f7a702e80a9c183a6ce9d6732991df2e914555ba35a364a70aed2433984e7544b9060200160405180910390a25050565b6001600160a01b0382166112535760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b0382163014156112b85760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f74207472616e7366657220746f207468652042616e6b206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b038316600090815260026020526040902054818110156113215760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161045c565b6001600160a01b038085166000908152600260205260408082208585039055918516815290812080548492906113589084906117d6565b92505081905550826001600160a01b0316846001600160a01b03167f4163d0b06696468b3d7903f482bcd0097bd38a9a9086157479fd6c6561d24261846040516113a491815260200190565b60405180910390a350505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461142657600080fd5b919050565b6000806040838503121561143e57600080fd5b6114478361140f565b946020939093013593505050565b60008083601f84011261146757600080fd5b50813567ffffffffffffffff81111561147f57600080fd5b6020830191508360208260051b850101111561149a57600080fd5b9250929050565b600080600080604085870312156114b757600080fd5b843567ffffffffffffffff808211156114cf57600080fd5b6114db88838901611455565b909650945060208701359150808211156114f457600080fd5b5061150187828801611455565b95989497509550505050565b60006020828403121561151f57600080fd5b5035919050565b6000806000806060858703121561153c57600080fd5b6115458561140f565b935060208501359250604085013567ffffffffffffffff8082111561156957600080fd5b818701915087601f83011261157d57600080fd5b81358181111561158c57600080fd5b88602082850101111561159e57600080fd5b95989497505060200194505050565b6000602082840312156115bf57600080fd5b6115c88261140f565b9392505050565b6000806000606084860312156115e457600080fd5b6115ed8461140f565b92506115fb6020850161140f565b9150604084013590509250925092565b60008060008060006060868803121561162357600080fd5b61162c8661140f565b9450602086013567ffffffffffffffff8082111561164957600080fd5b61165589838a01611455565b9096509450604088013591508082111561166e57600080fd5b5061167b88828901611455565b969995985093965092949392505050565b600080600080600080600060e0888a0312156116a757600080fd5b6116b08861140f565b96506116be6020890161140f565b95506040880135945060608801359350608088013560ff811681146116e257600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561171257600080fd5b61171b8361140f565b91506117296020840161140f565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561177257611772611748565b5060010190565b60008282101561178b5761178b611748565b500390565b6001600160a01b038516815283602082015260606040820152816060820152818360808301376000818301608090810191909152601f909201601f191601019392505050565b600082198211156117e9576117e9611748565b500190565b6040808252810184905260008560608301825b8781101561182f576001600160a01b0361181a8461140f565b16825260209283019290910190600101611801565b5083810360208501528481527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85111561186857600080fd5b8460051b91508186602083013760009101602001908152969550505050505056fea264697066735822122073c4472895358b2938892bf5f89f9928607594b2bd51aada78b5cdf9216fe04864736f6c63430008090033",
|
|
540
540
|
"linkReferences": {},
|
|
541
541
|
"deployedLinkReferences": {}
|
|
542
542
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"contractName": "BitcoinTx",
|
|
4
4
|
"sourceName": "contracts/bridge/BitcoinTx.sol",
|
|
5
5
|
"abi": [],
|
|
6
|
-
"bytecode": "
|
|
7
|
-
"deployedBytecode": "
|
|
6
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220859c0bd8a513718aefb371dbcc1d8995fa266e02e96de41acaba9edd4bf41b7f64736f6c63430008090033",
|
|
7
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220859c0bd8a513718aefb371dbcc1d8995fa266e02e96de41acaba9edd4bf41b7f64736f6c63430008090033",
|
|
8
8
|
"linkReferences": {},
|
|
9
9
|
"deployedLinkReferences": {}
|
|
10
10
|
}
|