Contract Overview
Balance:
0 CELO
CELO Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xe8d55a1a467eb4b8122543e63446763dbb01f4ba9b66c08e778d55a10feed015 | 0x60a06040 | 14251907 | 304 days 23 hrs ago | 0xd632d38ae05b2b760f5793b57c69246c26bf7e8d | IN | Create: BaseCarbonTonne | 0 CELO | 0.002666907 |
[ Download CSV Export ]
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.4 <=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 '../interfaces/ICarbonOffsetBatches.sol'; import '../interfaces/IToucanCarbonOffsets.sol'; import '../interfaces/IToucanContractRegistry.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 //slither-disable-next-line unprotected-upgrade contract BaseCarbonTonne is ContextUpgradeable, ERC20Upgradeable, OwnableUpgradeable, PausableUpgradeable, AccessControlUpgradeable, UUPSUpgradeable, BaseCarbonTonneStorage { using SafeERC20Upgradeable for IERC20Upgradeable; // ---------------------------------------- // Constants // ---------------------------------------- bytes32 public constant PAUSER_ROLE = keccak256('PAUSER_ROLE'); bytes32 public constant MANAGER_ROLE = keccak256('MANAGER_ROLE'); /// @dev fees redeem percentage with 2 fixed decimals precision uint256 public constant feeRedeemDivider = 1e4; // ---------------------------------------- // Events // ---------------------------------------- event Deposited(address erc20Addr, uint256 amount); event Redeemed(address account, address erc20, uint256 amount); event ExternalAddressWhitelisted(address erc20addr); event ExternalAddressRemovedFromWhitelist(address erc20addr); event InternalAddressWhitelisted(address erc20addr); event InternalAddressBlacklisted(address erc20addr); event InternalAddressRemovedFromBlackList(address erc20addr); event InternalAddressRemovedFromWhitelist(address erc20addr); event AttributeStandardAdded(string standard); event AttributeStandardRemoved(string standard); event AttributeMethodologyAdded(string methodology); event AttributeMethodologyRemoved(string methodology); event AttributeRegionAdded(string region); event AttributeRegionRemoved(string region); event RedeemFeePaid(address redeemer, uint256 fees); event RedeemFeeBurnt(address redeemer, uint256 fees); event ToucanRegistrySet(address ContractRegistry); event MappingSwitched(string mappingName, bool accepted); event SupplyCapUpdated(uint256 newCap); event MinimumVintageStartTimeUpdated(uint256 minimumVintageStartTime); event TCO2ScoringUpdated(address[] tco2s); event AddFeeExemptedTCO2(address tco2); event RemoveFeeExemptedTCO2(address tco2); /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } // ---------------------------------------- // Upgradable related functions // ---------------------------------------- /// @dev Returns the current version of the smart contract function version() external pure virtual returns (string memory) { return '1.4.0'; } 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 newImplementation) internal virtual override onlyOwner {} // ------------------------ // Admin functions // ------------------------ /// @dev modifier that only lets the contract's owner and granted role to execute modifier onlyWithRole(bytes32 role) { require( hasRole(role, msg.sender) || owner() == msg.sender, 'Unauthorized' ); _; } /// @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 onlyOwner { 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 onlyOwner { 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 onlyOwner { //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 onlyOwner { //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 onlyOwner { //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 onlyOwner { //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 onlyOwner { //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 onlyOwner { //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 onlyOwner { //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 onlyOwner { require( _feeRedeemPercentageInBase < feeRedeemDivider, 'Invalid fee percentage' ); feeRedeemPercentageInBase = _feeRedeemPercentageInBase; } /// @notice Update the fee redeem receiver /// @param _feeRedeemReceiver address to transfer the fees function setFeeRedeemReceiver(address _feeRedeemReceiver) external virtual onlyOwner { require(_feeRedeemReceiver != address(0), 'Invalid fee address'); feeRedeemReceiver = _feeRedeemReceiver; } /// @notice Update the fee redeem burn percentage /// @param _feeRedeemBurnPercentageInBase percentage of fee in base function setFeeRedeemBurnPercentage(uint256 _feeRedeemBurnPercentageInBase) external virtual onlyOwner { require( _feeRedeemBurnPercentageInBase < feeRedeemDivider, 'Invalid burn percentage' ); feeRedeemBurnPercentageInBase = _feeRedeemBurnPercentageInBase; } /// @notice Update the fee redeem burn address /// @param _feeRedeemBurnAddress address to transfer the fees to burn function setFeeRedeemBurnAddress(address _feeRedeemBurnAddress) external virtual onlyOwner { require(_feeRedeemBurnAddress != address(0), 'Invalid burn 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 onlyOwner { 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 onlyOwner { 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 onlyOwner { 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 onlyOwner { 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 onlyOwner { 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 onlyOwner { 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, '!tco2s'); scoredTCO2s = tco2s; emit TCO2ScoringUpdated(tco2s); } /** * @notice method to set router address * @dev use this method to set router address * @param _router address of ToucanCrosschainMessenger */ function setRouter(address _router) external onlyOwner { // router address can be set to zero to make bridgeMint and bridgeBurn unusable router = _router; } // ------------------------------------- // ToucanCrosschainMessenger functions // ------------------------------------- modifier onlyRouter() { require(msg.sender == router, 'Only Router functionality'); _; } /** * @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); } // ---------------------------- // 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 whenNotPaused { require(checkEligible(erc20Addr), 'Token rejected'); uint256 remainingSpace = getRemaining(); require(remainingSpace > 0, 'Full pool'); if (amount > remainingSpace) amount = remainingSpace; /// @dev Increase balance sheet of individual token tokenBalances[erc20Addr] += amount; _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] == false, 'Blacklisted TCO2'); require( checkAttributeMatching(erc20Addr) == true, 'Non-matching attributes' ); } /// @dev If not Toucan native contract, check if address is whitelisted else { require(externalWhiteList[erc20Addr] == true, 'Not whitelisted'); return true; } 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, 'Start time too old' ); require( regions[projectData.region] == regionsIsAcceptedMapping, 'Region not accepted' ); require( standards[projectData.standard] == standardsIsAcceptedMapping, 'Standard not accepted' ); require( methodologies[projectData.methodology] == methodologiesIsAcceptedMapping, '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 whenNotPaused returns (uint256) { if (redeemFeeExemptedAddresses[msg.sender]) { return 0; } require(tco2s.length == amounts.length, 'Length of arrays differ'); //slither-disable-next-line uninitialized-local uint256 totalFee; uint256 _feeRedeemPercentageInBase = feeRedeemPercentageInBase; //slither-disable-next-line uninitialized-local for (uint256 i; i < tco2s.length; ++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 whenNotPaused { require(redeemFeeExemptedTCO2s[tco2], '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 whenNotPaused { uint256 tco2Length = tco2s.length; require(tco2Length == amounts.length, 'Length of arrays differ'); //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) { 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 whenNotPaused { require(amount <= totalSupply(), 'Amount exceeds totalSupply'); uint256 remainingAmount = amount; //slither-disable-next-line uninitialized-local uint256 i; uint256 scoredTCO2Len = scoredTCO2s.length; while (remainingAmount > 0 && i < scoredTCO2Len) { address tco2 = scoredTCO2s[i]; uint256 balance = tokenBalances[tco2]; // Only TCO2s with a balance should be included for a redemption. if (balance != 0) { uint256 amountToRedeem = remainingAmount > balance ? balance : remainingAmount; redeemSingle(tco2, amountToRedeem); remainingAmount -= amountToRedeem; } unchecked { i += 1; } } require(remainingAmount == 0, 'Non-zero remaining 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. redeemAuto2 is slightly more expensive /// than redeemAuto but it is going to be more optimal to use by other on-chain /// contracts. /// @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) external virtual whenNotPaused returns (address[] memory tco2s, uint256[] memory amounts) { require(amount <= totalSupply(), 'Amount exceeds totalSupply'); uint256 remainingAmount = amount; //slither-disable-next-line uninitialized-local uint256 i; uint256 scoredTCO2Len = scoredTCO2s.length; while (remainingAmount > 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 = remainingAmount > balance ? balance : remainingAmount; remainingAmount -= amountToRedeem; } unchecked { i += 1; } // 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. if (remainingAmount == 0) { tco2s = new address[](i); amounts = new uint256[](i); tco2s[i - 1] = tco2; amounts[i - 1] = amountToRedeem; redeemSingle(tco2, amountToRedeem); } } require(remainingAmount == 0, 'Non-zero remaining amount'); // Execute the second iteration by avoiding to run the last index // since we have already executed that in the first iteration. //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 `remainingAmount` 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 `remainingAmount` 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. if (balance == 0) continue; tco2s[j] = tco2; amounts[j] = balance; redeemSingle(tco2, balance); } } /// @dev Internal function that redeems a single underlying token function redeemSingle(address erc20, uint256 amount) internal virtual whenNotPaused { require(tokenBalances[erc20] >= amount, 'Amount exceeds supply'); _burn(msg.sender, amount); tokenBalances[erc20] -= 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); require(!paused(), 'Paused contract'); } /// @dev Returns the remaining space in pool before hitting the cap function getRemaining() public view returns (uint256) { return (supplyCap - totalSupply()); } // ----------------------------- // Locked ERC20 safety // ----------------------------- /// @dev Modifier to disallowing sending tokens to either the 0-address /// or this contract itself modifier validDestination(address to) { require(to != address(0x0)); require(to != address(this)); _; } function transfer(address recipient, uint256 amount) public virtual override validDestination(recipient) returns (bool) { super.transfer(recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override validDestination(recipient) returns (bool) { 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-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 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-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 (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 (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.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 (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-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.4 <=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.4 <=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.4 <=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.4 <=0.8.14; /// @dev Storage for UUPS Proxy upgradable BaseCarbonTonne abstract contract BaseCarbonTonneStorageV1 { uint256 public supplyCap; mapping(address => uint256) public 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-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 (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 (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 (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); }
// 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 (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-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.4 <=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.4 <=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.4 <=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; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"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":"uint256","name":"newCap","type":"uint256"}],"name":"SupplyCapUpdated","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":[{"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":"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":"","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"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b62000156565b6200003260ff62000035565b50565b60008054610100900460ff1615620000ce578160ff1660011480156200006e57506200006c306200014760201b62003b001760201c565b155b620000c65760405162461bcd60e51b815260206004820152602e60248201526000805160206200609983398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff8084169116106200012d5760405162461bcd60e51b815260206004820152602e60248201526000805160206200609983398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000bd565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b608051615f0b6200018e6000396000818161168e015281816116ce0152818161204d0152818161208d015261211c0152615f0b6000f3fe6080604052600436106104b55760003560e01c80638662522f1161026b578063c0d786551161014f578063e63ab1e9116100c1578063f138ac1611610085578063f138ac1614610f45578063f141b84f14610f76578063f2fde38b14610f98578063f3edb9ec14610fb8578063f75991cd14610ff4578063f887ea401461103057600080fd5b8063e63ab1e914610e6c578063e882e37b14610ea0578063e9d131ad14610ec0578063ec87621c14610ee0578063f06f510314610f1457600080fd5b8063d80e05aa11610113578063d80e05aa14610dbf578063dc5f560e14610ddf578063dd62ed3e14610dff578063dff0f52314610e1f578063e07f744c14610e36578063e0d7cad914610e5657600080fd5b8063c0d7865514610d34578063c36a257314610d54578063d4e457ec14610d6f578063d547741f14610d8a578063d6a022b814610daa57600080fd5b8063a1631e4b116101e8578063a9a484c5116101ac578063a9a484c514610c71578063abf410e514610c91578063b516f8cf14610cb2578063b6a3f59a14610cd2578063bbe669eb14610cf2578063bf2f870f14610d1257600080fd5b8063a1631e4b14610bc5578063a217fddf14610c05578063a457c2d714610c1a578063a7381a6414610c3a578063a9059cbb14610c5157600080fd5b80638dcb01ec1161022f5780638dcb01ec14610b395780638f770ad014610b5957806391d1485414610b7057806395d89b4114610b90578063963ff55e14610ba557600080fd5b80638662522f14610a7f57806388c9cf6e14610abb57806389022e2e14610adb5780638c2a993e14610afb5780638da5cb5b14610b1b57600080fd5b806341dbbb2a1161039d5780635db44cef1161030f57806374f4f547116102d357806374f4f547146109d557806379255ddd146109f55780637966529d14610a155780638129fc1c14610a3557806381e48e9014610a4a5780638456cb5914610a6a57600080fd5b80635db44cef146109195780636dbb3102146109395780636fd2f1811461095957806370a082311461098a578063715018a6146109c057600080fd5b80634f1ef286116103615780634f1ef2861461085d578063523fba7f1461087057806352d1902d1461089e57806354c9c970146108b357806354fd4d50146108d35780635c975abb1461090157600080fd5b806341dbbb2a146107af5780634642547b146107cf57806346518b0a146107ef57806347e7ef241461080f5780634c02cad11461082f57600080fd5b806324adbf4d1161043657806336568abe116103fa57806336568abe146106f95780633659cfe614610719578063395093511461073957806339cd7a8a146107595780633a9a77ee146107795780633f4ba83a1461079a57600080fd5b806324adbf4d146106335780632b540f191461066c5780632b5541421461069d5780632f2ff15d146106bd578063313ce567146106dd57600080fd5b80630e2d15ab1161047d5780630e2d15ab1461057357806318160ddd146105a457806320b167f9146105c357806323b872dd146105e3578063248a9ca31461060357600080fd5b806301ffc9a7146104ba57806306fdde03146104ef578063095ea7b3146105115780630b7d28c7146105315780630c0efecc14610553575b600080fd5b3480156104c657600080fd5b506104da6104d5366004614f82565b611051565b60405190151581526020015b60405180910390f35b3480156104fb57600080fd5b50610504611088565b6040516104e69190615004565b34801561051d57600080fd5b506104da61052c36600461502c565b61111a565b34801561053d57600080fd5b5061055161054c366004615058565b611132565b005b34801561055f57600080fd5b5061055161056e36600461508a565b61118a565b34801561057f57600080fd5b506104da61058e366004615058565b6101a06020526000908152604090205460ff1681565b3480156105b057600080fd5b506035545b6040519081526020016104e6565b3480156105cf57600080fd5b506105516105de3660046150a7565b611217565b3480156105ef57600080fd5b506104da6105fe3660046150c0565b611377565b34801561060f57600080fd5b506105b561061e3660046150a7565b600090815260fb602052604090206001015490565b34801561063f57600080fd5b5061019c54610654906001600160a01b031681565b6040516001600160a01b0390911681526020016104e6565b34801561067857600080fd5b506104da610687366004615058565b6101a26020526000908152604090205460ff1681565b3480156106a957600080fd5b506105516106b836600461522a565b6113b9565b3480156106c957600080fd5b506105516106d83660046152e4565b6115dc565b3480156106e957600080fd5b50604051601281526020016104e6565b34801561070557600080fd5b506105516107143660046152e4565b611606565b34801561072557600080fd5b50610551610734366004615058565b611684565b34801561074557600080fd5b506104da61075436600461502c565b611763565b34801561076557600080fd5b506105516107743660046153a2565b611785565b34801561078557600080fd5b5061019e54610654906001600160a01b031681565b3480156107a657600080fd5b5061055161190a565b3480156107bb57600080fd5b506105b56107ca36600461522a565b61197d565b3480156107db57600080fd5b506105516107ea366004615058565b611a84565b3480156107fb57600080fd5b5061055161080a3660046153e8565b611ad0565b34801561081b57600080fd5b5061055161082a36600461502c565b611bcd565b34801561083b57600080fd5b5061084f61084a3660046150a7565b611d1a565b6040516104e6929190615460565b61055161086b3660046154b7565b612043565b34801561087c57600080fd5b506105b561088b366004615058565b6101926020526000908152604090205481565b3480156108aa57600080fd5b506105b561210f565b3480156108bf57600080fd5b506105516108ce3660046153e8565b6121c2565b3480156108df57600080fd5b506040805180820190915260058152640312e342e360dc1b6020820152610504565b34801561090d57600080fd5b5060975460ff166104da565b34801561092557600080fd5b506105516109343660046153e8565b6122bf565b34801561094557600080fd5b50610551610954366004615058565b6123bc565b34801561096557600080fd5b506104da610974366004615058565b6101996020526000908152604090205460ff1681565b34801561099657600080fd5b506105b56109a5366004615058565b6001600160a01b031660009081526033602052604090205490565b3480156109cc57600080fd5b5061055161243b565b3480156109e157600080fd5b506105516109f036600461502c565b612471565b348015610a0157600080fd5b50610551610a103660046150a7565b6124d2565b348015610a2157600080fd5b50610551610a303660046153e8565b612553565b348015610a4157600080fd5b50610551612650565b348015610a5657600080fd5b50610551610a65366004615599565b612716565b348015610a7657600080fd5b50610551612b93565b348015610a8b57600080fd5b506104da610a9a366004615633565b80516020818301810180516101948252928201919093012091525460ff1681565b348015610ac757600080fd5b50610551610ad63660046153e8565b612c06565b348015610ae757600080fd5b50610551610af636600461502c565b612d03565b348015610b0757600080fd5b50610551610b1636600461502c565b612dec565b348015610b2757600080fd5b506065546001600160a01b0316610654565b348015610b4557600080fd5b50610551610b543660046153e8565b612e4d565b348015610b6557600080fd5b506105b56101915481565b348015610b7c57600080fd5b506104da610b8b3660046152e4565b612f4a565b348015610b9c57600080fd5b50610504612f75565b348015610bb157600080fd5b50610654610bc03660046150a7565b612f84565b348015610bd157600080fd5b5061019354610bed90600160a01b90046001600160401b031681565b6040516001600160401b0390911681526020016104e6565b348015610c1157600080fd5b506105b5600081565b348015610c2657600080fd5b506104da610c3536600461502c565b612faf565b348015610c4657600080fd5b506105b561019f5481565b348015610c5d57600080fd5b506104da610c6c36600461502c565b613035565b348015610c7d57600080fd5b506104da610c8c366004615058565b61306a565b348015610c9d57600080fd5b5061019354610654906001600160a01b031681565b348015610cbe57600080fd5b50610551610ccd366004615058565b613391565b348015610cde57600080fd5b50610551610ced3660046150a7565b61342a565b348015610cfe57600080fd5b50610551610d0d366004615667565b61348a565b348015610d1e57600080fd5b50610d27613577565b6040516104e691906156db565b348015610d4057600080fd5b50610551610d4f366004615058565b6135d9565b348015610d6057600080fd5b50610195546104da9060ff1681565b348015610d7b57600080fd5b50610197546104da9060ff1681565b348015610d9657600080fd5b50610551610da53660046152e4565b613626565b348015610db657600080fd5b506105b561364b565b348015610dcb57600080fd5b50610551610dda366004615058565b613669565b348015610deb57600080fd5b506104da610dfa366004615058565b6136e5565b348015610e0b57600080fd5b506105b5610e1a3660046156ee565b6138b0565b348015610e2b57600080fd5b506105b561019d5481565b348015610e4257600080fd5b50610551610e51366004615058565b6138db565b348015610e6257600080fd5b506105b561271081565b348015610e7857600080fd5b506105b57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610eac57600080fd5b50610551610ebb366004615058565b613975565b348015610ecc57600080fd5b50610551610edb3660046150a7565b6139ee565b348015610eec57600080fd5b506105b57f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610f2057600080fd5b506104da610f2f366004615058565b61019b6020526000908152604090205460ff1681565b348015610f5157600080fd5b506104da610f60366004615058565b61019a6020526000908152604090205460ff1681565b348015610f8257600080fd5b50610193546104da90600160e01b900460ff1681565b348015610fa457600080fd5b50610551610fb3366004615058565b613a68565b348015610fc457600080fd5b506104da610fd3366004615633565b80516020818301810180516101968252928201919093012091525460ff1681565b34801561100057600080fd5b506104da61100f366004615633565b80516020818301810180516101988252928201919093012091525460ff1681565b34801561103c57600080fd5b506101a354610654906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061108257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060603680546110979061571c565b80601f01602080910402602001604051908101604052809291908181526020018280546110c39061571c565b80156111105780601f106110e557610100808354040283529160200191611110565b820191906000526020600020905b8154815290600101906020018083116110f357829003601f168201915b5050505050905090565b600033611128818585613b0f565b5060019392505050565b6065546001600160a01b031633146111655760405162461bcd60e51b815260040161115c90615756565b60405180910390fd5b6001600160a01b031660009081526101a060205260409020805460ff19166001179055565b6065546001600160a01b031633146111b45760405162461bcd60e51b815260040161115c90615756565b610193805467ffffffffffffffff60a01b1916600160a01b6001600160401b038416908102919091179091556040519081527f87f670402a6c72fff3b60ba5223165f062b58d671871fc2c49ea96101fdd19a0906020015b60405180910390a150565b60975460ff161561123a5760405162461bcd60e51b815260040161115c9061578b565b60355481111561128c5760405162461bcd60e51b815260206004820152601a60248201527f416d6f756e74206578636565647320746f74616c537570706c79000000000000604482015260640161115c565b6101a15481906000905b6000831180156112a557508082105b156113275760006101a183815481106112c0576112c06157b5565b60009182526020808320909101546001600160a01b0316808352610192909152604090912054909150801561131a5760008186116112fe5785611300565b815b905061130c8382613c33565b61131681876157e1565b9550505b6001840193505050611296565b82156113715760405162461bcd60e51b8152602060048201526019602482015278139bdb8b5e995c9bc81c995b585a5b9a5b99c8185b5bdd5b9d603a1b604482015260640161115c565b50505050565b6000826001600160a01b03811661138d57600080fd5b306001600160a01b038216036113a257600080fd5b6113ad858585613d4a565b50600195945050505050565b60975460ff16156113dc5760405162461bcd60e51b815260040161115c9061578b565b8151815181146114285760405162461bcd60e51b81526020600482015260176024820152762632b733ba341037b31030b93930bcb9903234b33332b960491b604482015260640161115c565b61019d543360009081526101a0602052604081205490919060ff1682805b858110156114f457826114985761271084888381518110611469576114696157b5565b602002602001015161147b91906157f8565b6114859190615817565b91506114918286615839565b945061149d565b600091505b6114e48882815181106114b2576114b26157b5565b6020026020010151838984815181106114cd576114cd6157b5565b60200260200101516114df91906157e1565b613c33565b6114ed81615851565b9050611446565b5083156115d357600061271061019f548661150f91906157f8565b6115199190615817565b905061152581866157e1565b61019c5490955061153f906001600160a01b031686613035565b5060408051338152602081018790527f3f89e1d936a29a8de9ae9040436992721a00bc63bbe3ca55692b95f0311640b2910160405180910390a180156115d15761019e54611596906001600160a01b031682613035565b5060408051338152602081018390527f932bd968974f0b6fa1cb59bf961f81d2e57b39332d311b413dceae17966387db910160405180910390a15b505b50505050505050565b600082815260fb60205260409020600101546115f781613d70565b6116018383613d7a565b505050565b6001600160a01b03811633146116765760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161115c565b6116808282613e00565b5050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036116cc5760405162461bcd60e51b815260040161115c9061586a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611715600080516020615e8f833981519152546001600160a01b031690565b6001600160a01b03161461173b5760405162461bcd60e51b815260040161115c906158b6565b61174481613e67565b6040805160008082526020820190925261176091839190613e91565b50565b60003361112881858561177683836138b0565b6117809190615839565b613b0f565b6065546001600160a01b031633146117af5760405162461bcd60e51b815260040161115c90615756565b6117d88260405180604001604052806007815260200166726567696f6e7360c81b815250613ffc565b1561181457806117f757610193805460ff60e01b19169055600061180e565b610193805460ff60e01b1916600160e01b17905560015b506118cd565b61183f82604051806040016040528060098152602001687374616e646172647360b81b815250613ffc565b1561186e578061185b57610195805460ff19169055600061180e565b610195805460ff191660011790556118cd565b61189d826040518060400160405280600d81526020016c6d6574686f646f6c6f6769657360981b815250613ffc565b156118cd57806118b957610197805460ff1916905560006118cb565b610197805460ff191660019081179091555b505b7fcdc35455a1217219a4240bb18a7d2978eb98208f22f7ec36d6a1381c28f9d0f582826040516118fe929190615902565b60405180910390a15050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6119358133612f4a565b8061195957503361194e6065546001600160a01b031690565b6001600160a01b0316145b6119755760405162461bcd60e51b815260040161115c90615926565b611760614008565b600061198b60975460ff1690565b156119a85760405162461bcd60e51b815260040161115c9061578b565b3360009081526101a0602052604090205460ff16156119c957506000611082565b8151835114611a145760405162461bcd60e51b81526020600482015260176024820152762632b733ba341037b31030b93930bcb9903234b33332b960491b604482015260640161115c565b61019d54600090815b8551811015611a7a57600061271083878481518110611a3e57611a3e6157b5565b6020026020010151611a5091906157f8565b611a5a9190615817565b9050611a668185615839565b93505080611a7390615851565b9050611a1d565b5090949350505050565b6065546001600160a01b03163314611aae5760405162461bcd60e51b815260040161115c90615756565b6001600160a01b031660009081526101a060205260409020805460ff19169055565b6065546001600160a01b03163314611afa5760405162461bcd60e51b815260040161115c90615756565b60005b81518110156116805760016101996000848481518110611b1f57611b1f6157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f29b8b184f4394a88477750516a3701dd0c9409451be78c24428bf5f827f527a5828281518110611b9157611b916157b5565b6020026020010151604051611bb591906001600160a01b0391909116815260200190565b60405180910390a1611bc681615851565b9050611afd565b60975460ff1615611bf05760405162461bcd60e51b815260040161115c9061578b565b611bf9826136e5565b611c365760405162461bcd60e51b815260206004820152600e60248201526d151bdad95b881c995a9958dd195960921b604482015260640161115c565b6000611c4061364b565b905060008111611c7e5760405162461bcd60e51b8152602060048201526009602482015268119d5b1b081c1bdbdb60ba1b604482015260640161115c565b80821115611c8a578091505b6001600160a01b0383166000908152610192602052604081208054849290611cb3908490615839565b90915550611cc39050338361409b565b604080516001600160a01b0385168152602081018490527f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4910160405180910390a16116016001600160a01b038416333085614186565b606080611d2960975460ff1690565b15611d465760405162461bcd60e51b815260040161115c9061578b565b603554831115611d985760405162461bcd60e51b815260206004820152601a60248201527f416d6f756e74206578636565647320746f74616c537570706c79000000000000604482015260640161115c565b6101a15483906000905b600083118015611db157508082105b15611f1f5760006101a18381548110611dcc57611dcc6157b5565b60009182526020808320909101546001600160a01b03168083526101929091526040822054909250908115611e1957818611611e085785611e0a565b815b9050611e1681876157e1565b95505b60018501945085600003611f1757846001600160401b03811115611e3f57611e3f615101565b604051908082528060200260200182016040528015611e68578160200160208202803683370190505b509750846001600160401b03811115611e8357611e83615101565b604051908082528060200260200182016040528015611eac578160200160208202803683370190505b5096508288611ebc6001886157e1565b81518110611ecc57611ecc6157b5565b6001600160a01b03909216602092830291909101909101528087611ef16001886157e1565b81518110611f0157611f016157b5565b602002602001018181525050611f178382613c33565b505050611da2565b8215611f695760405162461bcd60e51b8152602060048201526019602482015278139bdb8b5e995c9bc81c995b585a5b9a5b99c8185b5bdd5b9d603a1b604482015260640161115c565b60005b611f776001846157e1565b81101561203a5760006101a18281548110611f9457611f946157b5565b60009182526020808320909101546001600160a01b0316808352610192909152604082205490925090819003611fcb57505061202a565b81888481518110611fde57611fde6157b5565b60200260200101906001600160a01b031690816001600160a01b03168152505080878481518110612011576120116157b5565b6020026020010181815250506120278282613c33565b50505b61203381615851565b9050611f6c565b50505050915091565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361208b5760405162461bcd60e51b815260040161115c9061586a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166120d4600080516020615e8f833981519152546001600160a01b031690565b6001600160a01b0316146120fa5760405162461bcd60e51b815260040161115c906158b6565b61210382613e67565b61168082826001613e91565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146121af5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161115c565b50600080516020615e8f83398151915290565b6065546001600160a01b031633146121ec5760405162461bcd60e51b815260040161115c90615756565b60005b815181101561168057600161019b6000848481518110612211576122116157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f43388d274033333ceb567d699874be067ce7411c2bfc989f8e623694c9b3284f828281518110612283576122836157b5565b60200260200101516040516122a791906001600160a01b0391909116815260200190565b60405180910390a16122b881615851565b90506121ef565b6065546001600160a01b031633146122e95760405162461bcd60e51b815260040161115c90615756565b60005b815181101561168057600061019b600084848151811061230e5761230e6157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7f25a7a7bea0a3fabbe5dc8b6176bd9a603925da390010a10998148c192b670828281518110612380576123806157b5565b60200260200101516040516123a491906001600160a01b0391909116815260200190565b60405180910390a16123b581615851565b90506122ec565b6065546001600160a01b031633146123e65760405162461bcd60e51b815260040161115c90615756565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916600117905590519182527fbfe78aa03afab7296923112293cb902a2fe6df5a6d3d81e1933c652c4cf860f4910161120c565b6065546001600160a01b031633146124655760405162461bcd60e51b815260040161115c90615756565b61246f60006141f1565b565b6101a3546001600160a01b031633146124c85760405162461bcd60e51b81526020600482015260196024820152784f6e6c7920526f757465722066756e6374696f6e616c69747960381b604482015260640161115c565b6116808282614243565b6065546001600160a01b031633146124fc5760405162461bcd60e51b815260040161115c90615756565b612710811061254d5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206275726e2070657263656e74616765000000000000000000604482015260640161115c565b61019f55565b6065546001600160a01b0316331461257d5760405162461bcd60e51b815260040161115c90615756565b60005b815181101561168057600061019960008484815181106125a2576125a26157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3c36656d3e8c3db21a1c7d0a7208d73387e15535964c44c30b20c45ab51b3c38828281518110612614576126146157b5565b602002602001015160405161263891906001600160a01b0391909116815260200190565b60405180910390a161264981615851565b9050612580565b600061265c600161439d565b90508015612674576000805461ff0019166101001790555b61267c61442a565b612684614451565b61268c614481565b6126c9604051806060016040528060228152602001615e6d60229139604051806040016040528060038152602001621090d560ea1b8152506144b4565b6126d4600033613d7a565b8015611760576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200161120c565b6065546001600160a01b031633146127405760405162461bcd60e51b815260040161115c90615756565b60005b82518110156128ae578415156001036127fc57600161019684838151811061276d5761276d6157b5565b6020026020010151604051612782919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fa27e97999993c298fae0b7088ff732fe078cc1585665ee1554220b3cbe6317a98382815181106127da576127da6157b5565b60200260200101516040516127ef9190615004565b60405180910390a161289e565b6000610196848381518110612813576128136157b5565b6020026020010151604051612828919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f0127ddc00426c693b5becb26ba43a260c781ebc323b61d3b24b61e4dc5c93c71838281518110612880576128806157b5565b60200260200101516040516128959190615004565b60405180910390a15b6128a781615851565b9050612743565b5060005b8151811015612a1d5784151560010361296b5760016101988383815181106128dc576128dc6157b5565b60200260200101516040516128f1919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f156643e9a7f860e95993739893595e6ee1d04d9ff1b98567dbe9d5681cd152b2828281518110612949576129496157b5565b602002602001015160405161295e9190615004565b60405180910390a1612a0d565b6000610198838381518110612982576129826157b5565b6020026020010151604051612997919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f21a77ac4edf49633047cc4e32b10dfe633811216214400e0e1f507c3f7287b618282815181106129ef576129ef6157b5565b6020026020010151604051612a049190615004565b60405180910390a15b612a1681615851565b90506128b2565b5060005b8351811015612b8c57841515600103612ada576001610194858381518110612a4b57612a4b6157b5565b6020026020010151604051612a60919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f3df7a1330febee3646ae4a0f0e46c94c046f0ee810b2b7f1fa10fa8f34d7b7ef848281518110612ab857612ab86157b5565b6020026020010151604051612acd9190615004565b60405180910390a1612b7c565b6000610194858381518110612af157612af16157b5565b6020026020010151604051612b06919061594c565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507fc84badb33408cce6e89b30a735d8f06e094fa4a19c01c2da66718f490c672f65848281518110612b5e57612b5e6157b5565b6020026020010151604051612b739190615004565b60405180910390a15b612b8581615851565b9050612a21565b5050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a612bbe8133612f4a565b80612be2575033612bd76065546001600160a01b031690565b6001600160a01b0316145b612bfe5760405162461bcd60e51b815260040161115c90615926565b611760614502565b6065546001600160a01b03163314612c305760405162461bcd60e51b815260040161115c90615756565b60005b815181101561168057600161019a6000848481518110612c5557612c556157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2e333bce7bf5a0097fbb4fef2a950809960b5a4aa1a63cbcffc24ac62dc4fd07828281518110612cc757612cc76157b5565b6020026020010151604051612ceb91906001600160a01b0391909116815260200190565b60405180910390a1612cfc81615851565b9050612c33565b60975460ff1615612d265760405162461bcd60e51b815260040161115c9061578b565b6001600160a01b03821660009081526101a2602052604090205460ff16612d7e5760405162461bcd60e51b815260206004820152600c60248201526b139bdd08195e195b5c1d195960a21b604482015260640161115c565b612d888282613c33565b60405163079cc67960e41b8152336004820152602481018290526001600160a01b038316906379cc679090604401600060405180830381600087803b158015612dd057600080fd5b505af1158015612de4573d6000803e3d6000fd5b505050505050565b6101a3546001600160a01b03163314612e435760405162461bcd60e51b81526020600482015260196024820152784f6e6c7920526f757465722066756e6374696f6e616c69747960381b604482015260640161115c565b611680828261409b565b6065546001600160a01b03163314612e775760405162461bcd60e51b815260040161115c90615756565b60005b815181101561168057600061019a6000848481518110612e9c57612e9c6157b5565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9cee5064afac40e291311ecb6a670ef3ef652131fb1ed15c1266fb22cffd6bdd828281518110612f0e57612f0e6157b5565b6020026020010151604051612f3291906001600160a01b0391909116815260200190565b60405180910390a1612f4381615851565b9050612e7a565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060603780546110979061571c565b6101a18181548110612f9557600080fd5b6000918252602090912001546001600160a01b0316905081565b60003381612fbd82866138b0565b90508381101561301d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161115c565b61302a8286868403613b0f565b506001949350505050565b6000826001600160a01b03811661304b57600080fd5b306001600160a01b0382160361306057600080fd5b61302a848461455a565b60006130cb60405180610140016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200160006001600160a01b031681525090565b6131476040518061016001604052806060815260200160006001600160401b0316815260200160006001600160401b031681526020016000815260200160006001600160401b03168152602001600015158152602001600015158152602001606081526020016060815260200160608152602001606081525090565b836001600160a01b031663152583de6040518163ffffffff1660e01b8152600401600060405180830381865afa158015613185573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131ad9190810190615b11565b6101935460208201519294509092506001600160401b03600160a01b9091048116911610156132135760405162461bcd60e51b815260206004820152601260248201527114dd185c9d081d1a5b59481d1bdbc81bdb1960721b604482015260640161115c565b610193601c9054906101000a900460ff161515610194836060015160405161323b919061594c565b9081526040519081900360200190205460ff161515146132935760405162461bcd60e51b8152602060048201526013602482015272149959da5bdb881b9bdd081858d8d95c1d1959606a1b604482015260640161115c565b61019554602083015160405160ff909216151591610196916132b49161594c565b9081526040519081900360200190205460ff1615151461330e5760405162461bcd60e51b815260206004820152601560248201527414dd185b99185c99081b9bdd081858d8d95c1d1959605a1b604482015260640161115c565b61019754604080840151905160ff9092161515916101989161332f9161594c565b9081526040519081900360200190205460ff161515146111285760405162461bcd60e51b815260206004820152601860248201527f4d6574686f646f6c6f6779206e6f742061636365707465640000000000000000604482015260640161115c565b6065546001600160a01b031633146133bb5760405162461bcd60e51b815260040161115c90615756565b6001600160a01b0381166134075760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420666565206164647265737360681b604482015260640161115c565b61019c80546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b031633146134545760405162461bcd60e51b815260040161115c90615756565b6101918190556040518181527f4e44c8be34d12f1b7f56b13b4bbe97e64ca37a91916f86c73412da80c21748e29060200161120c565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086134b58133612f4a565b806134d95750336134ce6065546001600160a01b031690565b6001600160a01b0316145b6134f55760405162461bcd60e51b815260040161115c90615926565b8161352b5760405162461bcd60e51b81526020600482015260066024820152652174636f327360d01b604482015260640161115c565b6135386101a18484614e96565b507f9204d457ace303c5dbbeaa6966e5ec65661a390007a367c6645e52b4ef4b528e838360405161356a929190615cce565b60405180910390a1505050565b60606101a180548060200260200160405190810160405280929190818152602001828054801561111057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116135b2575050505050905090565b6065546001600160a01b031633146136035760405162461bcd60e51b815260040161115c90615756565b6101a380546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260fb602052604090206001015461364181613d70565b6116018383613e00565b600061365660355490565b6101915461366491906157e1565b905090565b6065546001600160a01b031633146136935760405162461bcd60e51b815260040161115c90615756565b6001600160a01b03811660008181526101a26020908152604091829020805460ff1916905590519182527fd1fc9d8986829d0ba9df2bc201a2c76327e0f71567b5a2fb82ba464bf4a03f44910161120c565b6101935460405163787d871360e01b81526001600160a01b038381166004830152600092839291169063787d871390602401602060405180830381865afa158015613734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137589190615d11565b90508015613847576001600160a01b038316600090815261019a602052604090205460ff161561378b5750600192915050565b6001600160a01b038316600090815261019b602052604090205460ff16156137e85760405162461bcd60e51b815260206004820152601060248201526f213630b1b5b634b9ba32b2102a21a79960811b604482015260640161115c565b6137f18361306a565b15156001146138425760405162461bcd60e51b815260206004820152601760248201527f4e6f6e2d6d61746368696e672061747472696275746573000000000000000000604482015260640161115c565b6138a7565b6001600160a01b0383166000908152610199602052604090205460ff1615156001146138a75760405162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015260640161115c565b50600192915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6065546001600160a01b031633146139055760405162461bcd60e51b815260040161115c90615756565b6001600160a01b0381166139525760405162461bcd60e51b8152602060048201526014602482015273496e76616c6964206275726e206164647265737360601b604482015260640161115c565b61019e80546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b0316331461399f5760405162461bcd60e51b815260040161115c90615756565b61019380546001600160a01b0319166001600160a01b0383169081179091556040519081527f86907b53cf2024579968511876daf0b4620d65803b550e33101baf70aeb6f5eb9060200161120c565b6065546001600160a01b03163314613a185760405162461bcd60e51b815260040161115c90615756565b6127108110613a625760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206665652070657263656e7461676560501b604482015260640161115c565b61019d55565b6065546001600160a01b03163314613a925760405162461bcd60e51b815260040161115c90615756565b6001600160a01b038116613af75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161115c565b611760816141f1565b6001600160a01b03163b151590565b6001600160a01b038316613b715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161115c565b6001600160a01b038216613bd25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161115c565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60975460ff1615613c565760405162461bcd60e51b815260040161115c9061578b565b6001600160a01b03821660009081526101926020526040902054811115613cb75760405162461bcd60e51b8152602060048201526015602482015274416d6f756e74206578636565647320737570706c7960581b604482015260640161115c565b613cc13382614243565b6001600160a01b0382166000908152610192602052604081208054839290613cea9084906157e1565b90915550613d0490506001600160a01b0383163383614568565b604080513381526001600160a01b03841660208201529081018290527f27d4634c833b7622a0acddbf7f746183625f105945e95c723ad1d5a9f2a0b6fc906060016118fe565b600033613d58858285614598565b613d6385858561460c565b60019150505b9392505050565b61176081336147e5565b613d848282612f4a565b61168057600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613dbc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613e0a8282612f4a565b1561168057600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6065546001600160a01b031633146117605760405162461bcd60e51b815260040161115c90615756565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615613ec45761160183614849565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613f1e575060408051601f3d908101601f19168201909252613f1b91810190615d2e565b60015b613f815760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b606482015260840161115c565b600080516020615e8f8339815191528114613ff05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b606482015260840161115c565b506116018383836148e5565b6000613d69838361490a565b60975460ff166140515760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161115c565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0382166140f15760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161115c565b6140fd6000838361492f565b806035600082825461410f9190615839565b90915550506001600160a01b0382166000908152603360205260408120805483929061413c908490615839565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526113719085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614974565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166142a35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161115c565b6142af8260008361492f565b6001600160a01b038216600090815260336020526040902054818110156143235760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161115c565b6001600160a01b03831660009081526033602052604081208383039055603580548492906143529084906157e1565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60008054610100900460ff16156143e4578160ff1660011480156143c05750303b155b6143dc5760405162461bcd60e51b815260040161115c90615d47565b506000919050565b60005460ff80841691161061440b5760405162461bcd60e51b815260040161115c90615d47565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff1661246f5760405162461bcd60e51b815260040161115c90615d95565b600054610100900460ff166144785760405162461bcd60e51b815260040161115c90615d95565b61246f336141f1565b600054610100900460ff166144a85760405162461bcd60e51b815260040161115c90615d95565b6097805460ff19169055565b600054610100900460ff166144db5760405162461bcd60e51b815260040161115c90615d95565b81516144ee906036906020850190614ef9565b508051611601906037906020840190614ef9565b60975460ff16156145255760405162461bcd60e51b815260040161115c9061578b565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861407e3390565b60003361112881858561460c565b6040516001600160a01b03831660248201526044810182905261160190849063a9059cbb60e01b906064016141ba565b60006145a484846138b0565b9050600019811461137157818110156145ff5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161115c565b6113718484848403613b0f565b6001600160a01b0383166146705760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161115c565b6001600160a01b0382166146d25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161115c565b6146dd83838361492f565b6001600160a01b038316600090815260336020526040902054818110156147555760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161115c565b6001600160a01b0380851660009081526033602052604080822085850390559185168152908120805484929061478c908490615839565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516147d891815260200190565b60405180910390a3611371565b6147ef8282612f4a565b61168057614807816001600160a01b03166014614a46565b614812836020614a46565b604051602001614823929190615de0565b60408051601f198184030181529082905262461bcd60e51b825261115c91600401615004565b6001600160a01b0381163b6148b65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161115c565b600080516020615e8f83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6148ee83614be1565b6000825111806148fb5750805b15611601576113718383614c21565b600081518351148015613d695750508051602091820120825192909101919091201490565b60975460ff16156116015760405162461bcd60e51b815260206004820152600f60248201526e14185d5cd9590818dbdb9d1c9858dd608a1b604482015260640161115c565b60006149c9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614d159092919063ffffffff16565b80519091501561160157808060200190518101906149e79190615d11565b6116015760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161115c565b60606000614a558360026157f8565b614a60906002615839565b6001600160401b03811115614a7757614a77615101565b6040519080825280601f01601f191660200182016040528015614aa1576020820181803683370190505b509050600360fc1b81600081518110614abc57614abc6157b5565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614aeb57614aeb6157b5565b60200101906001600160f81b031916908160001a9053506000614b0f8460026157f8565b614b1a906001615839565b90505b6001811115614b92576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614b4e57614b4e6157b5565b1a60f81b828281518110614b6457614b646157b5565b60200101906001600160f81b031916908160001a90535060049490941c93614b8b81615e55565b9050614b1d565b508315613d695760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161115c565b614bea81614849565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b614c895760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161115c565b600080846001600160a01b031684604051614ca4919061594c565b600060405180830381855af49150503d8060008114614cdf576040519150601f19603f3d011682016040523d82523d6000602084013e614ce4565b606091505b5091509150614d0c8282604051806060016040528060278152602001615eaf60279139614d2c565b95945050505050565b6060614d248484600085614d65565b949350505050565b60608315614d3b575081613d69565b825115614d4b5782518084602001fd5b8160405162461bcd60e51b815260040161115c9190615004565b606082471015614dc65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161115c565b6001600160a01b0385163b614e1d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161115c565b600080866001600160a01b03168587604051614e39919061594c565b60006040518083038185875af1925050503d8060008114614e76576040519150601f19603f3d011682016040523d82523d6000602084013e614e7b565b606091505b5091509150614e8b828286614d2c565b979650505050505050565b828054828255906000526020600020908101928215614ee9579160200282015b82811115614ee95781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614eb6565b50614ef5929150614f6d565b5090565b828054614f059061571c565b90600052602060002090601f016020900481019282614f275760008555614ee9565b82601f10614f4057805160ff1916838001178555614ee9565b82800160010185558215614ee9579182015b82811115614ee9578251825591602001919060010190614f52565b5b80821115614ef55760008155600101614f6e565b600060208284031215614f9457600080fd5b81356001600160e01b031981168114613d6957600080fd5b60005b83811015614fc7578181015183820152602001614faf565b838111156113715750506000910152565b60008151808452614ff0816020860160208601614fac565b601f01601f19169290920160200192915050565b602081526000613d696020830184614fd8565b6001600160a01b038116811461176057600080fd5b6000806040838503121561503f57600080fd5b823561504a81615017565b946020939093013593505050565b60006020828403121561506a57600080fd5b8135613d6981615017565b6001600160401b038116811461176057600080fd5b60006020828403121561509c57600080fd5b8135613d6981615075565b6000602082840312156150b957600080fd5b5035919050565b6000806000606084860312156150d557600080fd5b83356150e081615017565b925060208401356150f081615017565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60405161016081016001600160401b038111828210171561513a5761513a615101565b60405290565b60405161014081016001600160401b038111828210171561513a5761513a615101565b604051601f8201601f191681016001600160401b038111828210171561518b5761518b615101565b604052919050565b60006001600160401b038211156151ac576151ac615101565b5060051b60200190565b600082601f8301126151c757600080fd5b813560206151dc6151d783615193565b615163565b82815260059290921b840181019181810190868411156151fb57600080fd5b8286015b8481101561521f57803561521281615017565b83529183019183016151ff565b509695505050505050565b6000806040838503121561523d57600080fd5b82356001600160401b038082111561525457600080fd5b615260868387016151b6565b935060209150818501358181111561527757600080fd5b85019050601f8101861361528a57600080fd5b80356152986151d782615193565b81815260059190911b820183019083810190888311156152b757600080fd5b928401925b828410156152d5578335825292840192908401906152bc565b80955050505050509250929050565b600080604083850312156152f757600080fd5b82359150602083013561530981615017565b809150509250929050565b60006001600160401b0382111561532d5761532d615101565b50601f01601f191660200190565b60006153496151d784615314565b905082815283838301111561535d57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261538557600080fd5b613d698383356020850161533b565b801515811461176057600080fd5b600080604083850312156153b557600080fd5b82356001600160401b038111156153cb57600080fd5b6153d785828601615374565b925050602083013561530981615394565b6000602082840312156153fa57600080fd5b81356001600160401b0381111561541057600080fd5b614d24848285016151b6565b600081518084526020808501945080840160005b838110156154555781516001600160a01b031687529582019590820190600101615430565b509495945050505050565b604081526000615473604083018561541c565b82810360208481019190915284518083528582019282019060005b818110156154aa5784518352938301939183019160010161548e565b5090979650505050505050565b600080604083850312156154ca57600080fd5b82356154d581615017565b915060208301356001600160401b038111156154f057600080fd5b8301601f8101851361550157600080fd5b6155108582356020840161533b565b9150509250929050565b600082601f83011261552b57600080fd5b8135602061553b6151d783615193565b82815260059290921b8401810191818101908684111561555a57600080fd5b8286015b8481101561521f5780356001600160401b0381111561557d5760008081fd5b61558b8986838b0101615374565b84525091830191830161555e565b600080600080608085870312156155af57600080fd5b84356155ba81615394565b935060208501356001600160401b03808211156155d657600080fd5b6155e28883890161551a565b945060408701359150808211156155f857600080fd5b6156048883890161551a565b9350606087013591508082111561561a57600080fd5b506156278782880161551a565b91505092959194509250565b60006020828403121561564557600080fd5b81356001600160401b0381111561565b57600080fd5b614d2484828501615374565b6000806020838503121561567a57600080fd5b82356001600160401b038082111561569157600080fd5b818501915085601f8301126156a557600080fd5b8135818111156156b457600080fd5b8660208260051b85010111156156c957600080fd5b60209290920196919550909350505050565b602081526000613d69602083018461541c565b6000806040838503121561570157600080fd5b823561570c81615017565b9150602083013561530981615017565b600181811c9082168061573057607f821691505b60208210810361575057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156157f3576157f36157cb565b500390565b6000816000190483118215151615615812576158126157cb565b500290565b60008261583457634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561584c5761584c6157cb565b500190565b600060018201615863576158636157cb565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6040815260006159156040830185614fd8565b905082151560208301529392505050565b6020808252600c908201526b155b985d5d1a1bdc9a5e995960a21b604082015260600190565b6000825161595e818460208701614fac565b9190910192915050565b600082601f83011261597957600080fd5b81516159876151d782615314565b81815284602083860101111561599c57600080fd5b614d24826020830160208701614fac565b805161442581615017565b805161442581615075565b805161442581615394565b600061016082840312156159e157600080fd5b6159e9615117565b905081516001600160401b0380821115615a0257600080fd5b615a0e85838601615968565b8352615a1c602085016159b8565b6020840152615a2d604085016159b8565b604084015260608401516060840152615a48608085016159b8565b6080840152615a5960a085016159c3565b60a0840152615a6a60c085016159c3565b60c084015260e0840151915080821115615a8357600080fd5b615a8f85838601615968565b60e084015261010091508184015181811115615aaa57600080fd5b615ab686828701615968565b838501525061012091508184015181811115615ad157600080fd5b615add86828701615968565b838501525061014091508184015181811115615af857600080fd5b615b0486828701615968565b8385015250505092915050565b60008060408385031215615b2457600080fd5b82516001600160401b0380821115615b3b57600080fd5b908401906101408287031215615b5057600080fd5b615b58615140565b825182811115615b6757600080fd5b615b7388828601615968565b825250602083015182811115615b8857600080fd5b615b9488828601615968565b602083015250604083015182811115615bac57600080fd5b615bb888828601615968565b604083015250606083015182811115615bd057600080fd5b615bdc88828601615968565b606083015250608083015182811115615bf457600080fd5b615c0088828601615968565b60808301525060a083015182811115615c1857600080fd5b615c2488828601615968565b60a08301525060c083015182811115615c3c57600080fd5b615c4888828601615968565b60c08301525060e083015182811115615c6057600080fd5b615c6c88828601615968565b60e0830152506101008084015183811115615c8657600080fd5b615c9289828701615968565b828401525050610120615ca68185016159ad565b908201526020860151909450915080821115615cc157600080fd5b50615510858286016159ce565b60208082528181018390526000908460408401835b8681101561521f578235615cf681615017565b6001600160a01b031682529183019190830190600101615ce3565b600060208284031215615d2357600080fd5b8151613d6981615394565b600060208284031215615d4057600080fd5b5051919050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615e18816017850160208801614fac565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615e49816028840160208801614fac565b01602801949350505050565b600081615e6457615e646157cb565b50600019019056fe546f7563616e2050726f746f636f6c3a204261736520436172626f6e20546f6e6e65360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207c28064d1e71df1460c127c67f4b37227b10e3304bbf9bb3e723f66a5489ff8164736f6c634300080e0033496e697469616c697a61626c653a20636f6e747261637420697320616c726561
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.