Address Details
contract

0x7C9574c1b16bC28676dB5c070ceF017D8D4b4399

Contract Name
CASBuffer
Creator
0xb156c1–ebc770 at 0xfdfc42–1c82fd
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
0 Transfers
Gas Used
46,314
Last Balance Update
16133049
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
CASBuffer




Optimization enabled
false
Compiler version
v0.8.7+commit.e28d00a7




EVM Version
istanbul




Verified at
2023-02-01T16:15:58.395706Z

project:/contracts/CASBuffer.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./CASBundle.sol";

// get needed function and put them here
import "./BytesLib.sol";

contract CASBuffer is CASBundle, Ownable, AccessControl {
    /**
     * @dev Constant value to set up new role
     */
    bytes32 public constant REGISTRY_ROLE = keccak256("REGISTRY_ROLE");
    /**
     * @dev modifier to check if the sender has access to a function
     */
    modifier checkAccess {
        require(hasRole(REGISTRY_ROLE, msg.sender), "Caller is not an admin or Registry Manager contract");
        _;
    }
    /**
     * @dev modifier to block access for a buffer
     */
    modifier blockAccess {
        require(false, "You cannot do transfer in buffer");
        _;
    }
    /**
     * @dev Setter to add access to registry functions
     * (more precisely to give access to other our contracts call the function)
     * @param newAddress the address to which the role is assigned
     */
    function addToRegistryRole(address newAddress) public onlyOwner {
        _setupRole(REGISTRY_ROLE, newAddress);
    }
    /**
     * @dev Remove an account from the registry role
     */
    function removeFromRegistryRole(address account) public virtual onlyOwner {
        revokeRole(REGISTRY_ROLE, account);
    }
    /**
     * @dev create new bundle and assign it to the buffer
     * @param bufferOutput (
     *     bufferAddress: bytes(address),
     *     outputBundleId: bytes(string),
     *     bundleVolume: bytes(int),
     *     unitType: bytes(string),
     *     metadataUrl: bytes(string)
     *     projectAddress: bytes(address)
     * )
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function addBundleVolume(bytes[] memory bufferOutput) public override checkAccess {
        super.addBundleVolume(bufferOutput);
    }
    /**
     * @dev subtract tokens from the bundle
     * @param bufferInput (
     *     bufferAddress: bytes(address),
     *     bundleId: bytes(string),
     *     bundleVolume: bytes(int),
     *     unitType: bytes(string),
     *     metadataUrl: bytes(string)
     *     projectAddress: bytes(address)
     * )
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function subtractBundleVolume(bytes[] memory bufferInput) public override checkAccess {
        super.subtractBundleVolume(bufferInput);
    }
    /**
     * @dev blocked function to restrict access for the transfer inside the buffer
     */
}
        

/_openzeppelin/contracts/access/AccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}
          

/_openzeppelin/contracts/access/IAccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}
          

/_openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

/_openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

/_openzeppelin/contracts/utils/Strings.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}
          

/_openzeppelin/contracts/utils/introspection/ERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
          

/_openzeppelin/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
          

/project_/contracts/BytesLib.sol

// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <goncalo.sa@consensys.net>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity >=0.8.0 <0.9.0;


library BytesLib {
    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    )
        internal
        pure
        returns (bytes memory)
    {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
              add(add(end, iszero(add(length, mload(_preBytes)))), 31),
              not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    )
        internal
        pure
        returns (bytes memory)
    {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    )
        internal
        view
        returns (bool)
    {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}
          

/project_/contracts/CASBundle.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8;

// get needed function and put them here
import "./BytesLib.sol";

contract CASBundle {
    /**
     * @dev key:value mapping to save bundle info
     * where the key is a bundle id,
     * the value is a BundleStruct 
     */
    mapping(string => BundleStruct) private bundleInfos;
    /**
     * @dev Bundle struct to save bundle info
     */
    struct BundleStruct {
        string unitType;
        uint date;
        string metadataUrl;
        address projectAddress;
    }
    /**
     * @dev Volume struct to save volume
     */
    struct VolumeStruct {
        uint volume;
        bool isValue;
    }
    /**
     * @dev 2d key:value mapping to save volume
     * where the first key is an address,
     * the second key is and bundle id,
     * the value is a VolumeStruct 
     */
    mapping(address => mapping(string => VolumeStruct)) private bundlesVolume;
    /**
     * @dev private function to store bundle struct to bundleInfos mapping
     * @param projectAddress: address,
     * @param bundleId: string,
     * @param unitType: string,
     * @param metadataUrl: string,
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function storeOutputBandleInfo(
        address projectAddress,
        string memory bundleId,
        string memory unitType,
        string memory metadataUrl
    ) private {
        bundleInfos[bundleId] = BundleStruct(
            unitType,
            block.timestamp,
            metadataUrl,
            projectAddress
        );
    }
    /**
     * @dev create a new bundle
     * @param output (
     *     toAddress: bytes(address),
     *     outputBundleId: bytes(string),
     *     bundleVolume: bytes(int),
     *     unitType: bytes(string),
     *     metadataUrl: bytes(string)
     *     projectAddress: bytes(address)
     * )
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function addBundleVolume(bytes[] memory output) public virtual {
        address toAddress = BytesLib.toAddress(output[0], 0);
        string memory bundleId = string(abi.encodePacked(output[1]));
        uint volume = BytesLib.toUint256(output[2], 0);
        string memory unitType = string(abi.encodePacked(output[3]));
        string memory metadataUrl = string(abi.encodePacked(output[4]));
        address projectAddress = BytesLib.toAddress(output[5], 0);

        require(toAddress != address(0), "address(0) cannot be a holder");

        require(!bundlesVolume[toAddress][bundleId].isValue, "sorry, you cannot override existing bundle id");

        bundlesVolume[toAddress][bundleId] = VolumeStruct(volume, true);

        storeOutputBandleInfo(toAddress, bundleId, unitType, metadataUrl);
    }
    /**
     * @dev subtract tokens from a bundle
     * @param input (
     *     fromAddress: bytes(address),
     *     bundleId: bytes(string),
     *     bundleVolume: bytes(int),
     *     unitType: bytes(string),
     *     metadataUrl: bytes(string)
     *     projectAddress: bytes(address)
     * )
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function subtractBundleVolume(bytes[] memory input) public virtual {
        address fromAddress = BytesLib.toAddress(input[0], 0);
        string memory bundleId = string(abi.encodePacked(input[1]));
        uint volumeToSubtract = BytesLib.toUint256(input[2], 0);

        require(volumeToSubtract != 0, "cannot subtract 0 tokens");
        require(bundlesVolume[fromAddress][bundleId].volume >= volumeToSubtract, "not enough tokens");

        bundlesVolume[fromAddress][bundleId].volume -= volumeToSubtract;
    }
    /**
     * @dev get bundle info
     * @param bundleId: string,
     * @return unitType type of the unit (FCRU or VCRU),
     * @return date creation date in timestamp
     * @return metadataUrl link to the metadata
     * @return projectAddress project address
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function getBundleInfo(string memory bundleId) public view
    returns(string memory unitType, uint date, string memory metadataUrl, address projectAddress) {
        return (
            bundleInfos[bundleId].unitType,
            bundleInfos[bundleId].date,
            bundleInfos[bundleId].metadataUrl,
            bundleInfos[bundleId].projectAddress);
    }
    /**
     * @dev get bundle info
     * @param ownerAddress: address,
     * @param bundleId: string,
     * @return volume volume amount on current address and bundle id
     * @notice All parameters must be passed in bytes and opened in the contract as the required type
     */
    function getBundleVolume(address ownerAddress, string memory bundleId) public view returns(uint volume) {
        return bundlesVolume[ownerAddress][bundleId].volume;
    }
}
          

Contract ABI

[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"REGISTRY_ROLE","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addBundleVolume","inputs":[{"type":"bytes[]","name":"bufferOutput","internalType":"bytes[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addToRegistryRole","inputs":[{"type":"address","name":"newAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"unitType","internalType":"string"},{"type":"uint256","name":"date","internalType":"uint256"},{"type":"string","name":"metadataUrl","internalType":"string"},{"type":"address","name":"projectAddress","internalType":"address"}],"name":"getBundleInfo","inputs":[{"type":"string","name":"bundleId","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"volume","internalType":"uint256"}],"name":"getBundleVolume","inputs":[{"type":"address","name":"ownerAddress","internalType":"address"},{"type":"string","name":"bundleId","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeFromRegistryRole","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"subtractBundleVolume","inputs":[{"type":"bytes[]","name":"bufferInput","internalType":"bytes[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x60806040523480156200001157600080fd5b5062000032620000266200003860201b60201c565b6200004060201b60201c565b62000106565b600033905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6128bf80620001166000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c806342f1e879116100a2578063a217fddf11610071578063a217fddf146102b9578063b45e81bc146102d7578063ba028f75146102f3578063d547741f1461030f578063f2fde38b1461032b5761010b565b806342f1e87914610243578063715018a6146102615780638da5cb5b1461026b57806391d14854146102895761010b565b8063248a9ca3116100de578063248a9ca3146101a85780632f2ff15d146101d857806336568abe146101f457806341e43ae1146102105761010b565b806301ffc9a7146101105780630d5ab2621461014057806311cec3651461015c5780631437c3091461018c575b600080fd5b61012a60048036038101906101259190611bd3565b610347565b6040516101379190611f6a565b60405180910390f35b61015a60048036038101906101559190611a94565b6103c1565b005b61017660048036038101906101719190611ac1565b61046a565b6040516101839190612175565b60405180910390f35b6101a660048036038101906101a19190611a94565b6104d3565b005b6101c260048036038101906101bd9190611b66565b61057c565b6040516101cf9190611f85565b60405180910390f35b6101f260048036038101906101ed9190611b93565b61059c565b005b61020e60048036038101906102099190611b93565b6105c5565b005b61022a60048036038101906102259190611c00565b610648565b60405161023a9493929190611fc2565b60405180910390f35b61024b61081c565b6040516102589190611f85565b60405180910390f35b610269610840565b005b6102736108c8565b6040516102809190611f4f565b60405180910390f35b6102a3600480360381019061029e9190611b93565b6108f2565b6040516102b09190611f6a565b60405180910390f35b6102c161095d565b6040516102ce9190611f85565b60405180910390f35b6102f160048036038101906102ec9190611b1d565b610964565b005b61030d60048036038101906103089190611b1d565b6109d9565b005b61032960048036038101906103249190611b93565b610a4e565b005b61034560048036038101906103409190611a94565b610a77565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103ba57506103b982610b6f565b5b9050919050565b6103c9610bd9565b73ffffffffffffffffffffffffffffffffffffffff166103e76108c8565b73ffffffffffffffffffffffffffffffffffffffff161461043d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610434906120f5565b60405180910390fd5b6104677fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc82610be1565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020826040516104b99190611efe565b908152602001604051809103902060000154905092915050565b6104db610bd9565b73ffffffffffffffffffffffffffffffffffffffff166104f96108c8565b73ffffffffffffffffffffffffffffffffffffffff161461054f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610546906120f5565b60405180910390fd5b6105797fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc82610a4e565b50565b600060036000838152602001908152602001600020600101549050919050565b6105a58261057c565b6105b6816105b1610bd9565b610bef565b6105c08383610c8c565b505050565b6105cd610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461063a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063190612155565b60405180910390fd5b6106448282610d6d565b5050565b6060600060606000808560405161065f9190611efe565b90815260200160405180910390206000016000866040516106809190611efe565b9081526020016040518091039020600101546000876040516106a29190611efe565b90815260200160405180910390206002016000886040516106c39190611efe565b908152602001604051809103902060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168380546107019061244e565b80601f016020809104026020016040519081016040528092919081815260200182805461072d9061244e565b801561077a5780601f1061074f5761010080835404028352916020019161077a565b820191906000526020600020905b81548152906001019060200180831161075d57829003601f168201915b5050505050935081805461078d9061244e565b80601f01602080910402602001604051908101604052809291908181526020018280546107b99061244e565b80156108065780601f106107db57610100808354040283529160200191610806565b820191906000526020600020905b8154815290600101906020018083116107e957829003601f168201915b5050505050915093509350935093509193509193565b7fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc81565b610848610bd9565b73ffffffffffffffffffffffffffffffffffffffff166108666108c8565b73ffffffffffffffffffffffffffffffffffffffff16146108bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b3906120f5565b60405180910390fd5b6108c66000610e4f565b565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b81565b61098e7fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc336108f2565b6109cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c490612135565b60405180910390fd5b6109d681610f15565b50565b610a037fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc336108f2565b610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3990612135565b60405180910390fd5b610a4b81611108565b50565b610a578261057c565b610a6881610a63610bd9565b610bef565b610a728383610d6d565b505050565b610a7f610bd9565b73ffffffffffffffffffffffffffffffffffffffff16610a9d6108c8565b73ffffffffffffffffffffffffffffffffffffffff1614610af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aea906120f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90612055565b60405180910390fd5b610b6c81610e4f565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b610beb8282610c8c565b5050565b610bf982826108f2565b610c8857610c1e8173ffffffffffffffffffffffffffffffffffffffff166014611414565b610c2c8360001c6020611414565b604051602001610c3d929190611f15565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7f9190611fa0565b60405180910390fd5b5050565b610c9682826108f2565b610d695760016003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d0e610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610d7782826108f2565b15610e4b5760006003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610df0610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000610f3d82600081518110610f2e57610f2d61250f565b5b60200260200101516000611650565b9050600082600181518110610f5557610f5461250f565b5b6020026020010151604051602001610f6d9190611ee7565b60405160208183030381529060405290506000610fa684600281518110610f9757610f9661250f565b5b602002602001015160006116c6565b90506000811415610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe390612075565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208360405161103a9190611efe565b908152602001604051809103902060000154101561108d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611084906120b5565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020836040516110db9190611efe565b908152602001604051809103902060000160008282546110fb9190612330565b9250508190555050505050565b6000611130826000815181106111215761112061250f565b5b60200260200101516000611650565b90506000826001815181106111485761114761250f565b5b60200260200101516040516020016111609190611ee7565b604051602081830303815290604052905060006111998460028151811061118a5761118961250f565b5b602002602001015160006116c6565b90506000846003815181106111b1576111b061250f565b5b60200260200101516040516020016111c99190611ee7565b60405160208183030381529060405290506000856004815181106111f0576111ef61250f565b5b60200260200101516040516020016112089190611ee7565b60405160208183030381529060405290506000611241876005815181106112325761123161250f565b5b60200260200101516000611650565b9050600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa90612095565b60405180910390fd5b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020856040516113009190611efe565b908152602001604051809103902060010160009054906101000a900460ff161561135f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135690612035565b60405180910390fd5b604051806040016040528085815260200160011515815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113c49190611efe565b90815260200160405180910390206000820151816000015560208201518160010160006101000a81548160ff02191690831515021790555090505061140b8686858561172d565b50505050505050565b60606000600283600261142791906122d6565b6114319190612280565b67ffffffffffffffff81111561144a5761144961253e565b5b6040519080825280601f01601f19166020018201604052801561147c5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106114b4576114b361250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115185761151761250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261155891906122d6565b6115629190612280565b90505b6001811115611602577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106115a4576115a361250f565b5b1a60f81b8282815181106115bb576115ba61250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806115fb90612424565b9050611565565b5060008414611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d90612015565b60405180910390fd5b8091505092915050565b600060148261165f9190612280565b835110156116a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169990612115565b60405180910390fd5b60006c01000000000000000000000000836020860101510490508091505092915050565b60006020826116d59190612280565b83511015611718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170f906120d5565b60405180910390fd5b60008260208501015190508091505092915050565b60405180608001604052808381526020014281526020018281526020018573ffffffffffffffffffffffffffffffffffffffff168152506000846040516117749190611efe565b9081526020016040518091039020600082015181600001908051906020019061179e929190611816565b506020820151816001015560408201518160020190805190602001906117c5929190611816565b5060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505050505050565b8280546118229061244e565b90600052602060002090601f016020900481019282611844576000855561188b565b82601f1061185d57805160ff191683800117855561188b565b8280016001018555821561188b579182015b8281111561188a57825182559160200191906001019061186f565b5b509050611898919061189c565b5090565b5b808211156118b557600081600090555060010161189d565b5090565b60006118cc6118c7846121b5565b612190565b905080838252602082019050828560208602820111156118ef576118ee612572565b5b60005b8581101561193d57813567ffffffffffffffff8111156119155761191461256d565b5b8086016119228982611a38565b855260208501945060208401935050506001810190506118f2565b5050509392505050565b600061195a611955846121e1565b612190565b90508281526020810184848401111561197657611975612577565b5b6119818482856123e2565b509392505050565b600061199c61199784612212565b612190565b9050828152602081018484840111156119b8576119b7612577565b5b6119c38482856123e2565b509392505050565b6000813590506119da81612844565b92915050565b600082601f8301126119f5576119f461256d565b5b8135611a058482602086016118b9565b91505092915050565b600081359050611a1d8161285b565b92915050565b600081359050611a3281612872565b92915050565b600082601f830112611a4d57611a4c61256d565b5b8135611a5d848260208601611947565b91505092915050565b600082601f830112611a7b57611a7a61256d565b5b8135611a8b848260208601611989565b91505092915050565b600060208284031215611aaa57611aa9612581565b5b6000611ab8848285016119cb565b91505092915050565b60008060408385031215611ad857611ad7612581565b5b6000611ae6858286016119cb565b925050602083013567ffffffffffffffff811115611b0757611b0661257c565b5b611b1385828601611a66565b9150509250929050565b600060208284031215611b3357611b32612581565b5b600082013567ffffffffffffffff811115611b5157611b5061257c565b5b611b5d848285016119e0565b91505092915050565b600060208284031215611b7c57611b7b612581565b5b6000611b8a84828501611a0e565b91505092915050565b60008060408385031215611baa57611ba9612581565b5b6000611bb885828601611a0e565b9250506020611bc9858286016119cb565b9150509250929050565b600060208284031215611be957611be8612581565b5b6000611bf784828501611a23565b91505092915050565b600060208284031215611c1657611c15612581565b5b600082013567ffffffffffffffff811115611c3457611c3361257c565b5b611c4084828501611a66565b91505092915050565b611c5281612364565b82525050565b611c6181612376565b82525050565b611c7081612382565b82525050565b6000611c8182612243565b611c8b8185612259565b9350611c9b8185602086016123f1565b80840191505092915050565b6000611cb28261224e565b611cbc8185612264565b9350611ccc8185602086016123f1565b611cd581612586565b840191505092915050565b6000611ceb8261224e565b611cf58185612275565b9350611d058185602086016123f1565b80840191505092915050565b6000611d1e602083612264565b9150611d2982612597565b602082019050919050565b6000611d41602d83612264565b9150611d4c826125c0565b604082019050919050565b6000611d64602683612264565b9150611d6f8261260f565b604082019050919050565b6000611d87601883612264565b9150611d928261265e565b602082019050919050565b6000611daa601d83612264565b9150611db582612687565b602082019050919050565b6000611dcd601183612264565b9150611dd8826126b0565b602082019050919050565b6000611df0601583612264565b9150611dfb826126d9565b602082019050919050565b6000611e13602083612264565b9150611e1e82612702565b602082019050919050565b6000611e36601583612264565b9150611e418261272b565b602082019050919050565b6000611e59603383612264565b9150611e6482612754565b604082019050919050565b6000611e7c601783612275565b9150611e87826127a3565b601782019050919050565b6000611e9f601183612275565b9150611eaa826127cc565b601182019050919050565b6000611ec2602f83612264565b9150611ecd826127f5565b604082019050919050565b611ee1816123d8565b82525050565b6000611ef38284611c76565b915081905092915050565b6000611f0a8284611ce0565b915081905092915050565b6000611f2082611e6f565b9150611f2c8285611ce0565b9150611f3782611e92565b9150611f438284611ce0565b91508190509392505050565b6000602082019050611f646000830184611c49565b92915050565b6000602082019050611f7f6000830184611c58565b92915050565b6000602082019050611f9a6000830184611c67565b92915050565b60006020820190508181036000830152611fba8184611ca7565b905092915050565b60006080820190508181036000830152611fdc8187611ca7565b9050611feb6020830186611ed8565b8181036040830152611ffd8185611ca7565b905061200c6060830184611c49565b95945050505050565b6000602082019050818103600083015261202e81611d11565b9050919050565b6000602082019050818103600083015261204e81611d34565b9050919050565b6000602082019050818103600083015261206e81611d57565b9050919050565b6000602082019050818103600083015261208e81611d7a565b9050919050565b600060208201905081810360008301526120ae81611d9d565b9050919050565b600060208201905081810360008301526120ce81611dc0565b9050919050565b600060208201905081810360008301526120ee81611de3565b9050919050565b6000602082019050818103600083015261210e81611e06565b9050919050565b6000602082019050818103600083015261212e81611e29565b9050919050565b6000602082019050818103600083015261214e81611e4c565b9050919050565b6000602082019050818103600083015261216e81611eb5565b9050919050565b600060208201905061218a6000830184611ed8565b92915050565b600061219a6121ab565b90506121a68282612480565b919050565b6000604051905090565b600067ffffffffffffffff8211156121d0576121cf61253e565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156121fc576121fb61253e565b5b61220582612586565b9050602081019050919050565b600067ffffffffffffffff82111561222d5761222c61253e565b5b61223682612586565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061228b826123d8565b9150612296836123d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156122cb576122ca6124b1565b5b828201905092915050565b60006122e1826123d8565b91506122ec836123d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612325576123246124b1565b5b828202905092915050565b600061233b826123d8565b9150612346836123d8565b925082821015612359576123586124b1565b5b828203905092915050565b600061236f826123b8565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561240f5780820151818401526020810190506123f4565b8381111561241e576000848401525b50505050565b600061242f826123d8565b91506000821415612443576124426124b1565b5b600182039050919050565b6000600282049050600182168061246657607f821691505b6020821081141561247a576124796124e0565b5b50919050565b61248982612586565b810181811067ffffffffffffffff821117156124a8576124a761253e565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f736f7272792c20796f752063616e6e6f74206f7665727269646520657869737460008201527f696e672062756e646c6520696400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f63616e6e6f74207375627472616374203020746f6b656e730000000000000000600082015250565b7f616464726573732830292063616e6e6f74206265206120686f6c646572000000600082015250565b7f6e6f7420656e6f75676820746f6b656e73000000000000000000000000000000600082015250565b7f746f55696e743235365f6f75744f66426f756e64730000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f746f416464726573735f6f75744f66426f756e64730000000000000000000000600082015250565b7f43616c6c6572206973206e6f7420616e2061646d696e206f722052656769737460008201527f7279204d616e6167657220636f6e747261637400000000000000000000000000602082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b61284d81612364565b811461285857600080fd5b50565b61286481612382565b811461286f57600080fd5b50565b61287b8161238c565b811461288657600080fd5b5056fea26469706673582212208223091009135fabf62ddf6eaeee230ae22fd43f1137f7d831c030a4328d676b64736f6c63430008070033

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806342f1e879116100a2578063a217fddf11610071578063a217fddf146102b9578063b45e81bc146102d7578063ba028f75146102f3578063d547741f1461030f578063f2fde38b1461032b5761010b565b806342f1e87914610243578063715018a6146102615780638da5cb5b1461026b57806391d14854146102895761010b565b8063248a9ca3116100de578063248a9ca3146101a85780632f2ff15d146101d857806336568abe146101f457806341e43ae1146102105761010b565b806301ffc9a7146101105780630d5ab2621461014057806311cec3651461015c5780631437c3091461018c575b600080fd5b61012a60048036038101906101259190611bd3565b610347565b6040516101379190611f6a565b60405180910390f35b61015a60048036038101906101559190611a94565b6103c1565b005b61017660048036038101906101719190611ac1565b61046a565b6040516101839190612175565b60405180910390f35b6101a660048036038101906101a19190611a94565b6104d3565b005b6101c260048036038101906101bd9190611b66565b61057c565b6040516101cf9190611f85565b60405180910390f35b6101f260048036038101906101ed9190611b93565b61059c565b005b61020e60048036038101906102099190611b93565b6105c5565b005b61022a60048036038101906102259190611c00565b610648565b60405161023a9493929190611fc2565b60405180910390f35b61024b61081c565b6040516102589190611f85565b60405180910390f35b610269610840565b005b6102736108c8565b6040516102809190611f4f565b60405180910390f35b6102a3600480360381019061029e9190611b93565b6108f2565b6040516102b09190611f6a565b60405180910390f35b6102c161095d565b6040516102ce9190611f85565b60405180910390f35b6102f160048036038101906102ec9190611b1d565b610964565b005b61030d60048036038101906103089190611b1d565b6109d9565b005b61032960048036038101906103249190611b93565b610a4e565b005b61034560048036038101906103409190611a94565b610a77565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103ba57506103b982610b6f565b5b9050919050565b6103c9610bd9565b73ffffffffffffffffffffffffffffffffffffffff166103e76108c8565b73ffffffffffffffffffffffffffffffffffffffff161461043d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610434906120f5565b60405180910390fd5b6104677fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc82610be1565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020826040516104b99190611efe565b908152602001604051809103902060000154905092915050565b6104db610bd9565b73ffffffffffffffffffffffffffffffffffffffff166104f96108c8565b73ffffffffffffffffffffffffffffffffffffffff161461054f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610546906120f5565b60405180910390fd5b6105797fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc82610a4e565b50565b600060036000838152602001908152602001600020600101549050919050565b6105a58261057c565b6105b6816105b1610bd9565b610bef565b6105c08383610c8c565b505050565b6105cd610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461063a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063190612155565b60405180910390fd5b6106448282610d6d565b5050565b6060600060606000808560405161065f9190611efe565b90815260200160405180910390206000016000866040516106809190611efe565b9081526020016040518091039020600101546000876040516106a29190611efe565b90815260200160405180910390206002016000886040516106c39190611efe565b908152602001604051809103902060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168380546107019061244e565b80601f016020809104026020016040519081016040528092919081815260200182805461072d9061244e565b801561077a5780601f1061074f5761010080835404028352916020019161077a565b820191906000526020600020905b81548152906001019060200180831161075d57829003601f168201915b5050505050935081805461078d9061244e565b80601f01602080910402602001604051908101604052809291908181526020018280546107b99061244e565b80156108065780601f106107db57610100808354040283529160200191610806565b820191906000526020600020905b8154815290600101906020018083116107e957829003601f168201915b5050505050915093509350935093509193509193565b7fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc81565b610848610bd9565b73ffffffffffffffffffffffffffffffffffffffff166108666108c8565b73ffffffffffffffffffffffffffffffffffffffff16146108bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b3906120f5565b60405180910390fd5b6108c66000610e4f565b565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b81565b61098e7fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc336108f2565b6109cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c490612135565b60405180910390fd5b6109d681610f15565b50565b610a037fc2979137d1774e40fe2638d355bf7a7b092be4c67f242aad1655e1e27f9df9cc336108f2565b610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3990612135565b60405180910390fd5b610a4b81611108565b50565b610a578261057c565b610a6881610a63610bd9565b610bef565b610a728383610d6d565b505050565b610a7f610bd9565b73ffffffffffffffffffffffffffffffffffffffff16610a9d6108c8565b73ffffffffffffffffffffffffffffffffffffffff1614610af3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aea906120f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90612055565b60405180910390fd5b610b6c81610e4f565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b610beb8282610c8c565b5050565b610bf982826108f2565b610c8857610c1e8173ffffffffffffffffffffffffffffffffffffffff166014611414565b610c2c8360001c6020611414565b604051602001610c3d929190611f15565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7f9190611fa0565b60405180910390fd5b5050565b610c9682826108f2565b610d695760016003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d0e610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610d7782826108f2565b15610e4b5760006003600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610df0610bd9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000610f3d82600081518110610f2e57610f2d61250f565b5b60200260200101516000611650565b9050600082600181518110610f5557610f5461250f565b5b6020026020010151604051602001610f6d9190611ee7565b60405160208183030381529060405290506000610fa684600281518110610f9757610f9661250f565b5b602002602001015160006116c6565b90506000811415610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe390612075565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208360405161103a9190611efe565b908152602001604051809103902060000154101561108d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611084906120b5565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020836040516110db9190611efe565b908152602001604051809103902060000160008282546110fb9190612330565b9250508190555050505050565b6000611130826000815181106111215761112061250f565b5b60200260200101516000611650565b90506000826001815181106111485761114761250f565b5b60200260200101516040516020016111609190611ee7565b604051602081830303815290604052905060006111998460028151811061118a5761118961250f565b5b602002602001015160006116c6565b90506000846003815181106111b1576111b061250f565b5b60200260200101516040516020016111c99190611ee7565b60405160208183030381529060405290506000856004815181106111f0576111ef61250f565b5b60200260200101516040516020016112089190611ee7565b60405160208183030381529060405290506000611241876005815181106112325761123161250f565b5b60200260200101516000611650565b9050600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156112b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa90612095565b60405180910390fd5b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020856040516113009190611efe565b908152602001604051809103902060010160009054906101000a900460ff161561135f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135690612035565b60405180910390fd5b604051806040016040528085815260200160011515815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020866040516113c49190611efe565b90815260200160405180910390206000820151816000015560208201518160010160006101000a81548160ff02191690831515021790555090505061140b8686858561172d565b50505050505050565b60606000600283600261142791906122d6565b6114319190612280565b67ffffffffffffffff81111561144a5761144961253e565b5b6040519080825280601f01601f19166020018201604052801561147c5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106114b4576114b361250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115185761151761250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261155891906122d6565b6115629190612280565b90505b6001811115611602577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106115a4576115a361250f565b5b1a60f81b8282815181106115bb576115ba61250f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806115fb90612424565b9050611565565b5060008414611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d90612015565b60405180910390fd5b8091505092915050565b600060148261165f9190612280565b835110156116a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169990612115565b60405180910390fd5b60006c01000000000000000000000000836020860101510490508091505092915050565b60006020826116d59190612280565b83511015611718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170f906120d5565b60405180910390fd5b60008260208501015190508091505092915050565b60405180608001604052808381526020014281526020018281526020018573ffffffffffffffffffffffffffffffffffffffff168152506000846040516117749190611efe565b9081526020016040518091039020600082015181600001908051906020019061179e929190611816565b506020820151816001015560408201518160020190805190602001906117c5929190611816565b5060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090505050505050565b8280546118229061244e565b90600052602060002090601f016020900481019282611844576000855561188b565b82601f1061185d57805160ff191683800117855561188b565b8280016001018555821561188b579182015b8281111561188a57825182559160200191906001019061186f565b5b509050611898919061189c565b5090565b5b808211156118b557600081600090555060010161189d565b5090565b60006118cc6118c7846121b5565b612190565b905080838252602082019050828560208602820111156118ef576118ee612572565b5b60005b8581101561193d57813567ffffffffffffffff8111156119155761191461256d565b5b8086016119228982611a38565b855260208501945060208401935050506001810190506118f2565b5050509392505050565b600061195a611955846121e1565b612190565b90508281526020810184848401111561197657611975612577565b5b6119818482856123e2565b509392505050565b600061199c61199784612212565b612190565b9050828152602081018484840111156119b8576119b7612577565b5b6119c38482856123e2565b509392505050565b6000813590506119da81612844565b92915050565b600082601f8301126119f5576119f461256d565b5b8135611a058482602086016118b9565b91505092915050565b600081359050611a1d8161285b565b92915050565b600081359050611a3281612872565b92915050565b600082601f830112611a4d57611a4c61256d565b5b8135611a5d848260208601611947565b91505092915050565b600082601f830112611a7b57611a7a61256d565b5b8135611a8b848260208601611989565b91505092915050565b600060208284031215611aaa57611aa9612581565b5b6000611ab8848285016119cb565b91505092915050565b60008060408385031215611ad857611ad7612581565b5b6000611ae6858286016119cb565b925050602083013567ffffffffffffffff811115611b0757611b0661257c565b5b611b1385828601611a66565b9150509250929050565b600060208284031215611b3357611b32612581565b5b600082013567ffffffffffffffff811115611b5157611b5061257c565b5b611b5d848285016119e0565b91505092915050565b600060208284031215611b7c57611b7b612581565b5b6000611b8a84828501611a0e565b91505092915050565b60008060408385031215611baa57611ba9612581565b5b6000611bb885828601611a0e565b9250506020611bc9858286016119cb565b9150509250929050565b600060208284031215611be957611be8612581565b5b6000611bf784828501611a23565b91505092915050565b600060208284031215611c1657611c15612581565b5b600082013567ffffffffffffffff811115611c3457611c3361257c565b5b611c4084828501611a66565b91505092915050565b611c5281612364565b82525050565b611c6181612376565b82525050565b611c7081612382565b82525050565b6000611c8182612243565b611c8b8185612259565b9350611c9b8185602086016123f1565b80840191505092915050565b6000611cb28261224e565b611cbc8185612264565b9350611ccc8185602086016123f1565b611cd581612586565b840191505092915050565b6000611ceb8261224e565b611cf58185612275565b9350611d058185602086016123f1565b80840191505092915050565b6000611d1e602083612264565b9150611d2982612597565b602082019050919050565b6000611d41602d83612264565b9150611d4c826125c0565b604082019050919050565b6000611d64602683612264565b9150611d6f8261260f565b604082019050919050565b6000611d87601883612264565b9150611d928261265e565b602082019050919050565b6000611daa601d83612264565b9150611db582612687565b602082019050919050565b6000611dcd601183612264565b9150611dd8826126b0565b602082019050919050565b6000611df0601583612264565b9150611dfb826126d9565b602082019050919050565b6000611e13602083612264565b9150611e1e82612702565b602082019050919050565b6000611e36601583612264565b9150611e418261272b565b602082019050919050565b6000611e59603383612264565b9150611e6482612754565b604082019050919050565b6000611e7c601783612275565b9150611e87826127a3565b601782019050919050565b6000611e9f601183612275565b9150611eaa826127cc565b601182019050919050565b6000611ec2602f83612264565b9150611ecd826127f5565b604082019050919050565b611ee1816123d8565b82525050565b6000611ef38284611c76565b915081905092915050565b6000611f0a8284611ce0565b915081905092915050565b6000611f2082611e6f565b9150611f2c8285611ce0565b9150611f3782611e92565b9150611f438284611ce0565b91508190509392505050565b6000602082019050611f646000830184611c49565b92915050565b6000602082019050611f7f6000830184611c58565b92915050565b6000602082019050611f9a6000830184611c67565b92915050565b60006020820190508181036000830152611fba8184611ca7565b905092915050565b60006080820190508181036000830152611fdc8187611ca7565b9050611feb6020830186611ed8565b8181036040830152611ffd8185611ca7565b905061200c6060830184611c49565b95945050505050565b6000602082019050818103600083015261202e81611d11565b9050919050565b6000602082019050818103600083015261204e81611d34565b9050919050565b6000602082019050818103600083015261206e81611d57565b9050919050565b6000602082019050818103600083015261208e81611d7a565b9050919050565b600060208201905081810360008301526120ae81611d9d565b9050919050565b600060208201905081810360008301526120ce81611dc0565b9050919050565b600060208201905081810360008301526120ee81611de3565b9050919050565b6000602082019050818103600083015261210e81611e06565b9050919050565b6000602082019050818103600083015261212e81611e29565b9050919050565b6000602082019050818103600083015261214e81611e4c565b9050919050565b6000602082019050818103600083015261216e81611eb5565b9050919050565b600060208201905061218a6000830184611ed8565b92915050565b600061219a6121ab565b90506121a68282612480565b919050565b6000604051905090565b600067ffffffffffffffff8211156121d0576121cf61253e565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156121fc576121fb61253e565b5b61220582612586565b9050602081019050919050565b600067ffffffffffffffff82111561222d5761222c61253e565b5b61223682612586565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061228b826123d8565b9150612296836123d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156122cb576122ca6124b1565b5b828201905092915050565b60006122e1826123d8565b91506122ec836123d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612325576123246124b1565b5b828202905092915050565b600061233b826123d8565b9150612346836123d8565b925082821015612359576123586124b1565b5b828203905092915050565b600061236f826123b8565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561240f5780820151818401526020810190506123f4565b8381111561241e576000848401525b50505050565b600061242f826123d8565b91506000821415612443576124426124b1565b5b600182039050919050565b6000600282049050600182168061246657607f821691505b6020821081141561247a576124796124e0565b5b50919050565b61248982612586565b810181811067ffffffffffffffff821117156124a8576124a761253e565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f736f7272792c20796f752063616e6e6f74206f7665727269646520657869737460008201527f696e672062756e646c6520696400000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f63616e6e6f74207375627472616374203020746f6b656e730000000000000000600082015250565b7f616464726573732830292063616e6e6f74206265206120686f6c646572000000600082015250565b7f6e6f7420656e6f75676820746f6b656e73000000000000000000000000000000600082015250565b7f746f55696e743235365f6f75744f66426f756e64730000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f746f416464726573735f6f75744f66426f756e64730000000000000000000000600082015250565b7f43616c6c6572206973206e6f7420616e2061646d696e206f722052656769737460008201527f7279204d616e6167657220636f6e747261637400000000000000000000000000602082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b61284d81612364565b811461285857600080fd5b50565b61286481612382565b811461286f57600080fd5b50565b61287b8161238c565b811461288657600080fd5b5056fea26469706673582212208223091009135fabf62ddf6eaeee230ae22fd43f1137f7d831c030a4328d676b64736f6c63430008070033