Contract 0x96E2df7Bc3187DBecb7A5ed06Ed1552bf9C86599

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x00796324ce7e782c89b870620d03c08451ed58a7722cedd3094138aee05d74380x60806040105303022021-09-01 7:55:3254 days 2 hrs agoInsurAce Protocol: Deployer IN  Contract Creation0 BNB0.025756194
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Cover

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : Cover.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

import {ISecurityMatrix} from "../secmatrix/ISecurityMatrix.sol";
import {Math} from "../common/Math.sol";
import {Constant} from "../common/Constant.sol";
import {ICoverConfig} from "./ICoverConfig.sol";
import {ICoverData} from "./ICoverData.sol";
import {ICoverQuotation} from "./ICoverQuotation.sol";
import {ICapitalPool} from "../pool/ICapitalPool.sol";
import {IPremiumPool} from "../pool/IPremiumPool.sol";
import {IExchangeRate} from "../exchange/IExchangeRate.sol";
import {IReferralProgram} from "../referral/IReferralProgram.sol";
import {IProduct} from "../product/IProduct.sol";
import {ICover} from "./ICover.sol";

contract Cover is ICover, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {
    using SafeERC20Upgradeable for IERC20Upgradeable;
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;

    // the security matrix address
    address public smx;
    // the cover data address
    address public data;
    // the cover config address
    address public cfg;
    // the cover quotation address
    address public quotation;
    // the capital pool address
    address public capitalPool;
    // the premium pool address
    address public premiumPool;
    // the insur token address
    address public insur;

    // buy cover maxmimum block number latency
    uint256 public buyCoverMaxBlkNumLatency;
    // buy cover signer flag map (signer -> true/false)
    mapping(address => bool) public buyCoverSignerFlagMap;
    // buy cover owner nonce flag map (owner -> nonce -> true/false)
    mapping(address => mapping(uint256 => bool)) public buyCoverNonceFlagMap;

    // the exchange rate address
    address public exchangeRate;

    // the referral program address
    address public referralProgram;

    // the product address
    address public product;

    function initialize() public initializer {
        __Ownable_init();
        __ReentrancyGuard_init();
    }

    function setup(
        address securityMatrixAddress,
        address insurTokenAddress,
        address _coverDataAddress,
        address _coverCfgAddress,
        address _coverQuotationAddress,
        address _capitalPool,
        address _premiumPool,
        address _exchangeRate,
        address _referralProgram,
        address _productAddress
    ) external onlyOwner {
        require(securityMatrixAddress != address(0), "S:1");
        require(insurTokenAddress != address(0), "S:2");
        require(_coverDataAddress != address(0), "S:3");
        require(_coverCfgAddress != address(0), "S:4");
        require(_coverQuotationAddress != address(0), "S:5");
        require(_capitalPool != address(0), "S:6");
        require(_premiumPool != address(0), "S:7");
        require(_exchangeRate != address(0), "S:8");
        require(_referralProgram != address(0), "S:9");
        require(_productAddress != address(0), "S:10");
        smx = securityMatrixAddress;
        insur = insurTokenAddress;
        data = _coverDataAddress;
        cfg = _coverCfgAddress;
        quotation = _coverQuotationAddress;
        capitalPool = _capitalPool;
        premiumPool = _premiumPool;
        exchangeRate = _exchangeRate;
        referralProgram = _referralProgram;
        product = _productAddress;
    }

    function pauseAll() external onlyOwner whenNotPaused {
        _pause();
    }

    function unPauseAll() external onlyOwner whenPaused {
        _unpause();
    }

    modifier allowedCaller() {
        require((ISecurityMatrix(smx).isAllowdCaller(address(this), _msgSender())) || (_msgSender() == owner()), "allowedCaller");
        _;
    }

    function getPremium(
        uint256[] memory products,
        uint256[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256[] memory rewardPercentages
    )
        external
        view
        override
        returns (
            uint256,
            uint256[] memory,
            uint256,
            uint256[] memory
        )
    {
        require(products.length == durationInDays.length, "GPCHK: 1");
        require(products.length == amounts.length, "GPCHK: 2");

        // check if the currency is a valid premium currency
        require(ICoverConfig(cfg).isValidCurrency(currency), "GPCHK: 3");

        // check the owner and referrer addresses
        require(owner != address(0), "GPCHK: 4");
        require(address(uint160(referralCode)) != address(0), "GPCHK: 5");

        // check if each amount is within the individual capacity
        uint256[] memory helperParameters = new uint256[](2);
        helperParameters[0] = 0;
        helperParameters[1] = 0;
        for (uint256 i = 0; i < products.length; i++) {
            helperParameters[0] = helperParameters[0].add(amounts[i]);
            helperParameters[1] = helperParameters[1].add(amounts[i].mul(durationInDays[i]));
            require(ICapitalPool(capitalPool).canBuyCoverPerProduct(products[i], amounts[i], currency), "GPCHK: 6");
        }

        // check if the total amount is within the overall capacity (ETH/DAI, from Capital Pool)
        require(ICapitalPool(capitalPool).canBuyCover(helperParameters[0], currency), "GPCHK: 7");

        // check and calculate the cover premium amount
        uint256 premiumAmount = 0;
        uint256 discountPercent = 0;
        (premiumAmount, discountPercent) = ICoverQuotation(quotation).getPremium(products, durationInDays, amounts, currency);
        require(premiumAmount > 0, "GPCHK: 8");

        // check the Cover Owner and Referral Reward Percentages (its length is 2)
        require(rewardPercentages.length == 2, "GPCHK: 9");
        uint256[] memory insurRewardAmounts = new uint256[](2);

        // calculate the Cover Owner and Referral Reward amounts
        uint256 premiumAmount2Insur = IExchangeRate(exchangeRate).getTokenToTokenAmount(currency, insur, premiumAmount);
        if (premiumAmount2Insur > 0 && owner != address(uint160(referralCode))) {
            // estimate the Cover Owner INSUR Reward Amount
            uint256 coverOwnerRewardPctg = _getRewardPctg(rewardPercentages[0]);
            insurRewardAmounts[0] = _getRewardAmount(premiumAmount2Insur, coverOwnerRewardPctg);
            // estimate the Referral INSUR Reward Amount
            uint256 referralRewardPctg = IReferralProgram(referralProgram).getRewardPctg(Constant.REFERRALREWARD_COVER, rewardPercentages[1]);
            insurRewardAmounts[1] = IReferralProgram(referralProgram).getRewardAmount(Constant.REFERRALREWARD_COVER, premiumAmount2Insur, referralRewardPctg);
        } else {
            // there is no INSUR reward amounts if no valid premium value or referrer
            insurRewardAmounts[0] = 0;
            insurRewardAmounts[1] = 0;
        }

        return (premiumAmount, helperParameters, discountPercent, insurRewardAmounts);
    }

    event BuyCoverEvent(address indexed currency, address indexed owner, uint256 coverId, uint256 productId, uint256 durationInDays, uint256 extendedClaimDays, uint256 coverAmount, uint256 estimatedPremium, uint256 coverStatus);

    event BuyCoverEventV2(address indexed currency, address indexed owner, uint256 coverId, uint256 productId, uint256 durationInDays, uint256 extendedClaimDays, uint256 coverAmount, uint256 estimatedPremium, uint256 coverStatus, uint256 delayEffectiveDays);

    event BuyCoverOwnerRewardEvent(address indexed owner, uint256 rewardPctg, uint256 insurRewardAmt);

    function buyCover(
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters,
        uint256[] memory securityParameters,
        uint8[] memory v,
        bytes32[] memory r,
        bytes32[] memory s
    ) external payable override whenNotPaused nonReentrant {
        // check the number of cover details
        require(products.length == durationInDays.length, "BC: 1");
        require(products.length == amounts.length, "BC: 2");

        // check if the currency is a valid premium currency
        require(ICoverConfig(cfg).isValidCurrency(currency), "BC: 3");

        // check the beneficiary address list (its length is 2)
        require(owner != address(0), "BC: 4");
        require(address(uint160(referralCode)) != address(0), "BC: 5");

        // check the helper parameters (its length is 4)
        // helperParameters[0] -> totalAmounts (the sum of cover amounts)
        // helperParameters[1] -> totalWeight (the sum of cover amounts multipled by cover durations)
        // helperParameters[2] -> coverOwnerRewardPctg (the cover owner reward perentageX10000 of premium, 0 if not set)
        // helperParameters[3] -> referralRewardPctg (the referral reward perentageX10000 of premium, 0 if not set)
        require(helperParameters.length == 4, "BC: 6");

        // check the security parameters (its length is 2)
        // securityParameters[0] -> blockNumber (the block number when the signature is generated off-chain)
        // securityParameters[1] -> nonce (the nonce of the cover owner, can be timestamp in seconds)
        require(securityParameters.length == 2, "BC: 7");

        // check the block number latency
        require((block.number >= securityParameters[0]) && (block.number - securityParameters[0] <= buyCoverMaxBlkNumLatency), "BC: 8");

        // check the signature
        require(_checkSignature(address(this), products, durationInDays, amounts, currency, owner, referralCode, premiumAmount, helperParameters, securityParameters, v, r, s), "BC: 9");

        // check the cover owner nonce flag
        require(!buyCoverNonceFlagMap[owner][securityParameters[1]], "BC: 10");
        buyCoverNonceFlagMap[owner][securityParameters[1]] = true;

        // check and receive the premium from this transaction
        if (currency == Constant.BCNATIVETOKENADDRESS) {
            require(premiumAmount <= msg.value, "BC: 11");
            IPremiumPool(premiumPool).addPremiumAmount{value: premiumAmount}(currency, premiumAmount);
        } else {
            require(IERC20Upgradeable(currency).balanceOf(_msgSender()) >= premiumAmount, "BC: 12");
            require(IERC20Upgradeable(currency).allowance(_msgSender(), address(this)) >= premiumAmount, "BC: 13");
            IERC20Upgradeable(currency).safeTransferFrom(_msgSender(), address(this), premiumAmount);
            IERC20Upgradeable(currency).safeTransfer(premiumPool, premiumAmount);
            IPremiumPool(premiumPool).addPremiumAmount(currency, premiumAmount);
        }

        // process the cover creation and reward distribution
        _processCovers(products, durationInDays, amounts, currency, owner, referralCode, premiumAmount, helperParameters);
    }

    function _checkSignature(
        address scAddress,
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters,
        uint256[] memory securityParameters,
        uint8[] memory v,
        bytes32[] memory r,
        bytes32[] memory s
    ) internal view returns (bool) {
        bytes32 msgHash = "msgHash";
        {
            bytes memory msg1 = abi.encodePacked(scAddress, products, durationInDays, amounts, currency);
            bytes memory msg2 = abi.encodePacked(owner, referralCode, premiumAmount, helperParameters, securityParameters);
            msgHash = keccak256(abi.encodePacked(msg1, msg2));
        }
        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
        bytes32 prefixedHash = keccak256(abi.encodePacked(prefix, msgHash));
        address signer1 = ecrecover(prefixedHash, v[0], r[0], s[0]);
        return buyCoverSignerFlagMap[signer1];
    }

    function _processCovers(
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters
    ) internal {
        uint256 ownerRewardPctg = 0;
        uint256 referralRewardPctg = 0;

        // check and give out the insur token reward if there is any referrer
        if (owner != address(uint160(referralCode))) {
            uint256 premiumAmount2Insur = IExchangeRate(exchangeRate).getTokenToTokenAmount(currency, insur, premiumAmount);
            // distribute the cover owner reward
            ownerRewardPctg = _getRewardPctg(helperParameters[2]);
            _processCoverOwnerReward(owner, premiumAmount2Insur, ownerRewardPctg);
            // distribute the referral reward if the referrer address is not the owner address
            referralRewardPctg = IReferralProgram(referralProgram).getRewardPctg(Constant.REFERRALREWARD_COVER, helperParameters[3]);
            IReferralProgram(referralProgram).processReferralReward(address(uint160(referralCode)), owner, Constant.REFERRALREWARD_COVER, premiumAmount2Insur, referralRewardPctg);
        }

        // create the expanded cover records (one per each cover item)
        uint256[] memory capacities = new uint256[](2);
        (capacities[0], capacities[1]) = ICapitalPool(capitalPool).getCapacityInfo();
        _createCovers(owner, currency, premiumAmount, products, durationInDays, amounts, capacities, helperParameters, ownerRewardPctg, referralRewardPctg);
    }

    function _createCovers(
        address owner,
        address currency,
        uint256 premiumAmount,
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        uint256[] memory capacities,
        uint256[] memory helperParameters,
        uint256 ownerRewardPctg,
        uint256 referralRewardPctg
    ) internal {
        require(IExchangeRate(exchangeRate).getTokenToTokenAmount(currency, ICapitalPool(capitalPool).getBaseToken(), helperParameters[0]) <= capacities[0], "BCC: 1");
        uint256 cumPremiumAmount = 0;
        for (uint256 index = 0; index < products.length; ++index) {
            require(IExchangeRate(exchangeRate).getTokenToTokenAmount(currency, ICapitalPool(capitalPool).getBaseToken(), amounts[index]).add(ICapitalPool(capitalPool).getCoverAmtPPInBaseToken(products[index])) <= capacities[1].mul(ICapitalPool(capitalPool).getCoverAmtPPMaxRatio()).div(10000), "BCC: 2");
            ICapitalPool(capitalPool).buyCoverPerProduct(products[index], amounts[index], currency);

            uint256 estimatedPremium = 0;
            if (index == products.length.sub(1)) {
                estimatedPremium = premiumAmount.sub(cumPremiumAmount);
            } else {
                uint256 currentWeight = amounts[index].mul(durationInDays[index]);
                estimatedPremium = currentWeight.mul(10000).div(helperParameters[1]).mul(premiumAmount).div(10000);
                cumPremiumAmount = cumPremiumAmount.add(estimatedPremium);
            }

            _createOneCover(owner, currency, products[index], durationInDays[index], amounts[index], estimatedPremium, ownerRewardPctg, referralRewardPctg);
        }
    }

    function _createOneCover(
        address owner,
        address currency,
        uint256 productId,
        uint256 durationInDays,
        uint256 amount,
        uint256 estimatedPremium,
        uint256 ownerRewardPctg,
        uint256 referralRewardPctg
    ) internal {
        uint256 beginTimestamp = block.timestamp.add(IProduct(product).getProductDelayEffectiveDays(productId) * 1 days); // solhint-disable-line not-rely-on-time
        uint256 endTimestamp = beginTimestamp.add(durationInDays * 1 days);
        uint256 nextCoverId = ICoverData(data).increaseCoverCount(owner);
        ICoverData(data).setNewCoverDetails(owner, nextCoverId, productId, amount, currency, beginTimestamp, endTimestamp, endTimestamp.add(ICoverConfig(cfg).getMaxClaimDurationInDaysAfterExpired() * 1 days), estimatedPremium);

        if (ownerRewardPctg > 0) {
            ICoverData(data).setCoverRewardPctg(owner, nextCoverId, ownerRewardPctg);
        }

        if (referralRewardPctg > 0) {
            ICoverData(data).setCoverReferralRewardPctg(owner, nextCoverId, referralRewardPctg);
        }

        uint256 delayEffectiveDays = IProduct(product).getProductDelayEffectiveDays(productId);
        emit BuyCoverEventV2(currency, owner, nextCoverId, productId, durationInDays, ICoverConfig(cfg).getMaxClaimDurationInDaysAfterExpired(), amount, estimatedPremium, Constant.COVERSTATUS_ACTIVE, delayEffectiveDays);
    }

    event UnlockCoverRewardEvent(address indexed owner, uint256 amount);

    function unlockRewardByController(address _owner, address _to) external override allowedCaller whenNotPaused nonReentrant returns (uint256) {
        return _unlockReward(_owner, _to);
    }

    function _unlockReward(address owner, address to) internal returns (uint256) {
        uint256 toBeunlockedAmt = ICoverData(data).getBuyCoverInsurTokenEarned(owner);
        if (toBeunlockedAmt > 0) {
            ICoverData(data).decreaseTotalInsurTokenRewardAmount(toBeunlockedAmt);
            ICoverData(data).decreaseBuyCoverInsurTokenEarned(owner, toBeunlockedAmt);
            IERC20Upgradeable(insur).safeTransfer(to, toBeunlockedAmt);
            emit UnlockCoverRewardEvent(owner, toBeunlockedAmt);
        }
        return toBeunlockedAmt;
    }

    function getRewardAmount() external view override returns (uint256) {
        return ICoverData(data).getBuyCoverInsurTokenEarned(_msgSender());
    }

    function getCoverOwnerRewardAmount(uint256 premiumAmount2Insur, uint256 overwrittenRewardPctg) external view override returns (uint256, uint256) {
        uint256 rewardPctg = _getRewardPctg(overwrittenRewardPctg);
        uint256 rewardAmount = _getRewardAmount(premiumAmount2Insur, rewardPctg);
        return (rewardPctg, rewardAmount);
    }

    function _getRewardPctg(uint256 overwrittenRewardPctg) internal view returns (uint256) {
        return overwrittenRewardPctg > 0 ? overwrittenRewardPctg : ICoverConfig(cfg).getInsurTokenRewardPercentX10000();
    }

    function _getRewardAmount(uint256 premiumAmount2Insur, uint256 rewardPctg) internal pure returns (uint256) {
        return rewardPctg <= 10000 ? premiumAmount2Insur.mul(rewardPctg).div(10**4) : 0;
    }

    function _processCoverOwnerReward(
        address owner,
        uint256 premiumAmount2Insur,
        uint256 rewardPctg
    ) internal {
        require(rewardPctg <= 10000, "PCORWD: 1");
        uint256 rewardAmount = _getRewardAmount(premiumAmount2Insur, rewardPctg);
        if (rewardAmount > 0) {
            ICoverData(data).increaseTotalInsurTokenRewardAmount(rewardAmount);
            ICoverData(data).increaseBuyCoverInsurTokenEarned(owner, rewardAmount);
            emit BuyCoverOwnerRewardEvent(owner, rewardPctg, rewardAmount);
        }
    }

    function getINSURRewardBalanceDetails() external view override returns (uint256, uint256) {
        uint256 insurRewardBalance = IERC20Upgradeable(insur).balanceOf(address(this));
        uint256 totalRewardRequired = ICoverData(data).getTotalInsurTokenRewardAmount();
        return (insurRewardBalance, totalRewardRequired);
    }

    function removeINSURRewardBalance(address toAddress, uint256 amount) external override onlyOwner {
        IERC20Upgradeable(insur).safeTransfer(toAddress, amount);
    }

    event SetBuyCoverMaxBlkNumLatencyEvent(uint256 numOfBlocks);

    function setBuyCoverMaxBlkNumLatency(uint256 numOfBlocks) external override onlyOwner {
        require(numOfBlocks > 0, "SBCMBNL: 1");
        buyCoverMaxBlkNumLatency = numOfBlocks;
        emit SetBuyCoverMaxBlkNumLatencyEvent(numOfBlocks);
    }

    event SetBuyCoverSignerEvent(address indexed signer, bool enabled);

    function setBuyCoverSigner(address signer, bool enabled) external override onlyOwner {
        require(signer != address(0), "SBCS: 1");
        buyCoverSignerFlagMap[signer] = enabled;
        emit SetBuyCoverSignerEvent(signer, enabled);
    }
}

File 2 of 22 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20Upgradeable.sol";
import "../../math/SafeMathUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using SafeMathUpgradeable for uint256;
    using AddressUpgradeable for address;

    function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 22 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 4 of 22 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 5 of 22 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
    uint256[49] private __gap;
}

File 6 of 22 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ContextUpgradeable.sol";
import "../proxy/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal initializer {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal initializer {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
    uint256[49] private __gap;
}

File 7 of 22 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    function __ReentrancyGuard_init() internal initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
    uint256[49] private __gap;
}

File 8 of 22 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 22 : ISecurityMatrix.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ISecurityMatrix {
    function isAllowdCaller(address _callee, address _caller) external view returns (bool);
}

File 10 of 22 : Math.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";

// a library for performing various math operations
library Math {
    using SafeMathUpgradeable for uint256;

    function max(uint256 x, uint256 y) internal pure returns (uint256) {
        return x < y ? y : x;
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256) {
        return x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y.div(2).add(1);
            while (x < z) {
                z = x;
                x = (y.div(x).add(x)).div(2);
            }
        } else if (y != 0) {
            z = 1;
        }
    }

    // power private function
    function pow(uint256 _base, uint256 _exponent) internal pure returns (uint256) {
        if (_exponent == 0) {
            return 1;
        } else if (_exponent == 1) {
            return _base;
        } else if (_base == 0 && _exponent != 0) {
            return 0;
        } else {
            uint256 z = _base;
            for (uint256 i = 1; i < _exponent; i++) {
                z = z.mul(_base);
            }
            return z;
        }
    }
}

File 11 of 22 : Constant.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

library Constant {
    // the standard 10**18 Amount Multiplier
    uint256 public constant MULTIPLIERX10E18 = 10**18;

    // the valid ETH and DAI addresses (Rinkeby, TBD: Mainnet)
    address public constant BCNATIVETOKENADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    // product status enumerations
    uint256 public constant PRODUCTSTATUS_ENABLED = 1;
    uint256 public constant PRODUCTSTATUS_DISABLED = 2;

    // the cover status enumerations
    uint256 public constant COVERSTATUS_ACTIVE = 0;
    uint256 public constant COVERSTATUS_EXPIRED = 1;
    uint256 public constant COVERSTATUS_CLAIMINPROGRESS = 2;
    uint256 public constant COVERSTATUS_CLAIMDONE = 3;
    uint256 public constant COVERSTATUS_CANCELLED = 4;

    // the claim status enumerations
    uint256 public constant CLAIMSTATUS_SUBMITTED = 0;
    uint256 public constant CLAIMSTATUS_INVESTIGATING = 1;
    uint256 public constant CLAIMSTATUS_PREPAREFORVOTING = 2;
    uint256 public constant CLAIMSTATUS_VOTING = 3;
    uint256 public constant CLAIMSTATUS_VOTINGCOMPLETED = 4;
    uint256 public constant CLAIMSTATUS_ABDISCRETION = 5;
    uint256 public constant CLAIMSTATUS_COMPLAINING = 6;
    uint256 public constant CLAIMSTATUS_COMPLAININGCOMPLETED = 7;
    uint256 public constant CLAIMSTATUS_ACCEPTED = 8;
    uint256 public constant CLAIMSTATUS_REJECTED = 9;
    uint256 public constant CLAIMSTATUS_PAYOUTREADY = 10;
    uint256 public constant CLAIMSTATUS_PAID = 11;

    // the voting outcome status enumerations
    uint256 public constant OUTCOMESTATUS_NONE = 0;
    uint256 public constant OUTCOMESTATUS_ACCEPTED = 1;
    uint256 public constant OUTCOMESTATUS_REJECTED = 2;

    // the referral reward type
    uint256 public constant REFERRALREWARD_NONE = 0;
    uint256 public constant REFERRALREWARD_COVER = 1;
    uint256 public constant REFERRALREWARD_STAKING = 2;
}

File 12 of 22 : ICoverConfig.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ICoverConfig {
    function getAllValidCurrencyArray() external view returns (address[] memory);

    function isValidCurrency(address currency) external view returns (bool);

    function getMinDurationInDays() external view returns (uint256);

    function getMaxDurationInDays() external view returns (uint256);

    function getMinAmountOfCurrency(address currency) external view returns (uint256);

    function getMaxAmountOfCurrency(address currency) external view returns (uint256);

    function getMaxClaimDurationInDaysAfterExpired() external view returns (uint256);

    function getInsurTokenRewardPercentX10000() external view returns (uint256);
}

File 13 of 22 : ICoverData.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ICoverData {
    function hasCoverOwner(address owner) external view returns (bool);

    function addCoverOwner(address owner) external;

    function getAllCoverOwnerList() external view returns (address[] memory);

    function getAllCoverCount() external view returns (uint256);

    function getCoverCount(address owner) external view returns (uint256);

    function increaseCoverCount(address owner) external returns (uint256);

    function setNewCoverDetails(
        address owner,
        uint256 coverId,
        uint256 productId,
        uint256 amount,
        address currency,
        uint256 beginTimestamp,
        uint256 endTimestamp,
        uint256 maxClaimableTimestamp,
        uint256 estimatedPremium
    ) external;

    function getCoverBeginTimestamp(address owner, uint256 coverId) external view returns (uint256);

    function setCoverBeginTimestamp(
        address owner,
        uint256 coverId,
        uint256 timestamp
    ) external;

    function getCoverEndTimestamp(address owner, uint256 coverId) external view returns (uint256);

    function setCoverEndTimestamp(
        address owner,
        uint256 coverId,
        uint256 timestamp
    ) external;

    function getCoverMaxClaimableTimestamp(address owner, uint256 coverId) external view returns (uint256);

    function setCoverMaxClaimableTimestamp(
        address owner,
        uint256 coverId,
        uint256 timestamp
    ) external;

    function getCoverProductId(address owner, uint256 coverId) external view returns (uint256);

    function setCoverProductId(
        address owner,
        uint256 coverId,
        uint256 productId
    ) external;

    function getCoverCurrency(address owner, uint256 coverId) external view returns (address);

    function setCoverCurrency(
        address owner,
        uint256 coverId,
        address currency
    ) external;

    function getCoverAmount(address owner, uint256 coverId) external view returns (uint256);

    function setCoverAmount(
        address owner,
        uint256 coverId,
        uint256 amount
    ) external;

    function getAdjustedCoverStatus(address owner, uint256 coverId) external view returns (uint256);

    function setCoverStatus(
        address owner,
        uint256 coverId,
        uint256 coverStatus
    ) external;

    function isCoverClaimable(address owner, uint256 coverId) external view returns (bool);

    function getCoverEstimatedPremiumAmount(address owner, uint256 coverId) external view returns (uint256);

    function setCoverEstimatedPremiumAmount(
        address owner,
        uint256 coverId,
        uint256 amount
    ) external;

    function getBuyCoverInsurTokenEarned(address owner) external view returns (uint256);

    function increaseBuyCoverInsurTokenEarned(address owner, uint256 amount) external;

    function decreaseBuyCoverInsurTokenEarned(address owner, uint256 amount) external;

    function getTotalInsurTokenRewardAmount() external view returns (uint256);

    function increaseTotalInsurTokenRewardAmount(uint256 amount) external;

    function decreaseTotalInsurTokenRewardAmount(uint256 amount) external;

    function getCoverRewardPctg(address owner, uint256 coverId) external view returns (uint256);

    function setCoverRewardPctg(
        address owner,
        uint256 coverId,
        uint256 rewardPctg
    ) external;

    function getCoverClaimedAmount(address owner, uint256 coverId) external view returns (uint256);

    function increaseCoverClaimedAmount(
        address owner,
        uint256 coverId,
        uint256 amount
    ) external;

    function getCoverReferralRewardPctg(address owner, uint256 coverId) external view returns (uint256);

    function setCoverReferralRewardPctg(
        address owner,
        uint256 coverId,
        uint256 referralRewardPctg
    ) external;
}

File 14 of 22 : ICoverQuotation.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ICoverQuotation {
    function getGrossUnitCost(uint256 productId) external view returns (uint256);

    function getGrossUnitCosts(uint256[] memory products) external view returns (uint256[] memory);

    function getAllGrossUnitCosts() external view returns (uint256[] memory, uint256[] memory);

    function getPremium(
        uint256[] memory products,
        uint256[] memory durationInDays,
        uint256[] memory amounts,
        address currency
    ) external view returns (uint256, uint256);
}

File 15 of 22 : ICapitalPool.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ICapitalPool {
    function canBuyCoverPerProduct(
        uint256 _productId,
        uint256 _amount,
        address _token
    ) external view returns (bool);

    function canBuyCover(uint256 _amount, address _token) external view returns (bool);

    function buyCoverPerProduct(
        uint256 _productId,
        uint256 _amount,
        address _token
    ) external;

    function hasTokenInStakersPool(address _token) external view returns (bool);

    function getCapacityInfo() external view returns (uint256, uint256);

    function getBaseToken() external view returns (address);

    function getCoverAmtPPMaxRatio() external view returns (uint256);

    function getCoverAmtPPInBaseToken(uint256 _productId) external view returns (uint256);

    function settlePaymentForClaim(
        address _token,
        uint256 _amount,
        uint256 _claimId
    ) external;

    function getStakingPercentageX10000() external view returns (uint256);

    function getTVLinBaseToken() external view returns (uint256);
}

File 16 of 22 : IPremiumPool.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface IPremiumPool {
    function addPremiumAmount(address _token, uint256 _amount) external payable;

    function getPremiumPoolAmtInPaymentToken(address _paymentToken) external view returns (uint256);

    function settlePayoutFromPremium(
        address _paymentToken,
        uint256 _settleAmt,
        address _claimToSettlementPool
    ) external returns (uint256);
}

File 17 of 22 : IExchangeRate.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface IExchangeRate {
    function getBaseCurrency() external view returns (address);

    function setBaseCurrency(address _currency) external;

    function getAllCurrencyArray() external view returns (address[] memory);

    function addCurrencies(
        address[] memory _currencies,
        uint128[] memory _multipliers,
        uint128[] memory _rates
    ) external;

    function removeCurrency(address _currency) external;

    function getAllCurrencyRates() external view returns (uint256[] memory);

    function updateAllCurrencies(uint128[] memory _rates) external;

    function updateCurrency(address _currency, uint128 _rate) external;

    function getTokenToTokenAmount(
        address _fromToken,
        address _toToken,
        uint256 _amount
    ) external view returns (uint256);
}

File 18 of 22 : IReferralProgram.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface IReferralProgram {
    function getReferralINSURRewardPctg(uint256 rewardType) external view returns (uint256);

    function setReferralINSURRewardPctg(uint256 rewardType, uint256 percent) external;

    function getReferralINSURRewardAmount() external view returns (uint256);

    function getTotalReferralINSURRewardAmount() external view returns (uint256);

    function getRewardPctg(uint256 rewardType, uint256 overwrittenRewardPctg) external view returns (uint256);

    function getRewardAmount(
        uint256 rewardType,
        uint256 baseAmount,
        uint256 overwrittenRewardPctg
    ) external view returns (uint256);

    function processReferralReward(
        address referrer,
        address referee,
        uint256 rewardType,
        uint256 baseAmount,
        uint256 rewardPctg
    ) external;

    function unlockRewardByController(address referrer, address to) external returns (uint256);

    function getINSURRewardBalanceDetails() external view returns (uint256, uint256);

    function removeINSURRewardBalance(address toAddress, uint256 amount) external;
}

File 19 of 22 : IProduct.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface IProduct {
    function getProductCount() external view returns (uint256);

    function getProductDelayEffectiveDays(uint256 productId) external view returns (uint256);

    function getProductStatus(uint256 productId) external view returns (uint256);

    function getProductDetails(uint256 productId)
        external
        view
        returns (
            bytes32,
            bytes32,
            bytes32,
            uint256,
            uint256
        );

    function getAllProductDetails()
        external
        view
        returns (
            uint256[] memory,
            bytes32[] memory,
            bytes32[] memory,
            bytes32[] memory,
            uint256[] memory,
            uint256[] memory
        );
}

File 20 of 22 : ICover.sol
/*
    Copyright (C) 2020 InsurAce.io

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.7.3;

interface ICover {
    function getPremium(
        uint256[] memory products,
        uint256[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256[] memory rewardPercentages
    )
        external
        view
        returns (
            uint256,
            uint256[] memory,
            uint256,
            uint256[] memory
        );

    function buyCover(
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters,
        uint256[] memory securityParameters,
        uint8[] memory v,
        bytes32[] memory r,
        bytes32[] memory s
    ) external payable;

    function unlockRewardByController(address owner, address to) external returns (uint256);

    function getRewardAmount() external view returns (uint256);

    function getCoverOwnerRewardAmount(uint256 premiumAmount2Insur, uint256 overwrittenRewardPctg) external view returns (uint256, uint256);

    function getINSURRewardBalanceDetails() external view returns (uint256, uint256);

    function removeINSURRewardBalance(address toAddress, uint256 amount) external;

    function setBuyCoverMaxBlkNumLatency(uint256 numOfBlocks) external;

    function setBuyCoverSigner(address signer, bool enabled) external;
}

File 21 of 22 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @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 GSN 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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
    uint256[50] private __gap;
}

File 22 of 22 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"coverId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"productId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"durationInDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"extendedClaimDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"coverAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"estimatedPremium","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"coverStatus","type":"uint256"}],"name":"BuyCoverEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"coverId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"productId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"durationInDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"extendedClaimDays","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"coverAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"estimatedPremium","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"coverStatus","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delayEffectiveDays","type":"uint256"}],"name":"BuyCoverEventV2","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardPctg","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"insurRewardAmt","type":"uint256"}],"name":"BuyCoverOwnerRewardEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numOfBlocks","type":"uint256"}],"name":"SetBuyCoverMaxBlkNumLatencyEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"SetBuyCoverSignerEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnlockCoverRewardEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"uint16[]","name":"products","type":"uint16[]"},{"internalType":"uint16[]","name":"durationInDays","type":"uint16[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"referralCode","type":"uint256"},{"internalType":"uint256","name":"premiumAmount","type":"uint256"},{"internalType":"uint256[]","name":"helperParameters","type":"uint256[]"},{"internalType":"uint256[]","name":"securityParameters","type":"uint256[]"},{"internalType":"uint8[]","name":"v","type":"uint8[]"},{"internalType":"bytes32[]","name":"r","type":"bytes32[]"},{"internalType":"bytes32[]","name":"s","type":"bytes32[]"}],"name":"buyCover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"buyCoverMaxBlkNumLatency","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"buyCoverNonceFlagMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"buyCoverSignerFlagMap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"capitalPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cfg","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"data","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"premiumAmount2Insur","type":"uint256"},{"internalType":"uint256","name":"overwrittenRewardPctg","type":"uint256"}],"name":"getCoverOwnerRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getINSURRewardBalanceDetails","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"products","type":"uint256[]"},{"internalType":"uint256[]","name":"durationInDays","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"referralCode","type":"uint256"},{"internalType":"uint256[]","name":"rewardPercentages","type":"uint256[]"}],"name":"getPremium","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"insur","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"product","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quotation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralProgram","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"removeINSURRewardBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numOfBlocks","type":"uint256"}],"name":"setBuyCoverMaxBlkNumLatency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setBuyCoverSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"securityMatrixAddress","type":"address"},{"internalType":"address","name":"insurTokenAddress","type":"address"},{"internalType":"address","name":"_coverDataAddress","type":"address"},{"internalType":"address","name":"_coverCfgAddress","type":"address"},{"internalType":"address","name":"_coverQuotationAddress","type":"address"},{"internalType":"address","name":"_capitalPool","type":"address"},{"internalType":"address","name":"_premiumPool","type":"address"},{"internalType":"address","name":"_exchangeRate","type":"address"},{"internalType":"address","name":"_referralProgram","type":"address"},{"internalType":"address","name":"_productAddress","type":"address"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smx","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unPauseAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"unlockRewardByController","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50614cb0806100206000396000f3fe6080604052600436106101cd5760003560e01c8063715018a6116100f75780639c9ace0d11610095578063ddeb2d4e11610064578063ddeb2d4e14610881578063f2fde38b14610cd6578063fe95f82814610d09578063ffe6e7d714610d1e576101cd565b80639c9ace0d1461080f578063a64fb0a614610842578063bf9ce95214610857578063cdc423441461086c576101cd565b80637894b779116100d15780637894b7791461077a5780638129fc1c146107b55780638da5cb5b146107ca5780639aec299a146107df576101cd565b8063715018a6146106d257806373ca45fa146106e757806373d4a13a14610765576101cd565b806345c98d561161016f578063595c6a671161013e578063595c6a67146106465780635bfb75081461065b5780635c975abb14610670578063679faa3914610699576101cd565b806345c98d56146102d45780634ba69faa146105ce5780634cb5ad7f146105e357806357776aa51461060d576101cd565b806309a69f57116101ab57806309a69f57146102485780630b0b93111461026f5780633ba0b9a9146102aa578063441da1ba146102bf576101cd565b80630457dad2146101d257806304caf0651461020357806307c97ffb14610231575b600080fd5b3480156101de57600080fd5b506101e7610d33565b604080516001600160a01b039092168252519081900360200190f35b34801561020f57600080fd5b50610218610d42565b6040805192835260208301919091528051918290030190f35b34801561023d57600080fd5b50610246610e42565b005b34801561025457600080fd5b5061025d610efe565b60408051918252519081900360200190f35b34801561027b57600080fd5b5061025d6004803603604081101561029257600080fd5b506001600160a01b0381358116916020013516610f88565b3480156102b657600080fd5b506101e7611149565b3480156102cb57600080fd5b506101e7611158565b3480156102e057600080fd5b50610527600480360360e08110156102f757600080fd5b810190602081018135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460208302840111600160201b8311171561034457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039357600080fd5b8201836020820111156103a557600080fd5b803590602001918460208302840111600160201b831117156103c657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041557600080fd5b82018360208201111561042757600080fd5b803590602001918460208302840111600160201b8311171561044857600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092956001600160a01b038535811696602087013590911695604081013595509193509150608081019060600135600160201b8111156104b657600080fd5b8201836020820111156104c857600080fd5b803590602001918460208302840111600160201b831117156104e957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611167945050505050565b604051808581526020018060200184815260200180602001838103835286818151815260200191508051906020019060200280838360005b8381101561057757818101518382015260200161055f565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156105b657818101518382015260200161059e565b50505050905001965050505050505060405180910390f35b3480156105da57600080fd5b506101e7611add565b3480156105ef57600080fd5b506102466004803603602081101561060657600080fd5b5035611aec565b34801561061957600080fd5b506102466004803603604081101561063057600080fd5b506001600160a01b038135169060200135611bcb565b34801561065257600080fd5b50610246611c48565b34801561066757600080fd5b506101e7611cff565b34801561067c57600080fd5b50610685611d0e565b604080519115158252519081900360200190f35b3480156106a557600080fd5b50610685600480360360408110156106bc57600080fd5b506001600160a01b038135169060200135611d17565b3480156106de57600080fd5b50610246611d37565b3480156106f357600080fd5b50610246600480360361014081101561070b57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c082013581169160e0810135821691610100820135811691610120013516611de3565b34801561077157600080fd5b506101e761217f565b34801561078657600080fd5b506102466004803603604081101561079d57600080fd5b506001600160a01b038135169060200135151561218e565b3480156107c157600080fd5b50610246612295565b3480156107d657600080fd5b506101e7612347565b3480156107eb57600080fd5b506102186004803603604081101561080257600080fd5b5080359060200135612356565b34801561081b57600080fd5b506106856004803603602081101561083257600080fd5b50356001600160a01b031661237f565b34801561084e57600080fd5b506101e7612394565b34801561086357600080fd5b506101e76123a3565b34801561087857600080fd5b506101e76123b2565b610246600480360361018081101561089857600080fd5b810190602081018135600160201b8111156108b257600080fd5b8201836020820111156108c457600080fd5b803590602001918460208302840111600160201b831117156108e557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561093457600080fd5b82018360208201111561094657600080fd5b803590602001918460208302840111600160201b8311171561096757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156109b657600080fd5b8201836020820111156109c857600080fd5b803590602001918460208302840111600160201b831117156109e957600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092956001600160a01b03853581169660208701359091169560408101359550606081013594509192509060a081019060800135600160201b811115610a5d57600080fd5b820183602082011115610a6f57600080fd5b803590602001918460208302840111600160201b83111715610a9057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610adf57600080fd5b820183602082011115610af157600080fd5b803590602001918460208302840111600160201b83111715610b1257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b6157600080fd5b820183602082011115610b7357600080fd5b803590602001918460208302840111600160201b83111715610b9457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610be357600080fd5b820183602082011115610bf557600080fd5b803590602001918460208302840111600160201b83111715610c1657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610c6557600080fd5b820183602082011115610c7757600080fd5b803590602001918460208302840111600160201b83111715610c9857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506123c1945050505050565b348015610ce257600080fd5b5061024660048036036020811015610cf957600080fd5b50356001600160a01b0316612b6d565b348015610d1557600080fd5b5061025d612c70565b348015610d2a57600080fd5b506101e7612c76565b60cb546001600160a01b031681565b60cf54604080516370a0823160e01b81523060048201529051600092839283926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610d9457600080fd5b505afa158015610da8573d6000803e3d6000fd5b505050506040513d6020811015610dbe57600080fd5b505160ca54604080516301eaa5d760e71b815290519293506000926001600160a01b039092169163f552eb8091600480820192602092909190829003018186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d6020811015610e3557600080fd5b5051919350909150509091565b610e4a612c85565b6001600160a01b0316610e5b612347565b6001600160a01b031614610ea4576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b610eac611d0e565b610ef4576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b610efc612c89565b565b60ca546000906001600160a01b031663a31ede21610f1a612c85565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f5757600080fd5b505afa158015610f6b573d6000803e3d6000fd5b505050506040513d6020811015610f8157600080fd5b5051905090565b60c9546000906001600160a01b0316632a1450ea30610fa5612c85565b6040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b158015610ff257600080fd5b505afa158015611006573d6000803e3d6000fd5b505050506040513d602081101561101c57600080fd5b505180611048575061102c612347565b6001600160a01b031661103d612c85565b6001600160a01b0316145b611089576040805162461bcd60e51b815260206004820152600d60248201526c30b63637bbb2b221b0b63632b960991b604482015290519081900360640190fd5b611091611d0e565b156110d6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002609754141561112e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260975561113d8383612d29565b60016097559392505050565b60d3546001600160a01b031681565b60cc546001600160a01b031681565b600060606000606089518b51146111b0576040805162461bcd60e51b8152602060048201526008602482015267475043484b3a203160c01b604482015290519081900360640190fd5b88518b51146111f1576040805162461bcd60e51b815260206004820152600860248201526723a821a4259d101960c11b604482015290519081900360640190fd5b60cb54604080516309f724ab60e31b81526001600160a01b038b8116600483015291519190921691634fb92558916024808301926020929190829003018186803b15801561123e57600080fd5b505afa158015611252573d6000803e3d6000fd5b505050506040513d602081101561126857600080fd5b50516112a6576040805162461bcd60e51b8152602060048201526008602482015267475043484b3a203360c01b604482015290519081900360640190fd5b6001600160a01b0387166112ec576040805162461bcd60e51b815260206004820152600860248201526711d410d212ce880d60c21b604482015290519081900360640190fd5b6001600160a01b038616611332576040805162461bcd60e51b8152602060048201526008602482015267475043484b3a203560c01b604482015290519081900360640190fd5b604080516002808252606080830184529260208301908036833701905050905060008160008151811061136157fe5b60200260200101818152505060008160018151811061137c57fe5b60200260200101818152505060005b8c51811015611543576113ce8b82815181106113a357fe5b6020026020010151836000815181106113b857fe5b6020026020010151612edf90919063ffffffff16565b826000815181106113db57fe5b6020026020010181815250506114306114238d83815181106113f957fe5b60200260200101518d848151811061140d57fe5b6020026020010151612f3990919063ffffffff16565b836001815181106113b857fe5b8260018151811061143d57fe5b602090810291909101015260cd548d516001600160a01b0390911690634400c176908f908490811061146b57fe5b60200260200101518d848151811061147f57fe5b60200260200101518d6040518463ffffffff1660e01b815260040180848152602001838152602001826001600160a01b03168152602001935050505060206040518083038186803b1580156114d357600080fd5b505afa1580156114e7573d6000803e3d6000fd5b505050506040513d60208110156114fd57600080fd5b505161153b576040805162461bcd60e51b815260206004820152600860248201526723a821a4259d101b60c11b604482015290519081900360640190fd5b60010161138b565b5060cd5481516001600160a01b0390911690637613681790839060009061156657fe5b60200260200101518b6040518363ffffffff1660e01b815260040180838152602001826001600160a01b031681526020019250505060206040518083038186803b1580156115b357600080fd5b505afa1580156115c7573d6000803e3d6000fd5b505050506040513d60208110156115dd57600080fd5b505161161b576040805162461bcd60e51b8152602060048201526008602482015267475043484b3a203760c01b604482015290519081900360640190fd5b60008060cc60009054906101000a90046001600160a01b03166001600160a01b031663fc2f5c0d8f8f8f8f6040518563ffffffff1660e01b815260040180806020018060200180602001856001600160a01b03168152602001848103845288818151815260200191508051906020019060200280838360005b838110156116ac578181015183820152602001611694565b50505050905001848103835287818151815260200191508051906020019060200280838360005b838110156116eb5781810151838201526020016116d3565b50505050905001848103825286818151815260200191508051906020019060200280838360005b8381101561172a578181015183820152602001611712565b50505050905001975050505050505050604080518083038186803b15801561175157600080fd5b505afa158015611765573d6000803e3d6000fd5b505050506040513d604081101561177b57600080fd5b5080516020909101519092509050816117c6576040805162461bcd60e51b815260206004820152600860248201526708ea08690967440760c31b604482015290519081900360640190fd5b8751600214611807576040805162461bcd60e51b8152602060048201526008602482015267475043484b3a203960c01b604482015290519081900360640190fd5b6040805160028082526060808301845292602083019080368337019050509050600060d360009054906101000a90046001600160a01b03166001600160a01b0316636947ac658e60cf60009054906101000a90046001600160a01b0316876040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b03168152602001828152602001935050505060206040518083038186803b1580156118b957600080fd5b505afa1580156118cd573d6000803e3d6000fd5b505050506040513d60208110156118e357600080fd5b50519050801580159061190857508a6001600160a01b03168c6001600160a01b031614155b15611a9157600061192c8b60008151811061191f57fe5b6020026020010151612f92565b9050611938828261301e565b8360008151811061194557fe5b602090810291909101015260d4548b516000916001600160a01b03169063b1efb419906001908f908290811061197757fe5b60200260200101516040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156119ba57600080fd5b505afa1580156119ce573d6000803e3d6000fd5b505050506040513d60208110156119e457600080fd5b505160d45460408051635154e67560e11b815260016004820152602481018790526044810184905290519293506001600160a01b039091169163a2a9ccea91606480820192602092909190829003018186803b158015611a4357600080fd5b505afa158015611a57573d6000803e3d6000fd5b505050506040513d6020811015611a6d57600080fd5b5051845185906001908110611a7e57fe5b6020026020010181815250505050611ac8565b600082600081518110611aa057fe5b602002602001018181525050600082600181518110611abb57fe5b6020026020010181815250505b50919e929d509b509950975050505050505050565b60ce546001600160a01b031681565b611af4612c85565b6001600160a01b0316611b05612347565b6001600160a01b031614611b4e576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b60008111611b90576040805162461bcd60e51b815260206004820152600a6024820152695342434d424e4c3a203160b01b604482015290519081900360640190fd5b60d08190556040805182815290517f12605320350ba7ef8ab3aa0ccb329aa20c826013b6d739d9d93070a36b711df09181900360200190a150565b611bd3612c85565b6001600160a01b0316611be4612347565b6001600160a01b031614611c2d576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b60cf54611c44906001600160a01b03168383613047565b5050565b611c50612c85565b6001600160a01b0316611c61612347565b6001600160a01b031614611caa576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b611cb2611d0e565b15611cf7576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610efc61309e565b60cd546001600160a01b031681565b60655460ff1690565b60d260209081526000928352604080842090915290825290205460ff1681565b611d3f612c85565b6001600160a01b0316611d50612347565b6001600160a01b031614611d99576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b611deb612c85565b6001600160a01b0316611dfc612347565b6001600160a01b031614611e45576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b6001600160a01b038a16611e86576040805162461bcd60e51b8152602060048201526003602482015262533a3160e81b604482015290519081900360640190fd5b6001600160a01b038916611ec7576040805162461bcd60e51b8152602060048201526003602482015262299d1960e91b604482015290519081900360640190fd5b6001600160a01b038816611f08576040805162461bcd60e51b8152602060048201526003602482015262533a3360e81b604482015290519081900360640190fd5b6001600160a01b038716611f49576040805162461bcd60e51b815260206004820152600360248201526214ce8d60ea1b604482015290519081900360640190fd5b6001600160a01b038616611f8a576040805162461bcd60e51b8152602060048201526003602482015262533a3560e81b604482015290519081900360640190fd5b6001600160a01b038516611fcb576040805162461bcd60e51b8152602060048201526003602482015262299d1b60e91b604482015290519081900360640190fd5b6001600160a01b03841661200c576040805162461bcd60e51b8152602060048201526003602482015262533a3760e81b604482015290519081900360640190fd5b6001600160a01b03831661204d576040805162461bcd60e51b81526020600482015260036024820152620a674760eb1b604482015290519081900360640190fd5b6001600160a01b03821661208e576040805162461bcd60e51b8152602060048201526003602482015262533a3960e81b604482015290519081900360640190fd5b6001600160a01b0381166120d2576040805162461bcd60e51b815260206004808301919091526024820152630533a31360e41b604482015290519081900360640190fd5b60c980546001600160a01b03199081166001600160a01b039c8d161790915560cf805482169a8c169a909a1790995560ca80548a16988b169890981790975560cb80548916968a169690961790955560cc805488169489169490941790935560cd805487169288169290921790915560ce8054861691871691909117905560d38054851691861691909117905560d48054841691851691909117905560d580549092169216919091179055565b60ca546001600160a01b031681565b612196612c85565b6001600160a01b03166121a7612347565b6001600160a01b0316146121f0576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b6001600160a01b038216612235576040805162461bcd60e51b8152602060048201526007602482015266534243533a203160c81b604482015290519081900360640190fd5b6001600160a01b038216600081815260d16020908152604091829020805460ff1916851515908117909155825190815291517fd326b7ceeb8e8f511f9e85adedac8271ff0c316822de1ec8f73765a5a5532e269281900390910190a25050565b600054610100900460ff16806122ae57506122ae613121565b806122bc575060005460ff16155b6122f75760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff16158015612322576000805460ff1961ff0019909116610100171660011790555b61232a613132565b6123326131cf565b8015612344576000805461ff00191690555b50565b6033546001600160a01b031690565b600080600061236484612f92565b90506000612372868361301e565b9196919550909350505050565b60d16020526000908152604090205460ff1681565b60cf546001600160a01b031681565b60d5546001600160a01b031681565b60d4546001600160a01b031681565b6123c9611d0e565b1561240e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b60026097541415612466576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026097558a518c51146124a9576040805162461bcd60e51b815260206004820152600560248201526442433a203160d81b604482015290519081900360640190fd5b89518c51146124e7576040805162461bcd60e51b815260206004820152600560248201526421219d101960d91b604482015290519081900360640190fd5b60cb54604080516309f724ab60e31b81526001600160a01b038c8116600483015291519190921691634fb92558916024808301926020929190829003018186803b15801561253457600080fd5b505afa158015612548573d6000803e3d6000fd5b505050506040513d602081101561255e57600080fd5b5051612599576040805162461bcd60e51b815260206004820152600560248201526442433a203360d81b604482015290519081900360640190fd5b6001600160a01b0388166125dc576040805162461bcd60e51b81526020600482015260056024820152641090ce880d60da1b604482015290519081900360640190fd5b6001600160a01b03871661261f576040805162461bcd60e51b815260206004820152600560248201526442433a203560d81b604482015290519081900360640190fd5b845160041461265d576040805162461bcd60e51b815260206004820152600560248201526421219d101b60d91b604482015290519081900360640190fd5b835160021461269b576040805162461bcd60e51b815260206004820152600560248201526442433a203760d81b604482015290519081900360640190fd5b836000815181106126a857fe5b602002602001015143101580156126d7575060d054846000815181106126ca57fe5b6020026020010151430311155b612710576040805162461bcd60e51b8152602060048201526005602482015264084867440760db1b604482015290519081900360640190fd5b612725308d8d8d8d8d8d8d8d8d8d8d8d613264565b61275e576040805162461bcd60e51b815260206004820152600560248201526442433a203960d81b604482015290519081900360640190fd5b6001600160a01b038816600090815260d26020526040812085519091908690600190811061278857fe5b60209081029190910181015182528101919091526040016000205460ff16156127e1576040805162461bcd60e51b8152602060048201526006602482015265042433a2031360d41b604482015290519081900360640190fd5b6001600160a01b038816600090815260d26020526040812085516001929087908490811061280b57fe5b6020026020010151815260200190815260200160002060006101000a81548160ff02191690831515021790555073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0316896001600160a01b0316141561291a57348611156128a4576040805162461bcd60e51b815260206004820152600660248201526542433a20313160d01b604482015290519081900360640190fd5b60ce5460408051632aed081d60e01b81526001600160a01b038c81166004830152602482018a905291519190921691632aed081d91899160448082019260009290919082900301818588803b1580156128fc57600080fd5b505af1158015612910573d6000803e3d6000fd5b5050505050612b4a565b85896001600160a01b03166370a08231612932612c85565b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561296f57600080fd5b505afa158015612983573d6000803e3d6000fd5b505050506040513d602081101561299957600080fd5b505110156129d7576040805162461bcd60e51b815260206004820152600660248201526521219d10189960d11b604482015290519081900360640190fd5b85896001600160a01b031663dd62ed3e6129ef612c85565b306040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b158015612a3d57600080fd5b505afa158015612a51573d6000803e3d6000fd5b505050506040513d6020811015612a6757600080fd5b50511015612aa5576040805162461bcd60e51b815260206004820152600660248201526542433a20313360d01b604482015290519081900360640190fd5b612ac2612ab0612c85565b6001600160a01b038b16903089613635565b60ce54612adc906001600160a01b038b8116911688613047565b60ce5460408051632aed081d60e01b81526001600160a01b038c81166004830152602482018a905291519190921691632aed081d91604480830192600092919082900301818387803b158015612b3157600080fd5b505af1158015612b45573d6000803e3d6000fd5b505050505b612b5a8c8c8c8c8c8c8c8c613695565b5050600160975550505050505050505050565b612b75612c85565b6001600160a01b0316612b86612347565b6001600160a01b031614612bcf576040805162461bcd60e51b81526020600482018190526024820152600080516020614c31833981519152604482015290519081900360640190fd5b6001600160a01b038116612c145760405162461bcd60e51b8152600401808060200182810382526026815260200180614b966026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b60d05481565b60c9546001600160a01b031681565b3390565b612c91611d0e565b612cd9576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612d0c612c85565b604080516001600160a01b039092168252519081900360200190a1565b60ca546040805163a31ede2160e01b81526001600160a01b03858116600483015291516000938493169163a31ede21916024808301926020929190829003018186803b158015612d7857600080fd5b505afa158015612d8c573d6000803e3d6000fd5b505050506040513d6020811015612da257600080fd5b505190508015612ed65760ca5460408051639f44ff8d60e01b81526004810184905290516001600160a01b0390921691639f44ff8d9160248082019260009290919082900301818387803b158015612df957600080fd5b505af1158015612e0d573d6000803e3d6000fd5b505060ca546040805163710bf84d60e01b81526001600160a01b03898116600483015260248201879052915191909216935063710bf84d9250604480830192600092919082900301818387803b158015612e6657600080fd5b505af1158015612e7a573d6000803e3d6000fd5b505060cf54612e9692506001600160a01b031690508483613047565b6040805182815290516001600160a01b038616917fcda7ed6c14eca52ea33cd0011e0aa301a0d2d857b38df26366b098d36344263f919081900360200190a25b90505b92915050565b600082820183811015612ed6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082612f4857506000612ed9565b82820282848281612f5557fe5b0414612ed65760405162461bcd60e51b8152600401808060200182810382526021815260200180614c106021913960400191505060405180910390fd5b600080821161301a5760cb60009054906101000a90046001600160a01b03166001600160a01b031663e4b23a5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015612fe957600080fd5b505afa158015612ffd573d6000803e3d6000fd5b505050506040513d602081101561301357600080fd5b5051612ed9565b5090565b6000612710821115613031576000612ed6565b612ed66127106130418585612f39565b90613961565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526130999084906139c8565b505050565b6130a6611d0e565b156130eb576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612d0c612c85565b600061312c30613a79565b15905090565b600054610100900460ff168061314b575061314b613121565b80613159575060005460ff16155b6131945760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff161580156131bf576000805460ff1961ff0019909116610100171660011790555b6131c7613a7f565b612332613b1f565b600054610100900460ff16806131e857506131e8613121565b806131f6575060005460ff16155b6132315760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff1615801561325c576000805460ff1961ff0019909116610100171660011790555b612332613c18565b600080660dae6ce90c2e6d60cb1b905060608f8f8f8f8f60405160200180866001600160a01b031660601b8152601401858051906020019060200280838360005b838110156132bd5781810151838201526020016132a5565b50505050905001848051906020019060200280838360005b838110156132ed5781810151838201526020016132d5565b50505050905001838051906020019060200280838360005b8381101561331d578181015183820152602001613305565b50505050905001826001600160a01b031660601b815260140195505050505050604051602081830303815290604052905060608b8b8b8b8b60405160200180866001600160a01b031660601b8152601401858152602001848152602001838051906020019060200280838360005b838110156133a357818101518382015260200161338b565b50505050905001828051906020019060200280838360005b838110156133d35781810151838201526020016133bb565b5050505090500195505050505050604051602081830303815290604052905081816040516020018083805190602001908083835b602083106134265780518252601f199092019160209182019101613407565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831061346e5780518252601f19909201916020918201910161344f565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052805190602001209250505060606040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152509050600081836040516020018083805190602001908083835b6020831061351e5780518252601f1990920191602091820191016134ff565b6001836020036101000a0380198251168184511680821785525050505050509050018281526020019250505060405160208183030381529060405280519060200120905060006001828960008151811061357457fe5b60200260200101518960008151811061358957fe5b60200260200101518960008151811061359e57fe5b602002602001015160405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156135fa573d6000803e3d6000fd5b505060408051601f1901516001600160a01b0316600090815260d1602052205460ff16955050505050509d9c50505050505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261368f9085906139c8565b50505050565b600080846001600160a01b0316866001600160a01b0316146138805760d35460cf5460408051636947ac6560e01b81526001600160a01b038b8116600483015292831660248201526044810188905290516000939290921691636947ac6591606480820192602092909190829003018186803b15801561371457600080fd5b505afa158015613728573d6000803e3d6000fd5b505050506040513d602081101561373e57600080fd5b50518451909150613756908590600290811061191f57fe5b9250613763878285613cbe565b60d45484516001600160a01b039091169063b1efb419906001908790600390811061378a57fe5b60200260200101516040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b1580156137cd57600080fd5b505afa1580156137e1573d6000803e3d6000fd5b505050506040513d60208110156137f757600080fd5b505160d45460408051633948690560e21b81526001600160a01b038a811660048301528b81166024830152600160448301526064820186905260848201859052915193955091169163e521a4149160a48082019260009290919082900301818387803b15801561386657600080fd5b505af115801561387a573d6000803e3d6000fd5b50505050505b6040805160028082526060808301845292602083019080368337505060cd54604080516358deb88960e01b815281519495506001600160a01b03909216936358deb8899350600480840193829003018186803b1580156138df57600080fd5b505afa1580156138f3573d6000803e3d6000fd5b505050506040513d604081101561390957600080fd5b5080516020909101518251839060009061391f57fe5b602002602001018360018151811061393357fe5b6020908102919091010191909152526139548789878e8e8e878b8b8b613e33565b5050505050505050505050565b60008082116139b7576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816139c057fe5b049392505050565b6060613a1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661441f9092919063ffffffff16565b80519091501561309957808060200190516020811015613a3c57600080fd5b50516130995760405162461bcd60e51b815260040180806020018281038252602a815260200180614c51602a913960400191505060405180910390fd5b3b151590565b600054610100900460ff1680613a985750613a98613121565b80613aa6575060005460ff16155b613ae15760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff16158015612332576000805460ff1961ff0019909116610100171660011790558015612344576000805461ff001916905550565b600054610100900460ff1680613b385750613b38613121565b80613b46575060005460ff16155b613b815760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff16158015613bac576000805460ff1961ff0019909116610100171660011790555b6000613bb6612c85565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015612344576000805461ff001916905550565b600054610100900460ff1680613c315750613c31613121565b80613c3f575060005460ff16155b613c7a5760405162461bcd60e51b815260040180806020018281038252602e815260200180614be2602e913960400191505060405180910390fd5b600054610100900460ff16158015613ca5576000805460ff1961ff0019909116610100171660011790555b60016097558015612344576000805461ff001916905550565b612710811115613d01576040805162461bcd60e51b815260206004820152600960248201526850434f5257443a203160b81b604482015290519081900360640190fd5b6000613d0d838361301e565b9050801561368f5760ca546040805163b9f8a92d60e01b81526004810184905290516001600160a01b039092169163b9f8a92d9160248082019260009290919082900301818387803b158015613d6257600080fd5b505af1158015613d76573d6000803e3d6000fd5b505060ca5460408051637d37653960e11b81526001600160a01b03898116600483015260248201879052915191909216935063fa6eca729250604480830192600092919082900301818387803b158015613dcf57600080fd5b505af1158015613de3573d6000803e3d6000fd5b5050604080518581526020810185905281516001600160a01b03891694507fcc0eecf85cbc64ffe2e864a9f2b479e8c525711ee93de54a11ec35bdf76ef86393509081900390910190a250505050565b83600081518110613e4057fe5b602002602001015160d360009054906101000a90046001600160a01b03166001600160a01b0316636947ac658b60cd60009054906101000a90046001600160a01b03166001600160a01b03166398acd7a66040518163ffffffff1660e01b815260040160206040518083038186803b158015613ebb57600080fd5b505afa158015613ecf573d6000803e3d6000fd5b505050506040513d6020811015613ee557600080fd5b505187518890600090613ef457fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b03168152602001828152602001935050505060206040518083038186803b158015613f5057600080fd5b505afa158015613f64573d6000803e3d6000fd5b505050506040513d6020811015613f7a57600080fd5b50511115613fb8576040805162461bcd60e51b81526020600482015260066024820152654243433a203160d01b604482015290519081900360640190fd5b6000805b88518110156144115761405761271061304160cd60009054906101000a90046001600160a01b03166001600160a01b031663e14f72256040518163ffffffff1660e01b815260040160206040518083038186803b15801561401c57600080fd5b505afa158015614030573d6000803e3d6000fd5b505050506040513d602081101561404657600080fd5b505189518a90600190811061140d57fe5b60cd548a51614232916001600160a01b03169063610e9194908d908690811061407c57fe5b60200260200101516040518263ffffffff1660e01b8152600401808261ffff16815260200191505060206040518083038186803b1580156140bc57600080fd5b505afa1580156140d0573d6000803e3d6000fd5b505050506040513d60208110156140e657600080fd5b810190808051906020019092919050505060d360009054906101000a90046001600160a01b03166001600160a01b0316636947ac658f60cd60009054906101000a90046001600160a01b03166001600160a01b03166398acd7a66040518163ffffffff1660e01b815260040160206040518083038186803b15801561416a57600080fd5b505afa15801561417e573d6000803e3d6000fd5b505050506040513d602081101561419457600080fd5b50518d518e90899081106141a457fe5b60200260200101516040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b03168152602001828152602001935050505060206040518083038186803b15801561420057600080fd5b505afa158015614214573d6000803e3d6000fd5b505050506040513d602081101561422a57600080fd5b505190612edf565b111561426e576040805162461bcd60e51b81526020600482015260066024820152652121a19d101960d11b604482015290519081900360640190fd5b60cd5489516001600160a01b03909116906373ea4e2e908b908490811061429157fe5b60200260200101518984815181106142a557fe5b60200260200101518e6040518463ffffffff1660e01b8152600401808461ffff168152602001838152602001826001600160a01b031681526020019350505050600060405180830381600087803b1580156142ff57600080fd5b505af1158015614313573d6000803e3d6000fd5b50508a516000925061432791506001614438565b82141561433f576143388b84614438565b90506143b7565b60006143688a848151811061435057fe5b602002602001015161ffff168a858151811061140d57fe5b90506143a76127106130418e6143a18b60018151811061438457fe5b602002602001015161304161271088612f3990919063ffffffff16565b90612f39565b91506143b38483612edf565b9350505b6144088d8d8c85815181106143c857fe5b602002602001015161ffff168c86815181106143e057fe5b602002602001015161ffff168c87815181106143f857fe5b6020026020010151868b8b614495565b50600101613fbc565b505050505050505050505050565b606061442e8484600085614995565b90505b9392505050565b60008282111561448f576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60d5546040805163b9b02d8d60e01b8152600481018990529051600092614520926001600160a01b039091169163b9b02d8d91602480820192602092909190829003018186803b1580156144e857600080fd5b505afa1580156144fc573d6000803e3d6000fd5b505050506040513d602081101561451257600080fd5b505142906201518002612edf565b9050600061453382620151808902612edf565b60ca5460408051631f983e2f60e01b81526001600160a01b038e8116600483015291519394506000939190921691631f983e2f91602480830192602092919082900301818787803b15801561458757600080fd5b505af115801561459b573d6000803e3d6000fd5b505050506040513d60208110156145b157600080fd5b8101908080519060200190929190505050905060ca60009054906101000a90046001600160a01b03166001600160a01b031663f196304d8c838c8b8f898961467860cb60009054906101000a90046001600160a01b03166001600160a01b0316639852e8d26040518163ffffffff1660e01b815260040160206040518083038186803b15801561464057600080fd5b505afa158015614654573d6000803e3d6000fd5b505050506040513d602081101561466a57600080fd5b50518c906201518002612edf565b8f6040518a63ffffffff1660e01b8152600401808a6001600160a01b03168152602001898152602001888152602001878152602001866001600160a01b031681526020018581526020018481526020018381526020018281526020019950505050505050505050600060405180830381600087803b1580156146f957600080fd5b505af115801561470d573d6000803e3d6000fd5b50505050600085111561478f5760ca5460408051630b3a629960e11b81526001600160a01b038e81166004830152602482018590526044820189905291519190921691631674c53291606480830192600092919082900301818387803b15801561477657600080fd5b505af115801561478a573d6000803e3d6000fd5b505050505b831561480a5760ca54604080516383324fed60e01b81526001600160a01b038e811660048301526024820185905260448201889052915191909216916383324fed91606480830192600092919082900301818387803b1580156147f157600080fd5b505af1158015614805573d6000803e3d6000fd5b505050505b60d5546040805163b9b02d8d60e01b8152600481018c905290516000926001600160a01b03169163b9b02d8d916024808301926020929190829003018186803b15801561485657600080fd5b505afa15801561486a573d6000803e3d6000fd5b505050506040513d602081101561488057600080fd5b810190808051906020019092919050505090508b6001600160a01b03168b6001600160a01b03167f79d663999e2bb7b6d8ed3aa821af0d8d164f8da0ec2d19b659ab6bb47e6c3396848d8d60cb60009054906101000a90046001600160a01b03166001600160a01b0316639852e8d26040518163ffffffff1660e01b815260040160206040518083038186803b15801561491957600080fd5b505afa15801561492d573d6000803e3d6000fd5b505050506040513d602081101561494357600080fd5b5051604080519485526020850193909352838301919091526060830152608082018d905260a082018c9052600060c083015260e0820186905251908190036101000190a3505050505050505050505050565b6060824710156149d65760405162461bcd60e51b8152600401808060200182810382526026815260200180614bbc6026913960400191505060405180910390fd5b6149df85613a79565b614a30576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310614a6f5780518252601f199092019160209182019101614a50565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614ad1576040519150601f19603f3d011682016040523d82523d6000602084013e614ad6565b606091505b5091509150614ae6828286614af1565b979650505050505050565b60608315614b00575081614431565b825115614b105782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614b5a578181015183820152602001614b42565b50505050905090810190601f168015614b875780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212204c85ee4bfbcdb2cd93d8a7a52b7a66bc7c908640ad4d16615f04bd6c787ae8ef64736f6c63430007030033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.