Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- BFS
- Optimization enabled
- false
- Compiler version
- v0.8.17+commit.8df45f5f
- Verified at
- 2023-07-05T02:30:07.367938Z
contracts/Storage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./interfaces/IStorage.sol";
error FileExists();
error InvalidURI();
error InvalidBfsResult();
contract BFS is IBFS, Initializable {
using Counters for Counters.Counter;
using EnumerableSet for EnumerableSet.AddressSet;
Counters.Counter private idCounter;
mapping(address => mapping(string => mapping(uint256 => bytes))) public dataStorage;
mapping(address => mapping(string => uint256)) public chunks; // max chunk index
mapping(address => mapping(string => uint256)) public bfsId;
mapping(address => string[]) public filenames;
EnumerableSet.AddressSet addresses;
// event FileStored(address indexed addr, string filename, uint256 chunkIndex, uint256 indexed bfsId, string uri);
function initialize() public initializer {
idCounter.increment(); // start from 1
}
function store(string memory filename, uint256 chunkIndex, bytes memory _data) external {
if (dataStorage[msg.sender][filename][chunkIndex].length > 0) {
revert FileExists();
}
dataStorage[msg.sender][filename][chunkIndex] = _data;
if (chunks[msg.sender][filename] < chunkIndex) {
chunks[msg.sender][filename] = chunkIndex;
}
bfsId[msg.sender][filename] = idCounter.current();
idCounter.increment();
if (chunkIndex == 0) {
filenames[msg.sender].push(filename);
addresses.add(msg.sender);
}
string memory uri = string.concat(
"bfs://",
Strings.toString(block.chainid),
"/",
Strings.toHexString(address(this)),
"/",
Strings.toHexString(msg.sender),
"/",
filename
);
emit FileStored(msg.sender, filename, chunkIndex, bfsId[msg.sender][filename], uri);
}
function load(address addr, string memory filename, uint256 chunkIndex) public view returns (bytes memory, int256) {
uint256 temp = chunkIndex + 1;
int256 nextChunk = (temp > chunks[addr][filename]) ? -1 : int256(temp);
return (dataStorage[addr][filename][chunkIndex], nextChunk);
}
function loadWithUri(string memory uri, uint256 chunkIndex) public view returns (bytes memory, int256) {
// uri: bfs://chainId/contractAddress/address/filename
bytes memory uriBytes = bytes(uri);
bytes memory expectedPrefix = bytes(string.concat("bfs://", Strings.toString(block.chainid), "/"));
uint256 prefixLen = expectedPrefix.length;
if (uriBytes.length < prefixLen + 86) revert InvalidURI();
if (uriBytes[prefixLen + 42] != bytes1('/')) revert InvalidURI();
if (uriBytes[prefixLen + 86 - 1] != bytes1('/')) revert InvalidURI();
for (uint i = 0; i < prefixLen; i++) {
if (uriBytes[i] != expectedPrefix[i]) revert InvalidURI();
}
bytes memory contractAddressBytes = new bytes(42);
for (uint i = 0; i < 42; i++) {
contractAddressBytes[i] = uriBytes[i + prefixLen];
}
address contractAddress = addressFromHexString(string(contractAddressBytes));
bytes memory addressBytes = new bytes(42);
for (uint i = 0; i < 42; i++) {
addressBytes[i] = uriBytes[i + prefixLen + 42 + 1];
}
address addr = addressFromHexString(string(addressBytes));
bytes memory filenameBytes = new bytes(uriBytes.length - (prefixLen + 86));
for (uint i = 0; i < uriBytes.length - (prefixLen + 86); i++) {
filenameBytes[i] = uriBytes[i + (prefixLen + 86)];
}
string memory filename = string(filenameBytes);
bytes memory callData = abi.encodeWithSignature("load(address,string,uint256)", addr, filename, chunkIndex);
(bool success, bytes memory returnData) = contractAddress.staticcall(callData);
if (!success) revert InvalidBfsResult();
(bytes memory data, int256 nextChunk) = abi.decode(returnData, (bytes, int256));
return (data, nextChunk);
}
function loadFile(address addr, string memory filename) public view returns (bytes memory) {
bytes memory data;
bytes memory fullData = new bytes(0);
uint256 maxInd = chunks[addr][filename];
for (uint256 i = 0; i <= maxInd; i++) {
data = dataStorage[addr][filename][i];
fullData = abi.encodePacked(fullData, data);
}
return fullData;
}
function loadFileWithUri(string memory uri) public view returns (bytes memory) {
bytes memory uriBytes = bytes(uri);
bytes memory expectedPrefix = bytes(string.concat("bfs://", Strings.toString(block.chainid), "/"));
uint256 prefixLen = expectedPrefix.length;
if (uriBytes.length < prefixLen + 86) revert InvalidURI();
if (uriBytes[prefixLen + 42] != bytes1('/')) revert InvalidURI();
if (uriBytes[prefixLen + 86 - 1] != bytes1('/')) revert InvalidURI();
for (uint i = 0; i < prefixLen; i++) {
if (uriBytes[i] != expectedPrefix[i]) revert InvalidURI();
}
bytes memory contractAddressBytes = new bytes(42);
for (uint i = 0; i < 42; i++) {
contractAddressBytes[i] = uriBytes[i + prefixLen];
}
address contractAddress = addressFromHexString(string(contractAddressBytes));
bytes memory addressBytes = new bytes(42);
for (uint i = 0; i < 42; i++) {
addressBytes[i] = uriBytes[i + prefixLen + 42 + 1];
}
address addr = addressFromHexString(string(addressBytes));
bytes memory filenameBytes = new bytes(uriBytes.length - (prefixLen + 86));
for (uint i = 0; i < uriBytes.length - (prefixLen + 86); i++) {
filenameBytes[i] = uriBytes[i + (prefixLen + 86)];
}
string memory filename = string(filenameBytes);
int256 chunkIndex = 0;
bytes memory data;
bytes memory fullData = new bytes(0);
while (chunkIndex >= 0) {
bytes memory callData = abi.encodeWithSignature("load(address,string,uint256)", addr, filename, uint256(chunkIndex));
(bool success, bytes memory returnData) = contractAddress.staticcall(callData);
if (!success) revert InvalidBfsResult();
(data, chunkIndex) = abi.decode(returnData, (bytes, int256));
fullData = abi.encodePacked(fullData, data);
}
return fullData;
}
function count(address addr, string memory filename) public view returns (uint256) {
return chunks[addr][filename];
}
function getId(address addr, string memory filename) public view returns (uint256) {
return bfsId[addr][filename];
}
function getAllAddresses() public view returns (address[] memory) {
return addresses.values();
}
function getAllFilenames(address addr) public view returns (string[] memory) {
return filenames[addr];
}
function addressFromHexString(string memory hexStr) internal pure returns (address) {
bytes memory bytesString = bytes(hexStr);
uint160 addr;
for (uint i = 2; i < bytesString.length; i++) {
uint160 c = uint160(uint8(bytesString[i]));
if (c >= 48 && c <= 57) {
addr = addr * 16 + (c - 48);
}
if (c >= 65 && c <= 70) {
addr = addr * 16 + (c - 55);
}
if (c >= 97 && c <= 102) {
addr = addr * 16 + (c - 87);
}
}
return address(bytes20(addr));
}
}
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/contracts/utils/Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
@openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}
@openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
@openzeppelin/contracts/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
@openzeppelin/contracts/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}
contracts/interfaces/IStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// interface for the contract
interface IBFS {
event FileStored(address indexed addr, string filename, uint256 chunkIndex, uint256 indexed bfsId, string uri);
function store(string memory filename, uint256 chunkIndex, bytes memory _data) external;
function load(address addr, string memory filename, uint256 chunkIndex) external view returns (bytes memory, int256);
function count(address addr, string memory filename) external view returns (uint256);
function getId(address addr, string memory filename) external view returns (uint256);
function filenames(address addr, uint256 i) external view returns (string memory);
function getAllAddresses() external view returns (address[] memory);
function getAllFilenames(address addr) external view returns (string[] memory);
function loadWithUri(string memory uri, uint256 chunkIndex) external view returns (bytes memory, int256);
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"london"}
Contract ABI
[{"type":"error","name":"FileExists","inputs":[]},{"type":"error","name":"InvalidBfsResult","inputs":[]},{"type":"error","name":"InvalidURI","inputs":[]},{"type":"event","name":"FileStored","inputs":[{"type":"address","name":"addr","internalType":"address","indexed":true},{"type":"string","name":"filename","internalType":"string","indexed":false},{"type":"uint256","name":"chunkIndex","internalType":"uint256","indexed":false},{"type":"uint256","name":"bfsId","internalType":"uint256","indexed":true},{"type":"string","name":"uri","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bfsId","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"chunks","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"count","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"string","name":"filename","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"dataStorage","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"string","name":"","internalType":"string"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"filenames","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getAllAddresses","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"","internalType":"string[]"}],"name":"getAllFilenames","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getId","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"string","name":"filename","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"},{"type":"int256","name":"","internalType":"int256"}],"name":"load","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"string","name":"filename","internalType":"string"},{"type":"uint256","name":"chunkIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"loadFile","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"string","name":"filename","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"loadFileWithUri","inputs":[{"type":"string","name":"uri","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"},{"type":"int256","name":"","internalType":"int256"}],"name":"loadWithUri","inputs":[{"type":"string","name":"uri","internalType":"string"},{"type":"uint256","name":"chunkIndex","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"store","inputs":[{"type":"string","name":"filename","internalType":"string"},{"type":"uint256","name":"chunkIndex","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50613b04806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a0e567641161008c578063bf1450df11610066578063bf1450df14610285578063c9b09659146102b5578063d92e741e146102e5578063e0f64a3814610315576100ea565b8063a0e56764146101f3578063abb1521914610224578063ba67e64114610255576100ea565b806385273a90116100c857806385273a90146101595780638a5ca90b14610189578063928a4b3e146101b95780639516a104146101d5576100ea565b8063591070c4146100ef578063682f6b9f1461011f5780638129fc1c1461014f575b600080fd5b61010960048036038101906101049190612863565b610345565b604051610116919061292b565b60405180910390f35b610139600480360381019061013491906129ab565b610b2f565b604051610146919061292b565b60405180910390f35b610157610d28565b005b610173600480360381019061016e91906129ab565b610e68565b6040516101809190612a20565b60405180910390f35b6101a3600480360381019061019e91906129ab565b610ea3565b6040516101b09190612a20565b60405180910390f35b6101d360048036038101906101ce9190612b08565b610f09565b005b6101dd6112f3565b6040516101ea9190612c51565b60405180910390f35b61020d60048036038101906102089190612c73565b611304565b60405161021b929190612cfb565b60405180910390f35b61023e60048036038101906102399190612d2b565b6114ad565b60405161024c929190612cfb565b60405180910390f35b61026f600480360381019061026a91906129ab565b611c14565b60405161027c9190612a20565b60405180910390f35b61029f600480360381019061029a9190612d87565b611c7a565b6040516102ac9190612ecb565b60405180910390f35b6102cf60048036038101906102ca9190612eed565b611d92565b6040516102dc9190612f77565b60405180910390f35b6102ff60048036038101906102fa9190612c73565b611e4b565b60405161030c919061292b565b60405180910390f35b61032f600480360381019061032a91906129ab565b611f1b565b60405161033c9190612a20565b60405180910390f35b60606000829050600061035746611f56565b6040516020016103679190613021565b604051602081830303815290604052905060008151905060568161038b9190613085565b835110156103c5576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191683602a836104169190613085565b81518110610427576104266130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461048b576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168360016056846104de9190613085565b6104e891906130e8565b815181106104f9576104f86130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461055d576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156106325782818151811061057b5761057a6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106105bb576105ba6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461061f576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808061062a9061311c565b915050610560565b506000602a67ffffffffffffffff8111156106505761064f612738565b5b6040519080825280601f01601f1916602001820160405280156106825781602001600182028036833780820191505090505b50905060005b602a81101561070f5784838261069e9190613085565b815181106106af576106ae6130b9565b5b602001015160f81c60f81b8282815181106106cd576106cc6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806107079061311c565b915050610688565b50600061071b82612024565b90506000602a67ffffffffffffffff81111561073a57610739612738565b5b6040519080825280601f01601f19166020018201604052801561076c5781602001600182028036833780820191505090505b50905060005b602a81101561081157866001602a878461078c9190613085565b6107969190613085565b6107a09190613085565b815181106107b1576107b06130b9565b5b602001015160f81c60f81b8282815181106107cf576107ce6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806108099061311c565b915050610772565b50600061081d82612024565b9050600060568661082e9190613085565b885161083a91906130e8565b67ffffffffffffffff81111561085357610852612738565b5b6040519080825280601f01601f1916602001820160405280156108855781602001600182028036833780820191505090505b50905060005b6056876108989190613085565b89516108a491906130e8565b81101561093557886056886108b99190613085565b826108c49190613085565b815181106108d5576108d46130b9565b5b602001015160f81c60f81b8282815181106108f3576108f26130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061092d9061311c565b91505061088b565b5060008190506000606060008067ffffffffffffffff81111561095b5761095a612738565b5b6040519080825280601f01601f19166020018201604052801561098d5781602001600182028036833780820191505090505b5090505b60008312610b1b5760008685856040516024016109b093929190613173565b6040516020818303038152906040527fa0e56764000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000808a73ffffffffffffffffffffffffffffffffffffffff1683604051610a5791906131ed565b600060405180830381855afa9150503d8060008114610a92576040519150601f19603f3d011682016040523d82523d6000602084013e610a97565b606091505b509150915081610ad3576040517f3e0e1f0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806020019051810190610ae791906132a0565b80975081965050508385604051602001610b029291906132fc565b6040516020818303038152906040529350505050610991565b809c50505050505050505050505050919050565b60608060008067ffffffffffffffff811115610b4e57610b4d612738565b5b6040519080825280601f01601f191660200182016040528015610b805781602001600182028036833780820191505090505b5090506000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002085604051610bd29190613320565b908152602001604051809103902054905060005b818111610d1b57600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086604051610c3a9190613320565b908152602001604051809103902060008281526020019081526020016000208054610c6490613366565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9090613366565b8015610cdd5780601f10610cb257610100808354040283529160200191610cdd565b820191906000526020600020905b815481529060010190602001808311610cc057829003601f168201915b505050505093508284604051602001610cf79291906132fc565b60405160208183030381529060405292508080610d139061311c565b915050610be6565b5081935050505092915050565b60008060019054906101000a900460ff16159050808015610d595750600160008054906101000a900460ff1660ff16105b80610d865750610d68306121c6565b158015610d855750600160008054906101000a900460ff1660ff16145b5b610dc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbc90613409565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610e02576001600060016101000a81548160ff0219169083151502179055505b610e0c60016121e9565b8015610e655760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610e5c919061347b565b60405180910390a15b50565b600360205281600052604060002081805160208101820180518482526020830160208501208183528095505050505050600091509150505481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051610ef29190613320565b908152602001604051809103902054905092915050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084604051610f589190613320565b908152602001604051809103902060008481526020019081526020016000208054610f8290613366565b90501115610fbc576040517f26a5c59b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460405161100a9190613320565b9081526020016040518091039020600084815260200190815260200160002090816110359190613638565b5081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516110849190613320565b90815260200160405180910390205410156110fa5781600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516110e79190613320565b9081526020016040518091039020819055505b61110460016121ff565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516111519190613320565b90815260200160405180910390208190555061116d60016121e9565b600082036111fd57600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915090816111e69190613765565b506111fb33600661220d90919063ffffffff16565b505b600061120846611f56565b6112113061223d565b61121a3361223d565b8660405160200161122e9493929190613837565b6040516020818303038152906040529050600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460405161128c9190613320565b9081526020016040518091039020543373ffffffffffffffffffffffffffffffffffffffff167f3570439426bde556b3a1036679abf502ade483de5bc63fe5578a687650c96bdd8686856040516112e5939291906138b1565b60405180910390a350505050565b60606112ff600661226a565b905090565b60606000806001846113169190613085565b90506000600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113679190613320565b908152602001604051809103902054821161138257816113a4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b9050600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113f39190613320565b908152602001604051809103902060008681526020019081526020016000208181805461141f90613366565b80601f016020809104026020016040519081016040528092919081815260200182805461144b90613366565b80156114985780601f1061146d57610100808354040283529160200191611498565b820191906000526020600020905b81548152906001019060200180831161147b57829003601f168201915b50505050509150935093505050935093915050565b606060008084905060006114c046611f56565b6040516020016114d09190613021565b60405160208183030381529060405290506000815190506056816114f49190613085565b8351101561152e576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191683602a8361157f9190613085565b815181106115905761158f6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146115f4576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168360016056846116479190613085565b61165191906130e8565b81518110611662576116616130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146116c6576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561179b578281815181106116e4576116e36130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110611724576117236130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611788576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806117939061311c565b9150506116c9565b506000602a67ffffffffffffffff8111156117b9576117b8612738565b5b6040519080825280601f01601f1916602001820160405280156117eb5781602001600182028036833780820191505090505b50905060005b602a811015611878578483826118079190613085565b81518110611818576118176130b9565b5b602001015160f81c60f81b828281518110611836576118356130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806118709061311c565b9150506117f1565b50600061188482612024565b90506000602a67ffffffffffffffff8111156118a3576118a2612738565b5b6040519080825280601f01601f1916602001820160405280156118d55781602001600182028036833780820191505090505b50905060005b602a81101561197a57866001602a87846118f59190613085565b6118ff9190613085565b6119099190613085565b8151811061191a576119196130b9565b5b602001015160f81c60f81b828281518110611938576119376130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806119729061311c565b9150506118db565b50600061198682612024565b905060006056866119979190613085565b88516119a391906130e8565b67ffffffffffffffff8111156119bc576119bb612738565b5b6040519080825280601f01601f1916602001820160405280156119ee5781602001600182028036833780820191505090505b50905060005b605687611a019190613085565b8951611a0d91906130e8565b811015611a9e5788605688611a229190613085565b82611a2d9190613085565b81518110611a3e57611a3d6130b9565b5b602001015160f81c60f81b828281518110611a5c57611a5b6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611a969061311c565b9150506119f4565b506000819050600083828e604051602401611abb93929190613173565b6040516020818303038152906040527fa0e56764000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000808773ffffffffffffffffffffffffffffffffffffffff1683604051611b6291906131ed565b600060405180830381855afa9150503d8060008114611b9d576040519150601f19603f3d011682016040523d82523d6000602084013e611ba2565b606091505b509150915081611bde576040517f3e0e1f0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008082806020019051810190611bf591906132a0565b9150915081819f509f5050505050505050505050505050509250929050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051611c639190613320565b908152602001604051809103902054905092915050565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611d87578382906000526020600020018054611cfa90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611d2690613366565b8015611d735780601f10611d4857610100808354040283529160200191611d73565b820191906000526020600020905b815481529060010190602001808311611d5657829003601f168201915b505050505081526020019060010190611cdb565b505050509050919050565b60056020528160005260406000208181548110611dae57600080fd5b90600052602060002001600091509150508054611dca90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611df690613366565b8015611e435780601f10611e1857610100808354040283529160200191611e43565b820191906000526020600020905b815481529060010190602001808311611e2657829003601f168201915b505050505081565b60026020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050508054611e9a90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611ec690613366565b8015611f135780601f10611ee857610100808354040283529160200191611f13565b820191906000526020600020905b815481529060010190602001808311611ef657829003601f168201915b505050505081565b600460205281600052604060002081805160208101820180518482526020830160208501208183528095505050505050600091509150505481565b606060006001611f658461228b565b01905060008167ffffffffffffffff811115611f8457611f83612738565b5b6040519080825280601f01601f191660200182016040528015611fb65781602001600182028036833780820191505090505b509050600082602001820190505b600115612019578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161200d5761200c6138f6565b5b04945060008503611fc4575b819350505050919050565b600080829050600080600290505b82518110156121b55760008382815181106120505761204f6130b9565b5b602001015160f81c60f81b60f81c60ff16905060308173ffffffffffffffffffffffffffffffffffffffff16101580156120a1575060398173ffffffffffffffffffffffffffffffffffffffff1611155b156120cd576030816120b39190613925565b6010846120c0919061396d565b6120ca91906139af565b92505b60418173ffffffffffffffffffffffffffffffffffffffff161015801561210b575060468173ffffffffffffffffffffffffffffffffffffffff1611155b156121375760378161211d9190613925565b60108461212a919061396d565b61213491906139af565b92505b60618173ffffffffffffffffffffffffffffffffffffffff1610158015612175575060668173ffffffffffffffffffffffffffffffffffffffff1611155b156121a1576057816121879190613925565b601084612194919061396d565b61219e91906139af565b92505b5080806121ad9061311c565b915050612032565b508060601b60601c92505050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6001816000016000828254019250508190555050565b600081600001549050919050565b6000612235836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6123de565b905092915050565b60606122638273ffffffffffffffffffffffffffffffffffffffff16601460ff1661244e565b9050919050565b6060600061227a8360000161268a565b905060608190508092505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106122e9577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816122df576122de6138f6565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612326576d04ee2d6d415b85acef8100000000838161231c5761231b6138f6565b5b0492506020810190505b662386f26fc10000831061235557662386f26fc10000838161234b5761234a6138f6565b5b0492506010810190505b6305f5e100831061237e576305f5e1008381612374576123736138f6565b5b0492506008810190505b61271083106123a3576127108381612399576123986138f6565b5b0492506004810190505b606483106123c657606483816123bc576123bb6138f6565b5b0492506002810190505b600a83106123d5576001810190505b80915050919050565b60006123ea83836126e6565b612443578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612448565b600090505b92915050565b60606000600283600261246191906139f7565b61246b9190613085565b67ffffffffffffffff81111561248457612483612738565b5b6040519080825280601f01601f1916602001820160405280156124b65781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106124ee576124ed6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612552576125516130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261259291906139f7565b61259c9190613085565b90505b600181111561263c577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106125de576125dd6130b9565b5b1a60f81b8282815181106125f5576125f46130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061263590613a39565b905061259f565b5060008414612680576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267790613aae565b60405180910390fd5b8091505092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156126da57602002820191906000526020600020905b8154815260200190600101908083116126c6575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61277082612727565b810181811067ffffffffffffffff8211171561278f5761278e612738565b5b80604052505050565b60006127a2612709565b90506127ae8282612767565b919050565b600067ffffffffffffffff8211156127ce576127cd612738565b5b6127d782612727565b9050602081019050919050565b82818337600083830152505050565b6000612806612801846127b3565b612798565b90508281526020810184848401111561282257612821612722565b5b61282d8482856127e4565b509392505050565b600082601f83011261284a5761284961271d565b5b813561285a8482602086016127f3565b91505092915050565b60006020828403121561287957612878612713565b5b600082013567ffffffffffffffff81111561289757612896612718565b5b6128a384828501612835565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156128e65780820151818401526020810190506128cb565b60008484015250505050565b60006128fd826128ac565b61290781856128b7565b93506129178185602086016128c8565b61292081612727565b840191505092915050565b6000602082019050818103600083015261294581846128f2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006129788261294d565b9050919050565b6129888161296d565b811461299357600080fd5b50565b6000813590506129a58161297f565b92915050565b600080604083850312156129c2576129c1612713565b5b60006129d085828601612996565b925050602083013567ffffffffffffffff8111156129f1576129f0612718565b5b6129fd85828601612835565b9150509250929050565b6000819050919050565b612a1a81612a07565b82525050565b6000602082019050612a356000830184612a11565b92915050565b612a4481612a07565b8114612a4f57600080fd5b50565b600081359050612a6181612a3b565b92915050565b600067ffffffffffffffff821115612a8257612a81612738565b5b612a8b82612727565b9050602081019050919050565b6000612aab612aa684612a67565b612798565b905082815260208101848484011115612ac757612ac6612722565b5b612ad28482856127e4565b509392505050565b600082601f830112612aef57612aee61271d565b5b8135612aff848260208601612a98565b91505092915050565b600080600060608486031215612b2157612b20612713565b5b600084013567ffffffffffffffff811115612b3f57612b3e612718565b5b612b4b86828701612835565b9350506020612b5c86828701612a52565b925050604084013567ffffffffffffffff811115612b7d57612b7c612718565b5b612b8986828701612ada565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612bc88161296d565b82525050565b6000612bda8383612bbf565b60208301905092915050565b6000602082019050919050565b6000612bfe82612b93565b612c088185612b9e565b9350612c1383612baf565b8060005b83811015612c44578151612c2b8882612bce565b9750612c3683612be6565b925050600181019050612c17565b5085935050505092915050565b60006020820190508181036000830152612c6b8184612bf3565b905092915050565b600080600060608486031215612c8c57612c8b612713565b5b6000612c9a86828701612996565b935050602084013567ffffffffffffffff811115612cbb57612cba612718565b5b612cc786828701612835565b9250506040612cd886828701612a52565b9150509250925092565b6000819050919050565b612cf581612ce2565b82525050565b60006040820190508181036000830152612d1581856128f2565b9050612d246020830184612cec565b9392505050565b60008060408385031215612d4257612d41612713565b5b600083013567ffffffffffffffff811115612d6057612d5f612718565b5b612d6c85828601612835565b9250506020612d7d85828601612a52565b9150509250929050565b600060208284031215612d9d57612d9c612713565b5b6000612dab84828501612996565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b6000612e0782612de0565b612e118185612deb565b9350612e218185602086016128c8565b612e2a81612727565b840191505092915050565b6000612e418383612dfc565b905092915050565b6000602082019050919050565b6000612e6182612db4565b612e6b8185612dbf565b935083602082028501612e7d85612dd0565b8060005b85811015612eb95784840389528151612e9a8582612e35565b9450612ea583612e49565b925060208a01995050600181019050612e81565b50829750879550505050505092915050565b60006020820190508181036000830152612ee58184612e56565b905092915050565b60008060408385031215612f0457612f03612713565b5b6000612f1285828601612996565b9250506020612f2385828601612a52565b9150509250929050565b600082825260208201905092915050565b6000612f4982612de0565b612f538185612f2d565b9350612f638185602086016128c8565b612f6c81612727565b840191505092915050565b60006020820190508181036000830152612f918184612f3e565b905092915050565b7f6266733a2f2f0000000000000000000000000000000000000000000000000000815250565b600081905092915050565b6000612fd582612de0565b612fdf8185612fbf565b9350612fef8185602086016128c8565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000815250565b600061302c82612f99565b60068201915061303c8284612fca565b915061304782612ffb565b60018201915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309082612a07565b915061309b83612a07565b92508282019050808211156130b3576130b2613056565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006130f382612a07565b91506130fe83612a07565b925082820390508181111561311657613115613056565b5b92915050565b600061312782612a07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361315957613158613056565b5b600182019050919050565b61316d8161296d565b82525050565b60006060820190506131886000830186613164565b818103602083015261319a8185612f3e565b90506131a96040830184612a11565b949350505050565b600081905092915050565b60006131c7826128ac565b6131d181856131b1565b93506131e18185602086016128c8565b80840191505092915050565b60006131f982846131bc565b915081905092915050565b600061321761321284612a67565b612798565b90508281526020810184848401111561323357613232612722565b5b61323e8482856128c8565b509392505050565b600082601f83011261325b5761325a61271d565b5b815161326b848260208601613204565b91505092915050565b61327d81612ce2565b811461328857600080fd5b50565b60008151905061329a81613274565b92915050565b600080604083850312156132b7576132b6612713565b5b600083015167ffffffffffffffff8111156132d5576132d4612718565b5b6132e185828601613246565b92505060206132f28582860161328b565b9150509250929050565b600061330882856131bc565b915061331482846131bc565b91508190509392505050565b600061332c8284612fca565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061337e57607f821691505b60208210810361339157613390613337565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006133f3602e83612f2d565b91506133fe82613397565b604082019050919050565b60006020820190508181036000830152613422816133e6565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b600061346561346061345b84613429565b613440565b613433565b9050919050565b6134758161344a565b82525050565b6000602082019050613490600083018461346c565b92915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026134f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826134bb565b61350286836134bb565b95508019841693508086168417925050509392505050565b600061353561353061352b84612a07565b613440565b612a07565b9050919050565b6000819050919050565b61354f8361351a565b61356361355b8261353c565b8484546134c8565b825550505050565b600090565b61357861356b565b613583818484613546565b505050565b5b818110156135a75761359c600082613570565b600181019050613589565b5050565b601f8211156135ec576135bd81613496565b6135c6846134ab565b810160208510156135d5578190505b6135e96135e1856134ab565b830182613588565b50505b505050565b600082821c905092915050565b600061360f600019846008026135f1565b1980831691505092915050565b600061362883836135fe565b9150826002028217905092915050565b613641826128ac565b67ffffffffffffffff81111561365a57613659612738565b5b6136648254613366565b61366f8282856135ab565b600060209050601f8311600181146136a25760008415613690578287015190505b61369a858261361c565b865550613702565b601f1984166136b086613496565b60005b828110156136d8578489015182556001820191506020850194506020810190506136b3565b868310156136f557848901516136f1601f8916826135fe565b8355505b6001600288020188555050505b505050505050565b60008190508160005260206000209050919050565b601f821115613760576137318161370a565b61373a846134ab565b81016020851015613749578190505b61375d613755856134ab565b830182613588565b50505b505050565b61376e82612de0565b67ffffffffffffffff81111561378757613786612738565b5b6137918254613366565b61379c82828561371f565b600060209050601f8311600181146137cf57600084156137bd578287015190505b6137c7858261361c565b86555061382f565b601f1984166137dd8661370a565b60005b82811015613805578489015182556001820191506020850194506020810190506137e0565b86831015613822578489015161381e601f8916826135fe565b8355505b6001600288020188555050505b505050505050565b600061384282612f99565b6006820191506138528287612fca565b915061385d82612ffb565b60018201915061386d8286612fca565b915061387882612ffb565b6001820191506138888285612fca565b915061389382612ffb565b6001820191506138a38284612fca565b915081905095945050505050565b600060608201905081810360008301526138cb8186612f3e565b90506138da6020830185612a11565b81810360408301526138ec8184612f3e565b9050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006139308261294d565b915061393b8361294d565b9250828203905073ffffffffffffffffffffffffffffffffffffffff81111561396757613966613056565b5b92915050565b60006139788261294d565b91506139838361294d565b92508282026139918161294d565b915082820484148315176139a8576139a7613056565b5b5092915050565b60006139ba8261294d565b91506139c58361294d565b9250828201905073ffffffffffffffffffffffffffffffffffffffff8111156139f1576139f0613056565b5b92915050565b6000613a0282612a07565b9150613a0d83612a07565b9250828202613a1b81612a07565b91508282048414831517613a3257613a31613056565b5b5092915050565b6000613a4482612a07565b915060008203613a5757613a56613056565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613a98602083612f2d565b9150613aa382613a62565b602082019050919050565b60006020820190508181036000830152613ac781613a8b565b905091905056fea26469706673582212209654c40524517d16add64c182cdaaadf0cc8480eaece2715d7c5971e4e73c97564736f6c63430008110033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063a0e567641161008c578063bf1450df11610066578063bf1450df14610285578063c9b09659146102b5578063d92e741e146102e5578063e0f64a3814610315576100ea565b8063a0e56764146101f3578063abb1521914610224578063ba67e64114610255576100ea565b806385273a90116100c857806385273a90146101595780638a5ca90b14610189578063928a4b3e146101b95780639516a104146101d5576100ea565b8063591070c4146100ef578063682f6b9f1461011f5780638129fc1c1461014f575b600080fd5b61010960048036038101906101049190612863565b610345565b604051610116919061292b565b60405180910390f35b610139600480360381019061013491906129ab565b610b2f565b604051610146919061292b565b60405180910390f35b610157610d28565b005b610173600480360381019061016e91906129ab565b610e68565b6040516101809190612a20565b60405180910390f35b6101a3600480360381019061019e91906129ab565b610ea3565b6040516101b09190612a20565b60405180910390f35b6101d360048036038101906101ce9190612b08565b610f09565b005b6101dd6112f3565b6040516101ea9190612c51565b60405180910390f35b61020d60048036038101906102089190612c73565b611304565b60405161021b929190612cfb565b60405180910390f35b61023e60048036038101906102399190612d2b565b6114ad565b60405161024c929190612cfb565b60405180910390f35b61026f600480360381019061026a91906129ab565b611c14565b60405161027c9190612a20565b60405180910390f35b61029f600480360381019061029a9190612d87565b611c7a565b6040516102ac9190612ecb565b60405180910390f35b6102cf60048036038101906102ca9190612eed565b611d92565b6040516102dc9190612f77565b60405180910390f35b6102ff60048036038101906102fa9190612c73565b611e4b565b60405161030c919061292b565b60405180910390f35b61032f600480360381019061032a91906129ab565b611f1b565b60405161033c9190612a20565b60405180910390f35b60606000829050600061035746611f56565b6040516020016103679190613021565b604051602081830303815290604052905060008151905060568161038b9190613085565b835110156103c5576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191683602a836104169190613085565b81518110610427576104266130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461048b576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168360016056846104de9190613085565b6104e891906130e8565b815181106104f9576104f86130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461055d576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156106325782818151811061057b5761057a6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168482815181106105bb576105ba6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461061f576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808061062a9061311c565b915050610560565b506000602a67ffffffffffffffff8111156106505761064f612738565b5b6040519080825280601f01601f1916602001820160405280156106825781602001600182028036833780820191505090505b50905060005b602a81101561070f5784838261069e9190613085565b815181106106af576106ae6130b9565b5b602001015160f81c60f81b8282815181106106cd576106cc6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806107079061311c565b915050610688565b50600061071b82612024565b90506000602a67ffffffffffffffff81111561073a57610739612738565b5b6040519080825280601f01601f19166020018201604052801561076c5781602001600182028036833780820191505090505b50905060005b602a81101561081157866001602a878461078c9190613085565b6107969190613085565b6107a09190613085565b815181106107b1576107b06130b9565b5b602001015160f81c60f81b8282815181106107cf576107ce6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806108099061311c565b915050610772565b50600061081d82612024565b9050600060568661082e9190613085565b885161083a91906130e8565b67ffffffffffffffff81111561085357610852612738565b5b6040519080825280601f01601f1916602001820160405280156108855781602001600182028036833780820191505090505b50905060005b6056876108989190613085565b89516108a491906130e8565b81101561093557886056886108b99190613085565b826108c49190613085565b815181106108d5576108d46130b9565b5b602001015160f81c60f81b8282815181106108f3576108f26130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061092d9061311c565b91505061088b565b5060008190506000606060008067ffffffffffffffff81111561095b5761095a612738565b5b6040519080825280601f01601f19166020018201604052801561098d5781602001600182028036833780820191505090505b5090505b60008312610b1b5760008685856040516024016109b093929190613173565b6040516020818303038152906040527fa0e56764000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000808a73ffffffffffffffffffffffffffffffffffffffff1683604051610a5791906131ed565b600060405180830381855afa9150503d8060008114610a92576040519150601f19603f3d011682016040523d82523d6000602084013e610a97565b606091505b509150915081610ad3576040517f3e0e1f0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806020019051810190610ae791906132a0565b80975081965050508385604051602001610b029291906132fc565b6040516020818303038152906040529350505050610991565b809c50505050505050505050505050919050565b60608060008067ffffffffffffffff811115610b4e57610b4d612738565b5b6040519080825280601f01601f191660200182016040528015610b805781602001600182028036833780820191505090505b5090506000600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002085604051610bd29190613320565b908152602001604051809103902054905060005b818111610d1b57600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086604051610c3a9190613320565b908152602001604051809103902060008281526020019081526020016000208054610c6490613366565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9090613366565b8015610cdd5780601f10610cb257610100808354040283529160200191610cdd565b820191906000526020600020905b815481529060010190602001808311610cc057829003601f168201915b505050505093508284604051602001610cf79291906132fc565b60405160208183030381529060405292508080610d139061311c565b915050610be6565b5081935050505092915050565b60008060019054906101000a900460ff16159050808015610d595750600160008054906101000a900460ff1660ff16105b80610d865750610d68306121c6565b158015610d855750600160008054906101000a900460ff1660ff16145b5b610dc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbc90613409565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610e02576001600060016101000a81548160ff0219169083151502179055505b610e0c60016121e9565b8015610e655760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610e5c919061347b565b60405180910390a15b50565b600360205281600052604060002081805160208101820180518482526020830160208501208183528095505050505050600091509150505481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051610ef29190613320565b908152602001604051809103902054905092915050565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084604051610f589190613320565b908152602001604051809103902060008481526020019081526020016000208054610f8290613366565b90501115610fbc576040517f26a5c59b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460405161100a9190613320565b9081526020016040518091039020600084815260200190815260200160002090816110359190613638565b5081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516110849190613320565b90815260200160405180910390205410156110fa5781600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516110e79190613320565b9081526020016040518091039020819055505b61110460016121ff565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020846040516111519190613320565b90815260200160405180910390208190555061116d60016121e9565b600082036111fd57600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020839080600181540180825580915050600190039060005260206000200160009091909190915090816111e69190613765565b506111fb33600661220d90919063ffffffff16565b505b600061120846611f56565b6112113061223d565b61121a3361223d565b8660405160200161122e9493929190613837565b6040516020818303038152906040529050600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460405161128c9190613320565b9081526020016040518091039020543373ffffffffffffffffffffffffffffffffffffffff167f3570439426bde556b3a1036679abf502ade483de5bc63fe5578a687650c96bdd8686856040516112e5939291906138b1565b60405180910390a350505050565b60606112ff600661226a565b905090565b60606000806001846113169190613085565b90506000600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113679190613320565b908152602001604051809103902054821161138257816113a4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b9050600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113f39190613320565b908152602001604051809103902060008681526020019081526020016000208181805461141f90613366565b80601f016020809104026020016040519081016040528092919081815260200182805461144b90613366565b80156114985780601f1061146d57610100808354040283529160200191611498565b820191906000526020600020905b81548152906001019060200180831161147b57829003601f168201915b50505050509150935093505050935093915050565b606060008084905060006114c046611f56565b6040516020016114d09190613021565b60405160208183030381529060405290506000815190506056816114f49190613085565b8351101561152e576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191683602a8361157f9190613085565b815181106115905761158f6130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146115f4576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2f000000000000000000000000000000000000000000000000000000000000007effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168360016056846116479190613085565b61165191906130e8565b81518110611662576116616130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146116c6576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561179b578281815181106116e4576116e36130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110611724576117236130b9565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611788576040517f3ba0191100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806117939061311c565b9150506116c9565b506000602a67ffffffffffffffff8111156117b9576117b8612738565b5b6040519080825280601f01601f1916602001820160405280156117eb5781602001600182028036833780820191505090505b50905060005b602a811015611878578483826118079190613085565b81518110611818576118176130b9565b5b602001015160f81c60f81b828281518110611836576118356130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806118709061311c565b9150506117f1565b50600061188482612024565b90506000602a67ffffffffffffffff8111156118a3576118a2612738565b5b6040519080825280601f01601f1916602001820160405280156118d55781602001600182028036833780820191505090505b50905060005b602a81101561197a57866001602a87846118f59190613085565b6118ff9190613085565b6119099190613085565b8151811061191a576119196130b9565b5b602001015160f81c60f81b828281518110611938576119376130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806119729061311c565b9150506118db565b50600061198682612024565b905060006056866119979190613085565b88516119a391906130e8565b67ffffffffffffffff8111156119bc576119bb612738565b5b6040519080825280601f01601f1916602001820160405280156119ee5781602001600182028036833780820191505090505b50905060005b605687611a019190613085565b8951611a0d91906130e8565b811015611a9e5788605688611a229190613085565b82611a2d9190613085565b81518110611a3e57611a3d6130b9565b5b602001015160f81c60f81b828281518110611a5c57611a5b6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611a969061311c565b9150506119f4565b506000819050600083828e604051602401611abb93929190613173565b6040516020818303038152906040527fa0e56764000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000808773ffffffffffffffffffffffffffffffffffffffff1683604051611b6291906131ed565b600060405180830381855afa9150503d8060008114611b9d576040519150601f19603f3d011682016040523d82523d6000602084013e611ba2565b606091505b509150915081611bde576040517f3e0e1f0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008082806020019051810190611bf591906132a0565b9150915081819f509f5050505050505050505050505050509250929050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082604051611c639190613320565b908152602001604051809103902054905092915050565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611d87578382906000526020600020018054611cfa90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611d2690613366565b8015611d735780601f10611d4857610100808354040283529160200191611d73565b820191906000526020600020905b815481529060010190602001808311611d5657829003601f168201915b505050505081526020019060010190611cdb565b505050509050919050565b60056020528160005260406000208181548110611dae57600080fd5b90600052602060002001600091509150508054611dca90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611df690613366565b8015611e435780601f10611e1857610100808354040283529160200191611e43565b820191906000526020600020905b815481529060010190602001808311611e2657829003601f168201915b505050505081565b60026020528260005260406000208280516020810182018051848252602083016020850120818352809550505050505060205280600052604060002060009250925050508054611e9a90613366565b80601f0160208091040260200160405190810160405280929190818152602001828054611ec690613366565b8015611f135780601f10611ee857610100808354040283529160200191611f13565b820191906000526020600020905b815481529060010190602001808311611ef657829003601f168201915b505050505081565b600460205281600052604060002081805160208101820180518482526020830160208501208183528095505050505050600091509150505481565b606060006001611f658461228b565b01905060008167ffffffffffffffff811115611f8457611f83612738565b5b6040519080825280601f01601f191660200182016040528015611fb65781602001600182028036833780820191505090505b509050600082602001820190505b600115612019578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161200d5761200c6138f6565b5b04945060008503611fc4575b819350505050919050565b600080829050600080600290505b82518110156121b55760008382815181106120505761204f6130b9565b5b602001015160f81c60f81b60f81c60ff16905060308173ffffffffffffffffffffffffffffffffffffffff16101580156120a1575060398173ffffffffffffffffffffffffffffffffffffffff1611155b156120cd576030816120b39190613925565b6010846120c0919061396d565b6120ca91906139af565b92505b60418173ffffffffffffffffffffffffffffffffffffffff161015801561210b575060468173ffffffffffffffffffffffffffffffffffffffff1611155b156121375760378161211d9190613925565b60108461212a919061396d565b61213491906139af565b92505b60618173ffffffffffffffffffffffffffffffffffffffff1610158015612175575060668173ffffffffffffffffffffffffffffffffffffffff1611155b156121a1576057816121879190613925565b601084612194919061396d565b61219e91906139af565b92505b5080806121ad9061311c565b915050612032565b508060601b60601c92505050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6001816000016000828254019250508190555050565b600081600001549050919050565b6000612235836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6123de565b905092915050565b60606122638273ffffffffffffffffffffffffffffffffffffffff16601460ff1661244e565b9050919050565b6060600061227a8360000161268a565b905060608190508092505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106122e9577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816122df576122de6138f6565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612326576d04ee2d6d415b85acef8100000000838161231c5761231b6138f6565b5b0492506020810190505b662386f26fc10000831061235557662386f26fc10000838161234b5761234a6138f6565b5b0492506010810190505b6305f5e100831061237e576305f5e1008381612374576123736138f6565b5b0492506008810190505b61271083106123a3576127108381612399576123986138f6565b5b0492506004810190505b606483106123c657606483816123bc576123bb6138f6565b5b0492506002810190505b600a83106123d5576001810190505b80915050919050565b60006123ea83836126e6565b612443578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612448565b600090505b92915050565b60606000600283600261246191906139f7565b61246b9190613085565b67ffffffffffffffff81111561248457612483612738565b5b6040519080825280601f01601f1916602001820160405280156124b65781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106124ee576124ed6130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612552576125516130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261259291906139f7565b61259c9190613085565b90505b600181111561263c577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106125de576125dd6130b9565b5b1a60f81b8282815181106125f5576125f46130b9565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061263590613a39565b905061259f565b5060008414612680576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267790613aae565b60405180910390fd5b8091505092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156126da57602002820191906000526020600020905b8154815260200190600101908083116126c6575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61277082612727565b810181811067ffffffffffffffff8211171561278f5761278e612738565b5b80604052505050565b60006127a2612709565b90506127ae8282612767565b919050565b600067ffffffffffffffff8211156127ce576127cd612738565b5b6127d782612727565b9050602081019050919050565b82818337600083830152505050565b6000612806612801846127b3565b612798565b90508281526020810184848401111561282257612821612722565b5b61282d8482856127e4565b509392505050565b600082601f83011261284a5761284961271d565b5b813561285a8482602086016127f3565b91505092915050565b60006020828403121561287957612878612713565b5b600082013567ffffffffffffffff81111561289757612896612718565b5b6128a384828501612835565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156128e65780820151818401526020810190506128cb565b60008484015250505050565b60006128fd826128ac565b61290781856128b7565b93506129178185602086016128c8565b61292081612727565b840191505092915050565b6000602082019050818103600083015261294581846128f2565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006129788261294d565b9050919050565b6129888161296d565b811461299357600080fd5b50565b6000813590506129a58161297f565b92915050565b600080604083850312156129c2576129c1612713565b5b60006129d085828601612996565b925050602083013567ffffffffffffffff8111156129f1576129f0612718565b5b6129fd85828601612835565b9150509250929050565b6000819050919050565b612a1a81612a07565b82525050565b6000602082019050612a356000830184612a11565b92915050565b612a4481612a07565b8114612a4f57600080fd5b50565b600081359050612a6181612a3b565b92915050565b600067ffffffffffffffff821115612a8257612a81612738565b5b612a8b82612727565b9050602081019050919050565b6000612aab612aa684612a67565b612798565b905082815260208101848484011115612ac757612ac6612722565b5b612ad28482856127e4565b509392505050565b600082601f830112612aef57612aee61271d565b5b8135612aff848260208601612a98565b91505092915050565b600080600060608486031215612b2157612b20612713565b5b600084013567ffffffffffffffff811115612b3f57612b3e612718565b5b612b4b86828701612835565b9350506020612b5c86828701612a52565b925050604084013567ffffffffffffffff811115612b7d57612b7c612718565b5b612b8986828701612ada565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612bc88161296d565b82525050565b6000612bda8383612bbf565b60208301905092915050565b6000602082019050919050565b6000612bfe82612b93565b612c088185612b9e565b9350612c1383612baf565b8060005b83811015612c44578151612c2b8882612bce565b9750612c3683612be6565b925050600181019050612c17565b5085935050505092915050565b60006020820190508181036000830152612c6b8184612bf3565b905092915050565b600080600060608486031215612c8c57612c8b612713565b5b6000612c9a86828701612996565b935050602084013567ffffffffffffffff811115612cbb57612cba612718565b5b612cc786828701612835565b9250506040612cd886828701612a52565b9150509250925092565b6000819050919050565b612cf581612ce2565b82525050565b60006040820190508181036000830152612d1581856128f2565b9050612d246020830184612cec565b9392505050565b60008060408385031215612d4257612d41612713565b5b600083013567ffffffffffffffff811115612d6057612d5f612718565b5b612d6c85828601612835565b9250506020612d7d85828601612a52565b9150509250929050565b600060208284031215612d9d57612d9c612713565b5b6000612dab84828501612996565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b6000612e0782612de0565b612e118185612deb565b9350612e218185602086016128c8565b612e2a81612727565b840191505092915050565b6000612e418383612dfc565b905092915050565b6000602082019050919050565b6000612e6182612db4565b612e6b8185612dbf565b935083602082028501612e7d85612dd0565b8060005b85811015612eb95784840389528151612e9a8582612e35565b9450612ea583612e49565b925060208a01995050600181019050612e81565b50829750879550505050505092915050565b60006020820190508181036000830152612ee58184612e56565b905092915050565b60008060408385031215612f0457612f03612713565b5b6000612f1285828601612996565b9250506020612f2385828601612a52565b9150509250929050565b600082825260208201905092915050565b6000612f4982612de0565b612f538185612f2d565b9350612f638185602086016128c8565b612f6c81612727565b840191505092915050565b60006020820190508181036000830152612f918184612f3e565b905092915050565b7f6266733a2f2f0000000000000000000000000000000000000000000000000000815250565b600081905092915050565b6000612fd582612de0565b612fdf8185612fbf565b9350612fef8185602086016128c8565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000815250565b600061302c82612f99565b60068201915061303c8284612fca565b915061304782612ffb565b60018201915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309082612a07565b915061309b83612a07565b92508282019050808211156130b3576130b2613056565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006130f382612a07565b91506130fe83612a07565b925082820390508181111561311657613115613056565b5b92915050565b600061312782612a07565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361315957613158613056565b5b600182019050919050565b61316d8161296d565b82525050565b60006060820190506131886000830186613164565b818103602083015261319a8185612f3e565b90506131a96040830184612a11565b949350505050565b600081905092915050565b60006131c7826128ac565b6131d181856131b1565b93506131e18185602086016128c8565b80840191505092915050565b60006131f982846131bc565b915081905092915050565b600061321761321284612a67565b612798565b90508281526020810184848401111561323357613232612722565b5b61323e8482856128c8565b509392505050565b600082601f83011261325b5761325a61271d565b5b815161326b848260208601613204565b91505092915050565b61327d81612ce2565b811461328857600080fd5b50565b60008151905061329a81613274565b92915050565b600080604083850312156132b7576132b6612713565b5b600083015167ffffffffffffffff8111156132d5576132d4612718565b5b6132e185828601613246565b92505060206132f28582860161328b565b9150509250929050565b600061330882856131bc565b915061331482846131bc565b91508190509392505050565b600061332c8284612fca565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061337e57607f821691505b60208210810361339157613390613337565b5b50919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b60006133f3602e83612f2d565b91506133fe82613397565b604082019050919050565b60006020820190508181036000830152613422816133e6565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b600061346561346061345b84613429565b613440565b613433565b9050919050565b6134758161344a565b82525050565b6000602082019050613490600083018461346c565b92915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026134f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826134bb565b61350286836134bb565b95508019841693508086168417925050509392505050565b600061353561353061352b84612a07565b613440565b612a07565b9050919050565b6000819050919050565b61354f8361351a565b61356361355b8261353c565b8484546134c8565b825550505050565b600090565b61357861356b565b613583818484613546565b505050565b5b818110156135a75761359c600082613570565b600181019050613589565b5050565b601f8211156135ec576135bd81613496565b6135c6846134ab565b810160208510156135d5578190505b6135e96135e1856134ab565b830182613588565b50505b505050565b600082821c905092915050565b600061360f600019846008026135f1565b1980831691505092915050565b600061362883836135fe565b9150826002028217905092915050565b613641826128ac565b67ffffffffffffffff81111561365a57613659612738565b5b6136648254613366565b61366f8282856135ab565b600060209050601f8311600181146136a25760008415613690578287015190505b61369a858261361c565b865550613702565b601f1984166136b086613496565b60005b828110156136d8578489015182556001820191506020850194506020810190506136b3565b868310156136f557848901516136f1601f8916826135fe565b8355505b6001600288020188555050505b505050505050565b60008190508160005260206000209050919050565b601f821115613760576137318161370a565b61373a846134ab565b81016020851015613749578190505b61375d613755856134ab565b830182613588565b50505b505050565b61376e82612de0565b67ffffffffffffffff81111561378757613786612738565b5b6137918254613366565b61379c82828561371f565b600060209050601f8311600181146137cf57600084156137bd578287015190505b6137c7858261361c565b86555061382f565b601f1984166137dd8661370a565b60005b82811015613805578489015182556001820191506020850194506020810190506137e0565b86831015613822578489015161381e601f8916826135fe565b8355505b6001600288020188555050505b505050505050565b600061384282612f99565b6006820191506138528287612fca565b915061385d82612ffb565b60018201915061386d8286612fca565b915061387882612ffb565b6001820191506138888285612fca565b915061389382612ffb565b6001820191506138a38284612fca565b915081905095945050505050565b600060608201905081810360008301526138cb8186612f3e565b90506138da6020830185612a11565b81810360408301526138ec8184612f3e565b9050949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006139308261294d565b915061393b8361294d565b9250828203905073ffffffffffffffffffffffffffffffffffffffff81111561396757613966613056565b5b92915050565b60006139788261294d565b91506139838361294d565b92508282026139918161294d565b915082820484148315176139a8576139a7613056565b5b5092915050565b60006139ba8261294d565b91506139c58361294d565b9250828201905073ffffffffffffffffffffffffffffffffffffffff8111156139f1576139f0613056565b5b92915050565b6000613a0282612a07565b9150613a0d83612a07565b9250828202613a1b81612a07565b91508282048414831517613a3257613a31613056565b5b5092915050565b6000613a4482612a07565b915060008203613a5757613a56613056565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000613a98602083612f2d565b9150613aa382613a62565b602082019050919050565b60006020820190508181036000830152613ac781613a8b565b905091905056fea26469706673582212209654c40524517d16add64c182cdaaadf0cc8480eaece2715d7c5971e4e73c97564736f6c63430008110033