Token
ERC-1155
Overview
Max Total Supply
0
Holders
1
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Savings
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1300 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/Base64.sol'; import './interface/ICFA.sol'; import './interface/ISavings.sol'; import './Referral.sol'; import '../utils/Registry.sol'; contract Savings is ISavings, ERC1155, Ownable { using Strings for uint256; /** * Local variables */ Registry public registry; // The registry contract Life public life; // max and minimum life of Savings CFA Metadata public metadata; // The metadata of the Savings CFA mapping(uint256 => Attributes) public attributes; uint256[] public markers = new uint256[](219); uint256[] public interests = new uint256[](219); uint256 public idCounter = 1; /** * Events */ event SavingsCreated(Attributes _attribute); event SavingsWithdrawn(Attributes _attribute, uint256 _time); event SavingsBinded(Attributes _attribute, uint256 _time); /** * Modifier */ /** * Constructor */ constructor() ERC1155('') {} /** * Main Function */ function _saveMetadata(Attributes memory _attributes) internal { _attributes.timeCreated = block.timestamp; _attributes.interestRate = getInterestRate(); attributes[idCounter] = _attributes; } function _mintSavings(Attributes memory _attributes) internal { IERC20(registry.registry('BbToken')).transferFrom(msg.sender, address(this), _attributes.amount); _mint(msg.sender, idCounter, 1, ''); _saveMetadata(_attributes); emit SavingsCreated(_attributes); } function mintSavings(Attributes[] memory _attributes) external { for (uint256 i = 0; i < _attributes.length; i++) { _mintSavings(_attributes[i]); idCounter++; } // TODO: add referral } function _burnSavings(uint256 _id) internal { IERC20(registry.registry('BbToken')).transfer(msg.sender, attributes[_id].amount); delete attributes[_id]; _burn(msg.sender, _id, idCounter); } function withdrawSavings(uint256 _id) external { require(attributes[_id].timeCreated + attributes[_id].cfaLife < block.timestamp, 'Savings: CFA is not matured'); _burnSavings(_id); emit SavingsWithdrawn(attributes[_id], block.timestamp); } function bindSavings(uint256 _id) external { require(attributes[_id].soulBoundTerm == 0, 'Savings: CFA is already bound'); require(balanceOf(msg.sender, _id) > 0, 'Savings: CFA is not owned by the caller'); attributes[_id].soulBoundTerm = block.timestamp; emit SavingsBinded(attributes[_id], block.timestamp); } /** * Write Function */ function setImage(string[2] memory _image) external onlyOwner { metadata.image[0] = _image[0]; metadata.image[1] = _image[1]; } function setMetadata(string memory _name, string memory _description) external onlyOwner { metadata.name = _name; metadata.description = _description; } function setRegsitry(address _registry) external onlyOwner { registry = Registry(_registry); } function setLife(uint256 _min, uint256 _max) external onlyOwner { life.min = _min; life.max = _max; } function setInterest(uint256[] memory _marker, uint256[] memory _interest) external onlyOwner { require(_marker.length == _interest.length, 'Savings: Invalid input'); for (uint256 i = 0; i < _marker.length; i++) { markers[i] = _marker[i]; interests[i] = _interest[i]; } } /** * Read Function */ // TODO: change public to internal // function getDiff() public view returns (uint256, uint256, uint256) { // uint256 totalSupply = IERC20(registry.registry('BbToken')).totalSupply(); // if (totalSupply > 20_000_000 ether && totalSupply <= 24_000_000) { // return (20_000_000 ether, 24_000_000 ether, 1_000_000 ether); // } else if (totalSupply > 24_000_000 ether && totalSupply <= 82_000_000 ether) { // return (24_000_000 ether, 82_000_000 ether, 2_000_000 ether); // } else if (totalSupply > 82_000_000 ether && totalSupply <= 100_000_000 ether) { // return (82_000_000 ether, 100_000_000 ether, 3_000_000 ether); // } else if (totalSupply > 100_000_000 ether && totalSupply <= 120_000_000 ether) { // return (100_000_000 ether, 120_000_000 ether, 4_000_000 ether); // } else if (totalSupply > 120_000_000 ether && totalSupply <= 140_000_000 ether) { // return (120_000_000 ether, 140_000_000 ether, 5_000_000 ether); // } else if (totalSupply > 140_000_000 ether && totalSupply <= 280_000_000 ether) { // return (140_000_000 ether, 280_000_000 ether, 10_000_000 ether); // } else if (totalSupply > 280_000_000 ether && totalSupply <= 420_000_000 ether) { // return (280_000_000 ether, 420_000_000 ether, 20_000_000 ether); // } else if (totalSupply > 420_000_000 ether && totalSupply <= 720_000_000 ether) { // return (420_000_000 ether, 720_000_000 ether, 30_000_000 ether); // } else if (totalSupply > 720_000_000 ether && totalSupply <= 840_000_000 ether) { // return (720_000_000 ether, 840_000_000 ether, 40_000_000 ether); // } else if (totalSupply > 840_000_000 ether && totalSupply <= 2_100_000_000 ether) { // return (840_000_000 ether, 2_100_000_000 ether, 60_000_000 ether); // } else if (totalSupply > 2_100_000_000 ether && totalSupply <= 2_500_000_000 ether) { // return (2_100_000_000 ether, 2_500_000_000 ether, 80_000_000 ether); // } else if (totalSupply > 2_500_000_000 ether && totalSupply <= 4_500_000_000 ether) { // return (2_500_000_000 ether, 4_500_000_000 ether, 100_000_000 ether); // } else if (totalSupply > 4_500_000_000 ether && totalSupply <= 7_500_000_000 ether) { // return (4_500_000_000 ether, 7_500_000_000 ether, 200_000_000 ether); // } else if (totalSupply > 7_500_000_000 ether && totalSupply <= 19_000_000_000 ether) { // return (7_500_000_000 ether, 19_000_000_000 ether, 250_000_000 ether); // } else if (totalSupply > 19_000_000_000 ether && totalSupply <= 20_000_000_000 ether) { // return (19_000_000_000 ether, 20_000_000_000 ether, 200_000_000 ether); // } else if (totalSupply > 20_000_000_000 ether && totalSupply <= 20_200_000_000 ether) { // return (20_000_000_000 ether, 20_200_000_000 ether, 100_000_000 ether); // } else if (totalSupply > 20_200_000_000 ether && totalSupply <= 20_800_000_000 ether) { // return (20_200_000_000 ether, 20_800_000_000 ether, 50_000_000 ether); // } else if (totalSupply > 20_800_000_000 ether && totalSupply <= 20_900_000_000 ether) { // return (20_800_000_000 ether, 20_900_000_000 ether, 20_000_000 ether); // } else { // return (0, 1_000_000 ether, 20_000_000 ether); // } // } // TODO: change public to internal // function getMarker() public view returns (uint256) { // uint256 totalSupply = IERC20(registry.registry('BbToken')).totalSupply(); // (uint256 min, uint256 max, uint256 diff) = getDiff(); // uint256 iterations = (max - min) / diff; // for (uint256 index = 0; index < iterations; index++) { // if (totalSupply > min + (index * diff) && totalSupply <= min + ((index + 1) * diff)) { // return min + ((index + 1) * diff); // } // } // } // TODO: change public to internal function getMarker() public view returns (uint256) { uint256 totalSupply = IERC20(registry.registry('BbToken')).totalSupply(); uint256 marker = 0; for (uint256 index = 0; index < markers.length; index++) { if (totalSupply > markers[index] && totalSupply <= markers[index + 1]) { marker = markers[index]; } } return marker; } // TODO: change public to internal function getInterestRate() public view returns (uint256) { uint256 marker = getMarker(); return interests[marker]; } function getTotalInterest(uint256 _id) public view returns (uint256, uint256) { uint256 principal = attributes[_id].amount; uint256 interest = interests[attributes[_id].cfaLife]; uint256 month = 30 days; uint256 months = attributes[_id].cfaLife / month; uint256 basisPoint = 10000; uint256 totalInterest = 0; for (uint256 index = 0; index < months; index++) { uint256 tempInterest = (principal * interest) / basisPoint; principal += tempInterest; totalInterest += tempInterest; } // uint256 totalInterest = (principal * compoundedInterest) / basisPoint; return (principal, totalInterest); } function getYieldedInterest(uint256 _id) public view returns (uint256, uint256) { uint256 principal = attributes[_id].amount; uint256 interest = interests[attributes[_id].cfaLife]; uint256 months = (block.timestamp - attributes[_id].timeCreated) / 30 days; uint256 basisPoint = 10000; uint256 totalInterest = 0; for (uint256 index = 0; index < months; index++) { uint256 tempInterest = (principal * interest) / basisPoint; principal += tempInterest; totalInterest += tempInterest; } // uint256 totalInterest = (principal * compoundedInterest) / basisPoint; return (principal, totalInterest); } function getImage(uint256 tokenId) public view returns (string memory) { bool status = attributes[tokenId].soulBoundTerm > 0; string memory image = status ? metadata.image[1] : metadata.image[0]; return image; } function batchGetImage(uint256[] memory _tokenId) public view returns (string[] memory) { string[] memory images = new string[](_tokenId.length); for (uint256 index = 0; index < _tokenId.length; index++) { images[index] = getImage(_tokenId[index]); } return images; } function getMetadata(uint256 _tokenId) public view returns (string memory) { string memory _metadata = string( abi.encodePacked( '{', '"name":"', metadata.name, ' #', _tokenId.toString(), '",', '"description":', '"', metadata.description, '",', '"image":', '"', getImage(_tokenId), '"', '}' ) ); return _metadata; } /** * Override Functions */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) public override { require(attributes[id].soulBoundTerm == 0, 'CFA: El CFA esta bloqueado y no se puede transferir'); super.safeTransferFrom(from, to, id, amount, data); } /** * @dev Overrides the `burn` function to prevent burning of locked CFAs. */ function burn(uint256 id) public { require(attributes[id].soulBoundTerm == 0, 'CFA: El CFA esta bloqueado y no se puede quemar'); _burn(msg.sender, id, 1); } // Override the `burnBatch` function to prevent burning of locked CFAs function burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) public { for (uint256 i = 0; i < ids.length; i++) { require(attributes[ids[i]].soulBoundTerm == 0, 'CFA: No se puede quemar un CFA bloqueado'); } this.burnBatch(account, ids, amounts); } function uri(uint256 _tokenId) public view virtual override returns (string memory) { bytes memory _metadata = abi.encodePacked(getMetadata(_tokenId)); return string(abi.encodePacked('data:application/json;base64,', Base64.encode(_metadata))); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) 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() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn(address from, uint256 id, uint256 amount) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ICFA { struct Life { uint256 min; uint256 max; } struct Attributes { // Product product; // The type of CFA Product uint256 timeCreated; // The time the CFA was minted uint256 cfaLife; // The time the CFA was locked // *** Chagne to CFALife uint256 soulBoundTerm; // uint256 amount; // The amount of B&B tokens locked uint32 interestRate; // The interest rate of the CFA // uint256 originalTerm; // The original term in months for the CFA // uint256 timePassed; // The time that has passed since the minting of the CFA, in months // uint256 maximum Reduction; // The maximum reduction allowed in the original term, represented as a fraction (eg 0.25 for 25%) } struct Metadata { string name; // The name of the CFA string description; // The description of the CFA string[2] image; // The image of the CFA } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IReferral { struct Referrer { address referrer; uint256 referralCount; bool isAdded; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface ISavings { struct Life { uint256 min; uint256 max; } struct Attributes { uint256 timeCreated; // The time the CFA was minted uint256 cfaLife; // The time the CFA was locked // *** Chagne to CFALife uint256 soulBoundTerm; // uint256 amount; // The amount of B&B tokens locked uint256 interestRate; // The interest rate of the CFA } struct Metadata { string name; // The name of the CFA string description; // The description of the CFA string[2] image; // The image of the CFA } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import '@openzeppelin/contracts/access/Ownable.sol'; import './interface/IReferral.sol'; contract Referral is Ownable { // Local Variables uint256 public minBuys = 5; // minimum number of buys required to be eligible for referral uint256[] public bracket = [0, 100, 1_000, 10_000, 100_000, 1_000_000]; // number of referrals required to reach each bracket // uint256[] public address public defaultReferrer; // default referrer for users who have not been referred mapping(address => bool) public operators; // address => bool mapping to check if an address is an operator mapping(address => address) public referrer; // user => referrer mapping(address => uint256) public referralCount; // user => number of referrals mapping(address => uint256) public buyCount; // user => total buys of CFA // Events event ReferralRecorded(address indexed user, address indexed referrer); event ReferralRemoved(address indexed user); // Modifiers modifier onlyOperator() { require(operators[msg.sender], '000'); _; } // Constructor constructor() Ownable() {} // Write Functions /** * @dev Used to set referrer to a new user */ function addReferrer(address _referrer) external onlyOperator { require(referrer[msg.sender] == address(0), '001'); referrer[msg.sender] = _referrer; referralCount[_referrer]++; emit ReferralRecorded(msg.sender, _referrer); } /** * @dev Used to remove referrer from a user */ function removeReferrer(address _user) external onlyOwner { require(referrer[_user] != address(0), '002'); delete referrer[_user]; referralCount[referrer[_user]]--; emit ReferralRemoved(_user); } /** * @dev Used to set default referrer */ function setDefaultReferrer(address _referrer) external onlyOwner { defaultReferrer = _referrer; } function addBuyCount(address _user, uint256 _qty) external onlyOperator { buyCount[_user] += _qty; } /** * @dev Used to change required number of referrals to reach each bracket * @param _bracket Array of number of referrals required to reach each bracket */ function changeBracket(uint256[] memory _bracket) external onlyOwner { bracket = _bracket; } // View Functions /** * @dev Used to get bracket of a user * @param _user address of user that you wanted to check */ function getBracket(address _user) external view returns (uint256 _bracket) { uint256 _referralCount = referralCount[_user]; if (_referralCount == 0) { return 0; } else { for (uint256 i = 0; i < bracket.length; i++) { if (_referralCount < bracket[i]) { return i; } } } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; import '@openzeppelin/contracts/access/Ownable.sol'; contract Registry is Ownable { mapping(string => address) public registry; function addToRegistry(string memory _name, address _address) external onlyOwner { if (registry[_name] != address(0)) { revert('SteadRegistry: Name already exists'); } registry[_name] = _address; } function updateRegistry(string memory _name, address _address) external onlyOwner { registry[_name] = _address; } function removeFromRegistry(string memory _name) external onlyOwner { delete registry[_name]; } }
{ "optimizer": { "enabled": true, "runs": 1300 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"cfaLife","type":"uint256"},{"internalType":"uint256","name":"soulBoundTerm","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"indexed":false,"internalType":"struct ISavings.Attributes","name":"_attribute","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"_time","type":"uint256"}],"name":"SavingsBinded","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"cfaLife","type":"uint256"},{"internalType":"uint256","name":"soulBoundTerm","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"indexed":false,"internalType":"struct ISavings.Attributes","name":"_attribute","type":"tuple"}],"name":"SavingsCreated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"cfaLife","type":"uint256"},{"internalType":"uint256","name":"soulBoundTerm","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"indexed":false,"internalType":"struct ISavings.Attributes","name":"_attribute","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"_time","type":"uint256"}],"name":"SavingsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"attributes","outputs":[{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"cfaLife","type":"uint256"},{"internalType":"uint256","name":"soulBoundTerm","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenId","type":"uint256[]"}],"name":"batchGetImage","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"bindSavings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getImage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInterestRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMarker","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getMetadata","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getTotalInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getYieldedInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"idCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"interests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"life","outputs":[{"internalType":"uint256","name":"min","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"markers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadata","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"cfaLife","type":"uint256"},{"internalType":"uint256","name":"soulBoundTerm","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct ISavings.Attributes[]","name":"_attributes","type":"tuple[]"}],"name":"mintSavings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract Registry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"string[2]","name":"_image","type":"string[2]"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_marker","type":"uint256[]"},{"internalType":"uint256[]","name":"_interest","type":"uint256[]"}],"name":"setInterest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setLife","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_description","type":"string"}],"name":"setMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegsitry","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"withdrawSavings","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60db6080818152611c006040529060a0611b6080368337505081516200002d92600c92506020019062000106565b506040805160db808252611b8082019092529060208201611b6080368337505081516200006292600d92506020019062000106565b506001600e553480156200007557600080fd5b506040805160208101909152600081526200009081620000a2565b506200009c33620000b4565b620002de565b6002620000b0828262000212565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805482825590600052602060002090810192821562000144579160200282015b828111156200014457825182559160200191906001019062000127565b506200015292915062000156565b5090565b5b8082111562000152576000815560010162000157565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200019857607f821691505b602082108103620001b957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200020d57600081815260208120601f850160051c81016020861015620001e85750805b601f850160051c820191505b818110156200020957828155600101620001f4565b5050505b505050565b81516001600160401b038111156200022e576200022e6200016d565b62000246816200023f845462000183565b84620001bf565b602080601f8311600181146200027e5760008415620002655750858301515b600019600386901b1c1916600185901b17855562000209565b600085815260208120601f198616915b82811015620002af578886015182559484019460019091019084016200028e565b5085821015620002ce5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6138c880620002ee6000396000f3fe608060405234801561001057600080fd5b50600436106102405760003560e01c80637b10399911610145578063d05dcc6a116100bd578063e6eee47d1161008c578063eb08ab2811610071578063eb08ab2814610574578063f242432a1461057d578063f2fde38b1461059057600080fd5b8063e6eee47d14610525578063e985e9c51461053857600080fd5b8063d05dcc6a14610487578063d2cd99d0146104ec578063de986450146104ff578063e2047bc81461051257600080fd5b8063a574cea411610114578063bc2aba3c116100f9578063bc2aba3c14610453578063c1483e5a14610466578063c53108681461047957600080fd5b8063a574cea41461042d578063aa097f151461044057600080fd5b80637b103999146103cb57806385aeab40146103f65780638da5cb5b14610409578063a22cb4651461041a57600080fd5b8063392f37e9116101d85780635257b566116101a75780636b20c4541161018c5780636b20c4541461039d578063715018a6146103b0578063774d33af146103b857600080fd5b80635257b5661461036d57806364337f411461037557600080fd5b8063392f37e91461031157806342966c68146103275780634e1273f41461033a57806351335b501461035a57600080fd5b80630e89341c116102145780630e89341c146102c35780632607aafa146102e35780632eb2c2d6146102f6578063310e966d1461030957600080fd5b8062fdd58e14610245578063011163ba1461026b57806301ffc9a714610280578063028f3002146102a3575b600080fd5b61025861025336600461293f565b6105a3565b6040519081526020015b60405180910390f35b61027e61027936600461296b565b61064f565b005b61029361028e3660046129a3565b610662565b6040519015158152602001610262565b6102b66102b1366004612ae5565b6106fd565b6040516102629190612b72565b6102d66102d1366004612bd4565b6107b6565b6040516102629190612bed565b6102d66102f1366004612bd4565b610814565b61027e610304366004612c74565b6108ce565b610258610970565b610319610af9565b604051610262929190612d22565b61027e610335366004612bd4565b610c19565b61034d610348366004612d50565b610cad565b6040516102629190612e58565b61027e610368366004612e6b565b610deb565b610258610e11565b610388610383366004612bd4565b610e42565b60408051928352602083019190915201610262565b61027e6103ab366004612ec5565b610f0b565b61027e611046565b61027e6103c6366004612f3b565b61105a565b6004546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610262565b61027e610404366004612bd4565b6110b4565b6003546001600160a01b03166103de565b61027e610428366004613028565b611216565b6102d661043b366004612bd4565b611221565b61025861044e366004612bd4565b611265565b610258610461366004612bd4565b611286565b61027e610474366004613061565b611296565b600554600654610388919082565b6104c4610495366004612bd4565b600b60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a001610262565b61027e6104fa366004613100565b6112c0565b61027e61050d366004612bd4565b6113ab565b610388610520366004612bd4565b611493565b61027e61053336600461314d565b611560565b61029361054636600461316a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610258600e5481565b61027e61058b366004613198565b611597565b61027e61059e36600461314d565b611629565b60006001600160a01b0383166106265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b6106576116b6565b600591909155600655565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806106c557506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061064957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610649565b60606000825167ffffffffffffffff81111561071b5761071b6129c7565b60405190808252806020026020018201604052801561074e57816020015b60608152602001906001900390816107395790505b50905060005b83518110156107af5761077f84828151811061077257610772613201565b6020026020010151610814565b82828151811061079157610791613201565b602002602001018190525080806107a79061322d565b915050610754565b5092915050565b606060006107c383611221565b6040516020016107d39190613246565b60405160208183030381529060405290506107ed81611710565b6040516020016107fd9190613262565b604051602081830303815290604052915050919050565b6000818152600b6020526040812060020154606091901515908161083957600961083c565b600a5b8054610847906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610873906132a7565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b509398975050505050505050565b6001600160a01b0385163314806108ea57506108ea8533610546565b61095c5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161061d565b6109698585858585611863565b5050505050565b600480546040516392a296c960e01b815260009283926001600160a01b0316916392a296c9916109bc910160208082526007908201526621312a37b5b2b760c91b604082015260600190565b602060405180830381865afa1580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd91906132e1565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5e91906132fe565b90506000805b600c548110156107af57600c8181548110610a8157610a81613201565b906000526020600020015483118015610ac15750600c610aa2826001613317565b81548110610ab257610ab2613201565b90600052602060002001548311155b15610ae757600c8181548110610ad957610ad9613201565b906000526020600020015491505b80610af18161322d565b915050610a64565b600780548190610b08906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610b34906132a7565b8015610b815780601f10610b5657610100808354040283529160200191610b81565b820191906000526020600020905b815481529060010190602001808311610b6457829003601f168201915b505050505090806001018054610b96906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc2906132a7565b8015610c0f5780601f10610be457610100808354040283529160200191610c0f565b820191906000526020600020905b815481529060010190602001808311610bf257829003601f168201915b5050505050905082565b6000818152600b602052604090206002015415610c9e5760405162461bcd60e51b815260206004820152602f60248201527f4346413a20456c20434641206573746120626c6f71756561646f2079206e6f2060448201527f7365207075656465207175656d61720000000000000000000000000000000000606482015260840161061d565b610caa33826001611ae9565b50565b60608151835114610d265760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161061d565b6000835167ffffffffffffffff811115610d4257610d426129c7565b604051908082528060200260200182016040528015610d6b578160200160208202803683370190505b50905060005b8451811015610de357610db6858281518110610d8f57610d8f613201565b6020026020010151858381518110610da957610da9613201565b60200260200101516105a3565b828281518110610dc857610dc8613201565b6020908102919091010152610ddc8161322d565b9050610d71565b509392505050565b610df36116b6565b6007610dff8382613370565b506008610e0c8282613370565b505050565b600080610e1c610970565b9050600d8181548110610e3157610e31613201565b906000526020600020015491505090565b6000818152600b602052604081206003810154600190910154600d80548493928492918110610e7357610e73613201565b6000918252602080832090910154878352600b909152604082206001015490925062278d009190610ea5908390613430565b90506127106000805b83811015610efb57600083610ec3888a613452565b610ecd9190613430565b9050610ed98189613317565b9750610ee58184613317565b9250508080610ef39061322d565b915050610eae565b5094989497509395505050505050565b60005b8251811015610fce57600b6000848381518110610f2d57610f2d613201565b6020026020010151815260200190815260200160002060020154600014610fbc5760405162461bcd60e51b815260206004820152602860248201527f4346413a204e6f207365207075656465207175656d617220756e20434641206260448201527f6c6f71756561646f000000000000000000000000000000000000000000000000606482015260840161061d565b80610fc68161322d565b915050610f0e565b506040517f6b20c4540000000000000000000000000000000000000000000000000000000081523090636b20c4549061100f90869086908690600401613469565b600060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b50505050505050565b61104e6116b6565b6110586000611c98565b565b60005b81518110156110b05761108882828151811061107b5761107b613201565b6020026020010151611cf7565b600e80549060006110988361322d565b919050555080806110a89061322d565b91505061105d565b5050565b6000818152600b6020526040902060020154156111135760405162461bcd60e51b815260206004820152601d60248201527f536176696e67733a2043464120697320616c726561647920626f756e64000000604482015260640161061d565b600061111f33836105a3565b116111925760405162461bcd60e51b815260206004820152602760248201527f536176696e67733a20434641206973206e6f74206f776e65642062792074686560448201527f2063616c6c657200000000000000000000000000000000000000000000000000606482015260840161061d565b6000818152600b602052604090819020426002820181905591517fd37b000af6086badd48df55660020594d6bd96d909fbacfa7f53f7d1b7c321189261120b929182548152600183015460208201526002830154604082015260038301546060820152600490920154608083015260a082015260c00190565b60405180910390a150565b6110b0338383611e97565b60606000600761123084611f8b565b600861123b86610814565b60405160200161124e949392919061351a565b60408051601f198184030181529190529392505050565b600d818154811061127557600080fd5b600091825260209091200154905081565b600c818154811061127557600080fd5b61129e6116b6565b80516009906112ad9082613370565b506020810151600a906110b09082613370565b6112c86116b6565b80518251146113195760405162461bcd60e51b815260206004820152601660248201527f536176696e67733a20496e76616c696420696e70757400000000000000000000604482015260640161061d565b60005b8251811015610e0c5782818151811061133757611337613201565b6020026020010151600c828154811061135257611352613201565b906000526020600020018190555081818151811061137257611372613201565b6020026020010151600d828154811061138d5761138d613201565b600091825260209091200155806113a38161322d565b91505061131c565b6000818152600b602052604090206001810154905442916113cb91613317565b106114185760405162461bcd60e51b815260206004820152601b60248201527f536176696e67733a20434641206973206e6f74206d6174757265640000000000604482015260640161061d565b6114218161202b565b6000818152600b60205260409081902090517f40dec9c4da4f817eeec99e12dddc2acfb51cca895c933e897a902eb5454e80969161120b91429082548152600183015460208201526002830154604082015260038301546060820152600490920154608083015260a082015260c00190565b6000818152600b602052604081206003810154600190910154600d805484939284929181106114c4576114c4613201565b6000918252602080832090910154878352600b909152604082205490925062278d00906114f190426136a5565b6114fb9190613430565b90506127106000805b83811015611551576000836115198789613452565b6115239190613430565b905061152f8188613317565b965061153b8184613317565b92505080806115499061322d565b915050611504565b50939793965092945050505050565b6115686116b6565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000838152600b60205260409020600201541561161c5760405162461bcd60e51b815260206004820152603360248201527f4346413a20456c20434641206573746120626c6f71756561646f2079206e6f2060448201527f7365207075656465207472616e73666572697200000000000000000000000000606482015260840161061d565b610969858585858561218b565b6116316116b6565b6001600160a01b0381166116ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161061d565b610caa81611c98565b6003546001600160a01b031633146110585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061d565b6060815160000361172f57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613853604091399050600060038451600261175e9190613317565b6117689190613430565b611773906004613452565b67ffffffffffffffff81111561178b5761178b6129c7565b6040519080825280601f01601f1916602001820160405280156117b5576020820181803683370190505b509050600182016020820185865187015b80821015611821576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f81168501518453506001830192506117c6565b505060038651066001811461183d576002811461185057611858565b603d6001830353603d6002830353611858565b603d60018303535b509195945050505050565b81518351146118da5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161061d565b6001600160a01b03841661193e5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161061d565b3360005b8451811015611a7b57600085828151811061195f5761195f613201565b60200260200101519050600085838151811061197d5761197d613201565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015611a235760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161061d565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611a60908490613317565b9250508190555050505080611a749061322d565b9050611942565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611acb9291906136b8565b60405180910390a4611ae1818787878787612226565b505050505050565b6001600160a01b038316611b655760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161061d565b336000611b71846123cb565b90506000611b7e846123cb565b60408051602080820183526000918290528882528181528282206001600160a01b038b1683529052205490915084811015611c205760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161061d565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a460408051602081019091526000905261103d565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600480546040516392a296c960e01b8152602092810192909252600760248301526621312a37b5b2b760c91b60448301526001600160a01b0316906392a296c990606401602060405180830381865afa158015611d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7c91906132e1565b60608201516040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101919091526001600160a01b0391909116906323b872dd906064016020604051808303816000875af1158015611df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1491906136dd565b50611e3333600e54600160405180602001604052806000815250612416565b611e3c8161253d565b604080518251815260208084015190820152818301519181019190915260608083015190820152608080830151908201527f7ad296569c87e87d552d36b77ff2085e40f6eb004a2af3d19796729b4da818209060a00161120b565b816001600160a01b0316836001600160a01b031603611f1e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161061d565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60606000611f988361258e565b600101905060008167ffffffffffffffff811115611fb857611fb86129c7565b6040519080825280601f01601f191660200182016040528015611fe2576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084611fec57509392505050565b600480546040516392a296c960e01b8152602092810192909252600760248301526621312a37b5b2b760c91b60448301526001600160a01b0316906392a296c990606401602060405180830381865afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b091906132e1565b6000828152600b6020526040908190206003015490517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101919091526001600160a01b03919091169063a9059cbb906044016020604051808303816000875af115801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906136dd565b506000818152600b6020526040812081815560018101829055600281018290556003810182905560040155600e54610caa9033908390611ae9565b6001600160a01b0385163314806121a757506121a78533610546565b6122195760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161061d565b6109698585858585612670565b6001600160a01b0384163b15611ae15760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061226a90899089908890889088906004016136fa565b6020604051808303816000875af19250505080156122a5575060408051601f3d908101601f191682019092526122a29181019061374c565b60015b61235a576122b1613769565b806308c379a0036122ea57506122c5613785565b806122d057506122ec565b8060405162461bcd60e51b815260040161061d9190612bed565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161061d565b6001600160e01b0319811663bc197c8160e01b1461103d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161061d565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061240557612405613201565b602090810291909101015292915050565b6001600160a01b0384166124925760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161061d565b33600061249e856123cb565b905060006124ab856123cb565b90506000868152602081815260408083206001600160a01b038b168452909152812080548792906124dd908490613317565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461103d8360008989898961282e565b428152612548610e11565b60808201908152600e546000908152600b602090815260409182902084518155908401516001820155908301516002820155606090920151600383015551600490910155565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106125d7577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612603576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061262157662386f26fc10000830492506010015b6305f5e1008310612639576305f5e100830492506008015b612710831061264d57612710830492506004015b6064831061265f576064830492506002015b600a83106106495760010192915050565b6001600160a01b0384166126d45760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161061d565b3360006126e0856123cb565b905060006126ed856123cb565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156127865760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161061d565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127c3908490613317565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612823848a8a8a8a8a61282e565b505050505050505050565b6001600160a01b0384163b15611ae15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612872908990899088908890889060040161380f565b6020604051808303816000875af19250505080156128ad575060408051601f3d908101601f191682019092526128aa9181019061374c565b60015b6128b9576122b1613769565b6001600160e01b0319811663f23a6e6160e01b1461103d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161061d565b6001600160a01b0381168114610caa57600080fd5b6000806040838503121561295257600080fd5b823561295d8161292a565b946020939093013593505050565b6000806040838503121561297e57600080fd5b50508035926020909101359150565b6001600160e01b031981168114610caa57600080fd5b6000602082840312156129b557600080fd5b81356129c08161298d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60a0810181811067ffffffffffffffff821117156129fd576129fd6129c7565b60405250565b6040810181811067ffffffffffffffff821117156129fd576129fd6129c7565b601f8201601f1916810167ffffffffffffffff81118282101715612a4957612a496129c7565b6040525050565b600067ffffffffffffffff821115612a6a57612a6a6129c7565b5060051b60200190565b600082601f830112612a8557600080fd5b81356020612a9282612a50565b604051612a9f8282612a23565b83815260059390931b8501820192828101915086841115612abf57600080fd5b8286015b84811015612ada5780358352918301918301612ac3565b509695505050505050565b600060208284031215612af757600080fd5b813567ffffffffffffffff811115612b0e57600080fd5b612b1a84828501612a74565b949350505050565b60005b83811015612b3d578181015183820152602001612b25565b50506000910152565b60008151808452612b5e816020860160208601612b22565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612bc757603f19888603018452612bb5858351612b46565b94509285019290850190600101612b99565b5092979650505050505050565b600060208284031215612be657600080fd5b5035919050565b6020815260006129c06020830184612b46565b600082601f830112612c1157600080fd5b813567ffffffffffffffff811115612c2b57612c2b6129c7565b604051612c42601f8301601f191660200182612a23565b818152846020838601011115612c5757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612c8c57600080fd5b8535612c978161292a565b94506020860135612ca78161292a565b9350604086013567ffffffffffffffff80821115612cc457600080fd5b612cd089838a01612a74565b94506060880135915080821115612ce657600080fd5b612cf289838a01612a74565b93506080880135915080821115612d0857600080fd5b50612d1588828901612c00565b9150509295509295909350565b604081526000612d356040830185612b46565b8281036020840152612d478185612b46565b95945050505050565b60008060408385031215612d6357600080fd5b823567ffffffffffffffff80821115612d7b57600080fd5b818501915085601f830112612d8f57600080fd5b81356020612d9c82612a50565b604051612da98282612a23565b83815260059390931b8501820192828101915089841115612dc957600080fd5b948201945b83861015612df0578535612de18161292a565b82529482019490820190612dce565b96505086013592505080821115612e0657600080fd5b50612e1385828601612a74565b9150509250929050565b600081518084526020808501945080840160005b83811015612e4d57815187529582019590820190600101612e31565b509495945050505050565b6020815260006129c06020830184612e1d565b60008060408385031215612e7e57600080fd5b823567ffffffffffffffff80821115612e9657600080fd5b612ea286838701612c00565b93506020850135915080821115612eb857600080fd5b50612e1385828601612c00565b600080600060608486031215612eda57600080fd5b8335612ee58161292a565b9250602084013567ffffffffffffffff80821115612f0257600080fd5b612f0e87838801612a74565b93506040860135915080821115612f2457600080fd5b50612f3186828701612a74565b9150509250925092565b60006020808385031215612f4e57600080fd5b823567ffffffffffffffff811115612f6557600080fd5b8301601f81018513612f7657600080fd5b8035612f8181612a50565b60408051612f8f8382612a23565b83815260a09384028501860193868201935089851115612fae57600080fd5b948601945b8486101561300d5780868b031215612fcb5760008081fd5b8251612fd6816129dd565b8635815287870135888201528387013584820152606080880135908201526080808801359082015284529485019492860192612fb3565b5098975050505050505050565b8015158114610caa57600080fd5b6000806040838503121561303b57600080fd5b82356130468161292a565b915060208301356130568161301a565b809150509250929050565b6000602080838503121561307457600080fd5b823567ffffffffffffffff8082111561308c57600080fd5b818501915085601f8301126130a057600080fd5b6040516130ac81612a03565b8060408401888111156130be57600080fd5b845b818110156130f2578035858111156130d85760008081fd5b6130e48b828901612c00565b8452509186019186016130c0565b509198975050505050505050565b6000806040838503121561311357600080fd5b823567ffffffffffffffff8082111561312b57600080fd5b61313786838701612a74565b93506020850135915080821115612e0657600080fd5b60006020828403121561315f57600080fd5b81356129c08161292a565b6000806040838503121561317d57600080fd5b82356131888161292a565b915060208301356130568161292a565b600080600080600060a086880312156131b057600080fd5b85356131bb8161292a565b945060208601356131cb8161292a565b93506040860135925060608601359150608086013567ffffffffffffffff8111156131f557600080fd5b612d1588828901612c00565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161323f5761323f613217565b5060010190565b60008251613258818460208701612b22565b9190910192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161329a81601d850160208701612b22565b91909101601d0192915050565b600181811c908216806132bb57607f821691505b6020821081036132db57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156132f357600080fd5b81516129c08161292a565b60006020828403121561331057600080fd5b5051919050565b8082018082111561064957610649613217565b601f821115610e0c57600081815260208120601f850160051c810160208610156133515750805b601f850160051c820191505b81811015611ae15782815560010161335d565b815167ffffffffffffffff81111561338a5761338a6129c7565b61339e8161339884546132a7565b8461332a565b602080601f8311600181146133d357600084156133bb5750858301515b600019600386901b1c1916600185901b178555611ae1565b600085815260208120601f198616915b82811015613402578886015182559484019460019091019084016133e3565b50858210156134205787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008261344d57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761064957610649613217565b6001600160a01b038416815260606020820152600061348b6060830185612e1d565b828103604084015261349d8185612e1d565b9695505050505050565b600081546134b4816132a7565b600182811680156134cc57600181146134e157613510565b60ff1984168752821515830287019450613510565b8560005260208060002060005b858110156135075781548a8201529084019082016134ee565b50505082870194505b5050505092915050565b7f7b0000000000000000000000000000000000000000000000000000000000000081527f226e616d65223a220000000000000000000000000000000000000000000000006001820152600061357260098301876134a7565b7f2023000000000000000000000000000000000000000000000000000000000000815285516135a8816002840160208a01612b22565b8082019150507f222c0000000000000000000000000000000000000000000000000000000000008060028301527f226465736372697074696f6e223a0000000000000000000000000000000000006004830152601160f91b80601284015261361360138401886134a7565b9182527f22696d616765223a0000000000000000000000000000000000000000000000006002830152600a820152845190915061365781600b840160208801612b22565b613699613670600b83850101601160f91b815260010190565b7f7d00000000000000000000000000000000000000000000000000000000000000815260010190565b98975050505050505050565b8181038181111561064957610649613217565b6040815260006136cb6040830185612e1d565b8281036020840152612d478185612e1d565b6000602082840312156136ef57600080fd5b81516129c08161301a565b60006001600160a01b03808816835280871660208401525060a0604083015261372660a0830186612e1d565b82810360608401526137388186612e1d565b905082810360808401526136998185612b46565b60006020828403121561375e57600080fd5b81516129c08161298d565b600060033d11156137825760046000803e5060005160e01c5b90565b600060443d10156137935790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156137c357505050505090565b82850191508151818111156137db5750505050505090565b843d87010160208285010111156137f55750505050505090565b61380460208286010187612a23565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261384760a0830184612b46565b97965050505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212207dd380f0d4feaf0e66c6cae57069cc99f58e131af6c437ee7810e2034e7e9c8164736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102405760003560e01c80637b10399911610145578063d05dcc6a116100bd578063e6eee47d1161008c578063eb08ab2811610071578063eb08ab2814610574578063f242432a1461057d578063f2fde38b1461059057600080fd5b8063e6eee47d14610525578063e985e9c51461053857600080fd5b8063d05dcc6a14610487578063d2cd99d0146104ec578063de986450146104ff578063e2047bc81461051257600080fd5b8063a574cea411610114578063bc2aba3c116100f9578063bc2aba3c14610453578063c1483e5a14610466578063c53108681461047957600080fd5b8063a574cea41461042d578063aa097f151461044057600080fd5b80637b103999146103cb57806385aeab40146103f65780638da5cb5b14610409578063a22cb4651461041a57600080fd5b8063392f37e9116101d85780635257b566116101a75780636b20c4541161018c5780636b20c4541461039d578063715018a6146103b0578063774d33af146103b857600080fd5b80635257b5661461036d57806364337f411461037557600080fd5b8063392f37e91461031157806342966c68146103275780634e1273f41461033a57806351335b501461035a57600080fd5b80630e89341c116102145780630e89341c146102c35780632607aafa146102e35780632eb2c2d6146102f6578063310e966d1461030957600080fd5b8062fdd58e14610245578063011163ba1461026b57806301ffc9a714610280578063028f3002146102a3575b600080fd5b61025861025336600461293f565b6105a3565b6040519081526020015b60405180910390f35b61027e61027936600461296b565b61064f565b005b61029361028e3660046129a3565b610662565b6040519015158152602001610262565b6102b66102b1366004612ae5565b6106fd565b6040516102629190612b72565b6102d66102d1366004612bd4565b6107b6565b6040516102629190612bed565b6102d66102f1366004612bd4565b610814565b61027e610304366004612c74565b6108ce565b610258610970565b610319610af9565b604051610262929190612d22565b61027e610335366004612bd4565b610c19565b61034d610348366004612d50565b610cad565b6040516102629190612e58565b61027e610368366004612e6b565b610deb565b610258610e11565b610388610383366004612bd4565b610e42565b60408051928352602083019190915201610262565b61027e6103ab366004612ec5565b610f0b565b61027e611046565b61027e6103c6366004612f3b565b61105a565b6004546103de906001600160a01b031681565b6040516001600160a01b039091168152602001610262565b61027e610404366004612bd4565b6110b4565b6003546001600160a01b03166103de565b61027e610428366004613028565b611216565b6102d661043b366004612bd4565b611221565b61025861044e366004612bd4565b611265565b610258610461366004612bd4565b611286565b61027e610474366004613061565b611296565b600554600654610388919082565b6104c4610495366004612bd4565b600b60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a001610262565b61027e6104fa366004613100565b6112c0565b61027e61050d366004612bd4565b6113ab565b610388610520366004612bd4565b611493565b61027e61053336600461314d565b611560565b61029361054636600461316a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610258600e5481565b61027e61058b366004613198565b611597565b61027e61059e36600461314d565b611629565b60006001600160a01b0383166106265760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b6106576116b6565b600591909155600655565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806106c557506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061064957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610649565b60606000825167ffffffffffffffff81111561071b5761071b6129c7565b60405190808252806020026020018201604052801561074e57816020015b60608152602001906001900390816107395790505b50905060005b83518110156107af5761077f84828151811061077257610772613201565b6020026020010151610814565b82828151811061079157610791613201565b602002602001018190525080806107a79061322d565b915050610754565b5092915050565b606060006107c383611221565b6040516020016107d39190613246565b60405160208183030381529060405290506107ed81611710565b6040516020016107fd9190613262565b604051602081830303815290604052915050919050565b6000818152600b6020526040812060020154606091901515908161083957600961083c565b600a5b8054610847906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610873906132a7565b80156108c05780601f10610895576101008083540402835291602001916108c0565b820191906000526020600020905b8154815290600101906020018083116108a357829003601f168201915b509398975050505050505050565b6001600160a01b0385163314806108ea57506108ea8533610546565b61095c5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161061d565b6109698585858585611863565b5050505050565b600480546040516392a296c960e01b815260009283926001600160a01b0316916392a296c9916109bc910160208082526007908201526621312a37b5b2b760c91b604082015260600190565b602060405180830381865afa1580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fd91906132e1565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5e91906132fe565b90506000805b600c548110156107af57600c8181548110610a8157610a81613201565b906000526020600020015483118015610ac15750600c610aa2826001613317565b81548110610ab257610ab2613201565b90600052602060002001548311155b15610ae757600c8181548110610ad957610ad9613201565b906000526020600020015491505b80610af18161322d565b915050610a64565b600780548190610b08906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610b34906132a7565b8015610b815780601f10610b5657610100808354040283529160200191610b81565b820191906000526020600020905b815481529060010190602001808311610b6457829003601f168201915b505050505090806001018054610b96906132a7565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc2906132a7565b8015610c0f5780601f10610be457610100808354040283529160200191610c0f565b820191906000526020600020905b815481529060010190602001808311610bf257829003601f168201915b5050505050905082565b6000818152600b602052604090206002015415610c9e5760405162461bcd60e51b815260206004820152602f60248201527f4346413a20456c20434641206573746120626c6f71756561646f2079206e6f2060448201527f7365207075656465207175656d61720000000000000000000000000000000000606482015260840161061d565b610caa33826001611ae9565b50565b60608151835114610d265760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d617463680000000000000000000000000000000000000000000000606482015260840161061d565b6000835167ffffffffffffffff811115610d4257610d426129c7565b604051908082528060200260200182016040528015610d6b578160200160208202803683370190505b50905060005b8451811015610de357610db6858281518110610d8f57610d8f613201565b6020026020010151858381518110610da957610da9613201565b60200260200101516105a3565b828281518110610dc857610dc8613201565b6020908102919091010152610ddc8161322d565b9050610d71565b509392505050565b610df36116b6565b6007610dff8382613370565b506008610e0c8282613370565b505050565b600080610e1c610970565b9050600d8181548110610e3157610e31613201565b906000526020600020015491505090565b6000818152600b602052604081206003810154600190910154600d80548493928492918110610e7357610e73613201565b6000918252602080832090910154878352600b909152604082206001015490925062278d009190610ea5908390613430565b90506127106000805b83811015610efb57600083610ec3888a613452565b610ecd9190613430565b9050610ed98189613317565b9750610ee58184613317565b9250508080610ef39061322d565b915050610eae565b5094989497509395505050505050565b60005b8251811015610fce57600b6000848381518110610f2d57610f2d613201565b6020026020010151815260200190815260200160002060020154600014610fbc5760405162461bcd60e51b815260206004820152602860248201527f4346413a204e6f207365207075656465207175656d617220756e20434641206260448201527f6c6f71756561646f000000000000000000000000000000000000000000000000606482015260840161061d565b80610fc68161322d565b915050610f0e565b506040517f6b20c4540000000000000000000000000000000000000000000000000000000081523090636b20c4549061100f90869086908690600401613469565b600060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b50505050505050565b61104e6116b6565b6110586000611c98565b565b60005b81518110156110b05761108882828151811061107b5761107b613201565b6020026020010151611cf7565b600e80549060006110988361322d565b919050555080806110a89061322d565b91505061105d565b5050565b6000818152600b6020526040902060020154156111135760405162461bcd60e51b815260206004820152601d60248201527f536176696e67733a2043464120697320616c726561647920626f756e64000000604482015260640161061d565b600061111f33836105a3565b116111925760405162461bcd60e51b815260206004820152602760248201527f536176696e67733a20434641206973206e6f74206f776e65642062792074686560448201527f2063616c6c657200000000000000000000000000000000000000000000000000606482015260840161061d565b6000818152600b602052604090819020426002820181905591517fd37b000af6086badd48df55660020594d6bd96d909fbacfa7f53f7d1b7c321189261120b929182548152600183015460208201526002830154604082015260038301546060820152600490920154608083015260a082015260c00190565b60405180910390a150565b6110b0338383611e97565b60606000600761123084611f8b565b600861123b86610814565b60405160200161124e949392919061351a565b60408051601f198184030181529190529392505050565b600d818154811061127557600080fd5b600091825260209091200154905081565b600c818154811061127557600080fd5b61129e6116b6565b80516009906112ad9082613370565b506020810151600a906110b09082613370565b6112c86116b6565b80518251146113195760405162461bcd60e51b815260206004820152601660248201527f536176696e67733a20496e76616c696420696e70757400000000000000000000604482015260640161061d565b60005b8251811015610e0c5782818151811061133757611337613201565b6020026020010151600c828154811061135257611352613201565b906000526020600020018190555081818151811061137257611372613201565b6020026020010151600d828154811061138d5761138d613201565b600091825260209091200155806113a38161322d565b91505061131c565b6000818152600b602052604090206001810154905442916113cb91613317565b106114185760405162461bcd60e51b815260206004820152601b60248201527f536176696e67733a20434641206973206e6f74206d6174757265640000000000604482015260640161061d565b6114218161202b565b6000818152600b60205260409081902090517f40dec9c4da4f817eeec99e12dddc2acfb51cca895c933e897a902eb5454e80969161120b91429082548152600183015460208201526002830154604082015260038301546060820152600490920154608083015260a082015260c00190565b6000818152600b602052604081206003810154600190910154600d805484939284929181106114c4576114c4613201565b6000918252602080832090910154878352600b909152604082205490925062278d00906114f190426136a5565b6114fb9190613430565b90506127106000805b83811015611551576000836115198789613452565b6115239190613430565b905061152f8188613317565b965061153b8184613317565b92505080806115499061322d565b915050611504565b50939793965092945050505050565b6115686116b6565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000838152600b60205260409020600201541561161c5760405162461bcd60e51b815260206004820152603360248201527f4346413a20456c20434641206573746120626c6f71756561646f2079206e6f2060448201527f7365207075656465207472616e73666572697200000000000000000000000000606482015260840161061d565b610969858585858561218b565b6116316116b6565b6001600160a01b0381166116ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161061d565b610caa81611c98565b6003546001600160a01b031633146110585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061d565b6060815160000361172f57505060408051602081019091526000815290565b6000604051806060016040528060408152602001613853604091399050600060038451600261175e9190613317565b6117689190613430565b611773906004613452565b67ffffffffffffffff81111561178b5761178b6129c7565b6040519080825280601f01601f1916602001820160405280156117b5576020820181803683370190505b509050600182016020820185865187015b80821015611821576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f81168501518453506001830192506117c6565b505060038651066001811461183d576002811461185057611858565b603d6001830353603d6002830353611858565b603d60018303535b509195945050505050565b81518351146118da5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d61746368000000000000000000000000000000000000000000000000606482015260840161061d565b6001600160a01b03841661193e5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161061d565b3360005b8451811015611a7b57600085828151811061195f5761195f613201565b60200260200101519050600085838151811061197d5761197d613201565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015611a235760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161061d565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611a60908490613317565b9250508190555050505080611a749061322d565b9050611942565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611acb9291906136b8565b60405180910390a4611ae1818787878787612226565b505050505050565b6001600160a01b038316611b655760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161061d565b336000611b71846123cb565b90506000611b7e846123cb565b60408051602080820183526000918290528882528181528282206001600160a01b038b1683529052205490915084811015611c205760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e636500000000000000000000000000000000000000000000000000000000606482015260840161061d565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a460408051602081019091526000905261103d565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600480546040516392a296c960e01b8152602092810192909252600760248301526621312a37b5b2b760c91b60448301526001600160a01b0316906392a296c990606401602060405180830381865afa158015611d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7c91906132e1565b60608201516040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101919091526001600160a01b0391909116906323b872dd906064016020604051808303816000875af1158015611df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1491906136dd565b50611e3333600e54600160405180602001604052806000815250612416565b611e3c8161253d565b604080518251815260208084015190820152818301519181019190915260608083015190820152608080830151908201527f7ad296569c87e87d552d36b77ff2085e40f6eb004a2af3d19796729b4da818209060a00161120b565b816001600160a01b0316836001600160a01b031603611f1e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c660000000000000000000000000000000000000000000000606482015260840161061d565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60606000611f988361258e565b600101905060008167ffffffffffffffff811115611fb857611fb86129c7565b6040519080825280601f01601f191660200182016040528015611fe2576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084611fec57509392505050565b600480546040516392a296c960e01b8152602092810192909252600760248301526621312a37b5b2b760c91b60448301526001600160a01b0316906392a296c990606401602060405180830381865afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b091906132e1565b6000828152600b6020526040908190206003015490517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101919091526001600160a01b03919091169063a9059cbb906044016020604051808303816000875af115801561212c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215091906136dd565b506000818152600b6020526040812081815560018101829055600281018290556003810182905560040155600e54610caa9033908390611ae9565b6001600160a01b0385163314806121a757506121a78533610546565b6122195760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f766564000000000000000000000000000000000000606482015260840161061d565b6109698585858585612670565b6001600160a01b0384163b15611ae15760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061226a90899089908890889088906004016136fa565b6020604051808303816000875af19250505080156122a5575060408051601f3d908101601f191682019092526122a29181019061374c565b60015b61235a576122b1613769565b806308c379a0036122ea57506122c5613785565b806122d057506122ec565b8060405162461bcd60e51b815260040161061d9190612bed565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161061d565b6001600160e01b0319811663bc197c8160e01b1461103d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161061d565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061240557612405613201565b602090810291909101015292915050565b6001600160a01b0384166124925760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161061d565b33600061249e856123cb565b905060006124ab856123cb565b90506000868152602081815260408083206001600160a01b038b168452909152812080548792906124dd908490613317565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461103d8360008989898961282e565b428152612548610e11565b60808201908152600e546000908152600b602090815260409182902084518155908401516001820155908301516002820155606090920151600383015551600490910155565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106125d7577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612603576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061262157662386f26fc10000830492506010015b6305f5e1008310612639576305f5e100830492506008015b612710831061264d57612710830492506004015b6064831061265f576064830492506002015b600a83106106495760010192915050565b6001600160a01b0384166126d45760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161061d565b3360006126e0856123cb565b905060006126ed856123cb565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156127865760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e7366657200000000000000000000000000000000000000000000606482015260840161061d565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906127c3908490613317565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612823848a8a8a8a8a61282e565b505050505050505050565b6001600160a01b0384163b15611ae15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612872908990899088908890889060040161380f565b6020604051808303816000875af19250505080156128ad575060408051601f3d908101601f191682019092526128aa9181019061374c565b60015b6128b9576122b1613769565b6001600160e01b0319811663f23a6e6160e01b1461103d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161061d565b6001600160a01b0381168114610caa57600080fd5b6000806040838503121561295257600080fd5b823561295d8161292a565b946020939093013593505050565b6000806040838503121561297e57600080fd5b50508035926020909101359150565b6001600160e01b031981168114610caa57600080fd5b6000602082840312156129b557600080fd5b81356129c08161298d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60a0810181811067ffffffffffffffff821117156129fd576129fd6129c7565b60405250565b6040810181811067ffffffffffffffff821117156129fd576129fd6129c7565b601f8201601f1916810167ffffffffffffffff81118282101715612a4957612a496129c7565b6040525050565b600067ffffffffffffffff821115612a6a57612a6a6129c7565b5060051b60200190565b600082601f830112612a8557600080fd5b81356020612a9282612a50565b604051612a9f8282612a23565b83815260059390931b8501820192828101915086841115612abf57600080fd5b8286015b84811015612ada5780358352918301918301612ac3565b509695505050505050565b600060208284031215612af757600080fd5b813567ffffffffffffffff811115612b0e57600080fd5b612b1a84828501612a74565b949350505050565b60005b83811015612b3d578181015183820152602001612b25565b50506000910152565b60008151808452612b5e816020860160208601612b22565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612bc757603f19888603018452612bb5858351612b46565b94509285019290850190600101612b99565b5092979650505050505050565b600060208284031215612be657600080fd5b5035919050565b6020815260006129c06020830184612b46565b600082601f830112612c1157600080fd5b813567ffffffffffffffff811115612c2b57612c2b6129c7565b604051612c42601f8301601f191660200182612a23565b818152846020838601011115612c5757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612c8c57600080fd5b8535612c978161292a565b94506020860135612ca78161292a565b9350604086013567ffffffffffffffff80821115612cc457600080fd5b612cd089838a01612a74565b94506060880135915080821115612ce657600080fd5b612cf289838a01612a74565b93506080880135915080821115612d0857600080fd5b50612d1588828901612c00565b9150509295509295909350565b604081526000612d356040830185612b46565b8281036020840152612d478185612b46565b95945050505050565b60008060408385031215612d6357600080fd5b823567ffffffffffffffff80821115612d7b57600080fd5b818501915085601f830112612d8f57600080fd5b81356020612d9c82612a50565b604051612da98282612a23565b83815260059390931b8501820192828101915089841115612dc957600080fd5b948201945b83861015612df0578535612de18161292a565b82529482019490820190612dce565b96505086013592505080821115612e0657600080fd5b50612e1385828601612a74565b9150509250929050565b600081518084526020808501945080840160005b83811015612e4d57815187529582019590820190600101612e31565b509495945050505050565b6020815260006129c06020830184612e1d565b60008060408385031215612e7e57600080fd5b823567ffffffffffffffff80821115612e9657600080fd5b612ea286838701612c00565b93506020850135915080821115612eb857600080fd5b50612e1385828601612c00565b600080600060608486031215612eda57600080fd5b8335612ee58161292a565b9250602084013567ffffffffffffffff80821115612f0257600080fd5b612f0e87838801612a74565b93506040860135915080821115612f2457600080fd5b50612f3186828701612a74565b9150509250925092565b60006020808385031215612f4e57600080fd5b823567ffffffffffffffff811115612f6557600080fd5b8301601f81018513612f7657600080fd5b8035612f8181612a50565b60408051612f8f8382612a23565b83815260a09384028501860193868201935089851115612fae57600080fd5b948601945b8486101561300d5780868b031215612fcb5760008081fd5b8251612fd6816129dd565b8635815287870135888201528387013584820152606080880135908201526080808801359082015284529485019492860192612fb3565b5098975050505050505050565b8015158114610caa57600080fd5b6000806040838503121561303b57600080fd5b82356130468161292a565b915060208301356130568161301a565b809150509250929050565b6000602080838503121561307457600080fd5b823567ffffffffffffffff8082111561308c57600080fd5b818501915085601f8301126130a057600080fd5b6040516130ac81612a03565b8060408401888111156130be57600080fd5b845b818110156130f2578035858111156130d85760008081fd5b6130e48b828901612c00565b8452509186019186016130c0565b509198975050505050505050565b6000806040838503121561311357600080fd5b823567ffffffffffffffff8082111561312b57600080fd5b61313786838701612a74565b93506020850135915080821115612e0657600080fd5b60006020828403121561315f57600080fd5b81356129c08161292a565b6000806040838503121561317d57600080fd5b82356131888161292a565b915060208301356130568161292a565b600080600080600060a086880312156131b057600080fd5b85356131bb8161292a565b945060208601356131cb8161292a565b93506040860135925060608601359150608086013567ffffffffffffffff8111156131f557600080fd5b612d1588828901612c00565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161323f5761323f613217565b5060010190565b60008251613258818460208701612b22565b9190910192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161329a81601d850160208701612b22565b91909101601d0192915050565b600181811c908216806132bb57607f821691505b6020821081036132db57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156132f357600080fd5b81516129c08161292a565b60006020828403121561331057600080fd5b5051919050565b8082018082111561064957610649613217565b601f821115610e0c57600081815260208120601f850160051c810160208610156133515750805b601f850160051c820191505b81811015611ae15782815560010161335d565b815167ffffffffffffffff81111561338a5761338a6129c7565b61339e8161339884546132a7565b8461332a565b602080601f8311600181146133d357600084156133bb5750858301515b600019600386901b1c1916600185901b178555611ae1565b600085815260208120601f198616915b82811015613402578886015182559484019460019091019084016133e3565b50858210156134205787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008261344d57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761064957610649613217565b6001600160a01b038416815260606020820152600061348b6060830185612e1d565b828103604084015261349d8185612e1d565b9695505050505050565b600081546134b4816132a7565b600182811680156134cc57600181146134e157613510565b60ff1984168752821515830287019450613510565b8560005260208060002060005b858110156135075781548a8201529084019082016134ee565b50505082870194505b5050505092915050565b7f7b0000000000000000000000000000000000000000000000000000000000000081527f226e616d65223a220000000000000000000000000000000000000000000000006001820152600061357260098301876134a7565b7f2023000000000000000000000000000000000000000000000000000000000000815285516135a8816002840160208a01612b22565b8082019150507f222c0000000000000000000000000000000000000000000000000000000000008060028301527f226465736372697074696f6e223a0000000000000000000000000000000000006004830152601160f91b80601284015261361360138401886134a7565b9182527f22696d616765223a0000000000000000000000000000000000000000000000006002830152600a820152845190915061365781600b840160208801612b22565b613699613670600b83850101601160f91b815260010190565b7f7d00000000000000000000000000000000000000000000000000000000000000815260010190565b98975050505050505050565b8181038181111561064957610649613217565b6040815260006136cb6040830185612e1d565b8281036020840152612d478185612e1d565b6000602082840312156136ef57600080fd5b81516129c08161301a565b60006001600160a01b03808816835280871660208401525060a0604083015261372660a0830186612e1d565b82810360608401526137388186612e1d565b905082810360808401526136998185612b46565b60006020828403121561375e57600080fd5b81516129c08161298d565b600060033d11156137825760046000803e5060005160e01c5b90565b600060443d10156137935790565b6040516003193d81016004833e81513d67ffffffffffffffff81602484011181841117156137c357505050505090565b82850191508151818111156137db5750505050505090565b843d87010160208285010111156137f55750505050505090565b61380460208286010187612a23565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261384760a0830184612b46565b97965050505050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212207dd380f0d4feaf0e66c6cae57069cc99f58e131af6c437ee7810e2034e7e9c8164736f6c63430008110033
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.