CELO Price: $1.30 (-2.91%)
Gas: 5 GWei

Contract

0x6AE2341B158909F940EB1704393e97901C005861

Overview

CELO Balance

Celo Chain LogoCelo Chain LogoCelo Chain Logo0 CELO

CELO Value

$0.00

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
0x60a06040177299342023-02-13 19:48:54408 days ago1676317734IN
 Create: NatureCarbonTonne
0 CELO0.1305703725

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NatureCarbonTonne

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 31 : NatureCarbonTonne.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

import './Pool.sol';

/// @notice Nature Carbon Tonne (or NatureCarbonTonne)
/// Contract is an ERC20 compliant token that acts as a pool for TCO2 tokens
contract NatureCarbonTonne is Pool {
    // ----------------------------------------
    //      Constants
    // ----------------------------------------

    string public constant VERSION = '1.4.0';
    uint256 public constant VERSION_RELEASE_CANDIDATE = 2;

    // ----------------------------------------
    //      Upgradable related functions
    // ----------------------------------------

    function initialize() external virtual initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
        __Pausable_init_unchained();
        __ERC20_init_unchained('Toucan Protocol: Nature Carbon Tonne', 'NCT');
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }
}

File 2 of 31 : Pool.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

import '@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol';

import '../cross-chain/interfaces/IToucanCrosschainMessenger.sol';
import '../interfaces/ICarbonOffsetBatches.sol';
import '../interfaces/IToucanCarbonOffsets.sol';
import '../interfaces/IToucanContractRegistry.sol';
import '../libraries/Errors.sol';
import './PoolStorage.sol';

/// @notice Pool template contract
/// ERC20 compliant token that acts as a pool for TCO2 tokens
abstract contract Pool is
    ContextUpgradeable,
    ERC20Upgradeable,
    OwnableUpgradeable,
    PausableUpgradeable,
    AccessControlUpgradeable,
    UUPSUpgradeable,
    PoolStorage
{
    using SafeERC20Upgradeable for IERC20Upgradeable;

    // ----------------------------------------
    //      Constants
    // ----------------------------------------

    bytes32 public constant PAUSER_ROLE = keccak256('PAUSER_ROLE');
    bytes32 public constant MANAGER_ROLE = keccak256('MANAGER_ROLE');
    /// @dev fees redeem percentage with 2 fixed decimals precision
    uint256 public constant feeRedeemDivider = 1e4;

    // ----------------------------------------
    //      Events
    // ----------------------------------------

    event Deposited(address erc20Addr, uint256 amount);
    event Redeemed(address account, address erc20, uint256 amount);
    event ExternalAddressWhitelisted(address erc20addr);
    event ExternalAddressRemovedFromWhitelist(address erc20addr);
    event InternalAddressWhitelisted(address erc20addr);
    event InternalAddressBlacklisted(address erc20addr);
    event InternalAddressRemovedFromBlackList(address erc20addr);
    event InternalAddressRemovedFromWhitelist(address erc20addr);
    event AttributeStandardAdded(string standard);
    event AttributeStandardRemoved(string standard);
    event AttributeMethodologyAdded(string methodology);
    event AttributeMethodologyRemoved(string methodology);
    event AttributeRegionAdded(string region);
    event AttributeRegionRemoved(string region);
    event RedeemFeePaid(address redeemer, uint256 fees);
    event RedeemFeeBurnt(address redeemer, uint256 fees);
    event ToucanRegistrySet(address ContractRegistry);
    event MappingSwitched(string mappingName, bool accepted);
    event SupplyCapUpdated(uint256 newCap);
    event MinimumVintageStartTimeUpdated(uint256 minimumVintageStartTime);
    event TCO2ScoringUpdated(address[] tco2s);
    event AddFeeExemptedTCO2(address tco2);
    event RemoveFeeExemptedTCO2(address tco2);
    event RouterUpdated(address router);
    event TCO2Bridged(
        uint32 indexed destinationDomain,
        address indexed tco2,
        uint256 amount
    );

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    // ----------------------------------------
    //      Upgradable related functions
    // ----------------------------------------

    function _authorizeUpgrade(address) internal virtual override {
        onlyPoolOwner();
    }

    // ------------------------
    // Poor person's modifiers
    // ------------------------

    /// @dev function that checks whether the caller is the
    /// contract owner
    function onlyPoolOwner() internal view virtual {
        require(owner() == msg.sender, Errors.CP_ONLY_OWNER);
    }

    /// @dev function that only lets the contract's owner and granted role to execute
    function onlyWithRole(bytes32 role) internal view virtual {
        require(
            hasRole(role, msg.sender) || owner() == msg.sender,
            Errors.CP_UNAUTHORIZED
        );
    }

    /// @dev function that checks whether the contract is paused
    function onlyUnpaused() internal view {
        require(!paused(), Errors.CP_PAUSED_CONTRACT);
    }

    // ------------------------
    // Admin functions
    // ------------------------

    /// @notice Emergency function to disable contract's core functionality
    /// @dev wraps _pause(), only Admin
    function pause() external virtual {
        onlyWithRole(PAUSER_ROLE);
        _pause();
    }

    /// @dev Unpause the system, wraps _unpause(), only Admin
    function unpause() external virtual {
        onlyWithRole(PAUSER_ROLE);
        _unpause();
    }

    function setToucanContractRegistry(address _address) external virtual {
        onlyPoolOwner();
        contractRegistry = _address;
        emit ToucanRegistrySet(_address);
    }

    /// @notice Generic function to switch attributes mappings into either
    /// acceptance or rejection criteria
    /// @param _mappingName attribute mapping of project-vintage data
    /// @param accepted determines if mapping works as black or whitelist
    function switchMapping(string memory _mappingName, bool accepted)
        external
        virtual
    {
        onlyPoolOwner();
        if (strcmp(_mappingName, 'regions')) {
            accepted
                ? regionsIsAcceptedMapping = true
                : regionsIsAcceptedMapping = false;
        } else if (strcmp(_mappingName, 'standards')) {
            accepted
                ? standardsIsAcceptedMapping = true
                : standardsIsAcceptedMapping = false;
        } else if (strcmp(_mappingName, 'methodologies')) {
            accepted
                ? methodologiesIsAcceptedMapping = true
                : methodologiesIsAcceptedMapping = false;
        }
        emit MappingSwitched(_mappingName, accepted);
    }

    /// @notice Function to add attributes for filtering (does not support complex AttributeSets)
    /// @param addToList determines whether attribute should be added or removed
    /// Other params are arrays of attributes to be added
    function addAttributes(
        bool addToList,
        string[] memory _regions,
        string[] memory _standards,
        string[] memory _methodologies
    ) external virtual {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < _standards.length; ++i) {
            if (addToList == true) {
                standards[_standards[i]] = true;
                emit AttributeStandardAdded(_standards[i]);
            } else {
                standards[_standards[i]] = false;
                emit AttributeStandardRemoved(_standards[i]);
            }
        }

        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < _methodologies.length; ++i) {
            if (addToList == true) {
                methodologies[_methodologies[i]] = true;
                emit AttributeMethodologyAdded(_methodologies[i]);
            } else {
                methodologies[_methodologies[i]] = false;
                emit AttributeMethodologyRemoved(_methodologies[i]);
            }
        }

        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < _regions.length; ++i) {
            if (addToList == true) {
                regions[_regions[i]] = true;
                emit AttributeRegionAdded(_regions[i]);
            } else {
                regions[_regions[i]] = false;
                emit AttributeRegionRemoved(_regions[i]);
            }
        }
    }

    /// @notice Function to whitelist selected external non-TCO2 contracts by their address
    /// @param erc20Addr accepts an array of contract addresses
    function addToExternalWhiteList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            externalWhiteList[erc20Addr[i]] = true;
            emit ExternalAddressWhitelisted(erc20Addr[i]);
        }
    }

    /// @notice Function to whitelist certain TCO2 contracts by their address
    /// @param erc20Addr accepts an array of contract addresses
    function addToInternalWhiteList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            internalWhiteList[erc20Addr[i]] = true;
            emit InternalAddressWhitelisted(erc20Addr[i]);
        }
    }

    /// @notice Function to blacklist certain TCO2 contracts by their address
    /// @param erc20Addr accepts an array of contract addresses
    function addToInternalBlackList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            internalBlackList[erc20Addr[i]] = true;
            emit InternalAddressBlacklisted(erc20Addr[i]);
        }
    }

    /// @notice Function to remove ERC20 addresses from external whitelist
    /// @param erc20Addr accepts an array of contract addresses
    function removeFromExternalWhiteList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            externalWhiteList[erc20Addr[i]] = false;
            emit ExternalAddressRemovedFromWhitelist(erc20Addr[i]);
        }
    }

    /// @notice Function to remove TCO2 addresses from internal blacklist
    /// @param erc20Addr accepts an array of contract addresses
    function removeFromInternalBlackList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            internalBlackList[erc20Addr[i]] = false;
            emit InternalAddressRemovedFromBlackList(erc20Addr[i]);
        }
    }

    /// @notice Function to remove TCO2 addresses from internal whitelist
    /// @param erc20Addr accepts an array of contract addressesc
    function removeFromInternalWhiteList(address[] memory erc20Addr) external {
        onlyPoolOwner();
        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < erc20Addr.length; ++i) {
            internalWhiteList[erc20Addr[i]] = false;
            emit InternalAddressRemovedFromWhitelist(erc20Addr[i]);
        }
    }

    /// @notice Update the fee redeem percentage
    /// @param _feeRedeemPercentageInBase percentage of fee in base
    function setFeeRedeemPercentage(uint256 _feeRedeemPercentageInBase)
        external
        virtual
    {
        onlyPoolOwner();
        require(
            _feeRedeemPercentageInBase < feeRedeemDivider,
            Errors.CP_INVALID_FEE
        );
        feeRedeemPercentageInBase = _feeRedeemPercentageInBase;
    }

    /// @notice Update the fee redeem receiver
    /// @param _feeRedeemReceiver address to transfer the fees
    function setFeeRedeemReceiver(address _feeRedeemReceiver) external virtual {
        onlyPoolOwner();
        require(_feeRedeemReceiver != address(0), Errors.CP_EMPTY_ADDRESS);
        feeRedeemReceiver = _feeRedeemReceiver;
    }

    /// @notice Update the fee redeem burn percentage
    /// @param _feeRedeemBurnPercentageInBase percentage of fee in base
    function setFeeRedeemBurnPercentage(uint256 _feeRedeemBurnPercentageInBase)
        external
        virtual
    {
        onlyPoolOwner();
        require(
            _feeRedeemBurnPercentageInBase < feeRedeemDivider,
            Errors.CP_INVALID_FEE
        );
        feeRedeemBurnPercentageInBase = _feeRedeemBurnPercentageInBase;
    }

    /// @notice Update the fee redeem burn address
    /// @param _feeRedeemBurnAddress address to transfer the fees to burn
    function setFeeRedeemBurnAddress(address _feeRedeemBurnAddress)
        external
        virtual
    {
        onlyPoolOwner();
        require(_feeRedeemBurnAddress != address(0), Errors.CP_EMPTY_ADDRESS);
        feeRedeemBurnAddress = _feeRedeemBurnAddress;
    }

    /// @notice Adds a new address for redeem fees exemption
    /// @param _address address to be exempted on redeem fees
    function addRedeemFeeExemptedAddress(address _address) external virtual {
        onlyPoolOwner();
        redeemFeeExemptedAddresses[_address] = true;
    }

    /// @notice Removes an address from redeem fees exemption
    /// @param _address address to be removed from exemption
    function removeRedeemFeeExemptedAddress(address _address) external virtual {
        onlyPoolOwner();
        redeemFeeExemptedAddresses[_address] = false;
    }

    /// @notice Adds a new TCO2 for redeem fees exemption
    /// @param _tco2 TCO2 to be exempted on redeem fees
    function addRedeemFeeExemptedTCO2(address _tco2) external virtual {
        onlyPoolOwner();
        redeemFeeExemptedTCO2s[_tco2] = true;
        emit AddFeeExemptedTCO2(_tco2);
    }

    /// @notice Removes a TCO2 from redeem fees exemption
    /// @param _tco2 TCO2 to be removed from exemption
    function removeRedeemFeeExemptedTCO2(address _tco2) external virtual {
        onlyPoolOwner();
        redeemFeeExemptedTCO2s[_tco2] = false;
        emit RemoveFeeExemptedTCO2(_tco2);
    }

    /// @notice Function to limit the maximum pool supply
    /// @dev supplyCap is initially set to 0 and must be increased before deposits
    function setSupplyCap(uint256 newCap) external virtual {
        onlyPoolOwner();
        supplyCap = newCap;
        emit SupplyCapUpdated(newCap);
    }

    /// @notice Determines the minimum vintage start time acceptance criteria of TCO2s
    /// @param _minimumVintageStartTime unix time format
    function setMinimumVintageStartTime(uint64 _minimumVintageStartTime)
        external
        virtual
    {
        onlyPoolOwner();
        minimumVintageStartTime = _minimumVintageStartTime;
        emit MinimumVintageStartTimeUpdated(_minimumVintageStartTime);
    }

    /// @notice Allows MANAGERs or the owner to pass an array to hold TCO2 contract addesses that are
    /// ordered by some form of scoring mechanism
    /// @param tco2s array of ordered TCO2 addresses
    function setTCO2Scoring(address[] calldata tco2s) external {
        onlyWithRole(MANAGER_ROLE);
        require(tco2s.length != 0, Errors.CP_EMPTY_ARRAY);
        scoredTCO2s = tco2s;
        emit TCO2ScoringUpdated(tco2s);
    }

    // -------------------------------------
    //   ToucanCrosschainMessenger functions
    // -------------------------------------

    function onlyRouter() internal view {
        require(msg.sender == router, Errors.CP_ONLY_ROUTER);
    }

    /// @notice method to set router address
    /// @dev use this method to set router address
    /// @param _router address of ToucanCrosschainMessenger
    function setRouter(address _router) external {
        onlyPoolOwner();
        // router address can be set to zero to make bridgeMint and bridgeBurn unusable
        router = _router;
        emit RouterUpdated(_router);
    }

    /// @notice mint tokens to receiver account that were cross-chain bridged
    /// @dev invoked only by the ToucanCrosschainMessenger (Router)
    /// @param _account account that will be minted with corss-chain bridged tokens
    /// @param _amount amount of tokens that will be minted
    function bridgeMint(address _account, uint256 _amount) external {
        onlyRouter();
        _mint(_account, _amount);
    }

    /// @notice burn tokens from account to be cross-chain bridged
    /// @dev invoked only by the ToucanCrosschainMessenger (Router)
    /// @param _account account that will be burned with corss-chain bridged tokens
    /// @param _amount amount of tokens that will be burned
    function bridgeBurn(address _account, uint256 _amount) external {
        onlyRouter();
        _burn(_account, _amount);
    }

    /// @notice Allows MANAGER or the owner to bridge TCO2s into
    /// another domain.
    /// @param destinationDomain The domain to bridge TCO2s to
    /// @param tco2s The TCO2s to bridge
    /// @param amounts The amounts of TCO2s to bridge
    function bridgeTCO2s(
        uint32 destinationDomain,
        address[] calldata tco2s,
        uint256[] calldata amounts
    ) external {
        onlyWithRole(MANAGER_ROLE);
        uint256 tco2Length = tco2s.length;
        require(tco2Length != 0, Errors.CP_EMPTY_ARRAY);
        require(tco2Length == amounts.length, Errors.CP_LENGTH_MISMATCH);

        // TODO: Disallow bridging more TCO2s than an amount that
        // would bring the pool to imbalance, ie., end up with more
        // pool tokens than TCO2s in the pool in the source chain.

        // Read the address of the remote pool from ToucanCrosschainMessenger
        // and set that as a recipient in our cross-chain messages.
        address tcm = router;
        RemoteTokenInformation memory remoteInfo = IToucanCrosschainMessenger(
            tcm
        ).remoteTokens(address(this), destinationDomain);
        address recipient = remoteInfo.tokenAddress;
        require(recipient != address(0), Errors.CP_EMPTY_ADDRESS);

        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < tco2Length; ++i) {
            IToucanCrosschainMessenger(tcm).sendMessageWithRecipient(
                destinationDomain,
                tco2s[i],
                amounts[i],
                recipient
            );
            emit TCO2Bridged(destinationDomain, tco2s[i], amounts[i]);
        }
    }

    // ----------------------------
    //   Permissionless functions
    // ----------------------------

    /// @notice Deposit function for pool that accepts TCO2s and mints pool token 1:1
    /// @param erc20Addr ERC20 contract address to be deposited, requires approve
    /// @dev Eligibility is checked via `checkEligible`, balances are tracked
    /// for each TCO2 separately
    function deposit(address erc20Addr, uint256 amount) external virtual {
        onlyUnpaused();
        checkEligible(erc20Addr);

        uint256 remainingSpace = getRemaining();
        require(remainingSpace != 0, Errors.CP_FULL_POOL);

        if (amount > remainingSpace) amount = remainingSpace;

        _mint(msg.sender, amount);
        emit Deposited(erc20Addr, amount);

        IERC20Upgradeable(erc20Addr).safeTransferFrom(
            msg.sender,
            address(this),
            amount
        );
    }

    /// @notice Checks if token to be deposited is eligible for this pool
    function checkEligible(address erc20Addr)
        public
        view
        virtual
        returns (bool)
    {
        bool isToucanContract = IToucanContractRegistry(contractRegistry)
            .checkERC20(erc20Addr);

        if (isToucanContract) {
            if (internalWhiteList[erc20Addr]) {
                return true;
            }

            require(!internalBlackList[erc20Addr], Errors.CP_BLACKLISTED);

            checkAttributeMatching(erc20Addr);
        } else {
            /// @dev If not Toucan native contract, check if address is whitelisted
            require(externalWhiteList[erc20Addr], Errors.CP_NOT_WHITELISTED);
        }

        return true;
    }

    /// @notice Checks whether incoming TCO2s match the accepted criteria/attributes
    function checkAttributeMatching(address erc20Addr)
        public
        view
        virtual
        returns (bool)
    {
        ProjectData memory projectData;
        VintageData memory vintageData;
        (projectData, vintageData) = IToucanCarbonOffsets(erc20Addr)
            .getAttributes();

        /// @dev checks if any one of the attributes are blacklisted.
        /// If mappings are set to "whitelist"-mode, require the opposite
        require(
            vintageData.startTime >= minimumVintageStartTime,
            Errors.CP_START_TIME_TOO_OLD
        );
        require(
            regions[projectData.region] == regionsIsAcceptedMapping,
            Errors.CP_REGION_NOT_ACCEPTED
        );
        require(
            standards[projectData.standard] == standardsIsAcceptedMapping,
            Errors.CP_STANDARD_NOT_ACCEPTED
        );
        require(
            methodologies[projectData.methodology] ==
                methodologiesIsAcceptedMapping,
            Errors.CP_METHODOLOGY_NOT_ACCEPTED
        );

        return true;
    }

    /// @notice View function to calculate fees pre-execution
    /// @dev User specifies in front-end the addresses and amounts they want
    /// @param tco2s Array of TCO2 contract addresses
    /// @param amounts Array of amounts to redeem for each tco2s
    /// @return Total fees amount
    function calculateRedeemFees(
        address[] memory tco2s,
        uint256[] memory amounts
    ) external view virtual returns (uint256) {
        onlyUnpaused();
        if (redeemFeeExemptedAddresses[msg.sender]) {
            return 0;
        }
        uint256 tco2Length = tco2s.length;
        require(tco2Length == amounts.length, Errors.CP_LENGTH_MISMATCH);

        //slither-disable-next-line uninitialized-local
        uint256 totalFee;
        uint256 _feeRedeemPercentageInBase = feeRedeemPercentageInBase;

        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < tco2Length; ++i) {
            uint256 feeAmount = (amounts[i] * _feeRedeemPercentageInBase) /
                feeRedeemDivider;
            totalFee += feeAmount;
        }
        return totalFee;
    }

    /// @notice Redeem a whitelisted TCO2 without paying any fees and burn
    /// the TCO2. Initially added to burn HFC-23 credits, can be used in the
    /// future to dispose of any other whitelisted credits.
    /// @dev User needs to approve the pool contract in the TCO2 contract for
    /// the amount to be burnt before executing this function.
    /// @param tco2 TCO2 to redeem and burn
    /// @param amount Amount to redeem and burn
    function redeemAndBurn(address tco2, uint256 amount) external {
        onlyUnpaused();
        require(redeemFeeExemptedTCO2s[tco2], Errors.CP_NOT_EXEMPTED);
        redeemSingle(tco2, amount);
        // User has to approve the pool contract in the TCO2 contract
        // in order for this function to successfully burn the tokens
        IToucanCarbonOffsets(tco2).burnFrom(msg.sender, amount);
    }

    /// @notice Redeems Pool tokens for multiple underlying TCO2s 1:1 minus fees
    /// @dev User specifies in front-end the addresses and amounts they want
    /// @param tco2s Array of TCO2 contract addresses
    /// @param amounts Array of amounts to redeem for each tco2s
    /// Pool token in user's wallet get burned
    function redeemMany(address[] memory tco2s, uint256[] memory amounts)
        external
        virtual
    {
        onlyUnpaused();
        uint256 tco2Length = tco2s.length;
        require(tco2Length == amounts.length, Errors.CP_LENGTH_MISMATCH);

        //slither-disable-next-line uninitialized-local
        uint256 totalFee;
        uint256 _feeRedeemPercentageInBase = feeRedeemPercentageInBase;
        bool isExempted = redeemFeeExemptedAddresses[msg.sender];
        //slither-disable-next-line uninitialized-local
        uint256 feeAmount;

        //slither-disable-next-line uninitialized-local
        for (uint256 i; i < tco2Length; ++i) {
            checkEligible(tco2s[i]);
            if (!isExempted) {
                feeAmount =
                    (amounts[i] * _feeRedeemPercentageInBase) /
                    feeRedeemDivider;
                totalFee += feeAmount;
            } else {
                feeAmount = 0;
            }
            redeemSingle(tco2s[i], amounts[i] - feeAmount);
        }
        if (totalFee != 0) {
            uint256 burnAmount = (totalFee * feeRedeemBurnPercentageInBase) /
                feeRedeemDivider;
            totalFee -= burnAmount;
            transfer(feeRedeemReceiver, totalFee);
            emit RedeemFeePaid(msg.sender, totalFee);
            if (burnAmount > 0) {
                transfer(feeRedeemBurnAddress, burnAmount);
                emit RedeemFeeBurnt(msg.sender, burnAmount);
            }
        }
    }

    /// @notice Automatically redeems an amount of Pool tokens for underlying
    /// TCO2s from an array of ranked TCO2 contracts
    /// starting from contract at index 0 until amount is satisfied
    /// @param amount Total amount to be redeemed
    /// @dev Pool tokens in user's wallet get burned
    function redeemAuto(uint256 amount) external virtual {
        redeemAuto2(amount);
    }

    /// @notice Automatically redeems an amount of Pool tokens for underlying
    /// TCO2s from an array of ranked TCO2 contracts starting from contract at
    /// index 0 until amount is satisfied.
    /// @param amount Total amount to be redeemed
    /// @return tco2s amounts The addresses and amounts of the TCO2s that were
    /// automatically redeemed
    function redeemAuto2(uint256 amount)
        public
        virtual
        returns (address[] memory tco2s, uint256[] memory amounts)
    {
        onlyUnpaused();
        require(amount != 0, Errors.CP_ZERO_AMOUNT);
        //slither-disable-next-line uninitialized-local
        uint256 i;
        // Non-zero count tracks TCO2s with a balance
        //slither-disable-next-line uninitialized-local
        uint256 nonZeroCount;

        uint256 scoredTCO2Len = scoredTCO2s.length;
        while (amount > 0 && i < scoredTCO2Len) {
            address tco2 = scoredTCO2s[i];
            uint256 balance = tokenBalances(tco2);
            //slither-disable-next-line uninitialized-local
            uint256 amountToRedeem;

            // Only TCO2s with a balance should be included for a redemption.
            if (balance != 0) {
                amountToRedeem = amount > balance ? balance : amount;
                amount -= amountToRedeem;
                unchecked {
                    ++nonZeroCount;
                }
            }

            unchecked {
                ++i;
            }

            // Create return arrays statically since Solidity does not
            // support dynamic arrays or mappings in-memory (EIP-1153).
            // Do it here to avoid having to fill out the last indexes
            // during the second iteration.
            //slither-disable-next-line incorrect-equality
            if (amount == 0) {
                tco2s = new address[](nonZeroCount);
                amounts = new uint256[](nonZeroCount);

                tco2s[nonZeroCount - 1] = tco2;
                amounts[nonZeroCount - 1] = amountToRedeem;
                redeemSingle(tco2, amountToRedeem);
            }
        }

        require(amount == 0, Errors.CP_NON_ZERO_REMAINING);

        // Execute the second iteration by avoiding to run the last index
        // since we have already executed that in the first iteration.
        nonZeroCount = 0;
        //slither-disable-next-line uninitialized-local
        for (uint256 j; j < i - 1; ++j) {
            address tco2 = scoredTCO2s[j];
            // This second loop only gets called when the `amount` is larger
            // than the first tco2 balance in the array. Here, in every iteration the
            // tco2 balance is smaller than the remaining amount while the last bit of
            // the `amount` which is smaller than the tco2 balance, got redeemed
            // in the first loop.
            uint256 balance = tokenBalances(tco2);

            // Ignore empty balances so we don't generate redundant transactions.
            //slither-disable-next-line incorrect-equality
            if (balance == 0) continue;

            tco2s[nonZeroCount] = tco2;
            amounts[nonZeroCount] = balance;
            redeemSingle(tco2, balance);
            unchecked {
                ++nonZeroCount;
            }
        }
    }

    /// @dev Internal function that redeems a single underlying token
    function redeemSingle(address erc20, uint256 amount) internal virtual {
        _burn(msg.sender, amount);
        IERC20Upgradeable(erc20).safeTransfer(msg.sender, amount);
        emit Redeemed(msg.sender, erc20, amount);
    }

    /// @dev Implemented in order to disable transfers when paused
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, amount);

        onlyUnpaused();
    }

    /// @dev Returns the remaining space in pool before hitting the cap
    function getRemaining() public view returns (uint256) {
        return (supplyCap - totalSupply());
    }

    /// @notice Returns the balance of the TCO2 found in the pool
    function tokenBalances(address tco2) public view returns (uint256) {
        return IERC20Upgradeable(tco2).balanceOf(address(this));
    }

    // -----------------------------
    //      Locked ERC20 safety
    // -----------------------------

    /// @dev Function to disallowing sending tokens to either the 0-address
    /// or this contract itself
    function validDestination(address to) internal view {
        require(to != address(0x0), Errors.CP_INVALID_DESTINATION_ZERO);
        require(to != address(this), Errors.CP_INVALID_DESTINATION_SELF);
    }

    function transfer(address recipient, uint256 amount)
        public
        virtual
        override
        returns (bool)
    {
        validDestination(recipient);
        super.transfer(recipient, amount);
        return true;
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        validDestination(recipient);
        super.transferFrom(sender, recipient, amount);
        return true;
    }

    // -----------------------------
    //      Helper Functions
    // -----------------------------

    function memcmp(bytes memory a, bytes memory b)
        internal
        pure
        returns (bool)
    {
        return (a.length == b.length) && (keccak256(a) == keccak256(b));
    }

    function strcmp(string memory a, string memory b)
        internal
        pure
        returns (bool)
    {
        return memcmp(bytes(a), bytes(b));
    }

    function getScoredTCO2s() external view returns (address[] memory) {
        return scoredTCO2s;
    }
}

File 3 of 31 : ICarbonOffsetBatches.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

import '../CarbonOffsetBatchesTypes.sol';

interface ICarbonOffsetBatches {
    function getConfirmationStatus(uint256 tokenId)
        external
        view
        returns (RetirementStatus);

    function getBatchNFTData(uint256 tokenId)
        external
        view
        returns (
            uint256,
            uint256,
            RetirementStatus
        );
}

File 4 of 31 : IToucanCarbonOffsets.sol
// SPDX-FileCopyrightText: 2022 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

import '../CarbonProjectVintageTypes.sol';
import '../CarbonProjectTypes.sol';

interface IToucanCarbonOffsets {
    function burnFrom(address account, uint256 amount) external;

    function getAttributes()
        external
        view
        returns (ProjectData memory, VintageData memory);
}

File 5 of 31 : Errors.sol
// SPDX-FileCopyrightText: 2022 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

/**
 * @title Errors library
 * @notice Defines the error messages emitted by the different contracts of the Toucan protocol
 * @dev Inspired by the AAVE error library:
 * https://github.com/aave/protocol-v2/blob/5df59ec74a0c635d877dc1c5ee4a165d41488352/contracts/protocol/libraries/helpers/Errors.sol
 * Error messages prefix glossary:
 *  - CP = CarbonPool
 */
library Errors {
    // User is not authorized
    string public constant CP_UNAUTHORIZED = '1';
    // Empty array provided as input
    string public constant CP_EMPTY_ARRAY = '2';
    // Pool is full of TCO2s
    string public constant CP_FULL_POOL = '3';
    // ERC20 is blacklisted in the pool. This error
    // is returned for TCO2s that have been blacklisted
    // like the HFC-23 project.
    string public constant CP_BLACKLISTED = '4';
    // ERC20 is not whitelisted in the pool
    // This error is returned in case the ERC20 is
    // not a TCO2 in which case it has to be manually
    // whitelisted in order to be allowed in the pool.
    string public constant CP_NOT_WHITELISTED = '5';
    // Vintage start time of a TCO2 is too old
    string public constant CP_START_TIME_TOO_OLD = '6';
    string public constant CP_REGION_NOT_ACCEPTED = '7';
    string public constant CP_STANDARD_NOT_ACCEPTED = '8';
    string public constant CP_METHODOLOGY_NOT_ACCEPTED = '9';
    // Provided fee is invalid, not in a basis points format: [0,10000)
    string public constant CP_INVALID_FEE = '10';
    // Provided address needs to be non-zero
    string public constant CP_EMPTY_ADDRESS = '11';
    // Validation check to ensure array lengths match
    string public constant CP_LENGTH_MISMATCH = '12';
    // TCO2 not exempted from redeem fees
    string public constant CP_NOT_EXEMPTED = '13';
    // A contract has been paused
    string public constant CP_PAUSED_CONTRACT = '14';
    // Redemption has leftover unredeemed value
    string public constant CP_NON_ZERO_REMAINING = '15';
    // Redemption exceeds deposited TCO2 supply
    string public constant CP_EXCEEDS_TCO2_SUPPLY = '16';
    // User must be a router
    string public constant CP_ONLY_ROUTER = '17';
    // User must be the owner
    string public constant CP_ONLY_OWNER = '18';
    // Zero destination address is invalid for pool token transfers
    string public constant CP_INVALID_DESTINATION_ZERO = '19';
    // Self destination address is invalid for pool token transfers
    string public constant CP_INVALID_DESTINATION_SELF = '20';
    // Zero amount provided as an input (eg., in redemptions) in invalid
    string public constant CP_ZERO_AMOUNT = '21';
}

File 6 of 31 : PoolStorage.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

abstract contract PoolStorageV1 {
    /// @notice The supply cap is used as a measure to guard deposits
    /// in the pool. It is meant to minimize the impact a potential
    /// compromise in the source registry (eg. Verra) can have to the pool.
    uint256 public supplyCap;
    mapping(address => uint256) private DEPRECATED_tokenBalances;
    address public contractRegistry;

    /// @notice array used to read from when redeeming TCO2s automatically
    address[] public scoredTCO2s;

    /// @dev Mappings for attributes that can be included or excluded
    /// if set to `false`, attribute-values are blacklisted/rejected
    /// if set to `true`, attribute-values are whitelisted/accepted
    mapping(string => bool) public regions;
    mapping(string => bool) public standards;
    mapping(string => bool) public methodologies;

    /// @dev mapping to whitelist external non-TCO2 contracts by address
    mapping(address => bool) public externalWhiteList;

    /// @dev mapping to include certain TCO2 contracts by address,
    /// overriding attribute matching checks
    mapping(address => bool) public internalWhiteList;

    /// @dev mapping to exclude certain TCO2 contracts by address,
    /// even if the attribute matching would pass
    mapping(address => bool) public internalBlackList;

    /// @dev fees redeem receiver address
    address public feeRedeemReceiver;

    uint256 public feeRedeemPercentageInBase;

    /// @dev fees redeem burn address
    address public feeRedeemBurnAddress;

    /// @dev fees redeem burn percentage with 2 fixed decimals precision
    uint256 public feeRedeemBurnPercentageInBase;

    /// @dev repacked smaller variables here so new bools can be added below
    uint64 public minimumVintageStartTime;
    //slither-disable-next-line constable-states
    bool public seedMode;
    bool public regionsIsAcceptedMapping;
    bool public standardsIsAcceptedMapping;
    bool public methodologiesIsAcceptedMapping;
}

abstract contract PoolStorageV1_1 {
    /// @notice End users exempted from redeem fees
    mapping(address => bool) public redeemFeeExemptedAddresses;
}

abstract contract PoolStorageV1_2 {
    /// @notice TCO2s exempted from redeem fees
    mapping(address => bool) public redeemFeeExemptedTCO2s;
}

abstract contract PoolStorageV1_3 {
    /// @notice bridge router who has access to the bridgeMint & bridgeBurn functions which
    /// mint/burn pool tokens for cross chain messenges
    address public router;
}

abstract contract PoolStorage is
    PoolStorageV1,
    PoolStorageV1_1,
    PoolStorageV1_2,
    PoolStorageV1_3
{}

File 7 of 31 : IToucanContractRegistry.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

interface IToucanContractRegistry {
    function carbonOffsetBatchesAddress() external view returns (address);

    function carbonProjectsAddress() external view returns (address);

    function carbonProjectVintagesAddress() external view returns (address);

    function toucanCarbonOffsetsFactoryAddress()
        external
        view
        returns (address);

    function carbonOffsetBadgesAddress() external view returns (address);

    function checkERC20(address _address) external view returns (bool);

    function addERC20(address _address) external;
}

File 8 of 31 : IToucanCrosschainMessenger.sol
// SPDX-FileCopyrightText: 2022 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth
pragma solidity 0.8.14;

import {RemoteTokenInformation} from '../ToucanCrosschainMessengerStorage.sol';

interface IToucanCrosschainMessenger {
    function sendMessage(
        uint32 destinationDomain,
        address token,
        uint256 amount
    ) external payable;

    function sendMessageWithRecipient(
        uint32 destinationDomain,
        address token,
        uint256 amount,
        address recipient
    ) external payable;

    function remoteTokens(address _token, uint32 _destinationDomain)
        external
        view
        returns (RemoteTokenInformation memory);
}

File 9 of 31 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/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 onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 10 of 31 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/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 onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _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());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 11 of 31 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 12 of 31 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC20_init_unchained(name_, symbol_);
    }

    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[45] private __gap;
}

File 13 of 31 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/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 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 onlyInitializing {
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 14 of 31 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 15 of 31 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate that the this implementation remains valid after an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 16 of 31 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.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 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'
        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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 17 of 31 : CarbonOffsetBatchesTypes.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth

pragma solidity 0.8.14;

enum RetirementStatus {
    Pending, // 0
    Rejected, // 1
    Confirmed // 2
}

File 18 of 31 : CarbonProjectVintageTypes.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth

pragma solidity 0.8.14;

struct VintageData {
    /// @dev A human-readable string which differentiates this from other vintages in
    /// the same project, and helps build the corresponding TCO2 name and symbol.
    string name;
    uint64 startTime; // UNIX timestamp
    uint64 endTime; // UNIX timestamp
    uint256 projectTokenId;
    uint64 totalVintageQuantity;
    bool isCorsiaCompliant;
    bool isCCPcompliant;
    string coBenefits;
    string correspAdjustment;
    string additionalCertification;
    string uri;
}

File 19 of 31 : CarbonProjectTypes.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earth

pragma solidity 0.8.14;

/// @dev CarbonProject related data and attributes
struct ProjectData {
    string projectId;
    string standard;
    string methodology;
    string region;
    string storageMethod;
    string method;
    string emissionType;
    string category;
    string uri;
    address beneficiary;
}

File 20 of 31 : ToucanCrosschainMessengerStorage.sol
// SPDX-FileCopyrightText: 2021 Toucan Labs
//
// SPDX-License-Identifier: UNLICENSED

// If you encounter a vulnerability or an issue, please contact <[email protected]> or visit security.toucan.earthz
pragma solidity 0.8.14;

struct RemoteTokenInformation {
    /// @notice address of the token in the remote chain
    address tokenAddress;
    /// @notice timer keeps track of when the token pair
    /// was created in order to disallow updates to the
    /// pair after a specific amount of time elapses
    uint256 timer;
}

/// @dev Separate storage contract to improve upgrade safety
abstract contract ToucanCrosschainMessengerStorageV1 {
    enum BridgeRequestType {
        NOT_REGISTERED, // 0
        SENT, // 1
        RECEIVED // 2
    }

    enum MessageTypes {
        MINT
    }

    struct BridgeRequest {
        bool isReverted; // this state is added for future addition of revert functionality
        uint256 timestamp;
        BridgeRequestType requestType;
        MessageTypes messageType;
    }

    /// @dev nonce is used to serialize requests executed
    /// by the source chain in order to avoid duplicates
    /// from being processed in the remote chain
    uint256 public nonce;
    //slither-disable-next-line constable-states
    bytes32 private DEPRECATED_DOMAIN_SEPARATOR;
    /// @dev requests keeps track of a hash of the request
    /// to the request info in order to avoid duplicates
    /// from being processed in the remote chain
    mapping(bytes32 => BridgeRequest) public requests;
    /// @notice remoteTokens maps a token (address) in the source
    /// chain to the domain id of the remote chain (uint32)
    /// to info about the token in the remote chain (RemoteTokenInformation)
    mapping(address => mapping(uint32 => RemoteTokenInformation))
        public remoteTokens;
}

abstract contract ToucanCrosschainMessengerStorage is
    ToucanCrosschainMessengerStorageV1
{}

File 21 of 31 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = _setInitializedVersion(1);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        bool isTopLevelCall = _setInitializedVersion(version);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(version);
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        _setInitializedVersion(type(uint8).max);
    }

    function _setInitializedVersion(uint8 version) private returns (bool) {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
        // of initializers, because in other contexts the contract may have been reentered.
        if (_initializing) {
            require(
                version == 1 && !AddressUpgradeable.isContract(address(this)),
                "Initializable: contract is already initialized"
            );
            return false;
        } else {
            require(_initialized < version, "Initializable: contract is already initialized");
            _initialized = version;
            return true;
        }
    }
}

File 22 of 31 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 23 of 31 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 24 of 31 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 25 of 31 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 26 of 31 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 27 of 31 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 28 of 31 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 29 of 31 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 30 of 31 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 31 of 31 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tco2","type":"address"}],"name":"AddFeeExemptedTCO2","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"methodology","type":"string"}],"name":"AttributeMethodologyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"methodology","type":"string"}],"name":"AttributeMethodologyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"region","type":"string"}],"name":"AttributeRegionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"region","type":"string"}],"name":"AttributeRegionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"standard","type":"string"}],"name":"AttributeStandardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"standard","type":"string"}],"name":"AttributeStandardRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20Addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"ExternalAddressRemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"ExternalAddressWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"InternalAddressBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"InternalAddressRemovedFromBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"InternalAddressRemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"erc20addr","type":"address"}],"name":"InternalAddressWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"mappingName","type":"string"},{"indexed":false,"internalType":"bool","name":"accepted","type":"bool"}],"name":"MappingSwitched","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minimumVintageStartTime","type":"uint256"}],"name":"MinimumVintageStartTimeUpdated","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":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"RedeemFeeBurnt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"RedeemFeePaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"erc20","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tco2","type":"address"}],"name":"RemoveFeeExemptedTCO2","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"router","type":"address"}],"name":"RouterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"SupplyCapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"destinationDomain","type":"uint32"},{"indexed":true,"internalType":"address","name":"tco2","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TCO2Bridged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tco2s","type":"address[]"}],"name":"TCO2ScoringUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ContractRegistry","type":"address"}],"name":"ToucanRegistrySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION_RELEASE_CANDIDATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"addToList","type":"bool"},{"internalType":"string[]","name":"_regions","type":"string[]"},{"internalType":"string[]","name":"_standards","type":"string[]"},{"internalType":"string[]","name":"_methodologies","type":"string[]"}],"name":"addAttributes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addRedeemFeeExemptedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tco2","type":"address"}],"name":"addRedeemFeeExemptedTCO2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"addToExternalWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"addToInternalBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"addToInternalWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"bridgeBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"bridgeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"destinationDomain","type":"uint32"},{"internalType":"address[]","name":"tco2s","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"bridgeTCO2s","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tco2s","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"calculateRedeemFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20Addr","type":"address"}],"name":"checkAttributeMatching","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"erc20Addr","type":"address"}],"name":"checkEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20Addr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"externalWhiteList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedeemBurnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedeemBurnPercentageInBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedeemDivider","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedeemPercentageInBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRedeemReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getScoredTCO2s","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"internalBlackList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"internalWhiteList","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"methodologies","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"methodologiesIsAcceptedMapping","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumVintageStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tco2","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeemAndBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeemAuto","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeemAuto2","outputs":[{"internalType":"address[]","name":"tco2s","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"redeemFeeExemptedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"redeemFeeExemptedTCO2s","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tco2s","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"redeemMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"regions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"regionsIsAcceptedMapping","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"removeFromExternalWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"removeFromInternalBlackList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"erc20Addr","type":"address[]"}],"name":"removeFromInternalWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeRedeemFeeExemptedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tco2","type":"address"}],"name":"removeRedeemFeeExemptedTCO2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"scoredTCO2s","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seedMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_feeRedeemBurnAddress","type":"address"}],"name":"setFeeRedeemBurnAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeRedeemBurnPercentageInBase","type":"uint256"}],"name":"setFeeRedeemBurnPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeRedeemPercentageInBase","type":"uint256"}],"name":"setFeeRedeemPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeRedeemReceiver","type":"address"}],"name":"setFeeRedeemReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_minimumVintageStartTime","type":"uint64"}],"name":"setMinimumVintageStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"setSupplyCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tco2s","type":"address[]"}],"name":"setTCO2Scoring","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setToucanContractRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"standards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"standardsIsAcceptedMapping","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supplyCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_mappingName","type":"string"},{"internalType":"bool","name":"accepted","type":"bool"}],"name":"switchMapping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tco2","type":"address"}],"name":"tokenBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]

Contract Creation Code

60a0604052306080523480156200001557600080fd5b506200002062000026565b62000156565b6200003260ff62000035565b50565b60008054610100900460ff1615620000ce578160ff1660011480156200006e57506200006c306200014760201b620037b81760201c565b155b620000c65760405162461bcd60e51b815260206004820152602e602482015260008051602062005e9783398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff8084169116106200012d5760405162461bcd60e51b815260206004820152602e602482015260008051602062005e9783398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000bd565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b608051615d096200018e6000396000818161153b0152818161157b015281816120380152818161207801526121720152615d096000f3fe6080604052600436106104d65760003560e01c80638456cb5911610281578063c0d786551161015a578063e63ab1e9116100cc578063f141b84f11610085578063f141b84f14610fbe578063f2fde38b14610fe0578063f3edb9ec14611000578063f75991cd1461103c578063f887ea4014611078578063ffa1ad741461109957600080fd5b8063e63ab1e914610eb4578063e882e37b14610ee8578063e9d131ad14610f08578063ec87621c14610f28578063f06f510314610f5c578063f138ac1614610f8d57600080fd5b8063d80e05aa1161011e578063d80e05aa14610e07578063dc5f560e14610e27578063dd62ed3e14610e47578063dff0f52314610e67578063e07f744c14610e7e578063e0d7cad914610e9e57600080fd5b8063c0d7865514610d6e578063c36a257314610d8e578063d4e457ec14610db0578063d547741f14610dd2578063d6a022b814610df257600080fd5b8063a1631e4b116101f3578063a9a484c5116101b7578063a9a484c514610cab578063abf410e514610ccb578063b516f8cf14610cec578063b6a3f59a14610d0c578063bbe669eb14610d2c578063bf2f870f14610d4c57600080fd5b8063a1631e4b14610c06578063a217fddf14610c3f578063a457c2d714610c54578063a7381a6414610c74578063a9059cbb14610c8b57600080fd5b80638da5cb5b116102455780638da5cb5b14610b5c5780638dcb01ec14610b7a5780638f770ad014610b9a57806391d1485414610bb157806395d89b4114610bd1578063963ff55e14610be657600080fd5b80638456cb5914610aab5780638662522f14610ac057806388c9cf6e14610afc57806389022e2e14610b1c5780638c2a993e14610b3c57600080fd5b80633f4ba83a116103b35780635db44cef11610325578063715018a6116102e9578063715018a614610a0157806374f4f54714610a1657806379255ddd14610a365780637966529d14610a565780638129fc1c14610a7657806381e48e9014610a8b57600080fd5b80635db44cef146109455780636ca0b0d7146109655780636dbb31021461097a5780636fd2f1811461099a57806370a08231146109cb57600080fd5b80634c02cad1116103775780634c02cad1146108975780634f1ef286146108c5578063523fba7f146108d857806352d1902d146108f857806354c9c9701461090d5780635c975abb1461092d57600080fd5b80633f4ba83a1461080257806341dbbb2a146108175780634642547b1461083757806346518b0a1461085757806347e7ef241461087757600080fd5b806329f4c7a31161044c57806336568abe1161041057806336568abe146107415780633659cfe614610761578063395093511461078157806339cd7a8a146107a15780633a9a77ee146107c15780633d2afced146107e257600080fd5b806329f4c7a31461068d5780632b540f19146106b45780632b554142146106e55780632f2ff15d14610705578063313ce5671461072557600080fd5b80630e2d15ab1161049e5780630e2d15ab1461059457806318160ddd146105c557806320b167f9146105e457806323b872dd14610604578063248a9ca31461062457806324adbf4d1461065457600080fd5b806301ffc9a7146104db57806306fdde0314610510578063095ea7b3146105325780630b7d28c7146105525780630c0efecc14610574575b600080fd5b3480156104e757600080fd5b506104fb6104f6366004614d09565b6110ca565b60405190151581526020015b60405180910390f35b34801561051c57600080fd5b50610525611101565b6040516105079190614d8b565b34801561053e57600080fd5b506104fb61054d366004614db3565b611193565b34801561055e57600080fd5b5061057261056d366004614ddf565b6111ab565b005b34801561058057600080fd5b5061057261058f366004614e11565b6111d8565b3480156105a057600080fd5b506104fb6105af366004614ddf565b6101a06020526000908152604090205460ff1681565b3480156105d157600080fd5b506035545b604051908152602001610507565b3480156105f057600080fd5b506105726105ff366004614e2e565b611237565b34801561061057600080fd5b506104fb61061f366004614e47565b611245565b34801561063057600080fd5b506105d661063f366004614e2e565b600090815260fb602052604090206001015490565b34801561066057600080fd5b5061019b54610675906001600160a01b031681565b6040516001600160a01b039091168152602001610507565b34801561069957600080fd5b5061019f546104fb9068010000000000000000900460ff1681565b3480156106c057600080fd5b506104fb6106cf366004614ddf565b6101a16020526000908152604090205460ff1681565b3480156106f157600080fd5b50610572610700366004614fb1565b611268565b34801561071157600080fd5b5061057261072036600461506b565b61148e565b34801561073157600080fd5b5060405160128152602001610507565b34801561074d57600080fd5b5061057261075c36600461506b565b6114b3565b34801561076d57600080fd5b5061057261077c366004614ddf565b611531565b34801561078d57600080fd5b506104fb61079c366004614db3565b611610565b3480156107ad57600080fd5b506105726107bc366004615129565b611632565b3480156107cd57600080fd5b5061019d54610675906001600160a01b031681565b3480156107ee57600080fd5b506105726107fd3660046151ba565b6117a6565b34801561080e57600080fd5b50610572611a7a565b34801561082357600080fd5b506105d6610832366004614fb1565b611aad565b34801561084357600080fd5b50610572610852366004614ddf565b611b86565b34801561086357600080fd5b50610572610872366004615245565b611bb0565b34801561088357600080fd5b50610572610892366004614db3565b611c8b565b3480156108a357600080fd5b506108b76108b2366004614e2e565b611d4e565b6040516105079291906152bd565b6105726108d3366004615314565b61202e565b3480156108e457600080fd5b506105d66108f3366004614ddf565b6120fa565b34801561090457600080fd5b506105d6612165565b34801561091957600080fd5b50610572610928366004615245565b612218565b34801561093957600080fd5b5060975460ff166104fb565b34801561095157600080fd5b50610572610960366004615245565b6122f3565b34801561097157600080fd5b506105d6600281565b34801561098657600080fd5b50610572610995366004614ddf565b6123ce565b3480156109a657600080fd5b506104fb6109b5366004614ddf565b6101986020526000908152604090205460ff1681565b3480156109d757600080fd5b506105d66109e6366004614ddf565b6001600160a01b031660009081526033602052604090205490565b348015610a0d57600080fd5b5061057261242b565b348015610a2257600080fd5b50610572610a31366004614db3565b61248f565b348015610a4257600080fd5b50610572610a51366004614e2e565b6124a1565b348015610a6257600080fd5b50610572610a71366004615245565b6124eb565b348015610a8257600080fd5b506105726125c6565b348015610a9757600080fd5b50610572610aa63660046153f6565b61268c565b348015610ab757600080fd5b50610572612ae7565b348015610acc57600080fd5b506104fb610adb366004615490565b80516020818301810180516101958252928201919093012091525460ff1681565b348015610b0857600080fd5b50610572610b17366004615245565b612b18565b348015610b2857600080fd5b50610572610b37366004614db3565b612bf3565b348015610b4857600080fd5b50610572610b57366004614db3565b612cc1565b348015610b6857600080fd5b506065546001600160a01b0316610675565b348015610b8657600080fd5b50610572610b95366004615245565b612cd3565b348015610ba657600080fd5b506105d66101915481565b348015610bbd57600080fd5b506104fb610bcc36600461506b565b612dae565b348015610bdd57600080fd5b50610525612dd9565b348015610bf257600080fd5b50610675610c01366004614e2e565b612de8565b348015610c1257600080fd5b5061019f54610c27906001600160401b031681565b6040516001600160401b039091168152602001610507565b348015610c4b57600080fd5b506105d6600081565b348015610c6057600080fd5b506104fb610c6f366004614db3565b612e13565b348015610c8057600080fd5b506105d661019e5481565b348015610c9757600080fd5b506104fb610ca6366004614db3565b612e99565b348015610cb757600080fd5b506104fb610cc6366004614ddf565b612eae565b348015610cd757600080fd5b5061019354610675906001600160a01b031681565b348015610cf857600080fd5b50610572610d07366004614ddf565b6131ab565b348015610d1857600080fd5b50610572610d27366004614e2e565b613217565b348015610d3857600080fd5b50610572610d473660046154c4565b613255565b348015610d5857600080fd5b50610d616132f4565b6040516105079190615505565b348015610d7a57600080fd5b50610572610d89366004614ddf565b613356565b348015610d9a57600080fd5b5061019f546104fb90600160501b900460ff1681565b348015610dbc57600080fd5b5061019f546104fb90600160581b900460ff1681565b348015610dde57600080fd5b50610572610ded36600461506b565b6133ad565b348015610dfe57600080fd5b506105d66133d2565b348015610e1357600080fd5b50610572610e22366004614ddf565b6133f0565b348015610e3357600080fd5b506104fb610e42366004614ddf565b61344a565b348015610e5357600080fd5b506105d6610e62366004615518565b6135b8565b348015610e7357600080fd5b506105d661019c5481565b348015610e8a57600080fd5b50610572610e99366004614ddf565b6135e3565b348015610eaa57600080fd5b506105d661271081565b348015610ec057600080fd5b506105d67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ef457600080fd5b50610572610f03366004614ddf565b61364f565b348015610f1457600080fd5b50610572610f23366004614e2e565b6136a6565b348015610f3457600080fd5b506105d67f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610f6857600080fd5b506104fb610f77366004614ddf565b61019a6020526000908152604090205460ff1681565b348015610f9957600080fd5b506104fb610fa8366004614ddf565b6101996020526000908152604090205460ff1681565b348015610fca57600080fd5b5061019f546104fb90600160481b900460ff1681565b348015610fec57600080fd5b50610572610ffb366004614ddf565b6136f0565b34801561100c57600080fd5b506104fb61101b366004615490565b80516020818301810180516101968252928201919093012091525460ff1681565b34801561104857600080fd5b506104fb611057366004615490565b80516020818301810180516101978252928201919093012091525460ff1681565b34801561108457600080fd5b506101a254610675906001600160a01b031681565b3480156110a557600080fd5b50610525604051806040016040528060058152602001640312e342e360dc1b81525081565b60006001600160e01b03198216637965db0b60e01b14806110fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606036805461111090615546565b80601f016020809104026020016040519081016040528092919081815260200182805461113c90615546565b80156111895780601f1061115e57610100808354040283529160200191611189565b820191906000526020600020905b81548152906001019060200180831161116c57829003601f168201915b5050505050905090565b6000336111a18185856137c7565b5060019392505050565b6111b36138eb565b6001600160a01b031660009081526101a060205260409020805460ff19166001179055565b6111e06138eb565b61019f805467ffffffffffffffff19166001600160401b0383169081179091556040519081527f87f670402a6c72fff3b60ba5223165f062b58d671871fc2c49ea96101fdd19a0906020015b60405180910390a150565b61124081611d4e565b505050565b600061125083613941565b61125b8484846139c4565b50600190505b9392505050565b6112706139dd565b81518151604080518082019091526002815261189960f11b60208201529082146112b65760405162461bcd60e51b81526004016112ad9190614d8b565b60405180910390fd5b5061019c543360009081526101a0602052604081205490919060ff1682805b858110156113a6576112ff8882815181106112f2576112f2615580565b602002602001015161344a565b508261134a576127108488838151811061131b5761131b615580565b602002602001015161132d91906155ac565b61133791906155cb565b915061134382866155ed565b945061134f565b600091505b61139688828151811061136457611364615580565b60200260200101518389848151811061137f5761137f615580565b60200260200101516113919190615605565b613a1d565b61139f8161561c565b90506112d5565b50831561148557600061271061019e54866113c191906155ac565b6113cb91906155cb565b90506113d78186615605565b61019b549095506113f1906001600160a01b031686612e99565b5060408051338152602081018790527f3f89e1d936a29a8de9ae9040436992721a00bc63bbe3ca55692b95f0311640b2910160405180910390a180156114835761019d54611448906001600160a01b031682612e99565b5060408051338152602081018390527f932bd968974f0b6fa1cb59bf961f81d2e57b39332d311b413dceae17966387db910160405180910390a15b505b50505050505050565b600082815260fb60205260409020600101546114a981613a81565b6112408383613a8b565b6001600160a01b03811633146115235760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016112ad565b61152d8282613b11565b5050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036115795760405162461bcd60e51b81526004016112ad90615635565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166115c2600080516020615c69833981519152546001600160a01b031690565b6001600160a01b0316146115e85760405162461bcd60e51b81526004016112ad90615681565b6115f181613b78565b6040805160008082526020820190925261160d91839190613b80565b50565b6000336111a181858561162383836135b8565b61162d91906155ed565b6137c7565b61163a6138eb565b6116638260405180604001604052806007815260200166726567696f6e7360c81b815250613ceb565b1561169f57806116825761019f805460ff60481b191690556000611699565b61019f805460ff60481b1916600160481b17905560015b50611769565b6116ca82604051806040016040528060098152602001687374616e646172647360b81b815250613ceb565b1561170257806116e95761019f805460ff60501b191690556000611699565b61019f805460ff60501b1916600160501b179055611769565b611731826040518060400160405280600d81526020016c6d6574686f646f6c6f6769657360981b815250613ceb565b1561176957806117505761019f805460ff60581b191690556000611767565b61019f805460ff60581b1916600160581b17905560015b505b7fcdc35455a1217219a4240bb18a7d2978eb98208f22f7ec36d6a1381c28f9d0f5828260405161179a9291906156cd565b60405180910390a15050565b6117cf7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cf7565b6040805180820190915260018152601960f91b60208201528390816118075760405162461bcd60e51b81526004016112ad9190614d8b565b50604080518082019091526002815261189960f11b60208201528183146118415760405162461bcd60e51b81526004016112ad9190614d8b565b506101a254604051635ed6513d60e11b815230600482015263ffffffff881660248201526001600160a01b0390911690600090829063bdaca27a906044016040805180830381865afa15801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf91906156fc565b8051604080518082019091526002815261313160f01b6020820152919250906001600160a01b0382166119055760405162461bcd60e51b81526004016112ad9190614d8b565b5060005b84811015611a6e57836001600160a01b031663255e0ae48b8b8b8581811061193357611933615580565b90506020020160208101906119489190614ddf565b8a8a8681811061195a5761195a615580565b6040516001600160e01b031960e088901b16815263ffffffff9590951660048601526001600160a01b039384166024860152602002919091013560448401525085166064820152608401600060405180830381600087803b1580156119be57600080fd5b505af11580156119d2573d6000803e3d6000fd5b505050508888828181106119e8576119e8615580565b90506020020160208101906119fd9190614ddf565b6001600160a01b03168a63ffffffff167f36d0f926f9bce41fb6e90938955b971cee6bbdfbce772aadd3d6c824f0372797898985818110611a4057611a40615580565b90506020020135604051611a5691815260200190565b60405180910390a3611a678161561c565b9050611909565b50505050505050505050565b611aa37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cf7565b611aab613d5d565b565b6000611ab76139dd565b3360009081526101a0602052604090205460ff1615611ad8575060006110fb565b82518251604080518082019091526002815261189960f11b6020820152908214611b155760405162461bcd60e51b81526004016112ad9190614d8b565b5061019c54600090815b83811015611b7b57600061271083888481518110611b3f57611b3f615580565b6020026020010151611b5191906155ac565b611b5b91906155cb565b9050611b6781856155ed565b93505080611b749061561c565b9050611b1f565b509095945050505050565b611b8e6138eb565b6001600160a01b031660009081526101a060205260409020805460ff19169055565b611bb86138eb565b60005b815181101561152d5760016101986000848481518110611bdd57611bdd615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f29b8b184f4394a88477750516a3701dd0c9409451be78c24428bf5f827f527a5828281518110611c4f57611c4f615580565b6020026020010151604051611c7391906001600160a01b0391909116815260200190565b60405180910390a1611c848161561c565b9050611bbb565b611c936139dd565b611c9c8261344a565b506000611ca76133d2565b6040805180820190915260018152603360f81b602082015290915081611ce05760405162461bcd60e51b81526004016112ad9190614d8b565b5080821115611ced578091505b611cf73383613df0565b604080516001600160a01b0385168152602081018490527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4910160405180910390a16112406001600160a01b038416333085613edb565b606080611d596139dd565b604080518082019091526002815261323160f01b602082015283611d905760405162461bcd60e51b81526004016112ad9190614d8b565b506101945460009081905b600086118015611daa57508083105b15611f185760006101948481548110611dc557611dc5615580565b60009182526020822001546001600160a01b03169150611de4826120fa565b905060008115611e1257818911611dfb5788611dfd565b815b9050611e09818a615605565b98508460010194505b85600101955088600003611f1057846001600160401b03811115611e3857611e38614e88565b604051908082528060200260200182016040528015611e61578160200160208202803683370190505b509750846001600160401b03811115611e7c57611e7c614e88565b604051908082528060200260200182016040528015611ea5578160200160208202803683370190505b5096508288611eb5600188615605565b81518110611ec557611ec5615580565b6001600160a01b03909216602092830291909101909101528087611eea600188615605565b81518110611efa57611efa615580565b602002602001018181525050611f108382613a1d565b505050611d9b565b604080518082019091526002815261313560f01b60208201528615611f505760405162461bcd60e51b81526004016112ad9190614d8b565b506000915060005b611f63600185615605565b8110156120255760006101948281548110611f8057611f80615580565b60009182526020822001546001600160a01b03169150611f9f826120fa565b905080600003611fb0575050612015565b81888681518110611fc357611fc3615580565b60200260200101906001600160a01b031690816001600160a01b03168152505080878681518110611ff657611ff6615580565b60200260200101818152505061200c8282613a1d565b84600101945050505b61201e8161561c565b9050611f58565b50505050915091565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036120765760405162461bcd60e51b81526004016112ad90615635565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166120bf600080516020615c69833981519152546001600160a01b031690565b6001600160a01b0316146120e55760405162461bcd60e51b81526004016112ad90615681565b6120ee82613b78565b61152d82826001613b80565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190615753565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146122055760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016112ad565b50600080516020615c6983398151915290565b6122206138eb565b60005b815181101561152d57600161019a600084848151811061224557612245615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f43388d274033333ceb567d699874be067ce7411c2bfc989f8e623694c9b3284f8282815181106122b7576122b7615580565b60200260200101516040516122db91906001600160a01b0391909116815260200190565b60405180910390a16122ec8161561c565b9050612223565b6122fb6138eb565b60005b815181101561152d57600061019a600084848151811061232057612320615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7f25a7a7bea0a3fabbe5dc8b6176bd9a603925da390010a10998148c192b67082828151811061239257612392615580565b60200260200101516040516123b691906001600160a01b0391909116815260200190565b60405180910390a16123c78161561c565b90506122fe565b6123d66138eb565b6001600160a01b03811660008181526101a16020908152604091829020805460ff1916600117905590519182527fbfe78aa03afab7296923112293cb902a2fe6df5a6d3d81e1933c652c4cf860f4910161122c565b6065546001600160a01b031633146124855760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112ad565b611aab6000613f4c565b612497613f9e565b61152d8282613fe4565b6124a96138eb565b604080518082019091526002815261031360f41b602082015261271082106124e45760405162461bcd60e51b81526004016112ad9190614d8b565b5061019e55565b6124f36138eb565b60005b815181101561152d576000610198600084848151811061251857612518615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3c36656d3e8c3db21a1c7d0a7208d73387e15535964c44c30b20c45ab51b3c3882828151811061258a5761258a615580565b60200260200101516040516125ae91906001600160a01b0391909116815260200190565b60405180910390a16125bf8161561c565b90506124f6565b60006125d2600161413e565b905080156125ea576000805461ff0019166101001790555b6125f26141cb565b6125fa6141f2565b612602614222565b61263f604051806060016040528060248152602001615cb060249139604051806040016040528060038152602001621390d560ea1b815250614255565b61264a600033613a8b565b801561160d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200161122c565b6126946138eb565b60005b8251811015612802578415156001036127505760016101968483815181106126c1576126c1615580565b60200260200101516040516126d6919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fa27e97999993c298fae0b7088ff732fe078cc1585665ee1554220b3cbe6317a983828151811061272e5761272e615580565b60200260200101516040516127439190614d8b565b60405180910390a16127f2565b600061019684838151811061276757612767615580565b602002602001015160405161277c919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f0127ddc00426c693b5becb26ba43a260c781ebc323b61d3b24b61e4dc5c93c718382815181106127d4576127d4615580565b60200260200101516040516127e99190614d8b565b60405180910390a15b6127fb8161561c565b9050612697565b5060005b8151811015612971578415156001036128bf57600161019783838151811061283057612830615580565b6020026020010151604051612845919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f156643e9a7f860e95993739893595e6ee1d04d9ff1b98567dbe9d5681cd152b282828151811061289d5761289d615580565b60200260200101516040516128b29190614d8b565b60405180910390a1612961565b60006101978383815181106128d6576128d6615580565b60200260200101516040516128eb919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f21a77ac4edf49633047cc4e32b10dfe633811216214400e0e1f507c3f7287b6182828151811061294357612943615580565b60200260200101516040516129589190614d8b565b60405180910390a15b61296a8161561c565b9050612806565b5060005b8351811015612ae057841515600103612a2e57600161019585838151811061299f5761299f615580565b60200260200101516040516129b4919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f3df7a1330febee3646ae4a0f0e46c94c046f0ee810b2b7f1fa10fa8f34d7b7ef848281518110612a0c57612a0c615580565b6020026020010151604051612a219190614d8b565b60405180910390a1612ad0565b6000610195858381518110612a4557612a45615580565b6020026020010151604051612a5a919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fc84badb33408cce6e89b30a735d8f06e094fa4a19c01c2da66718f490c672f65848281518110612ab257612ab2615580565b6020026020010151604051612ac79190614d8b565b60405180910390a15b612ad98161561c565b9050612975565b5050505050565b612b107f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cf7565b611aab6142a3565b612b206138eb565b60005b815181101561152d5760016101996000848481518110612b4557612b45615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2e333bce7bf5a0097fbb4fef2a950809960b5a4aa1a63cbcffc24ac62dc4fd07828281518110612bb757612bb7615580565b6020026020010151604051612bdb91906001600160a01b0391909116815260200190565b60405180910390a1612bec8161561c565b9050612b23565b612bfb6139dd565b6001600160a01b03821660009081526101a160209081526040918290205482518084019093526002835261313360f01b9183019190915260ff16612c525760405162461bcd60e51b81526004016112ad9190614d8b565b50612c5d8282613a1d565b60405163079cc67960e41b8152336004820152602481018290526001600160a01b038316906379cc679090604401600060405180830381600087803b158015612ca557600080fd5b505af1158015612cb9573d6000803e3d6000fd5b505050505050565b612cc9613f9e565b61152d8282613df0565b612cdb6138eb565b60005b815181101561152d5760006101996000848481518110612d0057612d00615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9cee5064afac40e291311ecb6a670ef3ef652131fb1ed15c1266fb22cffd6bdd828281518110612d7257612d72615580565b6020026020010151604051612d9691906001600160a01b0391909116815260200190565b60405180910390a1612da78161561c565b9050612cde565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606037805461111090615546565b6101948181548110612df957600080fd5b6000918252602090912001546001600160a01b0316905081565b60003381612e2182866135b8565b905083811015612e815760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016112ad565b612e8e82868684036137c7565b506001949350505050565b6000612ea483613941565b6111a1838361431e565b6000612f0f60405180610140016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200160006001600160a01b031681525090565b612f8b6040518061016001604052806060815260200160006001600160401b0316815260200160006001600160401b031681526020016000815260200160006001600160401b03168152602001600015158152602001600015158152602001606081526020016060815260200160608152602001606081525090565b836001600160a01b031663152583de6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612fc9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612ff19190810190615926565b61019f546020808301516040805180820190915260018152601b60f91b9281019290925293955091935090916001600160401b03918216911610156130495760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f60099054906101000a900460ff1615156101958360600151604051613072919061576c565b9081526040805191829003602090810183205483830190925260018352603760f81b90830152909160ff9091161515146130bf5760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f600a9054906101000a900460ff16151561019683602001516040516130e8919061576c565b9081526040805191829003602090810183205483830190925260018352600760fb1b90830152909160ff9091161515146131355760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f600b9054906101000a900460ff161515610197836040015160405161315e919061576c565b9081526040805191829003602090810183205483830190925260018352603960f81b90830152909160ff909116151514612e8e5760405162461bcd60e51b81526004016112ad9190614d8b565b6131b36138eb565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166131f35760405162461bcd60e51b81526004016112ad9190614d8b565b5061019b80546001600160a01b0319166001600160a01b0392909216919091179055565b61321f6138eb565b6101918190556040518181527f4e44c8be34d12f1b7f56b13b4bbe97e64ca37a91916f86c73412da80c21748e29060200161122c565b61327e7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cf7565b6040805180820190915260018152601960f91b6020820152816132b45760405162461bcd60e51b81526004016112ad9190614d8b565b506132c26101948383614c1d565b507f9204d457ace303c5dbbeaa6966e5ec65661a390007a367c6645e52b4ef4b528e828260405161179a929190615ae3565b606061019480548060200260200160405190810160405280929190818152602001828054801561118957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161332f575050505050905090565b61335e6138eb565b6101a280546001600160a01b0319166001600160a01b0383169081179091556040519081527f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc809060200161122c565b600082815260fb60205260409020600101546133c881613a81565b6112408383613b11565b60006133dd60355490565b610191546133eb9190615605565b905090565b6133f86138eb565b6001600160a01b03811660008181526101a16020908152604091829020805460ff1916905590519182527fd1fc9d8986829d0ba9df2bc201a2c76327e0f71567b5a2fb82ba464bf4a03f44910161122c565b6101935460405163787d871360e01b81526001600160a01b038381166004830152600092839291169063787d871390602401602060405180830381865afa158015613499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bd9190615b26565b90508015613557576001600160a01b0383166000908152610199602052604090205460ff16156134f05750600192915050565b6001600160a01b038316600090815261019a602090815260409182902054825180840190935260018352600d60fa1b9183019190915260ff16156135475760405162461bcd60e51b81526004016112ad9190614d8b565b5061355183612eae565b506135af565b6001600160a01b0383166000908152610198602090815260409182902054825180840190935260018352603560f81b9183019190915260ff166135ad5760405162461bcd60e51b81526004016112ad9190614d8b565b505b50600192915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6135eb6138eb565b604080518082019091526002815261313160f01b60208201526001600160a01b03821661362b5760405162461bcd60e51b81526004016112ad9190614d8b565b5061019d80546001600160a01b0319166001600160a01b0392909216919091179055565b6136576138eb565b61019380546001600160a01b0319166001600160a01b0383169081179091556040519081527f86907b53cf2024579968511876daf0b4620d65803b550e33101baf70aeb6f5eb9060200161122c565b6136ae6138eb565b604080518082019091526002815261031360f41b602082015261271082106136e95760405162461bcd60e51b81526004016112ad9190614d8b565b5061019c55565b6065546001600160a01b0316331461374a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112ad565b6001600160a01b0381166137af5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016112ad565b61160d81613f4c565b6001600160a01b03163b151590565b6001600160a01b0383166138295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016112ad565b6001600160a01b03821661388a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016112ad565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b336138fe6065546001600160a01b031690565b6001600160a01b03161460405180604001604052806002815260200161062760f31b8152509061160d5760405162461bcd60e51b81526004016112ad9190614d8b565b604080518082019091526002815261313960f01b60208201526001600160a01b0382166139815760405162461bcd60e51b81526004016112ad9190614d8b565b50604080518082019091526002815261032360f41b60208201526001600160a01b038216300361152d5760405162461bcd60e51b81526004016112ad9190614d8b565b6000336139d285828561432c565b612e8e8585856143a0565b60975460ff1615604051806040016040528060028152602001610c4d60f21b8152509061160d5760405162461bcd60e51b81526004016112ad9190614d8b565b613a273382613fe4565b613a3b6001600160a01b0383163383614579565b604080513381526001600160a01b03841660208201529081018290527f27d4634c833b7622a0acddbf7f746183625f105945e95c723ad1d5a9f2a0b6fc9060600161179a565b61160d81336145a9565b613a958282612dae565b61152d57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613acd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613b1b8282612dae565b1561152d57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61160d6138eb565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613bb3576112408361460d565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613c0d575060408051601f3d908101601f19168201909252613c0a91810190615753565b60015b613c705760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016112ad565b600080516020615c698339815191528114613cdf5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016112ad565b506112408383836146a9565b600061126183836146ce565b613d018133612dae565b80613d25575033613d1a6065546001600160a01b031690565b6001600160a01b0316145b604051806040016040528060018152602001603160f81b8152509061152d5760405162461bcd60e51b81526004016112ad9190614d8b565b60975460ff16613da65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016112ad565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216613e465760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016112ad565b613e52600083836146f3565b8060356000828254613e6491906155ed565b90915550506001600160a01b03821660009081526033602052604081208054839290613e919084906155ed565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052613f469085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526146fb565b50505050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6101a254604080518082019091526002815261313760f01b6020820152906001600160a01b0316331461160d5760405162461bcd60e51b81526004016112ad9190614d8b565b6001600160a01b0382166140445760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016112ad565b614050826000836146f3565b6001600160a01b038216600090815260336020526040902054818110156140c45760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016112ad565b6001600160a01b03831660009081526033602052604081208383039055603580548492906140f3908490615605565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60008054610100900460ff1615614185578160ff1660011480156141615750303b155b61417d5760405162461bcd60e51b81526004016112ad90615b43565b506000919050565b60005460ff8084169116106141ac5760405162461bcd60e51b81526004016112ad90615b43565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16611aab5760405162461bcd60e51b81526004016112ad90615b91565b600054610100900460ff166142195760405162461bcd60e51b81526004016112ad90615b91565b611aab33613f4c565b600054610100900460ff166142495760405162461bcd60e51b81526004016112ad90615b91565b6097805460ff19169055565b600054610100900460ff1661427c5760405162461bcd60e51b81526004016112ad90615b91565b815161428f906036906020850190614c80565b508051611240906037906020840190614c80565b60975460ff16156142e95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016112ad565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613dd33390565b6000336111a18185856143a0565b600061433884846135b8565b90506000198114613f4657818110156143935760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016112ad565b613f4684848484036137c7565b6001600160a01b0383166144045760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016112ad565b6001600160a01b0382166144665760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016112ad565b6144718383836146f3565b6001600160a01b038316600090815260336020526040902054818110156144e95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016112ad565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906145209084906155ed565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161456c91815260200190565b60405180910390a3613f46565b6040516001600160a01b03831660248201526044810182905261124090849063a9059cbb60e01b90606401613f0f565b6145b38282612dae565b61152d576145cb816001600160a01b031660146147cd565b6145d68360206147cd565b6040516020016145e7929190615bdc565b60408051601f198184030181529082905262461bcd60e51b82526112ad91600401614d8b565b6001600160a01b0381163b61467a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016112ad565b600080516020615c6983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6146b283614968565b6000825111806146bf5750805b1561124057613f4683836149a8565b6000815183511480156112615750508051602091820120825192909101919091201490565b6112406139dd565b6000614750826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614a9c9092919063ffffffff16565b805190915015611240578080602001905181019061476e9190615b26565b6112405760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016112ad565b606060006147dc8360026155ac565b6147e79060026155ed565b6001600160401b038111156147fe576147fe614e88565b6040519080825280601f01601f191660200182016040528015614828576020820181803683370190505b509050600360fc1b8160008151811061484357614843615580565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061487257614872615580565b60200101906001600160f81b031916908160001a90535060006148968460026155ac565b6148a19060016155ed565b90505b6001811115614919576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106148d5576148d5615580565b1a60f81b8282815181106148eb576148eb615580565b60200101906001600160f81b031916908160001a90535060049490941c9361491281615c51565b90506148a4565b5083156112615760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016112ad565b6149718161460d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b614a105760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016112ad565b600080846001600160a01b031684604051614a2b919061576c565b600060405180830381855af49150503d8060008114614a66576040519150601f19603f3d011682016040523d82523d6000602084013e614a6b565b606091505b5091509150614a938282604051806060016040528060278152602001615c8960279139614ab3565b95945050505050565b6060614aab8484600085614aec565b949350505050565b60608315614ac2575081611261565b825115614ad25782518084602001fd5b8160405162461bcd60e51b81526004016112ad9190614d8b565b606082471015614b4d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016112ad565b6001600160a01b0385163b614ba45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016112ad565b600080866001600160a01b03168587604051614bc0919061576c565b60006040518083038185875af1925050503d8060008114614bfd576040519150601f19603f3d011682016040523d82523d6000602084013e614c02565b606091505b5091509150614c12828286614ab3565b979650505050505050565b828054828255906000526020600020908101928215614c70579160200282015b82811115614c705781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614c3d565b50614c7c929150614cf4565b5090565b828054614c8c90615546565b90600052602060002090601f016020900481019282614cae5760008555614c70565b82601f10614cc757805160ff1916838001178555614c70565b82800160010185558215614c70579182015b82811115614c70578251825591602001919060010190614cd9565b5b80821115614c7c5760008155600101614cf5565b600060208284031215614d1b57600080fd5b81356001600160e01b03198116811461126157600080fd5b60005b83811015614d4e578181015183820152602001614d36565b83811115613f465750506000910152565b60008151808452614d77816020860160208601614d33565b601f01601f19169290920160200192915050565b6020815260006112616020830184614d5f565b6001600160a01b038116811461160d57600080fd5b60008060408385031215614dc657600080fd5b8235614dd181614d9e565b946020939093013593505050565b600060208284031215614df157600080fd5b813561126181614d9e565b6001600160401b038116811461160d57600080fd5b600060208284031215614e2357600080fd5b813561126181614dfc565b600060208284031215614e4057600080fd5b5035919050565b600080600060608486031215614e5c57600080fd5b8335614e6781614d9e565b92506020840135614e7781614d9e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b0381118282101715614ec157614ec1614e88565b60405290565b60405161014081016001600160401b0381118282101715614ec157614ec1614e88565b604051601f8201601f191681016001600160401b0381118282101715614f1257614f12614e88565b604052919050565b60006001600160401b03821115614f3357614f33614e88565b5060051b60200190565b600082601f830112614f4e57600080fd5b81356020614f63614f5e83614f1a565b614eea565b82815260059290921b84018101918181019086841115614f8257600080fd5b8286015b84811015614fa6578035614f9981614d9e565b8352918301918301614f86565b509695505050505050565b60008060408385031215614fc457600080fd5b82356001600160401b0380821115614fdb57600080fd5b614fe786838701614f3d565b9350602091508185013581811115614ffe57600080fd5b85019050601f8101861361501157600080fd5b803561501f614f5e82614f1a565b81815260059190911b8201830190838101908883111561503e57600080fd5b928401925b8284101561505c57833582529284019290840190615043565b80955050505050509250929050565b6000806040838503121561507e57600080fd5b82359150602083013561509081614d9e565b809150509250929050565b60006001600160401b038211156150b4576150b4614e88565b50601f01601f191660200190565b60006150d0614f5e8461509b565b90508281528383830111156150e457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261510c57600080fd5b611261838335602085016150c2565b801515811461160d57600080fd5b6000806040838503121561513c57600080fd5b82356001600160401b0381111561515257600080fd5b61515e858286016150fb565b92505060208301356150908161511b565b60008083601f84011261518157600080fd5b5081356001600160401b0381111561519857600080fd5b6020830191508360208260051b85010111156151b357600080fd5b9250929050565b6000806000806000606086880312156151d257600080fd5b853563ffffffff811681146151e657600080fd5b945060208601356001600160401b038082111561520257600080fd5b61520e89838a0161516f565b9096509450604088013591508082111561522757600080fd5b506152348882890161516f565b969995985093965092949392505050565b60006020828403121561525757600080fd5b81356001600160401b0381111561526d57600080fd5b614aab84828501614f3d565b600081518084526020808501945080840160005b838110156152b25781516001600160a01b03168752958201959082019060010161528d565b509495945050505050565b6040815260006152d06040830185615279565b82810360208481019190915284518083528582019282019060005b81811015615307578451835293830193918301916001016152eb565b5090979650505050505050565b6000806040838503121561532757600080fd5b823561533281614d9e565b915060208301356001600160401b0381111561534d57600080fd5b8301601f8101851361535e57600080fd5b61536d858235602084016150c2565b9150509250929050565b600082601f83011261538857600080fd5b81356020615398614f5e83614f1a565b82815260059290921b840181019181810190868411156153b757600080fd5b8286015b84811015614fa65780356001600160401b038111156153da5760008081fd5b6153e88986838b01016150fb565b8452509183019183016153bb565b6000806000806080858703121561540c57600080fd5b84356154178161511b565b935060208501356001600160401b038082111561543357600080fd5b61543f88838901615377565b9450604087013591508082111561545557600080fd5b61546188838901615377565b9350606087013591508082111561547757600080fd5b5061548487828801615377565b91505092959194509250565b6000602082840312156154a257600080fd5b81356001600160401b038111156154b857600080fd5b614aab848285016150fb565b600080602083850312156154d757600080fd5b82356001600160401b038111156154ed57600080fd5b6154f98582860161516f565b90969095509350505050565b6020815260006112616020830184615279565b6000806040838503121561552b57600080fd5b823561553681614d9e565b9150602083013561509081614d9e565b600181811c9082168061555a57607f821691505b60208210810361557a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156155c6576155c6615596565b500290565b6000826155e857634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561560057615600615596565b500190565b60008282101561561757615617615596565b500390565b60006001820161562e5761562e615596565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6040815260006156e06040830185614d5f565b905082151560208301529392505050565b80516141c681614d9e565b60006040828403121561570e57600080fd5b604051604081018181106001600160401b038211171561573057615730614e88565b604052825161573e81614d9e565b81526020928301519281019290925250919050565b60006020828403121561576557600080fd5b5051919050565b6000825161577e818460208701614d33565b9190910192915050565b600082601f83011261579957600080fd5b81516157a7614f5e8261509b565b8181528460208386010111156157bc57600080fd5b614aab826020830160208701614d33565b80516141c681614dfc565b80516141c68161511b565b600061016082840312156157f657600080fd5b6157fe614e9e565b905081516001600160401b038082111561581757600080fd5b61582385838601615788565b8352615831602085016157cd565b6020840152615842604085016157cd565b60408401526060840151606084015261585d608085016157cd565b608084015261586e60a085016157d8565b60a084015261587f60c085016157d8565b60c084015260e084015191508082111561589857600080fd5b6158a485838601615788565b60e0840152610100915081840151818111156158bf57600080fd5b6158cb86828701615788565b8385015250610120915081840151818111156158e657600080fd5b6158f286828701615788565b83850152506101409150818401518181111561590d57600080fd5b61591986828701615788565b8385015250505092915050565b6000806040838503121561593957600080fd5b82516001600160401b038082111561595057600080fd5b90840190610140828703121561596557600080fd5b61596d614ec7565b82518281111561597c57600080fd5b61598888828601615788565b82525060208301518281111561599d57600080fd5b6159a988828601615788565b6020830152506040830151828111156159c157600080fd5b6159cd88828601615788565b6040830152506060830151828111156159e557600080fd5b6159f188828601615788565b606083015250608083015182811115615a0957600080fd5b615a1588828601615788565b60808301525060a083015182811115615a2d57600080fd5b615a3988828601615788565b60a08301525060c083015182811115615a5157600080fd5b615a5d88828601615788565b60c08301525060e083015182811115615a7557600080fd5b615a8188828601615788565b60e0830152506101008084015183811115615a9b57600080fd5b615aa789828701615788565b828401525050610120615abb8185016156f1565b908201526020860151909450915080821115615ad657600080fd5b5061536d858286016157e3565b60208082528181018390526000908460408401835b86811015614fa6578235615b0b81614d9e565b6001600160a01b031682529183019190830190600101615af8565b600060208284031215615b3857600080fd5b81516112618161511b565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615c14816017850160208801614d33565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615c45816028840160208801614d33565b01602801949350505050565b600081615c6057615c60615596565b50600019019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564546f7563616e2050726f746f636f6c3a204e617475726520436172626f6e20546f6e6e65a264697066735822122024e14dbd461e57722dbf17d926c102c6849379c6f7c16ba442392094fecfde3264736f6c634300080e0033496e697469616c697a61626c653a20636f6e747261637420697320616c726561

Deployed Bytecode

0x6080604052600436106104d65760003560e01c80638456cb5911610281578063c0d786551161015a578063e63ab1e9116100cc578063f141b84f11610085578063f141b84f14610fbe578063f2fde38b14610fe0578063f3edb9ec14611000578063f75991cd1461103c578063f887ea4014611078578063ffa1ad741461109957600080fd5b8063e63ab1e914610eb4578063e882e37b14610ee8578063e9d131ad14610f08578063ec87621c14610f28578063f06f510314610f5c578063f138ac1614610f8d57600080fd5b8063d80e05aa1161011e578063d80e05aa14610e07578063dc5f560e14610e27578063dd62ed3e14610e47578063dff0f52314610e67578063e07f744c14610e7e578063e0d7cad914610e9e57600080fd5b8063c0d7865514610d6e578063c36a257314610d8e578063d4e457ec14610db0578063d547741f14610dd2578063d6a022b814610df257600080fd5b8063a1631e4b116101f3578063a9a484c5116101b7578063a9a484c514610cab578063abf410e514610ccb578063b516f8cf14610cec578063b6a3f59a14610d0c578063bbe669eb14610d2c578063bf2f870f14610d4c57600080fd5b8063a1631e4b14610c06578063a217fddf14610c3f578063a457c2d714610c54578063a7381a6414610c74578063a9059cbb14610c8b57600080fd5b80638da5cb5b116102455780638da5cb5b14610b5c5780638dcb01ec14610b7a5780638f770ad014610b9a57806391d1485414610bb157806395d89b4114610bd1578063963ff55e14610be657600080fd5b80638456cb5914610aab5780638662522f14610ac057806388c9cf6e14610afc57806389022e2e14610b1c5780638c2a993e14610b3c57600080fd5b80633f4ba83a116103b35780635db44cef11610325578063715018a6116102e9578063715018a614610a0157806374f4f54714610a1657806379255ddd14610a365780637966529d14610a565780638129fc1c14610a7657806381e48e9014610a8b57600080fd5b80635db44cef146109455780636ca0b0d7146109655780636dbb31021461097a5780636fd2f1811461099a57806370a08231146109cb57600080fd5b80634c02cad1116103775780634c02cad1146108975780634f1ef286146108c5578063523fba7f146108d857806352d1902d146108f857806354c9c9701461090d5780635c975abb1461092d57600080fd5b80633f4ba83a1461080257806341dbbb2a146108175780634642547b1461083757806346518b0a1461085757806347e7ef241461087757600080fd5b806329f4c7a31161044c57806336568abe1161041057806336568abe146107415780633659cfe614610761578063395093511461078157806339cd7a8a146107a15780633a9a77ee146107c15780633d2afced146107e257600080fd5b806329f4c7a31461068d5780632b540f19146106b45780632b554142146106e55780632f2ff15d14610705578063313ce5671461072557600080fd5b80630e2d15ab1161049e5780630e2d15ab1461059457806318160ddd146105c557806320b167f9146105e457806323b872dd14610604578063248a9ca31461062457806324adbf4d1461065457600080fd5b806301ffc9a7146104db57806306fdde0314610510578063095ea7b3146105325780630b7d28c7146105525780630c0efecc14610574575b600080fd5b3480156104e757600080fd5b506104fb6104f6366004614d09565b6110ca565b60405190151581526020015b60405180910390f35b34801561051c57600080fd5b50610525611101565b6040516105079190614d8b565b34801561053e57600080fd5b506104fb61054d366004614db3565b611193565b34801561055e57600080fd5b5061057261056d366004614ddf565b6111ab565b005b34801561058057600080fd5b5061057261058f366004614e11565b6111d8565b3480156105a057600080fd5b506104fb6105af366004614ddf565b6101a06020526000908152604090205460ff1681565b3480156105d157600080fd5b506035545b604051908152602001610507565b3480156105f057600080fd5b506105726105ff366004614e2e565b611237565b34801561061057600080fd5b506104fb61061f366004614e47565b611245565b34801561063057600080fd5b506105d661063f366004614e2e565b600090815260fb602052604090206001015490565b34801561066057600080fd5b5061019b54610675906001600160a01b031681565b6040516001600160a01b039091168152602001610507565b34801561069957600080fd5b5061019f546104fb9068010000000000000000900460ff1681565b3480156106c057600080fd5b506104fb6106cf366004614ddf565b6101a16020526000908152604090205460ff1681565b3480156106f157600080fd5b50610572610700366004614fb1565b611268565b34801561071157600080fd5b5061057261072036600461506b565b61148e565b34801561073157600080fd5b5060405160128152602001610507565b34801561074d57600080fd5b5061057261075c36600461506b565b6114b3565b34801561076d57600080fd5b5061057261077c366004614ddf565b611531565b34801561078d57600080fd5b506104fb61079c366004614db3565b611610565b3480156107ad57600080fd5b506105726107bc366004615129565b611632565b3480156107cd57600080fd5b5061019d54610675906001600160a01b031681565b3480156107ee57600080fd5b506105726107fd3660046151ba565b6117a6565b34801561080e57600080fd5b50610572611a7a565b34801561082357600080fd5b506105d6610832366004614fb1565b611aad565b34801561084357600080fd5b50610572610852366004614ddf565b611b86565b34801561086357600080fd5b50610572610872366004615245565b611bb0565b34801561088357600080fd5b50610572610892366004614db3565b611c8b565b3480156108a357600080fd5b506108b76108b2366004614e2e565b611d4e565b6040516105079291906152bd565b6105726108d3366004615314565b61202e565b3480156108e457600080fd5b506105d66108f3366004614ddf565b6120fa565b34801561090457600080fd5b506105d6612165565b34801561091957600080fd5b50610572610928366004615245565b612218565b34801561093957600080fd5b5060975460ff166104fb565b34801561095157600080fd5b50610572610960366004615245565b6122f3565b34801561097157600080fd5b506105d6600281565b34801561098657600080fd5b50610572610995366004614ddf565b6123ce565b3480156109a657600080fd5b506104fb6109b5366004614ddf565b6101986020526000908152604090205460ff1681565b3480156109d757600080fd5b506105d66109e6366004614ddf565b6001600160a01b031660009081526033602052604090205490565b348015610a0d57600080fd5b5061057261242b565b348015610a2257600080fd5b50610572610a31366004614db3565b61248f565b348015610a4257600080fd5b50610572610a51366004614e2e565b6124a1565b348015610a6257600080fd5b50610572610a71366004615245565b6124eb565b348015610a8257600080fd5b506105726125c6565b348015610a9757600080fd5b50610572610aa63660046153f6565b61268c565b348015610ab757600080fd5b50610572612ae7565b348015610acc57600080fd5b506104fb610adb366004615490565b80516020818301810180516101958252928201919093012091525460ff1681565b348015610b0857600080fd5b50610572610b17366004615245565b612b18565b348015610b2857600080fd5b50610572610b37366004614db3565b612bf3565b348015610b4857600080fd5b50610572610b57366004614db3565b612cc1565b348015610b6857600080fd5b506065546001600160a01b0316610675565b348015610b8657600080fd5b50610572610b95366004615245565b612cd3565b348015610ba657600080fd5b506105d66101915481565b348015610bbd57600080fd5b506104fb610bcc36600461506b565b612dae565b348015610bdd57600080fd5b50610525612dd9565b348015610bf257600080fd5b50610675610c01366004614e2e565b612de8565b348015610c1257600080fd5b5061019f54610c27906001600160401b031681565b6040516001600160401b039091168152602001610507565b348015610c4b57600080fd5b506105d6600081565b348015610c6057600080fd5b506104fb610c6f366004614db3565b612e13565b348015610c8057600080fd5b506105d661019e5481565b348015610c9757600080fd5b506104fb610ca6366004614db3565b612e99565b348015610cb757600080fd5b506104fb610cc6366004614ddf565b612eae565b348015610cd757600080fd5b5061019354610675906001600160a01b031681565b348015610cf857600080fd5b50610572610d07366004614ddf565b6131ab565b348015610d1857600080fd5b50610572610d27366004614e2e565b613217565b348015610d3857600080fd5b50610572610d473660046154c4565b613255565b348015610d5857600080fd5b50610d616132f4565b6040516105079190615505565b348015610d7a57600080fd5b50610572610d89366004614ddf565b613356565b348015610d9a57600080fd5b5061019f546104fb90600160501b900460ff1681565b348015610dbc57600080fd5b5061019f546104fb90600160581b900460ff1681565b348015610dde57600080fd5b50610572610ded36600461506b565b6133ad565b348015610dfe57600080fd5b506105d66133d2565b348015610e1357600080fd5b50610572610e22366004614ddf565b6133f0565b348015610e3357600080fd5b506104fb610e42366004614ddf565b61344a565b348015610e5357600080fd5b506105d6610e62366004615518565b6135b8565b348015610e7357600080fd5b506105d661019c5481565b348015610e8a57600080fd5b50610572610e99366004614ddf565b6135e3565b348015610eaa57600080fd5b506105d661271081565b348015610ec057600080fd5b506105d67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ef457600080fd5b50610572610f03366004614ddf565b61364f565b348015610f1457600080fd5b50610572610f23366004614e2e565b6136a6565b348015610f3457600080fd5b506105d67f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610f6857600080fd5b506104fb610f77366004614ddf565b61019a6020526000908152604090205460ff1681565b348015610f9957600080fd5b506104fb610fa8366004614ddf565b6101996020526000908152604090205460ff1681565b348015610fca57600080fd5b5061019f546104fb90600160481b900460ff1681565b348015610fec57600080fd5b50610572610ffb366004614ddf565b6136f0565b34801561100c57600080fd5b506104fb61101b366004615490565b80516020818301810180516101968252928201919093012091525460ff1681565b34801561104857600080fd5b506104fb611057366004615490565b80516020818301810180516101978252928201919093012091525460ff1681565b34801561108457600080fd5b506101a254610675906001600160a01b031681565b3480156110a557600080fd5b50610525604051806040016040528060058152602001640312e342e360dc1b81525081565b60006001600160e01b03198216637965db0b60e01b14806110fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606036805461111090615546565b80601f016020809104026020016040519081016040528092919081815260200182805461113c90615546565b80156111895780601f1061115e57610100808354040283529160200191611189565b820191906000526020600020905b81548152906001019060200180831161116c57829003601f168201915b5050505050905090565b6000336111a18185856137c7565b5060019392505050565b6111b36138eb565b6001600160a01b031660009081526101a060205260409020805460ff19166001179055565b6111e06138eb565b61019f805467ffffffffffffffff19166001600160401b0383169081179091556040519081527f87f670402a6c72fff3b60ba5223165f062b58d671871fc2c49ea96101fdd19a0906020015b60405180910390a150565b61124081611d4e565b505050565b600061125083613941565b61125b8484846139c4565b50600190505b9392505050565b6112706139dd565b81518151604080518082019091526002815261189960f11b60208201529082146112b65760405162461bcd60e51b81526004016112ad9190614d8b565b60405180910390fd5b5061019c543360009081526101a0602052604081205490919060ff1682805b858110156113a6576112ff8882815181106112f2576112f2615580565b602002602001015161344a565b508261134a576127108488838151811061131b5761131b615580565b602002602001015161132d91906155ac565b61133791906155cb565b915061134382866155ed565b945061134f565b600091505b61139688828151811061136457611364615580565b60200260200101518389848151811061137f5761137f615580565b60200260200101516113919190615605565b613a1d565b61139f8161561c565b90506112d5565b50831561148557600061271061019e54866113c191906155ac565b6113cb91906155cb565b90506113d78186615605565b61019b549095506113f1906001600160a01b031686612e99565b5060408051338152602081018790527f3f89e1d936a29a8de9ae9040436992721a00bc63bbe3ca55692b95f0311640b2910160405180910390a180156114835761019d54611448906001600160a01b031682612e99565b5060408051338152602081018390527f932bd968974f0b6fa1cb59bf961f81d2e57b39332d311b413dceae17966387db910160405180910390a15b505b50505050505050565b600082815260fb60205260409020600101546114a981613a81565b6112408383613a8b565b6001600160a01b03811633146115235760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016112ad565b61152d8282613b11565b5050565b6001600160a01b037f0000000000000000000000006ae2341b158909f940eb1704393e97901c0058611630036115795760405162461bcd60e51b81526004016112ad90615635565b7f0000000000000000000000006ae2341b158909f940eb1704393e97901c0058616001600160a01b03166115c2600080516020615c69833981519152546001600160a01b031690565b6001600160a01b0316146115e85760405162461bcd60e51b81526004016112ad90615681565b6115f181613b78565b6040805160008082526020820190925261160d91839190613b80565b50565b6000336111a181858561162383836135b8565b61162d91906155ed565b6137c7565b61163a6138eb565b6116638260405180604001604052806007815260200166726567696f6e7360c81b815250613ceb565b1561169f57806116825761019f805460ff60481b191690556000611699565b61019f805460ff60481b1916600160481b17905560015b50611769565b6116ca82604051806040016040528060098152602001687374616e646172647360b81b815250613ceb565b1561170257806116e95761019f805460ff60501b191690556000611699565b61019f805460ff60501b1916600160501b179055611769565b611731826040518060400160405280600d81526020016c6d6574686f646f6c6f6769657360981b815250613ceb565b1561176957806117505761019f805460ff60581b191690556000611767565b61019f805460ff60581b1916600160581b17905560015b505b7fcdc35455a1217219a4240bb18a7d2978eb98208f22f7ec36d6a1381c28f9d0f5828260405161179a9291906156cd565b60405180910390a15050565b6117cf7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cf7565b6040805180820190915260018152601960f91b60208201528390816118075760405162461bcd60e51b81526004016112ad9190614d8b565b50604080518082019091526002815261189960f11b60208201528183146118415760405162461bcd60e51b81526004016112ad9190614d8b565b506101a254604051635ed6513d60e11b815230600482015263ffffffff881660248201526001600160a01b0390911690600090829063bdaca27a906044016040805180830381865afa15801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf91906156fc565b8051604080518082019091526002815261313160f01b6020820152919250906001600160a01b0382166119055760405162461bcd60e51b81526004016112ad9190614d8b565b5060005b84811015611a6e57836001600160a01b031663255e0ae48b8b8b8581811061193357611933615580565b90506020020160208101906119489190614ddf565b8a8a8681811061195a5761195a615580565b6040516001600160e01b031960e088901b16815263ffffffff9590951660048601526001600160a01b039384166024860152602002919091013560448401525085166064820152608401600060405180830381600087803b1580156119be57600080fd5b505af11580156119d2573d6000803e3d6000fd5b505050508888828181106119e8576119e8615580565b90506020020160208101906119fd9190614ddf565b6001600160a01b03168a63ffffffff167f36d0f926f9bce41fb6e90938955b971cee6bbdfbce772aadd3d6c824f0372797898985818110611a4057611a40615580565b90506020020135604051611a5691815260200190565b60405180910390a3611a678161561c565b9050611909565b50505050505050505050565b611aa37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cf7565b611aab613d5d565b565b6000611ab76139dd565b3360009081526101a0602052604090205460ff1615611ad8575060006110fb565b82518251604080518082019091526002815261189960f11b6020820152908214611b155760405162461bcd60e51b81526004016112ad9190614d8b565b5061019c54600090815b83811015611b7b57600061271083888481518110611b3f57611b3f615580565b6020026020010151611b5191906155ac565b611b5b91906155cb565b9050611b6781856155ed565b93505080611b749061561c565b9050611b1f565b509095945050505050565b611b8e6138eb565b6001600160a01b031660009081526101a060205260409020805460ff19169055565b611bb86138eb565b60005b815181101561152d5760016101986000848481518110611bdd57611bdd615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f29b8b184f4394a88477750516a3701dd0c9409451be78c24428bf5f827f527a5828281518110611c4f57611c4f615580565b6020026020010151604051611c7391906001600160a01b0391909116815260200190565b60405180910390a1611c848161561c565b9050611bbb565b611c936139dd565b611c9c8261344a565b506000611ca76133d2565b6040805180820190915260018152603360f81b602082015290915081611ce05760405162461bcd60e51b81526004016112ad9190614d8b565b5080821115611ced578091505b611cf73383613df0565b604080516001600160a01b0385168152602081018490527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4910160405180910390a16112406001600160a01b038416333085613edb565b606080611d596139dd565b604080518082019091526002815261323160f01b602082015283611d905760405162461bcd60e51b81526004016112ad9190614d8b565b506101945460009081905b600086118015611daa57508083105b15611f185760006101948481548110611dc557611dc5615580565b60009182526020822001546001600160a01b03169150611de4826120fa565b905060008115611e1257818911611dfb5788611dfd565b815b9050611e09818a615605565b98508460010194505b85600101955088600003611f1057846001600160401b03811115611e3857611e38614e88565b604051908082528060200260200182016040528015611e61578160200160208202803683370190505b509750846001600160401b03811115611e7c57611e7c614e88565b604051908082528060200260200182016040528015611ea5578160200160208202803683370190505b5096508288611eb5600188615605565b81518110611ec557611ec5615580565b6001600160a01b03909216602092830291909101909101528087611eea600188615605565b81518110611efa57611efa615580565b602002602001018181525050611f108382613a1d565b505050611d9b565b604080518082019091526002815261313560f01b60208201528615611f505760405162461bcd60e51b81526004016112ad9190614d8b565b506000915060005b611f63600185615605565b8110156120255760006101948281548110611f8057611f80615580565b60009182526020822001546001600160a01b03169150611f9f826120fa565b905080600003611fb0575050612015565b81888681518110611fc357611fc3615580565b60200260200101906001600160a01b031690816001600160a01b03168152505080878681518110611ff657611ff6615580565b60200260200101818152505061200c8282613a1d565b84600101945050505b61201e8161561c565b9050611f58565b50505050915091565b6001600160a01b037f0000000000000000000000006ae2341b158909f940eb1704393e97901c0058611630036120765760405162461bcd60e51b81526004016112ad90615635565b7f0000000000000000000000006ae2341b158909f940eb1704393e97901c0058616001600160a01b03166120bf600080516020615c69833981519152546001600160a01b031690565b6001600160a01b0316146120e55760405162461bcd60e51b81526004016112ad90615681565b6120ee82613b78565b61152d82826001613b80565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190615753565b6000306001600160a01b037f0000000000000000000000006ae2341b158909f940eb1704393e97901c00586116146122055760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016112ad565b50600080516020615c6983398151915290565b6122206138eb565b60005b815181101561152d57600161019a600084848151811061224557612245615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f43388d274033333ceb567d699874be067ce7411c2bfc989f8e623694c9b3284f8282815181106122b7576122b7615580565b60200260200101516040516122db91906001600160a01b0391909116815260200190565b60405180910390a16122ec8161561c565b9050612223565b6122fb6138eb565b60005b815181101561152d57600061019a600084848151811061232057612320615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7f25a7a7bea0a3fabbe5dc8b6176bd9a603925da390010a10998148c192b67082828151811061239257612392615580565b60200260200101516040516123b691906001600160a01b0391909116815260200190565b60405180910390a16123c78161561c565b90506122fe565b6123d66138eb565b6001600160a01b03811660008181526101a16020908152604091829020805460ff1916600117905590519182527fbfe78aa03afab7296923112293cb902a2fe6df5a6d3d81e1933c652c4cf860f4910161122c565b6065546001600160a01b031633146124855760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112ad565b611aab6000613f4c565b612497613f9e565b61152d8282613fe4565b6124a96138eb565b604080518082019091526002815261031360f41b602082015261271082106124e45760405162461bcd60e51b81526004016112ad9190614d8b565b5061019e55565b6124f36138eb565b60005b815181101561152d576000610198600084848151811061251857612518615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3c36656d3e8c3db21a1c7d0a7208d73387e15535964c44c30b20c45ab51b3c3882828151811061258a5761258a615580565b60200260200101516040516125ae91906001600160a01b0391909116815260200190565b60405180910390a16125bf8161561c565b90506124f6565b60006125d2600161413e565b905080156125ea576000805461ff0019166101001790555b6125f26141cb565b6125fa6141f2565b612602614222565b61263f604051806060016040528060248152602001615cb060249139604051806040016040528060038152602001621390d560ea1b815250614255565b61264a600033613a8b565b801561160d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200161122c565b6126946138eb565b60005b8251811015612802578415156001036127505760016101968483815181106126c1576126c1615580565b60200260200101516040516126d6919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fa27e97999993c298fae0b7088ff732fe078cc1585665ee1554220b3cbe6317a983828151811061272e5761272e615580565b60200260200101516040516127439190614d8b565b60405180910390a16127f2565b600061019684838151811061276757612767615580565b602002602001015160405161277c919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f0127ddc00426c693b5becb26ba43a260c781ebc323b61d3b24b61e4dc5c93c718382815181106127d4576127d4615580565b60200260200101516040516127e99190614d8b565b60405180910390a15b6127fb8161561c565b9050612697565b5060005b8151811015612971578415156001036128bf57600161019783838151811061283057612830615580565b6020026020010151604051612845919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f156643e9a7f860e95993739893595e6ee1d04d9ff1b98567dbe9d5681cd152b282828151811061289d5761289d615580565b60200260200101516040516128b29190614d8b565b60405180910390a1612961565b60006101978383815181106128d6576128d6615580565b60200260200101516040516128eb919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f21a77ac4edf49633047cc4e32b10dfe633811216214400e0e1f507c3f7287b6182828151811061294357612943615580565b60200260200101516040516129589190614d8b565b60405180910390a15b61296a8161561c565b9050612806565b5060005b8351811015612ae057841515600103612a2e57600161019585838151811061299f5761299f615580565b60200260200101516040516129b4919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f3df7a1330febee3646ae4a0f0e46c94c046f0ee810b2b7f1fa10fa8f34d7b7ef848281518110612a0c57612a0c615580565b6020026020010151604051612a219190614d8b565b60405180910390a1612ad0565b6000610195858381518110612a4557612a45615580565b6020026020010151604051612a5a919061576c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fc84badb33408cce6e89b30a735d8f06e094fa4a19c01c2da66718f490c672f65848281518110612ab257612ab2615580565b6020026020010151604051612ac79190614d8b565b60405180910390a15b612ad98161561c565b9050612975565b5050505050565b612b107f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cf7565b611aab6142a3565b612b206138eb565b60005b815181101561152d5760016101996000848481518110612b4557612b45615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2e333bce7bf5a0097fbb4fef2a950809960b5a4aa1a63cbcffc24ac62dc4fd07828281518110612bb757612bb7615580565b6020026020010151604051612bdb91906001600160a01b0391909116815260200190565b60405180910390a1612bec8161561c565b9050612b23565b612bfb6139dd565b6001600160a01b03821660009081526101a160209081526040918290205482518084019093526002835261313360f01b9183019190915260ff16612c525760405162461bcd60e51b81526004016112ad9190614d8b565b50612c5d8282613a1d565b60405163079cc67960e41b8152336004820152602481018290526001600160a01b038316906379cc679090604401600060405180830381600087803b158015612ca557600080fd5b505af1158015612cb9573d6000803e3d6000fd5b505050505050565b612cc9613f9e565b61152d8282613df0565b612cdb6138eb565b60005b815181101561152d5760006101996000848481518110612d0057612d00615580565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9cee5064afac40e291311ecb6a670ef3ef652131fb1ed15c1266fb22cffd6bdd828281518110612d7257612d72615580565b6020026020010151604051612d9691906001600160a01b0391909116815260200190565b60405180910390a1612da78161561c565b9050612cde565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606037805461111090615546565b6101948181548110612df957600080fd5b6000918252602090912001546001600160a01b0316905081565b60003381612e2182866135b8565b905083811015612e815760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016112ad565b612e8e82868684036137c7565b506001949350505050565b6000612ea483613941565b6111a1838361431e565b6000612f0f60405180610140016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200160006001600160a01b031681525090565b612f8b6040518061016001604052806060815260200160006001600160401b0316815260200160006001600160401b031681526020016000815260200160006001600160401b03168152602001600015158152602001600015158152602001606081526020016060815260200160608152602001606081525090565b836001600160a01b031663152583de6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612fc9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612ff19190810190615926565b61019f546020808301516040805180820190915260018152601b60f91b9281019290925293955091935090916001600160401b03918216911610156130495760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f60099054906101000a900460ff1615156101958360600151604051613072919061576c565b9081526040805191829003602090810183205483830190925260018352603760f81b90830152909160ff9091161515146130bf5760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f600a9054906101000a900460ff16151561019683602001516040516130e8919061576c565b9081526040805191829003602090810183205483830190925260018352600760fb1b90830152909160ff9091161515146131355760405162461bcd60e51b81526004016112ad9190614d8b565b5061019f600b9054906101000a900460ff161515610197836040015160405161315e919061576c565b9081526040805191829003602090810183205483830190925260018352603960f81b90830152909160ff909116151514612e8e5760405162461bcd60e51b81526004016112ad9190614d8b565b6131b36138eb565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166131f35760405162461bcd60e51b81526004016112ad9190614d8b565b5061019b80546001600160a01b0319166001600160a01b0392909216919091179055565b61321f6138eb565b6101918190556040518181527f4e44c8be34d12f1b7f56b13b4bbe97e64ca37a91916f86c73412da80c21748e29060200161122c565b61327e7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cf7565b6040805180820190915260018152601960f91b6020820152816132b45760405162461bcd60e51b81526004016112ad9190614d8b565b506132c26101948383614c1d565b507f9204d457ace303c5dbbeaa6966e5ec65661a390007a367c6645e52b4ef4b528e828260405161179a929190615ae3565b606061019480548060200260200160405190810160405280929190818152602001828054801561118957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161332f575050505050905090565b61335e6138eb565b6101a280546001600160a01b0319166001600160a01b0383169081179091556040519081527f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc809060200161122c565b600082815260fb60205260409020600101546133c881613a81565b6112408383613b11565b60006133dd60355490565b610191546133eb9190615605565b905090565b6133f86138eb565b6001600160a01b03811660008181526101a16020908152604091829020805460ff1916905590519182527fd1fc9d8986829d0ba9df2bc201a2c76327e0f71567b5a2fb82ba464bf4a03f44910161122c565b6101935460405163787d871360e01b81526001600160a01b038381166004830152600092839291169063787d871390602401602060405180830381865afa158015613499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bd9190615b26565b90508015613557576001600160a01b0383166000908152610199602052604090205460ff16156134f05750600192915050565b6001600160a01b038316600090815261019a602090815260409182902054825180840190935260018352600d60fa1b9183019190915260ff16156135475760405162461bcd60e51b81526004016112ad9190614d8b565b5061355183612eae565b506135af565b6001600160a01b0383166000908152610198602090815260409182902054825180840190935260018352603560f81b9183019190915260ff166135ad5760405162461bcd60e51b81526004016112ad9190614d8b565b505b50600192915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6135eb6138eb565b604080518082019091526002815261313160f01b60208201526001600160a01b03821661362b5760405162461bcd60e51b81526004016112ad9190614d8b565b5061019d80546001600160a01b0319166001600160a01b0392909216919091179055565b6136576138eb565b61019380546001600160a01b0319166001600160a01b0383169081179091556040519081527f86907b53cf2024579968511876daf0b4620d65803b550e33101baf70aeb6f5eb9060200161122c565b6136ae6138eb565b604080518082019091526002815261031360f41b602082015261271082106136e95760405162461bcd60e51b81526004016112ad9190614d8b565b5061019c55565b6065546001600160a01b0316331461374a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112ad565b6001600160a01b0381166137af5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016112ad565b61160d81613f4c565b6001600160a01b03163b151590565b6001600160a01b0383166138295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016112ad565b6001600160a01b03821661388a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016112ad565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b336138fe6065546001600160a01b031690565b6001600160a01b03161460405180604001604052806002815260200161062760f31b8152509061160d5760405162461bcd60e51b81526004016112ad9190614d8b565b604080518082019091526002815261313960f01b60208201526001600160a01b0382166139815760405162461bcd60e51b81526004016112ad9190614d8b565b50604080518082019091526002815261032360f41b60208201526001600160a01b038216300361152d5760405162461bcd60e51b81526004016112ad9190614d8b565b6000336139d285828561432c565b612e8e8585856143a0565b60975460ff1615604051806040016040528060028152602001610c4d60f21b8152509061160d5760405162461bcd60e51b81526004016112ad9190614d8b565b613a273382613fe4565b613a3b6001600160a01b0383163383614579565b604080513381526001600160a01b03841660208201529081018290527f27d4634c833b7622a0acddbf7f746183625f105945e95c723ad1d5a9f2a0b6fc9060600161179a565b61160d81336145a9565b613a958282612dae565b61152d57600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613acd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613b1b8282612dae565b1561152d57600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61160d6138eb565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613bb3576112408361460d565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613c0d575060408051601f3d908101601f19168201909252613c0a91810190615753565b60015b613c705760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016112ad565b600080516020615c698339815191528114613cdf5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016112ad565b506112408383836146a9565b600061126183836146ce565b613d018133612dae565b80613d25575033613d1a6065546001600160a01b031690565b6001600160a01b0316145b604051806040016040528060018152602001603160f81b8152509061152d5760405162461bcd60e51b81526004016112ad9190614d8b565b60975460ff16613da65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016112ad565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216613e465760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016112ad565b613e52600083836146f3565b8060356000828254613e6491906155ed565b90915550506001600160a01b03821660009081526033602052604081208054839290613e919084906155ed565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052613f469085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526146fb565b50505050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6101a254604080518082019091526002815261313760f01b6020820152906001600160a01b0316331461160d5760405162461bcd60e51b81526004016112ad9190614d8b565b6001600160a01b0382166140445760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016112ad565b614050826000836146f3565b6001600160a01b038216600090815260336020526040902054818110156140c45760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016112ad565b6001600160a01b03831660009081526033602052604081208383039055603580548492906140f3908490615605565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60008054610100900460ff1615614185578160ff1660011480156141615750303b155b61417d5760405162461bcd60e51b81526004016112ad90615b43565b506000919050565b60005460ff8084169116106141ac5760405162461bcd60e51b81526004016112ad90615b43565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16611aab5760405162461bcd60e51b81526004016112ad90615b91565b600054610100900460ff166142195760405162461bcd60e51b81526004016112ad90615b91565b611aab33613f4c565b600054610100900460ff166142495760405162461bcd60e51b81526004016112ad90615b91565b6097805460ff19169055565b600054610100900460ff1661427c5760405162461bcd60e51b81526004016112ad90615b91565b815161428f906036906020850190614c80565b508051611240906037906020840190614c80565b60975460ff16156142e95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016112ad565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613dd33390565b6000336111a18185856143a0565b600061433884846135b8565b90506000198114613f4657818110156143935760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016112ad565b613f4684848484036137c7565b6001600160a01b0383166144045760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016112ad565b6001600160a01b0382166144665760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016112ad565b6144718383836146f3565b6001600160a01b038316600090815260336020526040902054818110156144e95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016112ad565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906145209084906155ed565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161456c91815260200190565b60405180910390a3613f46565b6040516001600160a01b03831660248201526044810182905261124090849063a9059cbb60e01b90606401613f0f565b6145b38282612dae565b61152d576145cb816001600160a01b031660146147cd565b6145d68360206147cd565b6040516020016145e7929190615bdc565b60408051601f198184030181529082905262461bcd60e51b82526112ad91600401614d8b565b6001600160a01b0381163b61467a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016112ad565b600080516020615c6983398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6146b283614968565b6000825111806146bf5750805b1561124057613f4683836149a8565b6000815183511480156112615750508051602091820120825192909101919091201490565b6112406139dd565b6000614750826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614a9c9092919063ffffffff16565b805190915015611240578080602001905181019061476e9190615b26565b6112405760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016112ad565b606060006147dc8360026155ac565b6147e79060026155ed565b6001600160401b038111156147fe576147fe614e88565b6040519080825280601f01601f191660200182016040528015614828576020820181803683370190505b509050600360fc1b8160008151811061484357614843615580565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061487257614872615580565b60200101906001600160f81b031916908160001a90535060006148968460026155ac565b6148a19060016155ed565b90505b6001811115614919576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106148d5576148d5615580565b1a60f81b8282815181106148eb576148eb615580565b60200101906001600160f81b031916908160001a90535060049490941c9361491281615c51565b90506148a4565b5083156112615760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016112ad565b6149718161460d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b614a105760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016112ad565b600080846001600160a01b031684604051614a2b919061576c565b600060405180830381855af49150503d8060008114614a66576040519150601f19603f3d011682016040523d82523d6000602084013e614a6b565b606091505b5091509150614a938282604051806060016040528060278152602001615c8960279139614ab3565b95945050505050565b6060614aab8484600085614aec565b949350505050565b60608315614ac2575081611261565b825115614ad25782518084602001fd5b8160405162461bcd60e51b81526004016112ad9190614d8b565b606082471015614b4d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016112ad565b6001600160a01b0385163b614ba45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016112ad565b600080866001600160a01b03168587604051614bc0919061576c565b60006040518083038185875af1925050503d8060008114614bfd576040519150601f19603f3d011682016040523d82523d6000602084013e614c02565b606091505b5091509150614c12828286614ab3565b979650505050505050565b828054828255906000526020600020908101928215614c70579160200282015b82811115614c705781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614c3d565b50614c7c929150614cf4565b5090565b828054614c8c90615546565b90600052602060002090601f016020900481019282614cae5760008555614c70565b82601f10614cc757805160ff1916838001178555614c70565b82800160010185558215614c70579182015b82811115614c70578251825591602001919060010190614cd9565b5b80821115614c7c5760008155600101614cf5565b600060208284031215614d1b57600080fd5b81356001600160e01b03198116811461126157600080fd5b60005b83811015614d4e578181015183820152602001614d36565b83811115613f465750506000910152565b60008151808452614d77816020860160208601614d33565b601f01601f19169290920160200192915050565b6020815260006112616020830184614d5f565b6001600160a01b038116811461160d57600080fd5b60008060408385031215614dc657600080fd5b8235614dd181614d9e565b946020939093013593505050565b600060208284031215614df157600080fd5b813561126181614d9e565b6001600160401b038116811461160d57600080fd5b600060208284031215614e2357600080fd5b813561126181614dfc565b600060208284031215614e4057600080fd5b5035919050565b600080600060608486031215614e5c57600080fd5b8335614e6781614d9e565b92506020840135614e7781614d9e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b0381118282101715614ec157614ec1614e88565b60405290565b60405161014081016001600160401b0381118282101715614ec157614ec1614e88565b604051601f8201601f191681016001600160401b0381118282101715614f1257614f12614e88565b604052919050565b60006001600160401b03821115614f3357614f33614e88565b5060051b60200190565b600082601f830112614f4e57600080fd5b81356020614f63614f5e83614f1a565b614eea565b82815260059290921b84018101918181019086841115614f8257600080fd5b8286015b84811015614fa6578035614f9981614d9e565b8352918301918301614f86565b509695505050505050565b60008060408385031215614fc457600080fd5b82356001600160401b0380821115614fdb57600080fd5b614fe786838701614f3d565b9350602091508185013581811115614ffe57600080fd5b85019050601f8101861361501157600080fd5b803561501f614f5e82614f1a565b81815260059190911b8201830190838101908883111561503e57600080fd5b928401925b8284101561505c57833582529284019290840190615043565b80955050505050509250929050565b6000806040838503121561507e57600080fd5b82359150602083013561509081614d9e565b809150509250929050565b60006001600160401b038211156150b4576150b4614e88565b50601f01601f191660200190565b60006150d0614f5e8461509b565b90508281528383830111156150e457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261510c57600080fd5b611261838335602085016150c2565b801515811461160d57600080fd5b6000806040838503121561513c57600080fd5b82356001600160401b0381111561515257600080fd5b61515e858286016150fb565b92505060208301356150908161511b565b60008083601f84011261518157600080fd5b5081356001600160401b0381111561519857600080fd5b6020830191508360208260051b85010111156151b357600080fd5b9250929050565b6000806000806000606086880312156151d257600080fd5b853563ffffffff811681146151e657600080fd5b945060208601356001600160401b038082111561520257600080fd5b61520e89838a0161516f565b9096509450604088013591508082111561522757600080fd5b506152348882890161516f565b969995985093965092949392505050565b60006020828403121561525757600080fd5b81356001600160401b0381111561526d57600080fd5b614aab84828501614f3d565b600081518084526020808501945080840160005b838110156152b25781516001600160a01b03168752958201959082019060010161528d565b509495945050505050565b6040815260006152d06040830185615279565b82810360208481019190915284518083528582019282019060005b81811015615307578451835293830193918301916001016152eb565b5090979650505050505050565b6000806040838503121561532757600080fd5b823561533281614d9e565b915060208301356001600160401b0381111561534d57600080fd5b8301601f8101851361535e57600080fd5b61536d858235602084016150c2565b9150509250929050565b600082601f83011261538857600080fd5b81356020615398614f5e83614f1a565b82815260059290921b840181019181810190868411156153b757600080fd5b8286015b84811015614fa65780356001600160401b038111156153da5760008081fd5b6153e88986838b01016150fb565b8452509183019183016153bb565b6000806000806080858703121561540c57600080fd5b84356154178161511b565b935060208501356001600160401b038082111561543357600080fd5b61543f88838901615377565b9450604087013591508082111561545557600080fd5b61546188838901615377565b9350606087013591508082111561547757600080fd5b5061548487828801615377565b91505092959194509250565b6000602082840312156154a257600080fd5b81356001600160401b038111156154b857600080fd5b614aab848285016150fb565b600080602083850312156154d757600080fd5b82356001600160401b038111156154ed57600080fd5b6154f98582860161516f565b90969095509350505050565b6020815260006112616020830184615279565b6000806040838503121561552b57600080fd5b823561553681614d9e565b9150602083013561509081614d9e565b600181811c9082168061555a57607f821691505b60208210810361557a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156155c6576155c6615596565b500290565b6000826155e857634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561560057615600615596565b500190565b60008282101561561757615617615596565b500390565b60006001820161562e5761562e615596565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6040815260006156e06040830185614d5f565b905082151560208301529392505050565b80516141c681614d9e565b60006040828403121561570e57600080fd5b604051604081018181106001600160401b038211171561573057615730614e88565b604052825161573e81614d9e565b81526020928301519281019290925250919050565b60006020828403121561576557600080fd5b5051919050565b6000825161577e818460208701614d33565b9190910192915050565b600082601f83011261579957600080fd5b81516157a7614f5e8261509b565b8181528460208386010111156157bc57600080fd5b614aab826020830160208701614d33565b80516141c681614dfc565b80516141c68161511b565b600061016082840312156157f657600080fd5b6157fe614e9e565b905081516001600160401b038082111561581757600080fd5b61582385838601615788565b8352615831602085016157cd565b6020840152615842604085016157cd565b60408401526060840151606084015261585d608085016157cd565b608084015261586e60a085016157d8565b60a084015261587f60c085016157d8565b60c084015260e084015191508082111561589857600080fd5b6158a485838601615788565b60e0840152610100915081840151818111156158bf57600080fd5b6158cb86828701615788565b8385015250610120915081840151818111156158e657600080fd5b6158f286828701615788565b83850152506101409150818401518181111561590d57600080fd5b61591986828701615788565b8385015250505092915050565b6000806040838503121561593957600080fd5b82516001600160401b038082111561595057600080fd5b90840190610140828703121561596557600080fd5b61596d614ec7565b82518281111561597c57600080fd5b61598888828601615788565b82525060208301518281111561599d57600080fd5b6159a988828601615788565b6020830152506040830151828111156159c157600080fd5b6159cd88828601615788565b6040830152506060830151828111156159e557600080fd5b6159f188828601615788565b606083015250608083015182811115615a0957600080fd5b615a1588828601615788565b60808301525060a083015182811115615a2d57600080fd5b615a3988828601615788565b60a08301525060c083015182811115615a5157600080fd5b615a5d88828601615788565b60c08301525060e083015182811115615a7557600080fd5b615a8188828601615788565b60e0830152506101008084015183811115615a9b57600080fd5b615aa789828701615788565b828401525050610120615abb8185016156f1565b908201526020860151909450915080821115615ad657600080fd5b5061536d858286016157e3565b60208082528181018390526000908460408401835b86811015614fa6578235615b0b81614d9e565b6001600160a01b031682529183019190830190600101615af8565b600060208284031215615b3857600080fd5b81516112618161511b565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615c14816017850160208801614d33565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615c45816028840160208801614d33565b01602801949350505050565b600081615c6057615c60615596565b50600019019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564546f7563616e2050726f746f636f6c3a204e617475726520436172626f6e20546f6e6e65a264697066735822122024e14dbd461e57722dbf17d926c102c6849379c6f7c16ba442392094fecfde3264736f6c634300080e0033

Block Transaction Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.