Overview
POL Balance
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
BaseCarbonTonne
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 './BaseCarbonTonneStorage.sol'; /// @notice Base Carbon Tonne for KlimaDAO /// Contract is an ERC20 compliant token that acts as a pool for TCO2 tokens /// It is possible to whitelist Toucan Protocol external tokenized carbon contract BaseCarbonTonne is ContextUpgradeable, ERC20Upgradeable, OwnableUpgradeable, PausableUpgradeable, AccessControlUpgradeable, UUPSUpgradeable, BaseCarbonTonneStorage { using SafeERC20Upgradeable for IERC20Upgradeable; // ---------------------------------------- // Constants // ---------------------------------------- string public constant VERSION = '1.5.0'; uint256 public constant VERSION_RELEASE_CANDIDATE = 2; 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 initialize() external virtual initializer { __Context_init_unchained(); __Ownable_init_unchained(); __Pausable_init_unchained(); __ERC20_init_unchained('Toucan Protocol: Base Carbon Tonne', 'BCT'); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } 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 BCT 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 BCT pool that accepts TCO2s and mints BCT 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 project-vintage-ERC20 token matches 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 /// BCT 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 BCT 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; } }
// 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'; }
// 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 ); }
// 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); }
// 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; }
// 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 Storage for UUPS Proxy upgradable BaseCarbonTonne abstract contract BaseCarbonTonneStorageV1 { /// @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; uint64 public minimumVintageStartTime; /// @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 bool public regionsIsAcceptedMapping; mapping(string => bool) public regions; bool public standardsIsAcceptedMapping; mapping(string => bool) public standards; bool public methodologiesIsAcceptedMapping; 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; } abstract contract BaseCarbonTonneStorageV1_1 { /// @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; } abstract contract BaseCarbonTonneStorageV1_2 { /// @notice End users exempted from redeem fees mapping(address => bool) public redeemFeeExemptedAddresses; /// @notice array used to read from when redeeming TCO2s automatically address[] public scoredTCO2s; } abstract contract BaseCarbonTonneStorageV1_3 { /// @notice TCO2s exempted from redeem fees mapping(address => bool) public redeemFeeExemptedTCO2s; } abstract contract BaseCarbonTonneStorageV1_4 { /// @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 BaseCarbonTonneStorage is BaseCarbonTonneStorageV1, BaseCarbonTonneStorageV1_1, BaseCarbonTonneStorageV1_2, BaseCarbonTonneStorageV1_3, BaseCarbonTonneStorageV1_4 {}
// 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); }
// 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; }
// 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; }
// 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; }
// 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); }
// 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; }
// 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; }
// 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; }
// 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"); } } }
// 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 }
// 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; }
// 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; }
// 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 {}
// 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; } } }
// 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); } } } }
// 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); }
// 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; }
// 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); } }
// 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; }
// 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); }
// 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); }
// 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; }
// 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 } } }
// 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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":[{"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
60a0604052306080523480156200001557600080fd5b506200002062000026565b62000156565b6200003260ff62000035565b50565b60008054610100900460ff1615620000ce578160ff1660011480156200006e57506200006c306200014760201b620037731760201c565b155b620000c65760405162461bcd60e51b815260206004820152602e602482015260008051602062005e5083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff8084169116106200012d5760405162461bcd60e51b815260206004820152602e602482015260008051602062005e5083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000bd565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b608051615cc26200018e6000396000818161150e0152818161154e01528181611ffa0152818161203a01526121340152615cc26000f3fe6080604052600436106104cb5760003560e01c80638662522f11610276578063c36a25731161014f578063e882e37b116100c1578063f141b84f11610085578063f141b84f14610f85578063f2fde38b14610fa7578063f3edb9ec14610fc7578063f75991cd14611003578063f887ea401461103f578063ffa1ad741461106057600080fd5b8063e882e37b14610eaf578063e9d131ad14610ecf578063ec87621c14610eef578063f06f510314610f23578063f138ac1614610f5457600080fd5b8063dc5f560e11610113578063dc5f560e14610dee578063dd62ed3e14610e0e578063dff0f52314610e2e578063e07f744c14610e45578063e0d7cad914610e65578063e63ab1e914610e7b57600080fd5b8063c36a257314610d63578063d4e457ec14610d7e578063d547741f14610d99578063d6a022b814610db9578063d80e05aa14610dce57600080fd5b8063a217fddf116101e8578063abf410e5116101ac578063abf410e514610ca0578063b516f8cf14610cc1578063b6a3f59a14610ce1578063bbe669eb14610d01578063bf2f870f14610d21578063c0d7865514610d4357600080fd5b8063a217fddf14610c14578063a457c2d714610c29578063a7381a6414610c49578063a9059cbb14610c60578063a9a484c514610c8057600080fd5b80638dcb01ec1161023a5780638dcb01ec14610b485780638f770ad014610b6857806391d1485414610b7f57806395d89b4114610b9f578063963ff55e14610bb4578063a1631e4b14610bd457600080fd5b80638662522f14610a8e57806388c9cf6e14610aca57806389022e2e14610aea5780638c2a993e14610b0a5780638da5cb5b14610b2a57600080fd5b806341dbbb2a116103a85780636ca0b0d71161031a57806374f4f547116102de57806374f4f547146109e457806379255ddd14610a045780637966529d14610a245780638129fc1c14610a4457806381e48e9014610a595780638456cb5914610a7957600080fd5b80636ca0b0d7146109335780636dbb3102146109485780636fd2f1811461096857806370a0823114610999578063715018a6146109cf57600080fd5b80634f1ef2861161036c5780634f1ef28614610893578063523fba7f146108a657806352d1902d146108c657806354c9c970146108db5780635c975abb146108fb5780635db44cef1461091357600080fd5b806341dbbb2a146107e55780634642547b1461080557806346518b0a1461082557806347e7ef24146108455780634c02cad11461086557600080fd5b80632b540f19116104415780633659cfe6116104055780633659cfe61461072f578063395093511461074f57806339cd7a8a1461076f5780633a9a77ee1461078f5780633d2afced146107b05780633f4ba83a146107d057600080fd5b80632b540f19146106825780632b554142146106b35780632f2ff15d146106d3578063313ce567146106f357806336568abe1461070f57600080fd5b80630e2d15ab116104935780630e2d15ab1461058957806318160ddd146105ba57806320b167f9146105d957806323b872dd146105f9578063248a9ca31461061957806324adbf4d1461064957600080fd5b806301ffc9a7146104d057806306fdde0314610505578063095ea7b3146105275780630b7d28c7146105475780630c0efecc14610569575b600080fd5b3480156104dc57600080fd5b506104f06104eb366004614cc4565b611091565b60405190151581526020015b60405180910390f35b34801561051157600080fd5b5061051a6110c8565b6040516104fc9190614d46565b34801561053357600080fd5b506104f0610542366004614d6e565b61115a565b34801561055357600080fd5b50610567610562366004614d9a565b611172565b005b34801561057557600080fd5b50610567610584366004614dcc565b61119f565b34801561059557600080fd5b506104f06105a4366004614d9a565b6101a06020526000908152604090205460ff1681565b3480156105c657600080fd5b506035545b6040519081526020016104fc565b3480156105e557600080fd5b506105676105f4366004614de9565b61120a565b34801561060557600080fd5b506104f0610614366004614e02565b611218565b34801561062557600080fd5b506105cb610634366004614de9565b600090815260fb602052604090206001015490565b34801561065557600080fd5b5061019c5461066a906001600160a01b031681565b6040516001600160a01b0390911681526020016104fc565b34801561068e57600080fd5b506104f061069d366004614d9a565b6101a26020526000908152604090205460ff1681565b3480156106bf57600080fd5b506105676106ce366004614f6c565b61123b565b3480156106df57600080fd5b506105676106ee366004615026565b611461565b3480156106ff57600080fd5b50604051601281526020016104fc565b34801561071b57600080fd5b5061056761072a366004615026565b611486565b34801561073b57600080fd5b5061056761074a366004614d9a565b611504565b34801561075b57600080fd5b506104f061076a366004614d6e565b6115e3565b34801561077b57600080fd5b5061056761078a3660046150e4565b611605565b34801561079b57600080fd5b5061019e5461066a906001600160a01b031681565b3480156107bc57600080fd5b506105676107cb366004615175565b611768565b3480156107dc57600080fd5b50610567611a3c565b3480156107f157600080fd5b506105cb610800366004614f6c565b611a6f565b34801561081157600080fd5b50610567610820366004614d9a565b611b48565b34801561083157600080fd5b50610567610840366004615200565b611b72565b34801561085157600080fd5b50610567610860366004614d6e565b611c4d565b34801561087157600080fd5b50610885610880366004614de9565b611d10565b6040516104fc929190615278565b6105676108a13660046152cf565b611ff0565b3480156108b257600080fd5b506105cb6108c1366004614d9a565b6120bc565b3480156108d257600080fd5b506105cb612127565b3480156108e757600080fd5b506105676108f6366004615200565b6121da565b34801561090757600080fd5b5060975460ff166104f0565b34801561091f57600080fd5b5061056761092e366004615200565b6122b5565b34801561093f57600080fd5b506105cb600281565b34801561095457600080fd5b50610567610963366004614d9a565b612390565b34801561097457600080fd5b506104f0610983366004614d9a565b6101996020526000908152604090205460ff1681565b3480156109a557600080fd5b506105cb6109b4366004614d9a565b6001600160a01b031660009081526033602052604090205490565b3480156109db57600080fd5b506105676123ed565b3480156109f057600080fd5b506105676109ff366004614d6e565b612451565b348015610a1057600080fd5b50610567610a1f366004614de9565b612463565b348015610a3057600080fd5b50610567610a3f366004615200565b6124ad565b348015610a5057600080fd5b50610567612588565b348015610a6557600080fd5b50610567610a743660046153b1565b61264e565b348015610a8557600080fd5b50610567612aa9565b348015610a9a57600080fd5b506104f0610aa936600461544b565b80516020818301810180516101948252928201919093012091525460ff1681565b348015610ad657600080fd5b50610567610ae5366004615200565b612ada565b348015610af657600080fd5b50610567610b05366004614d6e565b612bb5565b348015610b1657600080fd5b50610567610b25366004614d6e565b612c83565b348015610b3657600080fd5b506065546001600160a01b031661066a565b348015610b5457600080fd5b50610567610b63366004615200565b612c95565b348015610b7457600080fd5b506105cb6101915481565b348015610b8b57600080fd5b506104f0610b9a366004615026565b612d70565b348015610bab57600080fd5b5061051a612d9b565b348015610bc057600080fd5b5061066a610bcf366004614de9565b612daa565b348015610be057600080fd5b5061019354610bfc90600160a01b90046001600160401b031681565b6040516001600160401b0390911681526020016104fc565b348015610c2057600080fd5b506105cb600081565b348015610c3557600080fd5b506104f0610c44366004614d6e565b612dd5565b348015610c5557600080fd5b506105cb61019f5481565b348015610c6c57600080fd5b506104f0610c7b366004614d6e565b612e5b565b348015610c8c57600080fd5b506104f0610c9b366004614d9a565b612e70565b348015610cac57600080fd5b506101935461066a906001600160a01b031681565b348015610ccd57600080fd5b50610567610cdc366004614d9a565b613166565b348015610ced57600080fd5b50610567610cfc366004614de9565b6131d2565b348015610d0d57600080fd5b50610567610d1c36600461547f565b613210565b348015610d2d57600080fd5b50610d366132af565b6040516104fc91906154c0565b348015610d4f57600080fd5b50610567610d5e366004614d9a565b613311565b348015610d6f57600080fd5b50610195546104f09060ff1681565b348015610d8a57600080fd5b50610197546104f09060ff1681565b348015610da557600080fd5b50610567610db4366004615026565b613368565b348015610dc557600080fd5b506105cb61338d565b348015610dda57600080fd5b50610567610de9366004614d9a565b6133ab565b348015610dfa57600080fd5b506104f0610e09366004614d9a565b613405565b348015610e1a57600080fd5b506105cb610e293660046154d3565b613573565b348015610e3a57600080fd5b506105cb61019d5481565b348015610e5157600080fd5b50610567610e60366004614d9a565b61359e565b348015610e7157600080fd5b506105cb61271081565b348015610e8757600080fd5b506105cb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ebb57600080fd5b50610567610eca366004614d9a565b61360a565b348015610edb57600080fd5b50610567610eea366004614de9565b613661565b348015610efb57600080fd5b506105cb7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610f2f57600080fd5b506104f0610f3e366004614d9a565b61019b6020526000908152604090205460ff1681565b348015610f6057600080fd5b506104f0610f6f366004614d9a565b61019a6020526000908152604090205460ff1681565b348015610f9157600080fd5b50610193546104f090600160e01b900460ff1681565b348015610fb357600080fd5b50610567610fc2366004614d9a565b6136ab565b348015610fd357600080fd5b506104f0610fe236600461544b565b80516020818301810180516101968252928201919093012091525460ff1681565b34801561100f57600080fd5b506104f061101e36600461544b565b80516020818301810180516101988252928201919093012091525460ff1681565b34801561104b57600080fd5b506101a35461066a906001600160a01b031681565b34801561106c57600080fd5b5061051a604051806040016040528060058152602001640312e352e360dc1b81525081565b60006001600160e01b03198216637965db0b60e01b14806110c257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060603680546110d790615501565b80601f016020809104026020016040519081016040528092919081815260200182805461110390615501565b80156111505780601f1061112557610100808354040283529160200191611150565b820191906000526020600020905b81548152906001019060200180831161113357829003601f168201915b5050505050905090565b600033611168818585613782565b5060019392505050565b61117a6138a6565b6001600160a01b031660009081526101a060205260409020805460ff19166001179055565b6111a76138a6565b610193805467ffffffffffffffff60a01b1916600160a01b6001600160401b038416908102919091179091556040519081527f87f670402a6c72fff3b60ba5223165f062b58d671871fc2c49ea96101fdd19a0906020015b60405180910390a150565b61121381611d10565b505050565b6000611223836138fc565b61122e84848461397f565b50600190505b9392505050565b611243613998565b81518151604080518082019091526002815261189960f11b60208201529082146112895760405162461bcd60e51b81526004016112809190614d46565b60405180910390fd5b5061019d543360009081526101a0602052604081205490919060ff1682805b85811015611379576112d28882815181106112c5576112c561553b565b6020026020010151613405565b508261131d57612710848883815181106112ee576112ee61553b565b60200260200101516113009190615567565b61130a9190615586565b915061131682866155a8565b9450611322565b600091505b6113698882815181106113375761133761553b565b6020026020010151838984815181106113525761135261553b565b602002602001015161136491906155c0565b6139d8565b611372816155d7565b90506112a8565b50831561145857600061271061019f54866113949190615567565b61139e9190615586565b90506113aa81866155c0565b61019c549095506113c4906001600160a01b031686612e5b565b5060408051338152602081018790527f3f89e1d936a29a8de9ae9040436992721a00bc63bbe3ca55692b95f0311640b2910160405180910390a180156114565761019e5461141b906001600160a01b031682612e5b565b5060408051338152602081018390527f932bd968974f0b6fa1cb59bf961f81d2e57b39332d311b413dceae17966387db910160405180910390a15b505b50505050505050565b600082815260fb602052604090206001015461147c81613a3c565b6112138383613a46565b6001600160a01b03811633146114f65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401611280565b6115008282613acc565b5050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361154c5760405162461bcd60e51b8152600401611280906155f0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611595600080516020615c46833981519152546001600160a01b031690565b6001600160a01b0316146115bb5760405162461bcd60e51b81526004016112809061563c565b6115c481613b33565b604080516000808252602082019092526115e091839190613b3b565b50565b6000336111688185856115f68383613573565b61160091906155a8565b613782565b61160d6138a6565b6116368260405180604001604052806007815260200166726567696f6e7360c81b815250613ca6565b15611672578061165557610193805460ff60e01b19169055600061166c565b610193805460ff60e01b1916600160e01b17905560015b5061172b565b61169d82604051806040016040528060098152602001687374616e646172647360b81b815250613ca6565b156116cc57806116b957610195805460ff19169055600061166c565b610195805460ff1916600117905561172b565b6116fb826040518060400160405280600d81526020016c6d6574686f646f6c6f6769657360981b815250613ca6565b1561172b578061171757610197805460ff191690556000611729565b610197805460ff191660019081179091555b505b7fcdc35455a1217219a4240bb18a7d2978eb98208f22f7ec36d6a1381c28f9d0f5828260405161175c929190615688565b60405180910390a15050565b6117917f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cb2565b6040805180820190915260018152601960f91b60208201528390816117c95760405162461bcd60e51b81526004016112809190614d46565b50604080518082019091526002815261189960f11b60208201528183146118035760405162461bcd60e51b81526004016112809190614d46565b506101a354604051635ed6513d60e11b815230600482015263ffffffff881660248201526001600160a01b0390911690600090829063bdaca27a906044016040805180830381865afa15801561185d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188191906156b7565b8051604080518082019091526002815261313160f01b6020820152919250906001600160a01b0382166118c75760405162461bcd60e51b81526004016112809190614d46565b5060005b84811015611a3057836001600160a01b031663255e0ae48b8b8b858181106118f5576118f561553b565b905060200201602081019061190a9190614d9a565b8a8a8681811061191c5761191c61553b565b6040516001600160e01b031960e088901b16815263ffffffff9590951660048601526001600160a01b039384166024860152602002919091013560448401525085166064820152608401600060405180830381600087803b15801561198057600080fd5b505af1158015611994573d6000803e3d6000fd5b505050508888828181106119aa576119aa61553b565b90506020020160208101906119bf9190614d9a565b6001600160a01b03168a63ffffffff167f36d0f926f9bce41fb6e90938955b971cee6bbdfbce772aadd3d6c824f0372797898985818110611a0257611a0261553b565b90506020020135604051611a1891815260200190565b60405180910390a3611a29816155d7565b90506118cb565b50505050505050505050565b611a657f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cb2565b611a6d613d18565b565b6000611a79613998565b3360009081526101a0602052604090205460ff1615611a9a575060006110c2565b82518251604080518082019091526002815261189960f11b6020820152908214611ad75760405162461bcd60e51b81526004016112809190614d46565b5061019d54600090815b83811015611b3d57600061271083888481518110611b0157611b0161553b565b6020026020010151611b139190615567565b611b1d9190615586565b9050611b2981856155a8565b93505080611b36906155d7565b9050611ae1565b509095945050505050565b611b506138a6565b6001600160a01b031660009081526101a060205260409020805460ff19169055565b611b7a6138a6565b60005b81518110156115005760016101996000848481518110611b9f57611b9f61553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f29b8b184f4394a88477750516a3701dd0c9409451be78c24428bf5f827f527a5828281518110611c1157611c1161553b565b6020026020010151604051611c3591906001600160a01b0391909116815260200190565b60405180910390a1611c46816155d7565b9050611b7d565b611c55613998565b611c5e82613405565b506000611c6961338d565b6040805180820190915260018152603360f81b602082015290915081611ca25760405162461bcd60e51b81526004016112809190614d46565b5080821115611caf578091505b611cb93383613dab565b604080516001600160a01b0385168152602081018490527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4910160405180910390a16112136001600160a01b038416333085613e96565b606080611d1b613998565b604080518082019091526002815261323160f01b602082015283611d525760405162461bcd60e51b81526004016112809190614d46565b506101a15460009081905b600086118015611d6c57508083105b15611eda5760006101a18481548110611d8757611d8761553b565b60009182526020822001546001600160a01b03169150611da6826120bc565b905060008115611dd457818911611dbd5788611dbf565b815b9050611dcb818a6155c0565b98508460010194505b85600101955088600003611ed257846001600160401b03811115611dfa57611dfa614e43565b604051908082528060200260200182016040528015611e23578160200160208202803683370190505b509750846001600160401b03811115611e3e57611e3e614e43565b604051908082528060200260200182016040528015611e67578160200160208202803683370190505b5096508288611e776001886155c0565b81518110611e8757611e8761553b565b6001600160a01b03909216602092830291909101909101528087611eac6001886155c0565b81518110611ebc57611ebc61553b565b602002602001018181525050611ed283826139d8565b505050611d5d565b604080518082019091526002815261313560f01b60208201528615611f125760405162461bcd60e51b81526004016112809190614d46565b506000915060005b611f256001856155c0565b811015611fe75760006101a18281548110611f4257611f4261553b565b60009182526020822001546001600160a01b03169150611f61826120bc565b905080600003611f72575050611fd7565b81888681518110611f8557611f8561553b565b60200260200101906001600160a01b031690816001600160a01b03168152505080878681518110611fb857611fb861553b565b602002602001018181525050611fce82826139d8565b84600101945050505b611fe0816155d7565b9050611f1a565b50505050915091565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036120385760405162461bcd60e51b8152600401611280906155f0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612081600080516020615c46833981519152546001600160a01b031690565b6001600160a01b0316146120a75760405162461bcd60e51b81526004016112809061563c565b6120b082613b33565b61150082826001613b3b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c2919061570e565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146121c75760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611280565b50600080516020615c4683398151915290565b6121e26138a6565b60005b815181101561150057600161019b60008484815181106122075761220761553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f43388d274033333ceb567d699874be067ce7411c2bfc989f8e623694c9b3284f8282815181106122795761227961553b565b602002602001015160405161229d91906001600160a01b0391909116815260200190565b60405180910390a16122ae816155d7565b90506121e5565b6122bd6138a6565b60005b815181101561150057600061019b60008484815181106122e2576122e261553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7f25a7a7bea0a3fabbe5dc8b6176bd9a603925da390010a10998148c192b6708282815181106123545761235461553b565b602002602001015160405161237891906001600160a01b0391909116815260200190565b60405180910390a1612389816155d7565b90506122c0565b6123986138a6565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916600117905590519182527fbfe78aa03afab7296923112293cb902a2fe6df5a6d3d81e1933c652c4cf860f491016111ff565b6065546001600160a01b031633146124475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611280565b611a6d6000613f07565b612459613f59565b6115008282613f9f565b61246b6138a6565b604080518082019091526002815261031360f41b602082015261271082106124a65760405162461bcd60e51b81526004016112809190614d46565b5061019f55565b6124b56138a6565b60005b815181101561150057600061019960008484815181106124da576124da61553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3c36656d3e8c3db21a1c7d0a7208d73387e15535964c44c30b20c45ab51b3c3882828151811061254c5761254c61553b565b602002602001015160405161257091906001600160a01b0391909116815260200190565b60405180910390a1612581816155d7565b90506124b8565b600061259460016140f9565b905080156125ac576000805461ff0019166101001790555b6125b4614186565b6125bc6141ad565b6125c46141dd565b612601604051806060016040528060228152602001615c2460229139604051806040016040528060038152602001621090d560ea1b815250614210565b61260c600033613a46565b80156115e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016111ff565b6126566138a6565b60005b82518110156127c4578415156001036127125760016101968483815181106126835761268361553b565b60200260200101516040516126989190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fa27e97999993c298fae0b7088ff732fe078cc1585665ee1554220b3cbe6317a98382815181106126f0576126f061553b565b60200260200101516040516127059190614d46565b60405180910390a16127b4565b60006101968483815181106127295761272961553b565b602002602001015160405161273e9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f0127ddc00426c693b5becb26ba43a260c781ebc323b61d3b24b61e4dc5c93c718382815181106127965761279661553b565b60200260200101516040516127ab9190614d46565b60405180910390a15b6127bd816155d7565b9050612659565b5060005b8151811015612933578415156001036128815760016101988383815181106127f2576127f261553b565b60200260200101516040516128079190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f156643e9a7f860e95993739893595e6ee1d04d9ff1b98567dbe9d5681cd152b282828151811061285f5761285f61553b565b60200260200101516040516128749190614d46565b60405180910390a1612923565b60006101988383815181106128985761289861553b565b60200260200101516040516128ad9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f21a77ac4edf49633047cc4e32b10dfe633811216214400e0e1f507c3f7287b618282815181106129055761290561553b565b602002602001015160405161291a9190614d46565b60405180910390a15b61292c816155d7565b90506127c8565b5060005b8351811015612aa2578415156001036129f05760016101948583815181106129615761296161553b565b60200260200101516040516129769190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f3df7a1330febee3646ae4a0f0e46c94c046f0ee810b2b7f1fa10fa8f34d7b7ef8482815181106129ce576129ce61553b565b60200260200101516040516129e39190614d46565b60405180910390a1612a92565b6000610194858381518110612a0757612a0761553b565b6020026020010151604051612a1c9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fc84badb33408cce6e89b30a735d8f06e094fa4a19c01c2da66718f490c672f65848281518110612a7457612a7461553b565b6020026020010151604051612a899190614d46565b60405180910390a15b612a9b816155d7565b9050612937565b5050505050565b612ad27f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cb2565b611a6d61425e565b612ae26138a6565b60005b815181101561150057600161019a6000848481518110612b0757612b0761553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2e333bce7bf5a0097fbb4fef2a950809960b5a4aa1a63cbcffc24ac62dc4fd07828281518110612b7957612b7961553b565b6020026020010151604051612b9d91906001600160a01b0391909116815260200190565b60405180910390a1612bae816155d7565b9050612ae5565b612bbd613998565b6001600160a01b03821660009081526101a260209081526040918290205482518084019093526002835261313360f01b9183019190915260ff16612c145760405162461bcd60e51b81526004016112809190614d46565b50612c1f82826139d8565b60405163079cc67960e41b8152336004820152602481018290526001600160a01b038316906379cc679090604401600060405180830381600087803b158015612c6757600080fd5b505af1158015612c7b573d6000803e3d6000fd5b505050505050565b612c8b613f59565b6115008282613dab565b612c9d6138a6565b60005b815181101561150057600061019a6000848481518110612cc257612cc261553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9cee5064afac40e291311ecb6a670ef3ef652131fb1ed15c1266fb22cffd6bdd828281518110612d3457612d3461553b565b6020026020010151604051612d5891906001600160a01b0391909116815260200190565b60405180910390a1612d69816155d7565b9050612ca0565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060603780546110d790615501565b6101a18181548110612dbb57600080fd5b6000918252602090912001546001600160a01b0316905081565b60003381612de38286613573565b905083811015612e435760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401611280565b612e508286868403613782565b506001949350505050565b6000612e66836138fc565b61116883836142d9565b6000612ed160405180610140016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200160006001600160a01b031681525090565b612f4d6040518061016001604052806060815260200160006001600160401b0316815260200160006001600160401b031681526020016000815260200160006001600160401b03168152602001600015158152602001600015158152602001606081526020016060815260200160608152602001606081525090565b836001600160a01b031663152583de6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612f8b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb391908101906158e1565b610193546020808301516040805180820190915260018152601b60f91b9281019290925293955091935090916001600160401b03600160a01b9092048216911610156130125760405162461bcd60e51b81526004016112809190614d46565b50610193601c9054906101000a900460ff161515610194836060015160405161303b9190615727565b9081526040805191829003602090810183205483830190925260018352603760f81b90830152909160ff9091161515146130885760405162461bcd60e51b81526004016112809190614d46565b5061019554602083015160405160ff909216151591610196916130aa91615727565b9081526040805191829003602090810183205483830190925260018352600760fb1b90830152909160ff9091161515146130f75760405162461bcd60e51b81526004016112809190614d46565b5061019754604080840151905160ff9092161515916101989161311991615727565b9081526040805191829003602090810183205483830190925260018352603960f81b90830152909160ff909116151514612e505760405162461bcd60e51b81526004016112809190614d46565b61316e6138a6565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166131ae5760405162461bcd60e51b81526004016112809190614d46565b5061019c80546001600160a01b0319166001600160a01b0392909216919091179055565b6131da6138a6565b6101918190556040518181527f4e44c8be34d12f1b7f56b13b4bbe97e64ca37a91916f86c73412da80c21748e2906020016111ff565b6132397f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cb2565b6040805180820190915260018152601960f91b60208201528161326f5760405162461bcd60e51b81526004016112809190614d46565b5061327d6101a18383614bd8565b507f9204d457ace303c5dbbeaa6966e5ec65661a390007a367c6645e52b4ef4b528e828260405161175c929190615a9e565b60606101a180548060200260200160405190810160405280929190818152602001828054801561115057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132ea575050505050905090565b6133196138a6565b6101a380546001600160a01b0319166001600160a01b0383169081179091556040519081527f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc80906020016111ff565b600082815260fb602052604090206001015461338381613a3c565b6112138383613acc565b600061339860355490565b610191546133a691906155c0565b905090565b6133b36138a6565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916905590519182527fd1fc9d8986829d0ba9df2bc201a2c76327e0f71567b5a2fb82ba464bf4a03f4491016111ff565b6101935460405163787d871360e01b81526001600160a01b038381166004830152600092839291169063787d871390602401602060405180830381865afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134789190615ae1565b90508015613512576001600160a01b038316600090815261019a602052604090205460ff16156134ab5750600192915050565b6001600160a01b038316600090815261019b602090815260409182902054825180840190935260018352600d60fa1b9183019190915260ff16156135025760405162461bcd60e51b81526004016112809190614d46565b5061350c83612e70565b5061356a565b6001600160a01b0383166000908152610199602090815260409182902054825180840190935260018352603560f81b9183019190915260ff166135685760405162461bcd60e51b81526004016112809190614d46565b505b50600192915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6135a66138a6565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166135e65760405162461bcd60e51b81526004016112809190614d46565b5061019e80546001600160a01b0319166001600160a01b0392909216919091179055565b6136126138a6565b61019380546001600160a01b0319166001600160a01b0383169081179091556040519081527f86907b53cf2024579968511876daf0b4620d65803b550e33101baf70aeb6f5eb906020016111ff565b6136696138a6565b604080518082019091526002815261031360f41b602082015261271082106136a45760405162461bcd60e51b81526004016112809190614d46565b5061019d55565b6065546001600160a01b031633146137055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611280565b6001600160a01b03811661376a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611280565b6115e081613f07565b6001600160a01b03163b151590565b6001600160a01b0383166137e45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401611280565b6001600160a01b0382166138455760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401611280565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b336138b96065546001600160a01b031690565b6001600160a01b03161460405180604001604052806002815260200161062760f31b815250906115e05760405162461bcd60e51b81526004016112809190614d46565b604080518082019091526002815261313960f01b60208201526001600160a01b03821661393c5760405162461bcd60e51b81526004016112809190614d46565b50604080518082019091526002815261032360f41b60208201526001600160a01b03821630036115005760405162461bcd60e51b81526004016112809190614d46565b60003361398d8582856142e7565b612e5085858561435b565b60975460ff1615604051806040016040528060028152602001610c4d60f21b815250906115e05760405162461bcd60e51b81526004016112809190614d46565b6139e23382613f9f565b6139f66001600160a01b0383163383614534565b604080513381526001600160a01b03841660208201529081018290527f27d4634c833b7622a0acddbf7f746183625f105945e95c723ad1d5a9f2a0b6fc9060600161175c565b6115e08133614564565b613a508282612d70565b61150057600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613a883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613ad68282612d70565b1561150057600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6115e06138a6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613b6e57611213836145c8565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613bc8575060408051601f3d908101601f19168201909252613bc59181019061570e565b60015b613c2b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401611280565b600080516020615c468339815191528114613c9a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401611280565b50611213838383614664565b60006112348383614689565b613cbc8133612d70565b80613ce0575033613cd56065546001600160a01b031690565b6001600160a01b0316145b604051806040016040528060018152602001603160f81b815250906115005760405162461bcd60e51b81526004016112809190614d46565b60975460ff16613d615760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611280565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216613e015760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611280565b613e0d600083836146ae565b8060356000828254613e1f91906155a8565b90915550506001600160a01b03821660009081526033602052604081208054839290613e4c9084906155a8565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052613f019085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526146b6565b50505050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6101a354604080518082019091526002815261313760f01b6020820152906001600160a01b031633146115e05760405162461bcd60e51b81526004016112809190614d46565b6001600160a01b038216613fff5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401611280565b61400b826000836146ae565b6001600160a01b0382166000908152603360205260409020548181101561407f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401611280565b6001600160a01b03831660009081526033602052604081208383039055603580548492906140ae9084906155c0565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60008054610100900460ff1615614140578160ff16600114801561411c5750303b155b6141385760405162461bcd60e51b815260040161128090615afe565b506000919050565b60005460ff8084169116106141675760405162461bcd60e51b815260040161128090615afe565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16611a6d5760405162461bcd60e51b815260040161128090615b4c565b600054610100900460ff166141d45760405162461bcd60e51b815260040161128090615b4c565b611a6d33613f07565b600054610100900460ff166142045760405162461bcd60e51b815260040161128090615b4c565b6097805460ff19169055565b600054610100900460ff166142375760405162461bcd60e51b815260040161128090615b4c565b815161424a906036906020850190614c3b565b508051611213906037906020840190614c3b565b60975460ff16156142a45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611280565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613d8e3390565b60003361116881858561435b565b60006142f38484613573565b90506000198114613f01578181101561434e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611280565b613f018484848403613782565b6001600160a01b0383166143bf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401611280565b6001600160a01b0382166144215760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401611280565b61442c8383836146ae565b6001600160a01b038316600090815260336020526040902054818110156144a45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401611280565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906144db9084906155a8565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161452791815260200190565b60405180910390a3613f01565b6040516001600160a01b03831660248201526044810182905261121390849063a9059cbb60e01b90606401613eca565b61456e8282612d70565b61150057614586816001600160a01b03166014614788565b614591836020614788565b6040516020016145a2929190615b97565b60408051601f198184030181529082905262461bcd60e51b825261128091600401614d46565b6001600160a01b0381163b6146355760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401611280565b600080516020615c4683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61466d83614923565b60008251118061467a5750805b1561121357613f018383614963565b6000815183511480156112345750508051602091820120825192909101919091201490565b611213613998565b600061470b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614a579092919063ffffffff16565b80519091501561121357808060200190518101906147299190615ae1565b6112135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611280565b60606000614797836002615567565b6147a29060026155a8565b6001600160401b038111156147b9576147b9614e43565b6040519080825280601f01601f1916602001820160405280156147e3576020820181803683370190505b509050600360fc1b816000815181106147fe576147fe61553b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061482d5761482d61553b565b60200101906001600160f81b031916908160001a9053506000614851846002615567565b61485c9060016155a8565b90505b60018111156148d4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106148905761489061553b565b1a60f81b8282815181106148a6576148a661553b565b60200101906001600160f81b031916908160001a90535060049490941c936148cd81615c0c565b905061485f565b5083156112345760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611280565b61492c816145c8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6149cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401611280565b600080846001600160a01b0316846040516149e69190615727565b600060405180830381855af49150503d8060008114614a21576040519150601f19603f3d011682016040523d82523d6000602084013e614a26565b606091505b5091509150614a4e8282604051806060016040528060278152602001615c6660279139614a6e565b95945050505050565b6060614a668484600085614aa7565b949350505050565b60608315614a7d575081611234565b825115614a8d5782518084602001fd5b8160405162461bcd60e51b81526004016112809190614d46565b606082471015614b085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611280565b6001600160a01b0385163b614b5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611280565b600080866001600160a01b03168587604051614b7b9190615727565b60006040518083038185875af1925050503d8060008114614bb8576040519150601f19603f3d011682016040523d82523d6000602084013e614bbd565b606091505b5091509150614bcd828286614a6e565b979650505050505050565b828054828255906000526020600020908101928215614c2b579160200282015b82811115614c2b5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614bf8565b50614c37929150614caf565b5090565b828054614c4790615501565b90600052602060002090601f016020900481019282614c695760008555614c2b565b82601f10614c8257805160ff1916838001178555614c2b565b82800160010185558215614c2b579182015b82811115614c2b578251825591602001919060010190614c94565b5b80821115614c375760008155600101614cb0565b600060208284031215614cd657600080fd5b81356001600160e01b03198116811461123457600080fd5b60005b83811015614d09578181015183820152602001614cf1565b83811115613f015750506000910152565b60008151808452614d32816020860160208601614cee565b601f01601f19169290920160200192915050565b6020815260006112346020830184614d1a565b6001600160a01b03811681146115e057600080fd5b60008060408385031215614d8157600080fd5b8235614d8c81614d59565b946020939093013593505050565b600060208284031215614dac57600080fd5b813561123481614d59565b6001600160401b03811681146115e057600080fd5b600060208284031215614dde57600080fd5b813561123481614db7565b600060208284031215614dfb57600080fd5b5035919050565b600080600060608486031215614e1757600080fd5b8335614e2281614d59565b92506020840135614e3281614d59565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b0381118282101715614e7c57614e7c614e43565b60405290565b60405161014081016001600160401b0381118282101715614e7c57614e7c614e43565b604051601f8201601f191681016001600160401b0381118282101715614ecd57614ecd614e43565b604052919050565b60006001600160401b03821115614eee57614eee614e43565b5060051b60200190565b600082601f830112614f0957600080fd5b81356020614f1e614f1983614ed5565b614ea5565b82815260059290921b84018101918181019086841115614f3d57600080fd5b8286015b84811015614f61578035614f5481614d59565b8352918301918301614f41565b509695505050505050565b60008060408385031215614f7f57600080fd5b82356001600160401b0380821115614f9657600080fd5b614fa286838701614ef8565b9350602091508185013581811115614fb957600080fd5b85019050601f81018613614fcc57600080fd5b8035614fda614f1982614ed5565b81815260059190911b82018301908381019088831115614ff957600080fd5b928401925b8284101561501757833582529284019290840190614ffe565b80955050505050509250929050565b6000806040838503121561503957600080fd5b82359150602083013561504b81614d59565b809150509250929050565b60006001600160401b0382111561506f5761506f614e43565b50601f01601f191660200190565b600061508b614f1984615056565b905082815283838301111561509f57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126150c757600080fd5b6112348383356020850161507d565b80151581146115e057600080fd5b600080604083850312156150f757600080fd5b82356001600160401b0381111561510d57600080fd5b615119858286016150b6565b925050602083013561504b816150d6565b60008083601f84011261513c57600080fd5b5081356001600160401b0381111561515357600080fd5b6020830191508360208260051b850101111561516e57600080fd5b9250929050565b60008060008060006060868803121561518d57600080fd5b853563ffffffff811681146151a157600080fd5b945060208601356001600160401b03808211156151bd57600080fd5b6151c989838a0161512a565b909650945060408801359150808211156151e257600080fd5b506151ef8882890161512a565b969995985093965092949392505050565b60006020828403121561521257600080fd5b81356001600160401b0381111561522857600080fd5b614a6684828501614ef8565b600081518084526020808501945080840160005b8381101561526d5781516001600160a01b031687529582019590820190600101615248565b509495945050505050565b60408152600061528b6040830185615234565b82810360208481019190915284518083528582019282019060005b818110156152c2578451835293830193918301916001016152a6565b5090979650505050505050565b600080604083850312156152e257600080fd5b82356152ed81614d59565b915060208301356001600160401b0381111561530857600080fd5b8301601f8101851361531957600080fd5b6153288582356020840161507d565b9150509250929050565b600082601f83011261534357600080fd5b81356020615353614f1983614ed5565b82815260059290921b8401810191818101908684111561537257600080fd5b8286015b84811015614f615780356001600160401b038111156153955760008081fd5b6153a38986838b01016150b6565b845250918301918301615376565b600080600080608085870312156153c757600080fd5b84356153d2816150d6565b935060208501356001600160401b03808211156153ee57600080fd5b6153fa88838901615332565b9450604087013591508082111561541057600080fd5b61541c88838901615332565b9350606087013591508082111561543257600080fd5b5061543f87828801615332565b91505092959194509250565b60006020828403121561545d57600080fd5b81356001600160401b0381111561547357600080fd5b614a66848285016150b6565b6000806020838503121561549257600080fd5b82356001600160401b038111156154a857600080fd5b6154b48582860161512a565b90969095509350505050565b6020815260006112346020830184615234565b600080604083850312156154e657600080fd5b82356154f181614d59565b9150602083013561504b81614d59565b600181811c9082168061551557607f821691505b60208210810361553557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561558157615581615551565b500290565b6000826155a357634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156155bb576155bb615551565b500190565b6000828210156155d2576155d2615551565b500390565b6000600182016155e9576155e9615551565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60408152600061569b6040830185614d1a565b905082151560208301529392505050565b805161418181614d59565b6000604082840312156156c957600080fd5b604051604081018181106001600160401b03821117156156eb576156eb614e43565b60405282516156f981614d59565b81526020928301519281019290925250919050565b60006020828403121561572057600080fd5b5051919050565b60008251615739818460208701614cee565b9190910192915050565b600082601f83011261575457600080fd5b8151615762614f1982615056565b81815284602083860101111561577757600080fd5b614a66826020830160208701614cee565b805161418181614db7565b8051614181816150d6565b600061016082840312156157b157600080fd5b6157b9614e59565b905081516001600160401b03808211156157d257600080fd5b6157de85838601615743565b83526157ec60208501615788565b60208401526157fd60408501615788565b60408401526060840151606084015261581860808501615788565b608084015261582960a08501615793565b60a084015261583a60c08501615793565b60c084015260e084015191508082111561585357600080fd5b61585f85838601615743565b60e08401526101009150818401518181111561587a57600080fd5b61588686828701615743565b8385015250610120915081840151818111156158a157600080fd5b6158ad86828701615743565b8385015250610140915081840151818111156158c857600080fd5b6158d486828701615743565b8385015250505092915050565b600080604083850312156158f457600080fd5b82516001600160401b038082111561590b57600080fd5b90840190610140828703121561592057600080fd5b615928614e82565b82518281111561593757600080fd5b61594388828601615743565b82525060208301518281111561595857600080fd5b61596488828601615743565b60208301525060408301518281111561597c57600080fd5b61598888828601615743565b6040830152506060830151828111156159a057600080fd5b6159ac88828601615743565b6060830152506080830151828111156159c457600080fd5b6159d088828601615743565b60808301525060a0830151828111156159e857600080fd5b6159f488828601615743565b60a08301525060c083015182811115615a0c57600080fd5b615a1888828601615743565b60c08301525060e083015182811115615a3057600080fd5b615a3c88828601615743565b60e0830152506101008084015183811115615a5657600080fd5b615a6289828701615743565b828401525050610120615a768185016156ac565b908201526020860151909450915080821115615a9157600080fd5b506153288582860161579e565b60208082528181018390526000908460408401835b86811015614f61578235615ac681614d59565b6001600160a01b031682529183019190830190600101615ab3565b600060208284031215615af357600080fd5b8151611234816150d6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615bcf816017850160208801614cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615c00816028840160208801614cee565b01602801949350505050565b600081615c1b57615c1b615551565b50600019019056fe546f7563616e2050726f746f636f6c3a204261736520436172626f6e20546f6e6e65360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e164e8c0e3adde6b344ecdd763ad65cdcbee490f131c9a1ee91cd8af0fe8a32b64736f6c634300080e0033496e697469616c697a61626c653a20636f6e747261637420697320616c726561
Deployed Bytecode
0x6080604052600436106104cb5760003560e01c80638662522f11610276578063c36a25731161014f578063e882e37b116100c1578063f141b84f11610085578063f141b84f14610f85578063f2fde38b14610fa7578063f3edb9ec14610fc7578063f75991cd14611003578063f887ea401461103f578063ffa1ad741461106057600080fd5b8063e882e37b14610eaf578063e9d131ad14610ecf578063ec87621c14610eef578063f06f510314610f23578063f138ac1614610f5457600080fd5b8063dc5f560e11610113578063dc5f560e14610dee578063dd62ed3e14610e0e578063dff0f52314610e2e578063e07f744c14610e45578063e0d7cad914610e65578063e63ab1e914610e7b57600080fd5b8063c36a257314610d63578063d4e457ec14610d7e578063d547741f14610d99578063d6a022b814610db9578063d80e05aa14610dce57600080fd5b8063a217fddf116101e8578063abf410e5116101ac578063abf410e514610ca0578063b516f8cf14610cc1578063b6a3f59a14610ce1578063bbe669eb14610d01578063bf2f870f14610d21578063c0d7865514610d4357600080fd5b8063a217fddf14610c14578063a457c2d714610c29578063a7381a6414610c49578063a9059cbb14610c60578063a9a484c514610c8057600080fd5b80638dcb01ec1161023a5780638dcb01ec14610b485780638f770ad014610b6857806391d1485414610b7f57806395d89b4114610b9f578063963ff55e14610bb4578063a1631e4b14610bd457600080fd5b80638662522f14610a8e57806388c9cf6e14610aca57806389022e2e14610aea5780638c2a993e14610b0a5780638da5cb5b14610b2a57600080fd5b806341dbbb2a116103a85780636ca0b0d71161031a57806374f4f547116102de57806374f4f547146109e457806379255ddd14610a045780637966529d14610a245780638129fc1c14610a4457806381e48e9014610a595780638456cb5914610a7957600080fd5b80636ca0b0d7146109335780636dbb3102146109485780636fd2f1811461096857806370a0823114610999578063715018a6146109cf57600080fd5b80634f1ef2861161036c5780634f1ef28614610893578063523fba7f146108a657806352d1902d146108c657806354c9c970146108db5780635c975abb146108fb5780635db44cef1461091357600080fd5b806341dbbb2a146107e55780634642547b1461080557806346518b0a1461082557806347e7ef24146108455780634c02cad11461086557600080fd5b80632b540f19116104415780633659cfe6116104055780633659cfe61461072f578063395093511461074f57806339cd7a8a1461076f5780633a9a77ee1461078f5780633d2afced146107b05780633f4ba83a146107d057600080fd5b80632b540f19146106825780632b554142146106b35780632f2ff15d146106d3578063313ce567146106f357806336568abe1461070f57600080fd5b80630e2d15ab116104935780630e2d15ab1461058957806318160ddd146105ba57806320b167f9146105d957806323b872dd146105f9578063248a9ca31461061957806324adbf4d1461064957600080fd5b806301ffc9a7146104d057806306fdde0314610505578063095ea7b3146105275780630b7d28c7146105475780630c0efecc14610569575b600080fd5b3480156104dc57600080fd5b506104f06104eb366004614cc4565b611091565b60405190151581526020015b60405180910390f35b34801561051157600080fd5b5061051a6110c8565b6040516104fc9190614d46565b34801561053357600080fd5b506104f0610542366004614d6e565b61115a565b34801561055357600080fd5b50610567610562366004614d9a565b611172565b005b34801561057557600080fd5b50610567610584366004614dcc565b61119f565b34801561059557600080fd5b506104f06105a4366004614d9a565b6101a06020526000908152604090205460ff1681565b3480156105c657600080fd5b506035545b6040519081526020016104fc565b3480156105e557600080fd5b506105676105f4366004614de9565b61120a565b34801561060557600080fd5b506104f0610614366004614e02565b611218565b34801561062557600080fd5b506105cb610634366004614de9565b600090815260fb602052604090206001015490565b34801561065557600080fd5b5061019c5461066a906001600160a01b031681565b6040516001600160a01b0390911681526020016104fc565b34801561068e57600080fd5b506104f061069d366004614d9a565b6101a26020526000908152604090205460ff1681565b3480156106bf57600080fd5b506105676106ce366004614f6c565b61123b565b3480156106df57600080fd5b506105676106ee366004615026565b611461565b3480156106ff57600080fd5b50604051601281526020016104fc565b34801561071b57600080fd5b5061056761072a366004615026565b611486565b34801561073b57600080fd5b5061056761074a366004614d9a565b611504565b34801561075b57600080fd5b506104f061076a366004614d6e565b6115e3565b34801561077b57600080fd5b5061056761078a3660046150e4565b611605565b34801561079b57600080fd5b5061019e5461066a906001600160a01b031681565b3480156107bc57600080fd5b506105676107cb366004615175565b611768565b3480156107dc57600080fd5b50610567611a3c565b3480156107f157600080fd5b506105cb610800366004614f6c565b611a6f565b34801561081157600080fd5b50610567610820366004614d9a565b611b48565b34801561083157600080fd5b50610567610840366004615200565b611b72565b34801561085157600080fd5b50610567610860366004614d6e565b611c4d565b34801561087157600080fd5b50610885610880366004614de9565b611d10565b6040516104fc929190615278565b6105676108a13660046152cf565b611ff0565b3480156108b257600080fd5b506105cb6108c1366004614d9a565b6120bc565b3480156108d257600080fd5b506105cb612127565b3480156108e757600080fd5b506105676108f6366004615200565b6121da565b34801561090757600080fd5b5060975460ff166104f0565b34801561091f57600080fd5b5061056761092e366004615200565b6122b5565b34801561093f57600080fd5b506105cb600281565b34801561095457600080fd5b50610567610963366004614d9a565b612390565b34801561097457600080fd5b506104f0610983366004614d9a565b6101996020526000908152604090205460ff1681565b3480156109a557600080fd5b506105cb6109b4366004614d9a565b6001600160a01b031660009081526033602052604090205490565b3480156109db57600080fd5b506105676123ed565b3480156109f057600080fd5b506105676109ff366004614d6e565b612451565b348015610a1057600080fd5b50610567610a1f366004614de9565b612463565b348015610a3057600080fd5b50610567610a3f366004615200565b6124ad565b348015610a5057600080fd5b50610567612588565b348015610a6557600080fd5b50610567610a743660046153b1565b61264e565b348015610a8557600080fd5b50610567612aa9565b348015610a9a57600080fd5b506104f0610aa936600461544b565b80516020818301810180516101948252928201919093012091525460ff1681565b348015610ad657600080fd5b50610567610ae5366004615200565b612ada565b348015610af657600080fd5b50610567610b05366004614d6e565b612bb5565b348015610b1657600080fd5b50610567610b25366004614d6e565b612c83565b348015610b3657600080fd5b506065546001600160a01b031661066a565b348015610b5457600080fd5b50610567610b63366004615200565b612c95565b348015610b7457600080fd5b506105cb6101915481565b348015610b8b57600080fd5b506104f0610b9a366004615026565b612d70565b348015610bab57600080fd5b5061051a612d9b565b348015610bc057600080fd5b5061066a610bcf366004614de9565b612daa565b348015610be057600080fd5b5061019354610bfc90600160a01b90046001600160401b031681565b6040516001600160401b0390911681526020016104fc565b348015610c2057600080fd5b506105cb600081565b348015610c3557600080fd5b506104f0610c44366004614d6e565b612dd5565b348015610c5557600080fd5b506105cb61019f5481565b348015610c6c57600080fd5b506104f0610c7b366004614d6e565b612e5b565b348015610c8c57600080fd5b506104f0610c9b366004614d9a565b612e70565b348015610cac57600080fd5b506101935461066a906001600160a01b031681565b348015610ccd57600080fd5b50610567610cdc366004614d9a565b613166565b348015610ced57600080fd5b50610567610cfc366004614de9565b6131d2565b348015610d0d57600080fd5b50610567610d1c36600461547f565b613210565b348015610d2d57600080fd5b50610d366132af565b6040516104fc91906154c0565b348015610d4f57600080fd5b50610567610d5e366004614d9a565b613311565b348015610d6f57600080fd5b50610195546104f09060ff1681565b348015610d8a57600080fd5b50610197546104f09060ff1681565b348015610da557600080fd5b50610567610db4366004615026565b613368565b348015610dc557600080fd5b506105cb61338d565b348015610dda57600080fd5b50610567610de9366004614d9a565b6133ab565b348015610dfa57600080fd5b506104f0610e09366004614d9a565b613405565b348015610e1a57600080fd5b506105cb610e293660046154d3565b613573565b348015610e3a57600080fd5b506105cb61019d5481565b348015610e5157600080fd5b50610567610e60366004614d9a565b61359e565b348015610e7157600080fd5b506105cb61271081565b348015610e8757600080fd5b506105cb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ebb57600080fd5b50610567610eca366004614d9a565b61360a565b348015610edb57600080fd5b50610567610eea366004614de9565b613661565b348015610efb57600080fd5b506105cb7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610f2f57600080fd5b506104f0610f3e366004614d9a565b61019b6020526000908152604090205460ff1681565b348015610f6057600080fd5b506104f0610f6f366004614d9a565b61019a6020526000908152604090205460ff1681565b348015610f9157600080fd5b50610193546104f090600160e01b900460ff1681565b348015610fb357600080fd5b50610567610fc2366004614d9a565b6136ab565b348015610fd357600080fd5b506104f0610fe236600461544b565b80516020818301810180516101968252928201919093012091525460ff1681565b34801561100f57600080fd5b506104f061101e36600461544b565b80516020818301810180516101988252928201919093012091525460ff1681565b34801561104b57600080fd5b506101a35461066a906001600160a01b031681565b34801561106c57600080fd5b5061051a604051806040016040528060058152602001640312e352e360dc1b81525081565b60006001600160e01b03198216637965db0b60e01b14806110c257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060603680546110d790615501565b80601f016020809104026020016040519081016040528092919081815260200182805461110390615501565b80156111505780601f1061112557610100808354040283529160200191611150565b820191906000526020600020905b81548152906001019060200180831161113357829003601f168201915b5050505050905090565b600033611168818585613782565b5060019392505050565b61117a6138a6565b6001600160a01b031660009081526101a060205260409020805460ff19166001179055565b6111a76138a6565b610193805467ffffffffffffffff60a01b1916600160a01b6001600160401b038416908102919091179091556040519081527f87f670402a6c72fff3b60ba5223165f062b58d671871fc2c49ea96101fdd19a0906020015b60405180910390a150565b61121381611d10565b505050565b6000611223836138fc565b61122e84848461397f565b50600190505b9392505050565b611243613998565b81518151604080518082019091526002815261189960f11b60208201529082146112895760405162461bcd60e51b81526004016112809190614d46565b60405180910390fd5b5061019d543360009081526101a0602052604081205490919060ff1682805b85811015611379576112d28882815181106112c5576112c561553b565b6020026020010151613405565b508261131d57612710848883815181106112ee576112ee61553b565b60200260200101516113009190615567565b61130a9190615586565b915061131682866155a8565b9450611322565b600091505b6113698882815181106113375761133761553b565b6020026020010151838984815181106113525761135261553b565b602002602001015161136491906155c0565b6139d8565b611372816155d7565b90506112a8565b50831561145857600061271061019f54866113949190615567565b61139e9190615586565b90506113aa81866155c0565b61019c549095506113c4906001600160a01b031686612e5b565b5060408051338152602081018790527f3f89e1d936a29a8de9ae9040436992721a00bc63bbe3ca55692b95f0311640b2910160405180910390a180156114565761019e5461141b906001600160a01b031682612e5b565b5060408051338152602081018390527f932bd968974f0b6fa1cb59bf961f81d2e57b39332d311b413dceae17966387db910160405180910390a15b505b50505050505050565b600082815260fb602052604090206001015461147c81613a3c565b6112138383613a46565b6001600160a01b03811633146114f65760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401611280565b6115008282613acc565b5050565b6001600160a01b037f000000000000000000000000a81f17ead463b0c5b4cbd00386b99469f6fcc20a16300361154c5760405162461bcd60e51b8152600401611280906155f0565b7f000000000000000000000000a81f17ead463b0c5b4cbd00386b99469f6fcc20a6001600160a01b0316611595600080516020615c46833981519152546001600160a01b031690565b6001600160a01b0316146115bb5760405162461bcd60e51b81526004016112809061563c565b6115c481613b33565b604080516000808252602082019092526115e091839190613b3b565b50565b6000336111688185856115f68383613573565b61160091906155a8565b613782565b61160d6138a6565b6116368260405180604001604052806007815260200166726567696f6e7360c81b815250613ca6565b15611672578061165557610193805460ff60e01b19169055600061166c565b610193805460ff60e01b1916600160e01b17905560015b5061172b565b61169d82604051806040016040528060098152602001687374616e646172647360b81b815250613ca6565b156116cc57806116b957610195805460ff19169055600061166c565b610195805460ff1916600117905561172b565b6116fb826040518060400160405280600d81526020016c6d6574686f646f6c6f6769657360981b815250613ca6565b1561172b578061171757610197805460ff191690556000611729565b610197805460ff191660019081179091555b505b7fcdc35455a1217219a4240bb18a7d2978eb98208f22f7ec36d6a1381c28f9d0f5828260405161175c929190615688565b60405180910390a15050565b6117917f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cb2565b6040805180820190915260018152601960f91b60208201528390816117c95760405162461bcd60e51b81526004016112809190614d46565b50604080518082019091526002815261189960f11b60208201528183146118035760405162461bcd60e51b81526004016112809190614d46565b506101a354604051635ed6513d60e11b815230600482015263ffffffff881660248201526001600160a01b0390911690600090829063bdaca27a906044016040805180830381865afa15801561185d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188191906156b7565b8051604080518082019091526002815261313160f01b6020820152919250906001600160a01b0382166118c75760405162461bcd60e51b81526004016112809190614d46565b5060005b84811015611a3057836001600160a01b031663255e0ae48b8b8b858181106118f5576118f561553b565b905060200201602081019061190a9190614d9a565b8a8a8681811061191c5761191c61553b565b6040516001600160e01b031960e088901b16815263ffffffff9590951660048601526001600160a01b039384166024860152602002919091013560448401525085166064820152608401600060405180830381600087803b15801561198057600080fd5b505af1158015611994573d6000803e3d6000fd5b505050508888828181106119aa576119aa61553b565b90506020020160208101906119bf9190614d9a565b6001600160a01b03168a63ffffffff167f36d0f926f9bce41fb6e90938955b971cee6bbdfbce772aadd3d6c824f0372797898985818110611a0257611a0261553b565b90506020020135604051611a1891815260200190565b60405180910390a3611a29816155d7565b90506118cb565b50505050505050505050565b611a657f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cb2565b611a6d613d18565b565b6000611a79613998565b3360009081526101a0602052604090205460ff1615611a9a575060006110c2565b82518251604080518082019091526002815261189960f11b6020820152908214611ad75760405162461bcd60e51b81526004016112809190614d46565b5061019d54600090815b83811015611b3d57600061271083888481518110611b0157611b0161553b565b6020026020010151611b139190615567565b611b1d9190615586565b9050611b2981856155a8565b93505080611b36906155d7565b9050611ae1565b509095945050505050565b611b506138a6565b6001600160a01b031660009081526101a060205260409020805460ff19169055565b611b7a6138a6565b60005b81518110156115005760016101996000848481518110611b9f57611b9f61553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f29b8b184f4394a88477750516a3701dd0c9409451be78c24428bf5f827f527a5828281518110611c1157611c1161553b565b6020026020010151604051611c3591906001600160a01b0391909116815260200190565b60405180910390a1611c46816155d7565b9050611b7d565b611c55613998565b611c5e82613405565b506000611c6961338d565b6040805180820190915260018152603360f81b602082015290915081611ca25760405162461bcd60e51b81526004016112809190614d46565b5080821115611caf578091505b611cb93383613dab565b604080516001600160a01b0385168152602081018490527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4910160405180910390a16112136001600160a01b038416333085613e96565b606080611d1b613998565b604080518082019091526002815261323160f01b602082015283611d525760405162461bcd60e51b81526004016112809190614d46565b506101a15460009081905b600086118015611d6c57508083105b15611eda5760006101a18481548110611d8757611d8761553b565b60009182526020822001546001600160a01b03169150611da6826120bc565b905060008115611dd457818911611dbd5788611dbf565b815b9050611dcb818a6155c0565b98508460010194505b85600101955088600003611ed257846001600160401b03811115611dfa57611dfa614e43565b604051908082528060200260200182016040528015611e23578160200160208202803683370190505b509750846001600160401b03811115611e3e57611e3e614e43565b604051908082528060200260200182016040528015611e67578160200160208202803683370190505b5096508288611e776001886155c0565b81518110611e8757611e8761553b565b6001600160a01b03909216602092830291909101909101528087611eac6001886155c0565b81518110611ebc57611ebc61553b565b602002602001018181525050611ed283826139d8565b505050611d5d565b604080518082019091526002815261313560f01b60208201528615611f125760405162461bcd60e51b81526004016112809190614d46565b506000915060005b611f256001856155c0565b811015611fe75760006101a18281548110611f4257611f4261553b565b60009182526020822001546001600160a01b03169150611f61826120bc565b905080600003611f72575050611fd7565b81888681518110611f8557611f8561553b565b60200260200101906001600160a01b031690816001600160a01b03168152505080878681518110611fb857611fb861553b565b602002602001018181525050611fce82826139d8565b84600101945050505b611fe0816155d7565b9050611f1a565b50505050915091565b6001600160a01b037f000000000000000000000000a81f17ead463b0c5b4cbd00386b99469f6fcc20a1630036120385760405162461bcd60e51b8152600401611280906155f0565b7f000000000000000000000000a81f17ead463b0c5b4cbd00386b99469f6fcc20a6001600160a01b0316612081600080516020615c46833981519152546001600160a01b031690565b6001600160a01b0316146120a75760405162461bcd60e51b81526004016112809061563c565b6120b082613b33565b61150082826001613b3b565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015612103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c2919061570e565b6000306001600160a01b037f000000000000000000000000a81f17ead463b0c5b4cbd00386b99469f6fcc20a16146121c75760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401611280565b50600080516020615c4683398151915290565b6121e26138a6565b60005b815181101561150057600161019b60008484815181106122075761220761553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f43388d274033333ceb567d699874be067ce7411c2bfc989f8e623694c9b3284f8282815181106122795761227961553b565b602002602001015160405161229d91906001600160a01b0391909116815260200190565b60405180910390a16122ae816155d7565b90506121e5565b6122bd6138a6565b60005b815181101561150057600061019b60008484815181106122e2576122e261553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7f25a7a7bea0a3fabbe5dc8b6176bd9a603925da390010a10998148c192b6708282815181106123545761235461553b565b602002602001015160405161237891906001600160a01b0391909116815260200190565b60405180910390a1612389816155d7565b90506122c0565b6123986138a6565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916600117905590519182527fbfe78aa03afab7296923112293cb902a2fe6df5a6d3d81e1933c652c4cf860f491016111ff565b6065546001600160a01b031633146124475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611280565b611a6d6000613f07565b612459613f59565b6115008282613f9f565b61246b6138a6565b604080518082019091526002815261031360f41b602082015261271082106124a65760405162461bcd60e51b81526004016112809190614d46565b5061019f55565b6124b56138a6565b60005b815181101561150057600061019960008484815181106124da576124da61553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3c36656d3e8c3db21a1c7d0a7208d73387e15535964c44c30b20c45ab51b3c3882828151811061254c5761254c61553b565b602002602001015160405161257091906001600160a01b0391909116815260200190565b60405180910390a1612581816155d7565b90506124b8565b600061259460016140f9565b905080156125ac576000805461ff0019166101001790555b6125b4614186565b6125bc6141ad565b6125c46141dd565b612601604051806060016040528060228152602001615c2460229139604051806040016040528060038152602001621090d560ea1b815250614210565b61260c600033613a46565b80156115e0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016111ff565b6126566138a6565b60005b82518110156127c4578415156001036127125760016101968483815181106126835761268361553b565b60200260200101516040516126989190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fa27e97999993c298fae0b7088ff732fe078cc1585665ee1554220b3cbe6317a98382815181106126f0576126f061553b565b60200260200101516040516127059190614d46565b60405180910390a16127b4565b60006101968483815181106127295761272961553b565b602002602001015160405161273e9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f0127ddc00426c693b5becb26ba43a260c781ebc323b61d3b24b61e4dc5c93c718382815181106127965761279661553b565b60200260200101516040516127ab9190614d46565b60405180910390a15b6127bd816155d7565b9050612659565b5060005b8151811015612933578415156001036128815760016101988383815181106127f2576127f261553b565b60200260200101516040516128079190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f156643e9a7f860e95993739893595e6ee1d04d9ff1b98567dbe9d5681cd152b282828151811061285f5761285f61553b565b60200260200101516040516128749190614d46565b60405180910390a1612923565b60006101988383815181106128985761289861553b565b60200260200101516040516128ad9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f21a77ac4edf49633047cc4e32b10dfe633811216214400e0e1f507c3f7287b618282815181106129055761290561553b565b602002602001015160405161291a9190614d46565b60405180910390a15b61292c816155d7565b90506127c8565b5060005b8351811015612aa2578415156001036129f05760016101948583815181106129615761296161553b565b60200260200101516040516129769190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f3df7a1330febee3646ae4a0f0e46c94c046f0ee810b2b7f1fa10fa8f34d7b7ef8482815181106129ce576129ce61553b565b60200260200101516040516129e39190614d46565b60405180910390a1612a92565b6000610194858381518110612a0757612a0761553b565b6020026020010151604051612a1c9190615727565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fc84badb33408cce6e89b30a735d8f06e094fa4a19c01c2da66718f490c672f65848281518110612a7457612a7461553b565b6020026020010151604051612a899190614d46565b60405180910390a15b612a9b816155d7565b9050612937565b5050505050565b612ad27f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a613cb2565b611a6d61425e565b612ae26138a6565b60005b815181101561150057600161019a6000848481518110612b0757612b0761553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2e333bce7bf5a0097fbb4fef2a950809960b5a4aa1a63cbcffc24ac62dc4fd07828281518110612b7957612b7961553b565b6020026020010151604051612b9d91906001600160a01b0391909116815260200190565b60405180910390a1612bae816155d7565b9050612ae5565b612bbd613998565b6001600160a01b03821660009081526101a260209081526040918290205482518084019093526002835261313360f01b9183019190915260ff16612c145760405162461bcd60e51b81526004016112809190614d46565b50612c1f82826139d8565b60405163079cc67960e41b8152336004820152602481018290526001600160a01b038316906379cc679090604401600060405180830381600087803b158015612c6757600080fd5b505af1158015612c7b573d6000803e3d6000fd5b505050505050565b612c8b613f59565b6115008282613dab565b612c9d6138a6565b60005b815181101561150057600061019a6000848481518110612cc257612cc261553b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9cee5064afac40e291311ecb6a670ef3ef652131fb1ed15c1266fb22cffd6bdd828281518110612d3457612d3461553b565b6020026020010151604051612d5891906001600160a01b0391909116815260200190565b60405180910390a1612d69816155d7565b9050612ca0565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060603780546110d790615501565b6101a18181548110612dbb57600080fd5b6000918252602090912001546001600160a01b0316905081565b60003381612de38286613573565b905083811015612e435760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401611280565b612e508286868403613782565b506001949350505050565b6000612e66836138fc565b61116883836142d9565b6000612ed160405180610140016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200160006001600160a01b031681525090565b612f4d6040518061016001604052806060815260200160006001600160401b0316815260200160006001600160401b031681526020016000815260200160006001600160401b03168152602001600015158152602001600015158152602001606081526020016060815260200160608152602001606081525090565b836001600160a01b031663152583de6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612f8b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612fb391908101906158e1565b610193546020808301516040805180820190915260018152601b60f91b9281019290925293955091935090916001600160401b03600160a01b9092048216911610156130125760405162461bcd60e51b81526004016112809190614d46565b50610193601c9054906101000a900460ff161515610194836060015160405161303b9190615727565b9081526040805191829003602090810183205483830190925260018352603760f81b90830152909160ff9091161515146130885760405162461bcd60e51b81526004016112809190614d46565b5061019554602083015160405160ff909216151591610196916130aa91615727565b9081526040805191829003602090810183205483830190925260018352600760fb1b90830152909160ff9091161515146130f75760405162461bcd60e51b81526004016112809190614d46565b5061019754604080840151905160ff9092161515916101989161311991615727565b9081526040805191829003602090810183205483830190925260018352603960f81b90830152909160ff909116151514612e505760405162461bcd60e51b81526004016112809190614d46565b61316e6138a6565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166131ae5760405162461bcd60e51b81526004016112809190614d46565b5061019c80546001600160a01b0319166001600160a01b0392909216919091179055565b6131da6138a6565b6101918190556040518181527f4e44c8be34d12f1b7f56b13b4bbe97e64ca37a91916f86c73412da80c21748e2906020016111ff565b6132397f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08613cb2565b6040805180820190915260018152601960f91b60208201528161326f5760405162461bcd60e51b81526004016112809190614d46565b5061327d6101a18383614bd8565b507f9204d457ace303c5dbbeaa6966e5ec65661a390007a367c6645e52b4ef4b528e828260405161175c929190615a9e565b60606101a180548060200260200160405190810160405280929190818152602001828054801561115057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116132ea575050505050905090565b6133196138a6565b6101a380546001600160a01b0319166001600160a01b0383169081179091556040519081527f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc80906020016111ff565b600082815260fb602052604090206001015461338381613a3c565b6112138383613acc565b600061339860355490565b610191546133a691906155c0565b905090565b6133b36138a6565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916905590519182527fd1fc9d8986829d0ba9df2bc201a2c76327e0f71567b5a2fb82ba464bf4a03f4491016111ff565b6101935460405163787d871360e01b81526001600160a01b038381166004830152600092839291169063787d871390602401602060405180830381865afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134789190615ae1565b90508015613512576001600160a01b038316600090815261019a602052604090205460ff16156134ab5750600192915050565b6001600160a01b038316600090815261019b602090815260409182902054825180840190935260018352600d60fa1b9183019190915260ff16156135025760405162461bcd60e51b81526004016112809190614d46565b5061350c83612e70565b5061356a565b6001600160a01b0383166000908152610199602090815260409182902054825180840190935260018352603560f81b9183019190915260ff166135685760405162461bcd60e51b81526004016112809190614d46565b505b50600192915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6135a66138a6565b604080518082019091526002815261313160f01b60208201526001600160a01b0382166135e65760405162461bcd60e51b81526004016112809190614d46565b5061019e80546001600160a01b0319166001600160a01b0392909216919091179055565b6136126138a6565b61019380546001600160a01b0319166001600160a01b0383169081179091556040519081527f86907b53cf2024579968511876daf0b4620d65803b550e33101baf70aeb6f5eb906020016111ff565b6136696138a6565b604080518082019091526002815261031360f41b602082015261271082106136a45760405162461bcd60e51b81526004016112809190614d46565b5061019d55565b6065546001600160a01b031633146137055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611280565b6001600160a01b03811661376a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611280565b6115e081613f07565b6001600160a01b03163b151590565b6001600160a01b0383166137e45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401611280565b6001600160a01b0382166138455760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401611280565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b336138b96065546001600160a01b031690565b6001600160a01b03161460405180604001604052806002815260200161062760f31b815250906115e05760405162461bcd60e51b81526004016112809190614d46565b604080518082019091526002815261313960f01b60208201526001600160a01b03821661393c5760405162461bcd60e51b81526004016112809190614d46565b50604080518082019091526002815261032360f41b60208201526001600160a01b03821630036115005760405162461bcd60e51b81526004016112809190614d46565b60003361398d8582856142e7565b612e5085858561435b565b60975460ff1615604051806040016040528060028152602001610c4d60f21b815250906115e05760405162461bcd60e51b81526004016112809190614d46565b6139e23382613f9f565b6139f66001600160a01b0383163383614534565b604080513381526001600160a01b03841660208201529081018290527f27d4634c833b7622a0acddbf7f746183625f105945e95c723ad1d5a9f2a0b6fc9060600161175c565b6115e08133614564565b613a508282612d70565b61150057600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613a883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613ad68282612d70565b1561150057600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6115e06138a6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613b6e57611213836145c8565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613bc8575060408051601f3d908101601f19168201909252613bc59181019061570e565b60015b613c2b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401611280565b600080516020615c468339815191528114613c9a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401611280565b50611213838383614664565b60006112348383614689565b613cbc8133612d70565b80613ce0575033613cd56065546001600160a01b031690565b6001600160a01b0316145b604051806040016040528060018152602001603160f81b815250906115005760405162461bcd60e51b81526004016112809190614d46565b60975460ff16613d615760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611280565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216613e015760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401611280565b613e0d600083836146ae565b8060356000828254613e1f91906155a8565b90915550506001600160a01b03821660009081526033602052604081208054839290613e4c9084906155a8565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052613f019085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526146b6565b50505050565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6101a354604080518082019091526002815261313760f01b6020820152906001600160a01b031633146115e05760405162461bcd60e51b81526004016112809190614d46565b6001600160a01b038216613fff5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401611280565b61400b826000836146ae565b6001600160a01b0382166000908152603360205260409020548181101561407f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401611280565b6001600160a01b03831660009081526033602052604081208383039055603580548492906140ae9084906155c0565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60008054610100900460ff1615614140578160ff16600114801561411c5750303b155b6141385760405162461bcd60e51b815260040161128090615afe565b506000919050565b60005460ff8084169116106141675760405162461bcd60e51b815260040161128090615afe565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16611a6d5760405162461bcd60e51b815260040161128090615b4c565b600054610100900460ff166141d45760405162461bcd60e51b815260040161128090615b4c565b611a6d33613f07565b600054610100900460ff166142045760405162461bcd60e51b815260040161128090615b4c565b6097805460ff19169055565b600054610100900460ff166142375760405162461bcd60e51b815260040161128090615b4c565b815161424a906036906020850190614c3b565b508051611213906037906020840190614c3b565b60975460ff16156142a45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611280565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613d8e3390565b60003361116881858561435b565b60006142f38484613573565b90506000198114613f01578181101561434e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401611280565b613f018484848403613782565b6001600160a01b0383166143bf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401611280565b6001600160a01b0382166144215760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401611280565b61442c8383836146ae565b6001600160a01b038316600090815260336020526040902054818110156144a45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401611280565b6001600160a01b038085166000908152603360205260408082208585039055918516815290812080548492906144db9084906155a8565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161452791815260200190565b60405180910390a3613f01565b6040516001600160a01b03831660248201526044810182905261121390849063a9059cbb60e01b90606401613eca565b61456e8282612d70565b61150057614586816001600160a01b03166014614788565b614591836020614788565b6040516020016145a2929190615b97565b60408051601f198184030181529082905262461bcd60e51b825261128091600401614d46565b6001600160a01b0381163b6146355760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401611280565b600080516020615c4683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61466d83614923565b60008251118061467a5750805b1561121357613f018383614963565b6000815183511480156112345750508051602091820120825192909101919091201490565b611213613998565b600061470b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614a579092919063ffffffff16565b80519091501561121357808060200190518101906147299190615ae1565b6112135760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611280565b60606000614797836002615567565b6147a29060026155a8565b6001600160401b038111156147b9576147b9614e43565b6040519080825280601f01601f1916602001820160405280156147e3576020820181803683370190505b509050600360fc1b816000815181106147fe576147fe61553b565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061482d5761482d61553b565b60200101906001600160f81b031916908160001a9053506000614851846002615567565b61485c9060016155a8565b90505b60018111156148d4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106148905761489061553b565b1a60f81b8282815181106148a6576148a661553b565b60200101906001600160f81b031916908160001a90535060049490941c936148cd81615c0c565b905061485f565b5083156112345760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611280565b61492c816145c8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6149cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401611280565b600080846001600160a01b0316846040516149e69190615727565b600060405180830381855af49150503d8060008114614a21576040519150601f19603f3d011682016040523d82523d6000602084013e614a26565b606091505b5091509150614a4e8282604051806060016040528060278152602001615c6660279139614a6e565b95945050505050565b6060614a668484600085614aa7565b949350505050565b60608315614a7d575081611234565b825115614a8d5782518084602001fd5b8160405162461bcd60e51b81526004016112809190614d46565b606082471015614b085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611280565b6001600160a01b0385163b614b5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611280565b600080866001600160a01b03168587604051614b7b9190615727565b60006040518083038185875af1925050503d8060008114614bb8576040519150601f19603f3d011682016040523d82523d6000602084013e614bbd565b606091505b5091509150614bcd828286614a6e565b979650505050505050565b828054828255906000526020600020908101928215614c2b579160200282015b82811115614c2b5781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614bf8565b50614c37929150614caf565b5090565b828054614c4790615501565b90600052602060002090601f016020900481019282614c695760008555614c2b565b82601f10614c8257805160ff1916838001178555614c2b565b82800160010185558215614c2b579182015b82811115614c2b578251825591602001919060010190614c94565b5b80821115614c375760008155600101614cb0565b600060208284031215614cd657600080fd5b81356001600160e01b03198116811461123457600080fd5b60005b83811015614d09578181015183820152602001614cf1565b83811115613f015750506000910152565b60008151808452614d32816020860160208601614cee565b601f01601f19169290920160200192915050565b6020815260006112346020830184614d1a565b6001600160a01b03811681146115e057600080fd5b60008060408385031215614d8157600080fd5b8235614d8c81614d59565b946020939093013593505050565b600060208284031215614dac57600080fd5b813561123481614d59565b6001600160401b03811681146115e057600080fd5b600060208284031215614dde57600080fd5b813561123481614db7565b600060208284031215614dfb57600080fd5b5035919050565b600080600060608486031215614e1757600080fd5b8335614e2281614d59565b92506020840135614e3281614d59565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b0381118282101715614e7c57614e7c614e43565b60405290565b60405161014081016001600160401b0381118282101715614e7c57614e7c614e43565b604051601f8201601f191681016001600160401b0381118282101715614ecd57614ecd614e43565b604052919050565b60006001600160401b03821115614eee57614eee614e43565b5060051b60200190565b600082601f830112614f0957600080fd5b81356020614f1e614f1983614ed5565b614ea5565b82815260059290921b84018101918181019086841115614f3d57600080fd5b8286015b84811015614f61578035614f5481614d59565b8352918301918301614f41565b509695505050505050565b60008060408385031215614f7f57600080fd5b82356001600160401b0380821115614f9657600080fd5b614fa286838701614ef8565b9350602091508185013581811115614fb957600080fd5b85019050601f81018613614fcc57600080fd5b8035614fda614f1982614ed5565b81815260059190911b82018301908381019088831115614ff957600080fd5b928401925b8284101561501757833582529284019290840190614ffe565b80955050505050509250929050565b6000806040838503121561503957600080fd5b82359150602083013561504b81614d59565b809150509250929050565b60006001600160401b0382111561506f5761506f614e43565b50601f01601f191660200190565b600061508b614f1984615056565b905082815283838301111561509f57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126150c757600080fd5b6112348383356020850161507d565b80151581146115e057600080fd5b600080604083850312156150f757600080fd5b82356001600160401b0381111561510d57600080fd5b615119858286016150b6565b925050602083013561504b816150d6565b60008083601f84011261513c57600080fd5b5081356001600160401b0381111561515357600080fd5b6020830191508360208260051b850101111561516e57600080fd5b9250929050565b60008060008060006060868803121561518d57600080fd5b853563ffffffff811681146151a157600080fd5b945060208601356001600160401b03808211156151bd57600080fd5b6151c989838a0161512a565b909650945060408801359150808211156151e257600080fd5b506151ef8882890161512a565b969995985093965092949392505050565b60006020828403121561521257600080fd5b81356001600160401b0381111561522857600080fd5b614a6684828501614ef8565b600081518084526020808501945080840160005b8381101561526d5781516001600160a01b031687529582019590820190600101615248565b509495945050505050565b60408152600061528b6040830185615234565b82810360208481019190915284518083528582019282019060005b818110156152c2578451835293830193918301916001016152a6565b5090979650505050505050565b600080604083850312156152e257600080fd5b82356152ed81614d59565b915060208301356001600160401b0381111561530857600080fd5b8301601f8101851361531957600080fd5b6153288582356020840161507d565b9150509250929050565b600082601f83011261534357600080fd5b81356020615353614f1983614ed5565b82815260059290921b8401810191818101908684111561537257600080fd5b8286015b84811015614f615780356001600160401b038111156153955760008081fd5b6153a38986838b01016150b6565b845250918301918301615376565b600080600080608085870312156153c757600080fd5b84356153d2816150d6565b935060208501356001600160401b03808211156153ee57600080fd5b6153fa88838901615332565b9450604087013591508082111561541057600080fd5b61541c88838901615332565b9350606087013591508082111561543257600080fd5b5061543f87828801615332565b91505092959194509250565b60006020828403121561545d57600080fd5b81356001600160401b0381111561547357600080fd5b614a66848285016150b6565b6000806020838503121561549257600080fd5b82356001600160401b038111156154a857600080fd5b6154b48582860161512a565b90969095509350505050565b6020815260006112346020830184615234565b600080604083850312156154e657600080fd5b82356154f181614d59565b9150602083013561504b81614d59565b600181811c9082168061551557607f821691505b60208210810361553557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561558157615581615551565b500290565b6000826155a357634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156155bb576155bb615551565b500190565b6000828210156155d2576155d2615551565b500390565b6000600182016155e9576155e9615551565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60408152600061569b6040830185614d1a565b905082151560208301529392505050565b805161418181614d59565b6000604082840312156156c957600080fd5b604051604081018181106001600160401b03821117156156eb576156eb614e43565b60405282516156f981614d59565b81526020928301519281019290925250919050565b60006020828403121561572057600080fd5b5051919050565b60008251615739818460208701614cee565b9190910192915050565b600082601f83011261575457600080fd5b8151615762614f1982615056565b81815284602083860101111561577757600080fd5b614a66826020830160208701614cee565b805161418181614db7565b8051614181816150d6565b600061016082840312156157b157600080fd5b6157b9614e59565b905081516001600160401b03808211156157d257600080fd5b6157de85838601615743565b83526157ec60208501615788565b60208401526157fd60408501615788565b60408401526060840151606084015261581860808501615788565b608084015261582960a08501615793565b60a084015261583a60c08501615793565b60c084015260e084015191508082111561585357600080fd5b61585f85838601615743565b60e08401526101009150818401518181111561587a57600080fd5b61588686828701615743565b8385015250610120915081840151818111156158a157600080fd5b6158ad86828701615743565b8385015250610140915081840151818111156158c857600080fd5b6158d486828701615743565b8385015250505092915050565b600080604083850312156158f457600080fd5b82516001600160401b038082111561590b57600080fd5b90840190610140828703121561592057600080fd5b615928614e82565b82518281111561593757600080fd5b61594388828601615743565b82525060208301518281111561595857600080fd5b61596488828601615743565b60208301525060408301518281111561597c57600080fd5b61598888828601615743565b6040830152506060830151828111156159a057600080fd5b6159ac88828601615743565b6060830152506080830151828111156159c457600080fd5b6159d088828601615743565b60808301525060a0830151828111156159e857600080fd5b6159f488828601615743565b60a08301525060c083015182811115615a0c57600080fd5b615a1888828601615743565b60c08301525060e083015182811115615a3057600080fd5b615a3c88828601615743565b60e0830152506101008084015183811115615a5657600080fd5b615a6289828701615743565b828401525050610120615a768185016156ac565b908201526020860151909450915080821115615a9157600080fd5b506153288582860161579e565b60208082528181018390526000908460408401835b86811015614f61578235615ac681614d59565b6001600160a01b031682529183019190830190600101615ab3565b600060208284031215615af357600080fd5b8151611234816150d6565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615bcf816017850160208801614cee565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615c00816028840160208801614cee565b01602801949350505050565b600081615c1b57615c1b615551565b50600019019056fe546f7563616e2050726f746f636f6c3a204261736520436172626f6e20546f6e6e65360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e164e8c0e3adde6b344ecdd763ad65cdcbee490f131c9a1ee91cd8af0fe8a32b64736f6c634300080e0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.