Contract 0xA75453c61AdEA4db0a52AEDa47880f055bD3aF12 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x1a7c498527dd9fc25f0412a852a53056d95d8c046b4a113a9907049cddd0a4250x60806040199835932022-08-11 7:34:3250 days 8 hrs ago0x1dcb85efea6a3fb528d19b9174e88ee35bff540a IN  Create: STokensManager0 ETH0.016554639616 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xfa088063a157cc6540e058e4e7ad69ce84856821ae11b7f603bacd13702c3871270668372022-09-27 22:11:192 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xfa088063a157cc6540e058e4e7ad69ce84856821ae11b7f603bacd13702c3871270668372022-09-27 22:11:192 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xab9298ed4aad5fc9df91255520e3afc450c025bc479c6b9b6e3fbb70a046c664270665722022-09-27 22:08:092 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xab9298ed4aad5fc9df91255520e3afc450c025bc479c6b9b6e3fbb70a046c664270665722022-09-27 22:08:092 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xab9298ed4aad5fc9df91255520e3afc450c025bc479c6b9b6e3fbb70a046c664270665722022-09-27 22:08:092 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xf07ead15ba073404c9175be85200ed2ed9a59793ddbfe1adece5ed54eea4cbfa270664632022-09-27 22:06:482 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xf07ead15ba073404c9175be85200ed2ed9a59793ddbfe1adece5ed54eea4cbfa270664632022-09-27 22:06:482 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xf07ead15ba073404c9175be85200ed2ed9a59793ddbfe1adece5ed54eea4cbfa270664632022-09-27 22:06:482 days 18 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x3ede2178fbdb3e265d84ddfa0606e37183e6ac88a71849e862a1643b019c4655239381892022-09-10 12:22:5320 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x3ede2178fbdb3e265d84ddfa0606e37183e6ac88a71849e862a1643b019c4655239381892022-09-10 12:22:5320 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x182e420371e757e76c4079510178e0668eccc4a2faac2dbb53fabfd38420a6aa239379302022-09-10 12:21:3620 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x182e420371e757e76c4079510178e0668eccc4a2faac2dbb53fabfd38420a6aa239379302022-09-10 12:21:3620 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x640a7f860c4870e7ea96039cc084547caed71888f81027fb8a5347fd82f8e643239375982022-09-10 12:19:0420 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x640a7f860c4870e7ea96039cc084547caed71888f81027fb8a5347fd82f8e643239375982022-09-10 12:19:0420 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x1418adc574848bc75a390accaba074d5679d5f6ad34cbcb15e51ef555324dd95239372862022-09-10 12:17:2220 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x1418adc574848bc75a390accaba074d5679d5f6ad34cbcb15e51ef555324dd95239372862022-09-10 12:17:2220 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x3112abdbf8ecee5cab0d55ea4e6169f0e2fc61a32ef06e18becb0429db8048fe239370512022-09-10 12:15:4820 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x3112abdbf8ecee5cab0d55ea4e6169f0e2fc61a32ef06e18becb0429db8048fe239370512022-09-10 12:15:4820 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x9ab43927d33a6987eed143699db7f5c1f2d3a94bea78e919c6eaf9ee98c966a0239368412022-09-10 12:14:0820 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x9ab43927d33a6987eed143699db7f5c1f2d3a94bea78e919c6eaf9ee98c966a0239368412022-09-10 12:14:0820 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xc30c356eba7581aacb5093880605f2c17b4f6ac28acdac11447566f94ff6e0e7239365552022-09-10 12:11:2420 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xc30c356eba7581aacb5093880605f2c17b4f6ac28acdac11447566f94ff6e0e7239365552022-09-10 12:11:2420 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xdff4839d7d02295a78eb2140324dd0b3e9b6c55ccb98224d4da6486e6f8351b8239364132022-09-10 12:10:0920 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0xdff4839d7d02295a78eb2140324dd0b3e9b6c55ccb98224d4da6486e6f8351b8239364132022-09-10 12:10:0920 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
0x5241ba512ec24f71bdaf70b00dfcbdd9218c9768efd7bb39c9e92dc05d62dd5d239362782022-09-10 12:08:3520 days 4 hrs ago 0x40d999931f7055f670511860e24624939e71a96a 0xa75453c61adea4db0a52aeda47880f055bd3af120 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
STokensManager

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 35 : STokensManager.sol
// SPDX-License-Identifier: MPL-2.0
pragma solidity =0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "../../interface/ISTokensManager.sol";
import "../../interface/ITokenURIDescriptor.sol";
import "../../interface/IAddressRegistry.sol";
import "../../interface/ILockup.sol";
import "../../interface/IProperty.sol";
import "../common/registry/InitializableUsingRegistry.sol";
import "./STokensDescriptor.sol";

contract STokensManager is
	ISTokensManager,
	STokensDescriptor,
	IERC721EnumerableUpgradeable,
	ERC721Upgradeable,
	InitializableUsingRegistry
{
	Counters.Counter private tokenIdCounter;
	mapping(bytes32 => bytes) private bytesStorage;
	mapping(address => uint256[]) private tokenIdsMapOfProperty;
	mapping(address => EnumerableSet.UintSet) private tokenIdsMapOfOwner;
	mapping(uint256 => string) private tokenUriImage;
	mapping(uint256 => bool) public override isFreezed;
	mapping(address => address) public override descriptorOf;
	mapping(uint256 => bytes32) public override payloadOf;
	address private proxyAdmin;

	using Counters for Counters.Counter;
	using EnumerableSet for EnumerableSet.UintSet;

	modifier onlyLockup() {
		require(
			registry().registries("Lockup") == _msgSender(),
			"illegal access"
		);
		_;
	}

	modifier onlyAuthor(uint256 _tokenId) {
		StakingPositions memory currentPosition = getStoragePositions(_tokenId);
		address author = IProperty(currentPosition.property).author();
		require(author == _msgSender(), "illegal access");
		_;
	}

	modifier onlyPropertyAuthor(address _property) {
		address author = IProperty(_property).author();
		require(author == _msgSender(), "illegal access");
		_;
	}

	function initialize(address _registry) external initializer {
		__ERC721_init("Dev Protocol sTokens V1", "DEV-STOKENS-V1");
		__UsingRegistry_init(_registry);
	}

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

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

	/**
	 * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
	 */
	function tokenOfOwnerByIndex(address _owner, uint256 index)
		public
		view
		virtual
		override
		returns (uint256)
	{
		// solhint-disable-next-line reason-string
		require(
			index < tokenIdsMapOfOwner[_owner].length(),
			"ERC721Enumerable: owner index out of bounds"
		);
		return tokenIdsMapOfOwner[_owner].at(index);
	}

	/**
	 * @dev See {IERC721Enumerable-tokenByIndex}.
	 */
	function tokenByIndex(uint256 index)
		public
		view
		virtual
		override
		returns (uint256)
	{
		// solhint-disable-next-line reason-string
		require(
			index < tokenIdCounter.current(),
			"ERC721Enumerable: global index out of bounds"
		);
		return index + 1;
	}

	function owner() external view returns (address) {
		return ProxyAdmin(proxyAdmin).owner();
	}

	function setProxyAdmin(address _proxyAdmin) external {
		require(proxyAdmin == address(0), "already set");
		proxyAdmin = _proxyAdmin;
	}

	function tokenURI(uint256 _tokenId)
		public
		view
		override
		returns (string memory)
	{
		uint256 curretnTokenId = tokenIdCounter.current();
		require(_tokenId <= curretnTokenId, "not found");
		StakingPositions memory positons = getStoragePositions(_tokenId);
		Rewards memory tokenRewards = _rewards(_tokenId);
		address _owner = ownerOf(_tokenId);
		return
			_tokenURI(
				_tokenId,
				_owner,
				positons,
				tokenRewards,
				payloadOf[_tokenId]
			);
	}

	function tokenURISim(
		uint256 _tokenId,
		address _owner,
		StakingPositions memory _positions,
		Rewards memory _rewardsArg,
		bytes32 _payload
	) external view override returns (string memory) {
		return _tokenURI(_tokenId, _owner, _positions, _rewardsArg, _payload);
	}

	function currentIndex() external view override returns (uint256) {
		return tokenIdCounter.current();
	}

	function mint(
		address _owner,
		address _property,
		uint256 _amount,
		uint256 _price,
		bytes32 _payload
	) external override onlyLockup returns (uint256 tokenId_) {
		tokenIdCounter.increment();
		uint256 currentId = tokenIdCounter.current();
		_mint(_owner, currentId);
		emit Minted(currentId, _owner, _property, _amount, _price);
		StakingPositions memory newPosition = StakingPositions(
			_property,
			_amount,
			_price,
			0,
			0
		);
		// TODO V3 block number and history
		setStoragePositions(currentId, newPosition);
		tokenIdsMapOfProperty[_property].push(currentId);

		address descriptor = descriptorOf[_property];
		if (descriptor != address(0)) {
			require(
				ITokenURIDescriptor(descriptor).onBeforeMint(
					currentId,
					_owner,
					newPosition,
					_payload
				),
				"failed to call onBeforeMint"
			);
		}
		payloadOf[currentId] = _payload;

		return currentId;
	}

	function update(
		uint256 _tokenId,
		uint256 _amount,
		uint256 _price,
		uint256 _cumulativeReward,
		uint256 _pendingReward
	) external override onlyLockup returns (bool) {
		StakingPositions memory currentPosition = getStoragePositions(_tokenId);
		currentPosition.amount = _amount;
		currentPosition.price = _price;
		currentPosition.cumulativeReward = _cumulativeReward;
		currentPosition.pendingReward = _pendingReward;
		setStoragePositions(_tokenId, currentPosition);
		emit Updated(
			_tokenId,
			_amount,
			_price,
			_cumulativeReward,
			_pendingReward
		);
		return true;
	}

	function setTokenURIImage(uint256 _tokenId, string memory _data)
		external
		override
		onlyAuthor(_tokenId)
	{
		require(isFreezed[_tokenId] == false, "freezed");
		tokenUriImage[_tokenId] = _data;
	}

	function setTokenURIDescriptor(address _property, address _descriptor)
		external
		override
		onlyPropertyAuthor(_property)
	{
		descriptorOf[_property] = _descriptor;
	}

	function freezeTokenURI(uint256 _tokenId)
		external
		override
		onlyAuthor(_tokenId)
	{
		require(isFreezed[_tokenId] == false, "already freezed");
		string memory tokeUri = tokenUriImage[_tokenId];
		require(bytes(tokeUri).length != 0, "no data");
		isFreezed[_tokenId] = true;
		emit Freezed(_tokenId, _msgSender());
	}

	function positions(uint256 _tokenId)
		external
		view
		override
		returns (StakingPositions memory)
	{
		StakingPositions memory currentPosition = getStoragePositions(_tokenId);
		return currentPosition;
	}

	function rewards(uint256 _tokenId)
		external
		view
		override
		returns (Rewards memory)
	{
		return _rewards(_tokenId);
	}

	function positionsOfProperty(address _property)
		external
		view
		override
		returns (uint256[] memory)
	{
		return tokenIdsMapOfProperty[_property];
	}

	function positionsOfOwner(address _owner)
		external
		view
		override
		returns (uint256[] memory)
	{
		return tokenIdsMapOfOwner[_owner].values();
	}

	function _rewards(uint256 _tokenId) private view returns (Rewards memory) {
		uint256 withdrawableReward = ILockup(registry().registries("Lockup"))
			.calculateWithdrawableInterestAmountByPosition(_tokenId);
		StakingPositions memory currentPosition = getStoragePositions(_tokenId);
		uint256 cumulativeReward = currentPosition.cumulativeReward;
		uint256 entireReward = cumulativeReward + withdrawableReward;

		return Rewards(entireReward, cumulativeReward, withdrawableReward);
	}

	function _tokenURI(
		uint256 _tokenId,
		address _owner,
		StakingPositions memory _positions,
		Rewards memory _rewardsArg,
		bytes32 _payload
	) private view returns (string memory) {
		string memory _tokeUriImage = tokenUriImage[_tokenId];
		if (bytes(_tokeUriImage).length == 0) {
			address descriptor = descriptorOf[_positions.property];
			if (descriptor != address(0)) {
				_tokeUriImage = ITokenURIDescriptor(descriptor).image(
					_tokenId,
					_owner,
					_positions,
					_rewardsArg,
					_payload
				);
			}
		}
		return
			getTokenURI(
				_positions.property,
				_positions.amount,
				_positions.cumulativeReward,
				_tokeUriImage
			);
	}

	function getStoragePositions(uint256 _tokenId)
		private
		view
		returns (StakingPositions memory)
	{
		bytes32 key = getStoragePositionsKey(_tokenId);
		bytes memory tmp = bytesStorage[key];
		return abi.decode(tmp, (StakingPositions));
	}

	function setStoragePositions(
		uint256 _tokenId,
		StakingPositions memory _position
	) private {
		bytes32 key = getStoragePositionsKey(_tokenId);
		bytes memory tmp = abi.encode(_position);
		bytesStorage[key] = tmp;
	}

	function getStoragePositionsKey(uint256 _tokenId)
		private
		pure
		returns (bytes32)
	{
		return keccak256(abi.encodePacked("_positions", _tokenId));
	}

	function _beforeTokenTransfer(
		address from,
		address to,
		uint256 tokenId
	) internal virtual override {
		super._beforeTokenTransfer(from, to, tokenId);

		if (from == address(0)) {
			// mint
			tokenIdsMapOfOwner[to].add(tokenId);
		} else if (to == address(0)) {
			// burn
			revert("s tokens is not burned");
		} else if (to != from) {
			tokenIdsMapOfOwner[from].remove(tokenId);
			tokenIdsMapOfOwner[to].add(tokenId);
		}
	}
}

File 2 of 35 : STokensDescriptor.sol
// SPDX-License-Identifier: MPL-2.0
pragma solidity =0.8.9;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@devprotocol/util-contracts/contracts/utils/AddressLib.sol";
import "@devprotocol/util-contracts/contracts/utils/Base64.sol";
import "../../interface/ISTokensManager.sol";

library DecimalString {
	function decimalString(uint256 number, uint8 decimals)
		internal
		pure
		returns (string memory)
	{
		uint256 tenPowDecimals = 10**decimals;

		uint256 temp = number;
		uint8 digits;
		uint8 numSigfigs;
		while (temp != 0) {
			if (numSigfigs > 0) {
				// count all digits preceding least significant figure
				numSigfigs++;
			} else if (temp % 10 != 0) {
				numSigfigs++;
			}
			digits++;
			temp /= 10;
		}

		DecimalStringParams memory params;
		if ((digits - numSigfigs) >= decimals) {
			// no decimals, ensure we preserve all trailing zeros
			params.sigfigs = number / tenPowDecimals;
			params.sigfigIndex = digits - decimals;
			params.bufferLength = params.sigfigIndex;
		} else {
			// chop all trailing zeros for numbers with decimals
			params.sigfigs = number / (10**(digits - numSigfigs));
			if (tenPowDecimals > number) {
				// number is less tahn one
				// in this case, there may be leading zeros after the decimal place
				// that need to be added

				// offset leading zeros by two to account for leading '0.'
				params.zerosStartIndex = 2;
				params.zerosEndIndex = decimals - digits + 2;
				params.sigfigIndex = numSigfigs + params.zerosEndIndex;
				params.bufferLength = params.sigfigIndex;
				params.isLessThanOne = true;
			} else {
				// In this case, there are digits before and
				// after the decimal place
				params.sigfigIndex = numSigfigs + 1;
				params.decimalIndex = digits - decimals + 1;
			}
		}
		params.bufferLength = params.sigfigIndex;
		return generateDecimalString(params);
	}

	struct DecimalStringParams {
		// significant figures of decimal
		uint256 sigfigs;
		// length of decimal string
		uint8 bufferLength;
		// ending index for significant figures (funtion works backwards when copying sigfigs)
		uint8 sigfigIndex;
		// index of decimal place (0 if no decimal)
		uint8 decimalIndex;
		// start index for trailing/leading 0's for very small/large numbers
		uint8 zerosStartIndex;
		// end index for trailing/leading 0's for very small/large numbers
		uint8 zerosEndIndex;
		// true if decimal number is less than one
		bool isLessThanOne;
	}

	function generateDecimalString(DecimalStringParams memory params)
		private
		pure
		returns (string memory)
	{
		bytes memory buffer = new bytes(params.bufferLength);
		if (params.isLessThanOne) {
			buffer[0] = "0";
			buffer[1] = ".";
		}

		// add leading/trailing 0's
		for (
			uint256 zerosCursor = params.zerosStartIndex;
			zerosCursor < params.zerosEndIndex;
			zerosCursor++
		) {
			buffer[zerosCursor] = bytes1(uint8(48));
		}
		// add sigfigs
		while (params.sigfigs > 0) {
			if (
				params.decimalIndex > 0 &&
				params.sigfigIndex == params.decimalIndex
			) {
				buffer[--params.sigfigIndex] = ".";
			}
			buffer[--params.sigfigIndex] = bytes1(
				uint8(uint256(48) + (params.sigfigs % 10))
			);
			params.sigfigs /= 10;
		}
		return string(buffer);
	}
}

contract STokensDescriptor {
	using Base64 for bytes;
	using AddressLib for address;
	using Strings for uint256;
	using DecimalString for uint256;

	function getTokenURI(
		address _property,
		uint256 _amount,
		uint256 _cumulativeReward,
		string memory _tokeUriImage
	) internal pure returns (string memory) {
		string memory amount = _amount.decimalString(18);
		string memory name = string(
			abi.encodePacked(
				"Dev Protocol sTokens - ",
				_property.toChecksumString(),
				" - ",
				amount,
				" DEV",
				" - ",
				_cumulativeReward.toString()
			)
		);
		string memory description = string(
			abi.encodePacked(
				"This NFT represents a staking position in a Dev Protocol Property tokens. The owner of this NFT can modify or redeem the position.\\nProperty Address: ",
				_property.toChecksumString(),
				"\\n\\n\xE2\x9A\xA0 DISCLAIMER: Due diligence is imperative when assessing this NFT. Make sure token addresses match the expected tokens, as token symbols may be imitated."
			)
		);
		string memory attributes = string(
			abi.encodePacked(
				"[",
				// solhint-disable-next-line quotes
				'{"trait_type":"Destination", "value":"',
				_property.toChecksumString(),
				// solhint-disable-next-line quotes
				'"},',
				// solhint-disable-next-line quotes
				'{"trait_type":"Locked Amount", "display_type":"number", "value":',
				amount,
				// solhint-disable-next-line quotes
				"}",
				"]"
			)
		);
		string memory image = bytes(_tokeUriImage).length == 0
			? string(
				abi.encodePacked(
					"data:image/svg+xml;base64,",
					bytes(
						abi
							.encodePacked(
								// solhint-disable-next-line quotes
								'<svg xmlns="http://www.w3.org/2000/svg" width="290" height="500" viewBox="0 0 290 500" fill="none"><rect width="290" height="500" fill="url(#paint0_linear)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M192 203H168.5V226.5V250H145H121.5V226.5V203H98H74.5V226.5V250V273.5H51V297H74.5H98V273.5H121.5H145H168.5H192V250V226.5H215.5H239V203H215.5H192Z" fill="white"/><text fill="white" xml:space="preserve" style="white-space: pre" font-family="monospace" font-size="11" letter-spacing="0em"><tspan x="27.4072" y="333.418">',
								_property.toChecksumString(),
								// solhint-disable-next-line quotes
								'</tspan></text><defs><linearGradient id="paint0_linear" x1="0" y1="0" x2="290" y2="500" gradientUnits="userSpaceOnUse"><stop stop-color="#00D0FD"/><stop offset="0.151042" stop-color="#4889F5"/><stop offset="0.552083" stop-color="#D500E6"/><stop offset="1" stop-color="#FF3815"/></linearGradient></defs></svg>'
							)
							.encode()
					)
				)
			)
			: _tokeUriImage;
		return
			string(
				abi.encodePacked(
					"data:application/json;base64,",
					abi
						.encodePacked(
							// solhint-disable-next-line quotes
							'{"name":"',
							name,
							// solhint-disable-next-line quotes
							'", "description":"',
							description,
							// solhint-disable-next-line quotes
							'", "image": "',
							image,
							// solhint-disable-next-line quotes
							'", "attributes":',
							attributes,
							"}"
						)
						.encode()
				)
			);
	}
}

File 3 of 35 : InitializableUsingRegistry.sol
// SPDX-License-Identifier: MPL-2.0
pragma solidity =0.8.9;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../../../interface/IAddressRegistry.sol";

/**
 * Module for using AddressRegistry contracts.
 */
abstract contract InitializableUsingRegistry is Initializable {
	address private _registry;

	/**
	 * Initialize the argument as AddressRegistry address.
	 */
	/* solhint-disable func-name-mixedcase */
	function __UsingRegistry_init(address _addressRegistry)
		internal
		initializer
	{
		_registry = _addressRegistry;
	}

	/**
	 * Returns the latest AddressRegistry instance.
	 */
	function registry() internal view returns (IAddressRegistry) {
		return IAddressRegistry(_registry);
	}

	/**
	 * Returns the AddressRegistry address.
	 */
	function registryAddress() external view returns (address) {
		return _registry;
	}
}

File 4 of 35 : ITokenURIDescriptor.sol
// SPDX-License-Identifier: MPL-2.0
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

import "./ISTokensManager.sol";

interface ITokenURIDescriptor {
	/*
	 * @dev get image from custom descriopro
	 * @param _tokenId token id
	 * @param _owner owner address
	 * @param _positions staking position
	 * @param _rewards rewards
	 * @param _payload token payload
	 * @return string image information
	 */
	function image(
		uint256 _tokenId,
		address _owner,
		ISTokensManager.StakingPositions memory _positions,
		ISTokensManager.Rewards memory _rewards,
		bytes32 _payload
	) external view returns (string memory);

	/*
	 * @dev hooks and run a side-effect before minted
	 * @param _tokenId token id
	 * @param _owner owner address
	 * @param _positions staking position
	 * @param _payload token payload
	 * @return bool success or failure
	 */
	function onBeforeMint(
		uint256 _tokenId,
		address _owner,
		ISTokensManager.StakingPositions memory _positions,
		bytes32 _payload
	) external returns (bool);
}

File 5 of 35 : ISTokensManager.sol
// SPDX-License-Identifier: MPL-2.0
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

interface ISTokensManager {
	/*
	 * @dev Struct to declares a staking position.
	 * @param owner The address of the owner of the new staking position
	 * @param property The address of the Property as the staking destination
	 * @param amount The amount of the new staking position
	 * @param price The latest unit price of the cumulative staking reward
	 * @param cumulativeReward The cumulative withdrawn reward amount
	 * @param pendingReward The pending withdrawal reward amount amount
	 */
	struct StakingPositions {
		address property;
		uint256 amount;
		uint256 price;
		uint256 cumulativeReward;
		uint256 pendingReward;
	}

	/*
	 * @dev Struct to declares staking rewards.
	 * @param entireReward The reward amount of adding the cumulative withdrawn amount
	 to the withdrawable amount
	 * @param cumulativeReward The cumulative withdrawn reward amount
	 * @param withdrawableReward The withdrawable reward amount
	 */
	struct Rewards {
		uint256 entireReward;
		uint256 cumulativeReward;
		uint256 withdrawableReward;
	}

	/*
	 * @dev The event fired when a token is minted.
	 * @param tokenId The ID of the created new staking position
	 * @param owner The address of the owner of the new staking position
	 * @param property The address of the Property as the staking destination
	 * @param amount The amount of the new staking position
	 * @param price The latest unit price of the cumulative staking reward
	 */
	event Minted(
		uint256 tokenId,
		address owner,
		address property,
		uint256 amount,
		uint256 price
	);

	/*
	 * @dev The event fired when a token is updated.
	 * @param tokenId The ID of the staking position
	 * @param amount The new staking amount
	 * @param price The latest unit price of the cumulative staking reward
	 * This value equals the 3rd return value of the Lockup.calculateCumulativeRewardPrices
	 * @param cumulativeReward The cumulative withdrawn reward amount
	 * @param pendingReward The pending withdrawal reward amount amount
	 */
	event Updated(
		uint256 tokenId,
		uint256 amount,
		uint256 price,
		uint256 cumulativeReward,
		uint256 pendingReward
	);

	/*
	 * @dev The event fired when toke uri freezed.
	 * @param tokenId The ID of the freezed token uri
	 * @param freezingUser user of freezed token uri
	 */
	event Freezed(uint256 tokenId, address freezingUser);

	/*
	 * @dev Creates the new staking position for the caller.
	 * Mint must be called from the Lockup contract.
	 * @param _owner The address of the owner of the new staking position
	 * @param _property The address of the Property as the staking destination
	 * @param _amount The amount of the new staking position
	 * @param _price The latest unit price of the cumulative staking reward
	 * @param _payload additional payload
	 * @return uint256 The ID of the created new staking position
	 */
	function mint(
		address _owner,
		address _property,
		uint256 _amount,
		uint256 _price,
		bytes32 _payload
	) external returns (uint256);

	/*
	 * @dev Updates the existing staking position.
	 * Update must be called from the Lockup contract.
	 * @param _tokenId The ID of the staking position
	 * @param _amount The new staking amount
	 * @param _price The latest unit price of the cumulative staking reward
	 * This value equals the 3rd return value of the Lockup.calculateCumulativeRewardPrices
	 * @param _cumulativeReward The cumulative withdrawn reward amount
	 * @param _pendingReward The pending withdrawal reward amount amount
	 * @return bool On success, true will be returned
	 */
	function update(
		uint256 _tokenId,
		uint256 _amount,
		uint256 _price,
		uint256 _cumulativeReward,
		uint256 _pendingReward
	) external returns (bool);

	/*
	 * @dev set token uri information
	 * @param _tokenId The ID of the staking position
	 * @param _data set data
	 */
	function setTokenURIImage(uint256 _tokenId, string memory _data) external;

	/*
	 * @dev set token uri descriptor
	 * @param _property property address
	 * @param _descriptor descriptor address
	 */
	function setTokenURIDescriptor(address _property, address _descriptor)
		external;

	/*
	 * @dev freeze token uri data
	 * @param _tokenId The ID of the staking position
	 */
	function freezeTokenURI(uint256 _tokenId) external;

	/*
	 * @dev Gets the existing staking position.
	 * @param _tokenId The ID of the staking position
	 * @return StakingPositions staking positions
	 */
	function positions(uint256 _tokenId)
		external
		view
		returns (StakingPositions memory);

	/*
	 * @dev Get the freezed status.
	 * @param _tokenId The ID of the staking position
	 * @return bool If freezed, return true
	 */
	function isFreezed(uint256 _tokenId) external view returns (bool);

	/*
	 * @dev Gets the reward status of the staking position.
	 * @param _tokenId The ID of the staking position
	 * @return Rewards reward information
	 */
	function rewards(uint256 _tokenId) external view returns (Rewards memory);

	/*
	 * @dev get token ids by property
	 * @param _property property address
	 * @return uint256[] token id list
	 */
	function positionsOfProperty(address _property)
		external
		view
		returns (uint256[] memory);

	/*
	 * @dev get token ids by owner
	 * @param _owner owner address
	 * @return uint256[] token id list
	 */
	function positionsOfOwner(address _owner)
		external
		view
		returns (uint256[] memory);

	/*
	 * @dev get simulated token uri
	 * @param _tokenId token id
	 * @param _owner owner address
	 * @param _positions staking positions
	 * @param _rewards rewards
	 * @param _payload token payload
	 * @return string simulated token uri
	 */
	function tokenURISim(
		uint256 _tokenId,
		address _owner,
		StakingPositions memory _positions,
		Rewards memory _rewards,
		bytes32 _payload
	) external view returns (string memory);

	/*
	 * @dev get descriptor address
	 * @param _property property address
	 * @return address descriptor address
	 */
	function descriptorOf(address _property) external view returns (address);

	/*
	 * @dev get the payload
	 * @param _tokenId token id
	 * @return bytes32 stored payload
	 */
	function payloadOf(uint256 _tokenId) external view returns (bytes32);

	/*
	 * @dev get current token id
	 * @return uint256 current token id
	 */
	function currentIndex() external view returns (uint256);
}

File 6 of 35 : IProperty.sol
// SPDX-License-Identifier: MPL-2.0
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

interface IProperty {
	struct PropertyBalance {
		address account;
		uint256 balance;
	}

	event ChangeName(string _old, string _new);
	event ChangeSymbol(string _old, string _new);

	function author() external view returns (address);

	function changeName(string memory _name) external;

	function changeSymbol(string memory _symbol) external;

	function withdraw(address _sender, uint256 _value) external;

	function getBalances() external view returns (PropertyBalance[] memory);
}

File 7 of 35 : ILockup.sol
// SPDX-License-Identifier: MPL-2.0
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

interface ILockup {
	struct RewardPrices {
		uint256 reward;
		uint256 holders;
		uint256 interest;
		uint256 holdersCap;
	}

	struct LockedupProperty {
		address property;
		uint256 value;
	}

	event Lockedup(
		address indexed _from,
		address indexed _property,
		uint256 _value,
		uint256 _tokenId
	);
	event Withdrew(
		address indexed _from,
		address indexed _property,
		uint256 _value,
		uint256 _reward,
		uint256 _tokenId
	);

	event UpdateCap(uint256 _cap);

	function depositToProperty(
		address _property,
		uint256 _amount,
		bytes32 _payload
	) external returns (uint256);

	function depositToProperty(address _property, uint256 _amount)
		external
		returns (uint256);

	function depositToPosition(uint256 _tokenId, uint256 _amount)
		external
		returns (bool);

	function getLockedupProperties()
		external
		view
		returns (LockedupProperty[] memory);

	function update() external;

	function withdrawByPosition(uint256 _tokenId, uint256 _amount)
		external
		returns (bool);

	function calculateCumulativeRewardPrices()
		external
		view
		returns (
			uint256 _reward,
			uint256 _holders,
			uint256 _interest,
			uint256 _holdersCap
		);

	function calculateRewardAmount(address _property)
		external
		view
		returns (uint256, uint256);

	function totalLockedForProperty(address _property)
		external
		view
		returns (uint256);

	function totalLocked() external view returns (uint256);

	function calculateWithdrawableInterestAmountByPosition(uint256 _tokenId)
		external
		view
		returns (uint256);

	function cap() external view returns (uint256);

	function updateCap(uint256 _cap) external;
}

File 8 of 35 : IAddressRegistry.sol
// SPDX-License-Identifier: MPL-2.0
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

interface IAddressRegistry {
	function setRegistry(string memory _key, address _addr) external;

	function registries(string memory _key) external view returns (address);
}

File 9 of 35 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 10 of 35 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 11 of 35 : StorageSlot.sol
// SPDX-License-Identifier: MIT

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 StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

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

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

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

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

File 12 of 35 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 13 of 35 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 14 of 35 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @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,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 15 of 35 : TransparentUpgradeableProxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967Proxy.sol";

/**
 * @dev This contract implements a proxy that is upgradeable by an admin.
 *
 * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector
 * clashing], which can potentially be used in an attack, this contract uses the
 * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two
 * things that go hand in hand:
 *
 * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if
 * that call matches one of the admin functions exposed by the proxy itself.
 * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the
 * implementation. If the admin tries to call a function on the implementation it will fail with an error that says
 * "admin cannot fallback to proxy target".
 *
 * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing
 * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due
 * to sudden errors when trying to call a function from the proxy implementation.
 *
 * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,
 * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.
 */
contract TransparentUpgradeableProxy is ERC1967Proxy {
    /**
     * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and
     * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.
     */
    constructor(
        address _logic,
        address admin_,
        bytes memory _data
    ) payable ERC1967Proxy(_logic, _data) {
        assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
        _changeAdmin(admin_);
    }

    /**
     * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.
     */
    modifier ifAdmin() {
        if (msg.sender == _getAdmin()) {
            _;
        } else {
            _fallback();
        }
    }

    /**
     * @dev Returns the current admin.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function admin() external ifAdmin returns (address admin_) {
        admin_ = _getAdmin();
    }

    /**
     * @dev Returns the current implementation.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the
     * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function implementation() external ifAdmin returns (address implementation_) {
        implementation_ = _implementation();
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.
     */
    function changeAdmin(address newAdmin) external virtual ifAdmin {
        _changeAdmin(newAdmin);
    }

    /**
     * @dev Upgrade the implementation of the proxy.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.
     */
    function upgradeTo(address newImplementation) external ifAdmin {
        _upgradeToAndCall(newImplementation, bytes(""), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified
     * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the
     * proxied contract.
     *
     * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.
     */
    function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
        _upgradeToAndCall(newImplementation, data, true);
    }

    /**
     * @dev Returns the current admin.
     */
    function _admin() internal view virtual returns (address) {
        return _getAdmin();
    }

    /**
     * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.
     */
    function _beforeFallback() internal virtual override {
        require(msg.sender != _getAdmin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target");
        super._beforeFallback();
    }
}

File 16 of 35 : ProxyAdmin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./TransparentUpgradeableProxy.sol";
import "../../access/Ownable.sol";

/**
 * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an
 * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.
 */
contract ProxyAdmin is Ownable {
    /**
     * @dev Returns the current implementation of `proxy`.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("implementation()")) == 0x5c60da1b
        (bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Returns the current admin of `proxy`.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {
        // We need to manually run the static call since the getter cannot be flagged as view
        // bytes4(keccak256("admin()")) == 0xf851a440
        (bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440");
        require(success);
        return abi.decode(returndata, (address));
    }

    /**
     * @dev Changes the admin of `proxy` to `newAdmin`.
     *
     * Requirements:
     *
     * - This contract must be the current admin of `proxy`.
     */
    function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {
        proxy.changeAdmin(newAdmin);
    }

    /**
     * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {
        proxy.upgradeTo(implementation);
    }

    /**
     * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See
     * {TransparentUpgradeableProxy-upgradeToAndCall}.
     *
     * Requirements:
     *
     * - This contract must be the admin of `proxy`.
     */
    function upgradeAndCall(
        TransparentUpgradeableProxy proxy,
        address implementation,
        bytes memory data
    ) public payable virtual onlyOwner {
        proxy.upgradeToAndCall{value: msg.value}(implementation, data);
    }
}

File 17 of 35 : IBeacon.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @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);
}

File 18 of 35 : Proxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // Copy msg.data. We take full control of memory in this inline assembly
            // block because it will not return to Solidity code. We overwrite the
            // Solidity scratch pad at memory position 0.
            calldatacopy(0, 0, calldatasize())

            // Call the implementation.
            // out and outsize are 0 because we don't know the size yet.
            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)

            // Copy the returned data.
            returndatacopy(0, 0, returndatasize())

            switch result
            // delegatecall returns 0 on error.
            case 0 {
                revert(0, returndatasize())
            }
            default {
                return(0, returndatasize())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internall call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overriden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}

File 19 of 35 : ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.2;

import "../beacon/IBeacon.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.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 ERC1967Upgrade {
    // 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 StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlot.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) {
            Address.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            Address.functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            Address.functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @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 StorageSlot.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");
        StorageSlot.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 StorageSlot.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            Address.isContract(IBeacon(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlot.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) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        }
    }
}

File 20 of 35 : ERC1967Proxy.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../Proxy.sol";
import "./ERC1967Upgrade.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 */
contract ERC1967Proxy is Proxy, ERC1967Upgrade {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded
     * function call, and allows initializating the storage of the proxy like a Solidity constructor.
     */
    constructor(address _logic, bytes memory _data) payable {
        assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
        _upgradeToAndCall(_logic, _data, false);
    }

    /**
     * @dev Returns the current implementation address.
     */
    function _implementation() internal view virtual override returns (address impl) {
        return ERC1967Upgrade._getImplementation();
    }
}

File 21 of 35 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

pragma solidity ^0.8.0;

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

File 23 of 35 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 24 of 35 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 25 of 35 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __Context_init_unchained();
    }

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 26 of 35 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 27 of 35 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 28 of 35 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 29 of 35 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721Enumerable_init_unchained();
    }

    function __ERC721Enumerable_init_unchained() internal initializer {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721Upgradeable.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
    uint256[46] private __gap;
}

File 30 of 35 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 31 of 35 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 32 of 35 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal initializer {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal initializer {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` 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 tokenId
    ) internal virtual {}
    uint256[44] private __gap;
}

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

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {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.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

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

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

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 34 of 35 : Base64.sol
// SPDX-License-Identifier: MPL-2.0
pragma solidity ^0.8.0;

// see https://github.com/Brechtpd/base64/blob/main/base64.sol
library Base64 {
	string internal constant TABLE =
		"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

	function encode(bytes memory data) internal pure returns (string memory) {
		if (data.length == 0) return "";

		// load the table into memory
		string memory table = TABLE;

		// multiply by 4/3 rounded up
		uint256 encodedLen = 4 * ((data.length + 2) / 3);

		// add some extra buffer at the end required for the writing
		string memory result = new string(encodedLen + 32);

		// solhint-disable-next-line no-inline-assembly
		assembly {
			// set the actual output length
			mstore(result, encodedLen)

			// prepare the lookup table
			let tablePtr := add(table, 1)

			// input ptr
			let dataPtr := data
			let endPtr := add(dataPtr, mload(data))

			// result ptr, jump over length
			let resultPtr := add(result, 32)

			// run over the input, 3 bytes at a time
			for {

			} lt(dataPtr, endPtr) {

			} {
				dataPtr := add(dataPtr, 3)

				// read 3 bytes
				let input := mload(dataPtr)

				// write 4 characters
				mstore(
					resultPtr,
					shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F))))
				)
				resultPtr := add(resultPtr, 1)
				mstore(
					resultPtr,
					shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F))))
				)
				resultPtr := add(resultPtr, 1)
				mstore(
					resultPtr,
					shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F))))
				)
				resultPtr := add(resultPtr, 1)
				mstore(
					resultPtr,
					shl(248, mload(add(tablePtr, and(input, 0x3F))))
				)
				resultPtr := add(resultPtr, 1)
			}

			// padding with '='
			switch mod(mload(data), 3)
			case 1 {
				mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
			}
			case 2 {
				mstore(sub(resultPtr, 1), shl(248, 0x3d))
			}
		}

		return result;
	}
}

File 35 of 35 : AddressLib.sol
// SPDX-License-Identifier: MPL-2.0
pragma solidity ^0.8.0;

// see https://ethereum.stackexchange.com/questions/63908/address-checksum-solidity-implementation
library AddressLib {
	function toChecksumString(address account)
		internal
		pure
		returns (string memory asciiString)
	{
		// convert the account argument from address to bytes.
		bytes20 data = bytes20(account);

		// create an in-memory fixed-size bytes array.
		bytes memory asciiBytes = new bytes(40);

		// declare variable types.
		uint8 b;
		uint8 leftNibble;
		uint8 rightNibble;
		bool leftCaps;
		bool rightCaps;
		uint8 asciiOffset;

		// get the capitalized characters in the actual checksum.
		bool[40] memory caps = _toChecksumCapsFlags(account);

		// iterate over bytes, processing left and right nibble in each iteration.
		for (uint256 i = 0; i < data.length; i++) {
			// locate the byte and extract each nibble.
			b = uint8(uint160(data) / (2**(8 * (19 - i))));
			leftNibble = b / 16;
			rightNibble = b - 16 * leftNibble;

			// locate and extract each capitalization status.
			leftCaps = caps[2 * i];
			rightCaps = caps[2 * i + 1];

			// get the offset from nibble value to ascii character for left nibble.
			asciiOffset = _getAsciiOffset(leftNibble, leftCaps);

			// add the converted character to the byte array.
			asciiBytes[2 * i] = bytes1(leftNibble + asciiOffset)[0];

			// get the offset from nibble value to ascii character for right nibble.
			asciiOffset = _getAsciiOffset(rightNibble, rightCaps);

			// add the converted character to the byte array.
			asciiBytes[2 * i + 1] = bytes1(rightNibble + asciiOffset)[0];
		}

		return string(abi.encodePacked("0x", string(asciiBytes)));
	}

	function _toChecksumCapsFlags(address account)
		private
		pure
		returns (bool[40] memory characterCapitalized)
	{
		// convert the address to bytes.
		bytes20 a = bytes20(account);

		// hash the address (used to calculate checksum).
		bytes32 b = keccak256(abi.encodePacked(_toAsciiString(a)));

		// declare variable types.
		uint8 leftNibbleAddress;
		uint8 rightNibbleAddress;
		uint8 leftNibbleHash;
		uint8 rightNibbleHash;

		// iterate over bytes, processing left and right nibble in each iteration.
		for (uint256 i; i < a.length; i++) {
			// locate the byte and extract each nibble for the address and the hash.
			rightNibbleAddress = uint8(a[i]) % 16;
			leftNibbleAddress = (uint8(a[i]) - rightNibbleAddress) / 16;
			rightNibbleHash = uint8(b[i]) % 16;
			leftNibbleHash = (uint8(b[i]) - rightNibbleHash) / 16;

			characterCapitalized[2 * i] = (leftNibbleAddress > 9 &&
				leftNibbleHash > 7);
			characterCapitalized[2 * i + 1] = (rightNibbleAddress > 9 &&
				rightNibbleHash > 7);
		}
	}

	function _getAsciiOffset(uint8 nibble, bool caps)
		private
		pure
		returns (uint8 offset)
	{
		// to convert to ascii characters, add 48 to 0-9, 55 to A-F, & 87 to a-f.
		if (nibble < 10) {
			offset = 48;
		} else if (caps) {
			offset = 55;
		} else {
			offset = 87;
		}
	}

	function _toAsciiString(bytes20 data)
		private
		pure
		returns (string memory asciiString)
	{
		// create an in-memory fixed-size bytes array.
		bytes memory asciiBytes = new bytes(40);

		// declare variable types.
		uint8 b;
		uint8 leftNibble;
		uint8 rightNibble;

		// iterate over bytes, processing left and right nibble in each iteration.
		for (uint256 i = 0; i < data.length; i++) {
			// locate the byte and extract each nibble.
			b = uint8(uint160(data) / (2**(8 * (19 - i))));
			leftNibble = b / 16;
			rightNibble = b - 16 * leftNibble;

			// to convert to ascii characters, add 48 to 0-9 and 87 to a-f.
			asciiBytes[2 * i] = bytes1(
				leftNibble + (leftNibble < 10 ? 48 : 87)
			)[0];
			asciiBytes[2 * i + 1] = bytes1(
				rightNibble + (rightNibble < 10 ? 48 : 87)
			)[0];
		}

		return string(asciiBytes);
	}
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"freezingUser","type":"address"}],"name":"Freezed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"property","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cumulativeReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pendingReward","type":"uint256"}],"name":"Updated","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"descriptorOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"freezeTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isFreezed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_property","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes32","name":"_payload","type":"bytes32"}],"name":"mint","outputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payloadOf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"positions","outputs":[{"components":[{"internalType":"address","name":"property","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"cumulativeReward","type":"uint256"},{"internalType":"uint256","name":"pendingReward","type":"uint256"}],"internalType":"struct ISTokensManager.StakingPositions","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"positionsOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_property","type":"address"}],"name":"positionsOfProperty","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"rewards","outputs":[{"components":[{"internalType":"uint256","name":"entireReward","type":"uint256"},{"internalType":"uint256","name":"cumulativeReward","type":"uint256"},{"internalType":"uint256","name":"withdrawableReward","type":"uint256"}],"internalType":"struct ISTokensManager.Rewards","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proxyAdmin","type":"address"}],"name":"setProxyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_property","type":"address"},{"internalType":"address","name":"_descriptor","type":"address"}],"name":"setTokenURIDescriptor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_data","type":"string"}],"name":"setTokenURIImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"},{"components":[{"internalType":"address","name":"property","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"cumulativeReward","type":"uint256"},{"internalType":"uint256","name":"pendingReward","type":"uint256"}],"internalType":"struct ISTokensManager.StakingPositions","name":"_positions","type":"tuple"},{"components":[{"internalType":"uint256","name":"entireReward","type":"uint256"},{"internalType":"uint256","name":"cumulativeReward","type":"uint256"},{"internalType":"uint256","name":"withdrawableReward","type":"uint256"}],"internalType":"struct ISTokensManager.Rewards","name":"_rewardsArg","type":"tuple"},{"internalType":"bytes32","name":"_payload","type":"bytes32"}],"name":"tokenURISim","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_cumulativeReward","type":"uint256"},{"internalType":"uint256","name":"_pendingReward","type":"uint256"}],"name":"update","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50614840806100206000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80636352211e1161011a578063bba1b3fa116100ad578063d81ce7451161007c578063d81ce7451461048a578063e985e9c51461049d578063ed9aab51146104d9578063f301af42146104ea578063f96742bc1461050a57600080fd5b8063bba1b3fa14610428578063bff92b5e14610451578063c4d66de814610464578063c87b56dd1461047757600080fd5b806395d89b41116100e957806395d89b41146103da57806399fbab88146103e2578063a22cb46514610402578063b88d4fde1461041557600080fd5b80636352211e1461039957806370a08231146103ac57806386904ccf146103bf5780638da5cb5b146103d257600080fd5b806323b872dd1161019d5780633fb3a6c31161016c5780633fb3a6c31461031d57806340565efa1461033d57806342842e0e1461036057806347c02661146103735780634f6ccce71461038657600080fd5b806323b872dd146102e457806326987b60146102885780632f745c59146102f7578063385c0eb01461030a57600080fd5b806318160ddd116101d957806318160ddd146102885780631f8d009e1461029e5780631fd40887146102b157806320d7b327146102d157600080fd5b806301ffc9a71461020b57806306fdde0314610233578063081812fc14610248578063095ea7b314610273575b600080fd5b61021e6102193660046132ff565b61051d565b60405190151581526020015b60405180910390f35b61023b610548565b60405161022a9190613374565b61025b610256366004613387565b6105da565b6040516001600160a01b03909116815260200161022a565b6102866102813660046133b5565b610674565b005b61029061078a565b60405190815260200161022a565b6102866102ac3660046134b7565b61079a565b6102906102bf366004613387565b609f6020526000908152604090205481565b6102906102df366004613512565b6108b9565b6102866102f2366004613563565b610b44565b6102906103053660046133b5565b610b75565b610286610318366004613387565b610c21565b61033061032b3660046135a4565b610e5f565b60405161022a91906135c1565b61021e61034b366004613387565b609d6020526000908152604090205460ff1681565b61028661036e366004613563565b610ecb565b6102866103813660046135a4565b610ee6565b610290610394366004613387565b610f4f565b61025b6103a7366004613387565b610fc8565b6102906103ba3660046135a4565b61103f565b61021e6103cd366004613605565b6110c6565b61025b6111fe565b61023b61127b565b6103f56103f0366004613387565b61128a565b60405161022a9190613676565b610286610410366004613692565b61129d565b6102866104233660046136cb565b611362565b61025b6104363660046135a4565b609e602052600090815260409020546001600160a01b031681565b61023b61045f3660046137a7565b61139a565b6102866104723660046135a4565b6113b3565b61023b610485366004613387565b61148e565b6103306104983660046135a4565b611520565b61021e6104ab36600461384d565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6097546001600160a01b031661025b565b6104fd6104f8366004613387565b611544565b60405161022a919061387b565b61028661051836600461384d565b611571565b60006001600160e01b0319821663780e9d6360e01b148061054257506105428261163f565b92915050565b6060606580546105579061389c565b80601f01602080910402602001604051908101604052809291908181526020018280546105839061389c565b80156105d05780601f106105a5576101008083540402835291602001916105d0565b820191906000526020600020905b8154815290600101906020018083116105b357829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166106585760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b600061067f82610fc8565b9050806001600160a01b0316836001600160a01b031614156106ed5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161064f565b336001600160a01b0382161480610709575061070981336104ab565b61077b5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161064f565b610785838361168f565b505050565b600061079560985490565b905090565b8160006107a6826116fd565b9050600081600001516001600160a01b031663a6c3e6b96040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e757600080fd5b505afa1580156107fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081f91906138d7565b90506001600160a01b03811633146108495760405162461bcd60e51b815260040161064f906138f4565b6000858152609d602052604090205460ff16156108925760405162461bcd60e51b8152602060048201526007602482015266199c99595e995960ca1b604482015260640161064f565b6000858152609c6020908152604090912085516108b1928701906131f9565b505050505050565b60975460405163df5cbf7d60e01b815260009133916001600160a01b039091169063df5cbf7d906108ec9060040161391c565b60206040518083038186803b15801561090457600080fd5b505afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906138d7565b6001600160a01b0316146109625760405162461bcd60e51b815260040161064f906138f4565b610970609880546001019055565b600061097b60985490565b905061098787826117ca565b604080518281526001600160a01b038981166020830152881681830152606081018790526080810186905290517fd46616b47888bf162137201f2b51769d5891ea9b59978dc022f447f3335e4b369181900360a00190a16040805160a0810182526001600160a01b0388168152602081018790529081018590526000606082018190526080820152610a198282611918565b6001600160a01b038088166000818152609a60209081526040808320805460018101825590845282842001879055928252609e90522054168015610b275760405163e3a71f6360e01b81526001600160a01b0382169063e3a71f6390610a899086908d9087908b9060040161393c565b602060405180830381600087803b158015610aa357600080fd5b505af1158015610ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610adb919061396f565b610b275760405162461bcd60e51b815260206004820152601b60248201527f6661696c656420746f2063616c6c206f6e4265666f72654d696e740000000000604482015260640161064f565b50506000818152609f602052604090209290925550949350505050565b610b4e3382611971565b610b6a5760405162461bcd60e51b815260040161064f9061398c565b610785838383611a64565b6001600160a01b0382166000908152609b60205260408120610b9690611c0f565b8210610bf85760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161064f565b6001600160a01b0383166000908152609b60205260409020610c1a9083611c19565b9392505050565b806000610c2d826116fd565b9050600081600001516001600160a01b031663a6c3e6b96040518163ffffffff1660e01b815260040160206040518083038186803b158015610c6e57600080fd5b505afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca691906138d7565b90506001600160a01b0381163314610cd05760405162461bcd60e51b815260040161064f906138f4565b6000848152609d602052604090205460ff1615610d215760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e48199c99595e9959608a1b604482015260640161064f565b6000848152609c602052604081208054610d3a9061389c565b80601f0160208091040260200160405190810160405280929190818152602001828054610d669061389c565b8015610db35780601f10610d8857610100808354040283529160200191610db3565b820191906000526020600020905b815481529060010190602001808311610d9657829003601f168201915b50505050509050805160001415610df65760405162461bcd60e51b81526020600482015260076024820152666e6f206461746160c81b604482015260640161064f565b6000858152609d60205260409020805460ff191660011790557faf22e0980c2b7e44202e8c1203335e01a22820ba47c44e32ef994c6fea108b7a85610e383390565b604080519283526001600160a01b0390911660208301520160405180910390a15050505050565b6001600160a01b0381166000908152609a6020908152604091829020805483518184028101840190945280845260609392830182828015610ebf57602002820191906000526020600020905b815481526020019060010190808311610eab575b50505050509050919050565b61078583838360405180602001604052806000815250611362565b60a0546001600160a01b031615610f2d5760405162461bcd60e51b815260206004820152600b60248201526a185b1c9958591e481cd95d60aa1b604482015260640161064f565b60a080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610f5a60985490565b8210610fbd5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161064f565b6105428260016139f3565b6000818152606760205260408120546001600160a01b0316806105425760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161064f565b60006001600160a01b0382166110aa5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161064f565b506001600160a01b031660009081526068602052604090205490565b60975460405163df5cbf7d60e01b815260009133916001600160a01b039091169063df5cbf7d906110f99060040161391c565b60206040518083038186803b15801561111157600080fd5b505afa158015611125573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114991906138d7565b6001600160a01b03161461116f5760405162461bcd60e51b815260040161064f906138f4565b600061117a876116fd565b6020810187905260408101869052606081018590526080810184905290506111a28782611918565b604080518881526020810188905290810186905260608101859052608081018490527fd186cbf6df87e8d75402ae709b341a60af62280d4af57663f74527986880011b9060a00160405180910390a15060019695505050505050565b60a05460408051638da5cb5b60e01b815290516000926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b15801561124357600080fd5b505afa158015611257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079591906138d7565b6060606680546105579061389c565b61129261327d565b6000610c1a836116fd565b6001600160a01b0382163314156112f65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161064f565b336000818152606a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61136c3383611971565b6113885760405162461bcd60e51b815260040161064f9061398c565b61139484848484611c25565b50505050565b60606113a98686868686611c58565b9695505050505050565b600054610100900460ff16806113cc575060005460ff16155b6113e85760405162461bcd60e51b815260040161064f90613a0b565b600054610100900460ff1615801561140a576000805461ffff19166101011790555b61146f6040518060400160405280601781526020017f4465762050726f746f636f6c2073546f6b656e732056310000000000000000008152506040518060400160405280600e81526020016d4445562d53544f4b454e532d563160901b815250611dd3565b61147882611e5a565b801561148a576000805461ff00191690555b5050565b6060600061149b60985490565b9050808311156114d95760405162461bcd60e51b81526020600482015260096024820152681b9bdd08199bdd5b9960ba1b604482015260640161064f565b60006114e4846116fd565b905060006114f185611ee1565b905060006114fe86610fc8565b90506113a986828585609f60008c815260200190815260200160002054611c58565b6001600160a01b0381166000908152609b6020526040902060609061054290612054565b61156860405180606001604052806000815260200160008152602001600081525090565b61054282611ee1565b816000816001600160a01b031663a6c3e6b96040518163ffffffff1660e01b815260040160206040518083038186803b1580156115ad57600080fd5b505afa1580156115c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115e591906138d7565b90506001600160a01b038116331461160f5760405162461bcd60e51b815260040161064f906138f4565b50506001600160a01b039182166000908152609e6020526040902080546001600160a01b03191691909216179055565b60006001600160e01b031982166380ac58cd60e01b148061167057506001600160e01b03198216635b5e139f60e01b145b8061054257506301ffc9a760e01b6001600160e01b0319831614610542565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116c482610fc8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61170561327d565b600061171083612061565b60008181526099602052604081208054929350909161172e9061389c565b80601f016020809104026020016040519081016040528092919081815260200182805461175a9061389c565b80156117a75780601f1061177c576101008083540402835291602001916117a7565b820191906000526020600020905b81548152906001019060200180831161178a57829003601f168201915b50505050509050808060200190518101906117c29190613a59565b949350505050565b6001600160a01b0382166118205760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161064f565b6000818152606760205260409020546001600160a01b0316156118855760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161064f565b611891600083836120a1565b6001600160a01b03821660009081526068602052604081208054600192906118ba9084906139f3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061192383612061565b90506000826040516020016119389190613676565b60408051601f19818403018152918152600084815260996020908152919020825192935061196a9290918401906131f9565b5050505050565b6000818152606760205260408120546001600160a01b03166119ea5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161064f565b60006119f583610fc8565b9050806001600160a01b0316846001600160a01b03161480611a305750836001600160a01b0316611a25846105da565b6001600160a01b0316145b806117c257506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff166117c2565b826001600160a01b0316611a7782610fc8565b6001600160a01b031614611adf5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161064f565b6001600160a01b038216611b415760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161064f565b611b4c8383836120a1565b611b5760008261168f565b6001600160a01b0383166000908152606860205260408120805460019290611b80908490613ad2565b90915550506001600160a01b0382166000908152606860205260408120805460019290611bae9084906139f3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610542825490565b6000610c1a838361217e565b611c30848484611a64565b611c3c848484846121a8565b6113945760405162461bcd60e51b815260040161064f90613ae9565b6000858152609c6020526040812080546060929190611c769061389c565b80601f0160208091040260200160405190810160405280929190818152602001828054611ca29061389c565b8015611cef5780601f10611cc457610100808354040283529160200191611cef565b820191906000526020600020905b815481529060010190602001808311611cd257829003601f168201915b50505050509050805160001415611db05784516001600160a01b039081166000908152609e6020526040902054168015611dae5760405163658e8c9760e01b81526001600160a01b0382169063658e8c9790611d57908b908b908b908b908b90600401613b3b565b60006040518083038186803b158015611d6f57600080fd5b505afa158015611d83573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611dab9190810190613b89565b91505b505b611dc8856000015186602001518760600151846122b5565b979650505050505050565b600054610100900460ff1680611dec575060005460ff16155b611e085760405162461bcd60e51b815260040161064f90613a0b565b600054610100900460ff16158015611e2a576000805461ffff19166101011790555b611e32612427565b611e3a612427565b611e448383612493565b8015610785576000805461ff0019169055505050565b600054610100900460ff1680611e73575060005460ff16155b611e8f5760405162461bcd60e51b815260040161064f90613a0b565b600054610100900460ff16158015611eb1576000805461ffff19166101011790555b609780546001600160a01b0319166001600160a01b038416179055801561148a576000805461ff00191690555050565b611f0560405180606001604052806000815260200160008152602001600081525090565b6000611f196097546001600160a01b031690565b6001600160a01b031663df5cbf7d6040518163ffffffff1660e01b8152600401611f429061391c565b60206040518083038186803b158015611f5a57600080fd5b505afa158015611f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9291906138d7565b6001600160a01b03166360e8da7c846040518263ffffffff1660e01b8152600401611fbf91815260200190565b60206040518083038186803b158015611fd757600080fd5b505afa158015611feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200f9190613c00565b9050600061201c846116fd565b6060810151909150600061203084836139f3565b60408051606081018252918252602082019390935291820193909352949350505050565b60606000610c1a83612528565b604051695f706f736974696f6e7360b01b6020820152602a8101829052600090604a01604051602081830303815290604052805190602001209050919050565b6001600160a01b0383166120d1576001600160a01b0382166000908152609b602052604090206113949082612582565b6001600160a01b0382166121205760405162461bcd60e51b81526020600482015260166024820152751cc81d1bdad95b9cc81a5cc81b9bdd08189d5c9b995960521b604482015260640161064f565b826001600160a01b0316826001600160a01b031614610785576001600160a01b0383166000908152609b6020526040902061215b908261258e565b506001600160a01b0382166000908152609b602052604090206113949082612582565b600082600001828154811061219557612195613c19565b9060005260206000200154905092915050565b60006001600160a01b0384163b156122aa57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906121ec903390899088908890600401613c2f565b602060405180830381600087803b15801561220657600080fd5b505af1925050508015612236575060408051601f3d908101601f1916820190925261223391810190613c62565b60015b612290573d808015612264576040519150601f19603f3d011682016040523d82523d6000602084013e612269565b606091505b5080516122885760405162461bcd60e51b815260040161064f90613ae9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506117c2565b506001949350505050565b606060006122c485601261259a565b905060006122da876001600160a01b031661274f565b826122e487612930565b6040516020016122f693929190613c9b565b6040516020818303038152906040529050600061231b886001600160a01b031661274f565b60405160200161232b9190613d2f565b60405160208183030381529060405290506000612350896001600160a01b031661274f565b84604051602001612362929190613ec6565b60405160208183030381529060405290506000865160001461238457866123dd565b6123bd6123998b6001600160a01b031661274f565b6040516020016123a99190613fab565b604051602081830303815290604052612a2e565b6040516020016123cd91906143b1565b6040516020818303038152906040525b90506123f9848483856040516020016123a994939291906143f6565b60405160200161240991906144c8565b60405160208183030381529060405295505050505050949350505050565b600054610100900460ff1680612440575060005460ff16155b61245c5760405162461bcd60e51b815260040161064f90613a0b565b600054610100900460ff1615801561247e576000805461ffff19166101011790555b8015612490576000805461ff00191690555b50565b600054610100900460ff16806124ac575060005460ff16155b6124c85760405162461bcd60e51b815260040161064f90613a0b565b600054610100900460ff161580156124ea576000805461ffff19166101011790555b82516124fd9060659060208601906131f9565b5081516125119060669060208501906131f9565b508015610785576000805461ff0019169055505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015610ebf5760200282019190600052602060002090815481526020019060010190808311610eab5750505050509050919050565b6000610c1a8383612b96565b6000610c1a8383612be5565b606060006125a983600a6145f1565b9050836000805b821561260f5760ff8116156125d157806125c981614600565b9150506125ef565b6125dc600a84614636565b156125ef57806125eb81614600565b9150505b816125f981614600565b92506126089050600a8461464a565b92506125b0565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260ff8716612656838561465e565b60ff161061268857612668858961464a565b8152612674878461465e565b60ff1660408201819052602082015261272d565b612692828461465e565b61269d90600a6145f1565b6126a7908961464a565b8152878511156126fc57600260808201526126c2838861465e565b6126cd906002614681565b60ff1660a082018190526126e19083614681565b60ff16604082018190526020820152600160c082015261272d565b612707826001614681565b60ff166040820152612719878461465e565b612724906001614681565b60ff1660608201525b604081015160ff16602082015261274381612cd8565b98975050505050505050565b604080516028808252606082810190935283831b91600091602082018180368337019050509050600080600080600080600061278a8b612ed5565b905060005b60148110156128ff576127a3816013613ad2565b6127ae9060086146a6565b6127b99060026146c5565b6127c79060608c901c61464a565b97506127d46010896146d1565b96506127e18760106146f3565b6127eb908961465e565b9550816127f98260026146a6565b6028811061280957612809613c19565b602002015194508161281c8260026146a6565b6128279060016139f3565b6028811061283757612837613c19565b602002015193506128488786613066565b92506128548388614681565b60f81b60001a60f81b896128698360026146a6565b8151811061287957612879613c19565b60200101906001600160f81b031916908160001a90535061289a8685613066565b92506128a68387614681565b60f81b60001a60f81b896128bb8360026146a6565b6128c69060016139f3565b815181106128d6576128d6613c19565b60200101906001600160f81b031916908160001a905350806128f781614714565b91505061278f565b5087604051602001612911919061472f565b6040516020818303038152906040529950505050505050505050919050565b6060816129545750506040805180820190915260018152600360fc1b602082015290565b8160005b811561297e578061296881614714565b91506129779050600a8361464a565b9150612958565b60008167ffffffffffffffff811115612999576129996133e1565b6040519080825280601f01601f1916602001820160405280156129c3576020820181803683370190505b5090505b84156117c2576129d8600183613ad2565b91506129e5600a86614636565b6129f09060306139f3565b60f81b818381518110612a0557612a05613c19565b60200101906001600160f81b031916908160001a905350612a27600a8661464a565b94506129c7565b6060815160001415612a4e57505060408051602081019091526000815290565b60006040518060600160405280604081526020016147cb6040913990506000600384516002612a7d91906139f3565b612a87919061464a565b612a929060046146a6565b90506000612aa18260206139f3565b67ffffffffffffffff811115612ab957612ab96133e1565b6040519080825280601f01601f191660200182016040528015612ae3576020820181803683370190505b509050818152600183018586518101602084015b81831015612b515760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401612af7565b600389510660018114612b6b5760028114612b7c57612b88565b613d3d60f01b600119830152612b88565b603d60f81b6000198301525b509398975050505050505050565b6000818152600183016020526040812054612bdd57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610542565b506000610542565b60008181526001830160205260408120548015612cce576000612c09600183613ad2565b8554909150600090612c1d90600190613ad2565b9050818114612c82576000866000018281548110612c3d57612c3d613c19565b9060005260206000200154905080876000018481548110612c6057612c60613c19565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612c9357612c93614759565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610542565b6000915050610542565b60606000826020015160ff1667ffffffffffffffff811115612cfc57612cfc6133e1565b6040519080825280601f01601f191660200182016040528015612d26576020820181803683370190505b5090508260c0015115612d9257600360fc1b81600081518110612d4b57612d4b613c19565b60200101906001600160f81b031916908160001a905350601760f91b81600181518110612d7a57612d7a613c19565b60200101906001600160f81b031916908160001a9053505b608083015160ff165b8360a0015160ff16811015612dea57603060f81b828281518110612dc157612dc1613c19565b60200101906001600160f81b031916908160001a90535080612de281614714565b915050612d9b565b505b825115610542576000836060015160ff16118015612e175750826060015160ff16836040015160ff16145b15612e6057601760f91b81846040018051612e319061476f565b60ff169081905281518110612e4857612e48613c19565b60200101906001600160f81b031916908160001a9053505b8251612e6e90600a90614636565b612e799060306139f3565b60f81b81846040018051612e8c9061476f565b60ff169081905281518110612ea357612ea3613c19565b60200101906001600160f81b031916908160001a905350600a83600001818151612ecd919061464a565b905250612dec565b612edd6132b5565b606082901b6000612eed82613093565b604051602001612efd919061478c565b60405160208183030381529060405280519060200120905060008060008060005b601481101561305a576010878260148110612f3b57612f3b613c19565b612f479291901a6147a8565b9350601084888360148110612f5e57612f5e613c19565b612f6a9291901a61465e565b612f7491906146d1565b94506010868260208110612f8a57612f8a613c19565b612f969291901a6147a8565b9150601082878360208110612fad57612fad613c19565b612fb99291901a61465e565b612fc391906146d1565b925060098560ff16118015612fdb575060078360ff16115b88612fe78360026146a6565b60288110612ff757612ff7613c19565b91151560209092020152600960ff8516118015613017575060078260ff16115b886130238360026146a6565b61302e9060016139f3565b6028811061303e5761303e613c19565b911515602090920201528061305281614714565b915050612f1e565b50505050505050919050565b6000600a8360ff16101561307c57506030610542565b811561308a57506037610542565b50605792915050565b60408051602880825260608281019093526000919060208201818036833701905050905060008080805b60148110156131ee576130d1816013613ad2565b6130dc9060086146a6565b6130e79060026146c5565b6130f590606089901c61464a565b93506131026010856146d1565b925061310f8360106146f3565b613119908561465e565b9150600a8360ff161061312d576057613130565b60305b61313a9084614681565b60f81b60001a60f81b8561314f8360026146a6565b8151811061315f5761315f613c19565b60200101906001600160f81b031916908160001a905350600a8260ff161061318857605761318b565b60305b6131959083614681565b60f81b60001a60f81b856131aa8360026146a6565b6131b59060016139f3565b815181106131c5576131c5613c19565b60200101906001600160f81b031916908160001a905350806131e681614714565b9150506130bd565b509295945050505050565b8280546132059061389c565b90600052602060002090601f016020900481019282613227576000855561326d565b82601f1061324057805160ff191683800117855561326d565b8280016001018555821561326d579182015b8281111561326d578251825591602001919060010190613252565b506132799291506132d4565b5090565b6040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b6040518061050001604052806028906020820280368337509192915050565b5b8082111561327957600081556001016132d5565b6001600160e01b03198116811461249057600080fd5b60006020828403121561331157600080fd5b8135610c1a816132e9565b60005b8381101561333757818101518382015260200161331f565b838111156113945750506000910152565b6000815180845261336081602086016020860161331c565b601f01601f19169290920160200192915050565b602081526000610c1a6020830184613348565b60006020828403121561339957600080fd5b5035919050565b6001600160a01b038116811461249057600080fd5b600080604083850312156133c857600080fd5b82356133d3816133a0565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561341a5761341a6133e1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715613449576134496133e1565b604052919050565b600067ffffffffffffffff82111561346b5761346b6133e1565b50601f01601f191660200190565b600061348c61348784613451565b613420565b90508281528383830111156134a057600080fd5b828260208301376000602084830101529392505050565b600080604083850312156134ca57600080fd5b82359150602083013567ffffffffffffffff8111156134e857600080fd5b8301601f810185136134f957600080fd5b61350885823560208401613479565b9150509250929050565b600080600080600060a0868803121561352a57600080fd5b8535613535816133a0565b94506020860135613545816133a0565b94979496505050506040830135926060810135926080909101359150565b60008060006060848603121561357857600080fd5b8335613583816133a0565b92506020840135613593816133a0565b929592945050506040919091013590565b6000602082840312156135b657600080fd5b8135610c1a816133a0565b6020808252825182820181905260009190848201906040850190845b818110156135f9578351835292840192918401916001016135dd565b50909695505050505050565b600080600080600060a0868803121561361d57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b80516001600160a01b03168252602080820151908301526040808201519083015260608082015190830152608090810151910152565b60a081016105428284613640565b801515811461249057600080fd5b600080604083850312156136a557600080fd5b82356136b0816133a0565b915060208301356136c081613684565b809150509250929050565b600080600080608085870312156136e157600080fd5b84356136ec816133a0565b935060208501356136fc816133a0565b925060408501359150606085013567ffffffffffffffff81111561371f57600080fd5b8501601f8101871361373057600080fd5b61373f87823560208401613479565b91505092959194509250565b60006060828403121561375d57600080fd5b6040516060810181811067ffffffffffffffff82111715613780576137806133e1565b80604052508091508235815260208301356020820152604083013560408201525092915050565b60008060008060008587036101608112156137c157600080fd5b8635955060208701356137d3816133a0565b945060a0603f19820112156137e757600080fd5b506137f06133f7565b60408701356137fe816133a0565b80825250606087013560208201526080870135604082015260a0870135606082015260c087013560808201528093505061383b8760e0880161374b565b94979396509194610140013592915050565b6000806040838503121561386057600080fd5b823561386b816133a0565b915060208301356136c0816133a0565b81518152602080830151908201526040808301519082015260608101610542565b600181811c908216806138b057607f821691505b602082108114156138d157634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156138e957600080fd5b8151610c1a816133a0565b6020808252600e908201526d696c6c6567616c2061636365737360901b604082015260600190565b60208082526006908201526504c6f636b75760d41b604082015260600190565b8481526001600160a01b038416602082015261010081016139606040830185613640565b8260e083015295945050505050565b60006020828403121561398157600080fd5b8151610c1a81613684565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115613a0657613a066139dd565b500190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060a08284031215613a6b57600080fd5b60405160a0810181811067ffffffffffffffff82111715613a8e57613a8e6133e1565b6040528251613a9c816133a0565b80825250602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b600082821015613ae457613ae46139dd565b500390565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8581526001600160a01b03851660208201526101608101613b5f6040830186613640565b835160e0830152602084015161010083015260409093015161012082015261014001529392505050565b600060208284031215613b9b57600080fd5b815167ffffffffffffffff811115613bb257600080fd5b8201601f81018413613bc357600080fd5b8051613bd161348782613451565b818152856020838501011115613be657600080fd5b613bf782602083016020860161331c565b95945050505050565b600060208284031215613c1257600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906113a990830184613348565b600060208284031215613c7457600080fd5b8151610c1a816132e9565b60008151613c9181856020860161331c565b9290920192915050565b7f4465762050726f746f636f6c2073546f6b656e73202d20000000000000000000815260008451613cd381601785016020890161331c565b80830190506201016960ed1b8060178301528551613cf881601a850160208a0161331c565b63102222ab60e11b601a9390910192830152601e8201528351613d2281602184016020880161331c565b0160210195945050505050565b7f54686973204e465420726570726573656e74732061207374616b696e6720706f81527f736974696f6e20696e2061204465762050726f746f636f6c2050726f7065727460208201527f7920746f6b656e732e20546865206f776e6572206f662074686973204e46542060408201527f63616e206d6f64696679206f722072656465656d2074686520706f736974696f606082015275037172e37283937b832b93a3c9020b2323932b9b99d160551b608082015260008251613df881609685016020870161331c565b7f5c6e5c6ee29aa020444953434c41494d45523a204475652064696c6967656e6360969390910192830152507f6520697320696d7065726174697665207768656e20617373657373696e67207460b68201527f686973204e46542e204d616b65207375726520746f6b656e206164647265737360d68201527f6573206d617463682074686520657870656374656420746f6b656e732c20617360f68201527f20746f6b656e2073796d626f6c73206d617920626520696d6974617465642e0061011682015261013501919050565b605b60f81b81527f7b2274726169745f74797065223a2244657374696e6174696f6e222c20227661600182015265363ab2911d1160d11b60218201528251600090613f1881602785016020880161331c565b62089f4b60ea1b6027918401918201527f7b2274726169745f74797065223a224c6f636b656420416d6f756e74222c2022602a8201527f646973706c61795f74797065223a226e756d626572222c202276616c7565223a604a8201528351613f8781606a84016020880161331c565b607d60f81b606a9290910191820152605d60f81b606b820152606c01949350505050565b7f3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323081527f30302f737667222077696474683d2232393022206865696768743d223530302260208201527f2076696577426f783d223020302032393020353030222066696c6c3d226e6f6e60408201527f65223e3c726563742077696474683d2232393022206865696768743d2235303060608201527f222066696c6c3d2275726c28237061696e74305f6c696e65617229222f3e3c7060808201527f6174682066696c6c2d72756c653d226576656e6f64642220636c69702d72756c60a08201527f653d226576656e6f64642220643d224d31393220323033483136382e3556323260c08201527f362e355632353048313435483132312e35563232362e3556323033483938483760e08201527f342e35563232362e3556323530563237332e35483531563239374837342e35486101008201527f3938563237332e35483132312e3548313435483136382e3548313932563235306101208201527f563232362e35483231352e354832333956323033483231352e35483139325a226101408201527f2066696c6c3d227768697465222f3e3c746578742066696c6c3d2277686974656101608201527f2220786d6c3a73706163653d22707265736572766522207374796c653d2277686101808201527f6974652d73706163653a207072652220666f6e742d66616d696c793d226d6f6e6101a08201527f6f73706163652220666f6e742d73697a653d22313122206c65747465722d73706101c08201527f6163696e673d2230656d223e3c747370616e20783d2232372e343037322220796101e08201526a1e91199999971a189c111f60a91b6102008201526000610c1a61423861020b840185613c7f565b7f3c2f747370616e3e3c2f746578743e3c646566733e3c6c696e6561724772616481527f69656e742069643d227061696e74305f6c696e656172222078313d223022207960208201527f313d2230222078323d22323930222079323d2235303022206772616469656e7460408201527f556e6974733d227573657253706163654f6e557365223e3c73746f702073746f60608201527f702d636f6c6f723d2223303044304644222f3e3c73746f70206f66667365743d60808201527f22302e313531303432222073746f702d636f6c6f723d2223343838394635222f60a08201527f3e3c73746f70206f66667365743d22302e353532303833222073746f702d636f60c08201527f6c6f723d2223443530304536222f3e3c73746f70206f66667365743d2231222060e08201527f73746f702d636f6c6f723d2223464633383135222f3e3c2f6c696e65617247726101008201527330b234b2b73a1f1e17b232b3399f1e17b9bb339f60611b6101208201526101340190565b7f646174613a696d6167652f7376672b786d6c3b6261736536342c0000000000008152600082516143e981601a85016020870161331c565b91909101601a0192915050565b683d913730b6b2911d1160b91b8152845160009061441b816009850160208a0161331c565b71111610113232b9b1b934b83a34b7b7111d1160711b600991840191820152855161444d81601b840160208a0161331c565b6c1116101134b6b0b3b2911d101160991b601b9290910191820152845161447b81602884016020890161331c565b6f1116101130ba3a3934b13aba32b9911d60811b6028929091019182015283516144ac81603884016020880161331c565b607d60f81b603892909101918201526039019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161450081601d85016020870161331c565b91909101601d0192915050565b600181815b8085111561454857816000190482111561452e5761452e6139dd565b8085161561453b57918102915b93841c9390800290614512565b509250929050565b60008261455f57506001610542565b8161456c57506000610542565b8160018114614582576002811461458c576145a8565b6001915050610542565b60ff84111561459d5761459d6139dd565b50506001821b610542565b5060208310610133831016604e8410600b84101617156145cb575081810a610542565b6145d5838361450d565b80600019048211156145e9576145e96139dd565b029392505050565b6000610c1a60ff841683614550565b600060ff821660ff811415614617576146176139dd565b60010192915050565b634e487b7160e01b600052601260045260246000fd5b60008261464557614645614620565b500690565b60008261465957614659614620565b500490565b600060ff821660ff841680821015614678576146786139dd565b90039392505050565b600060ff821660ff84168060ff0382111561469e5761469e6139dd565b019392505050565b60008160001904831182151516156146c0576146c06139dd565b500290565b6000610c1a8383614550565b600060ff8316806146e4576146e4614620565b8060ff84160491505092915050565b600060ff821660ff84168160ff04811182151516156145e9576145e96139dd565b6000600019821415614728576147286139dd565b5060010190565b61060f60f31b81526000825161474c81600285016020870161331c565b9190910160020192915050565b634e487b7160e01b600052603160045260246000fd5b600060ff821680614782576147826139dd565b6000190192915050565b6000825161479e81846020870161331c565b9190910192915050565b600060ff8316806147bb576147bb614620565b8060ff8416069150509291505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212201c04b13fcfc3e59417ba7be8a7233e0ce94eb860bf608495a3e48471fb033ea264736f6c63430008090033

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