Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
100,000,000,000 PEOP
Holders
30
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.000000000000000001 PEOPValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Peop
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Snapshot.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./public.sol"; /** * @title PEOP Contract * @dev This contract allows for snapshot-based dividend distribution among token holders. * It leverages ERC20Snapshot for capturing token balances at specific points to calculate dividends. */ contract Peop is ERC20Snapshot, Ownable, ReentrancyGuard { receive() external payable {} struct Proposal { uint256 id; uint256 sid; uint votedWeight; uint256 dividends; mapping(address => eStatus) status; } enum eStatus { notVoted, voted, claimed } IDividendsPool public dividendsPool; IPeopOption public peopOption; Proposal[] public dividendsProposals; Proposal[] public adjustFeeProposals; uint public votesForIncrease; uint public votesForDecrease; mapping(uint256 => uint256) public snapshotDividends; event voteForDividendsSucc(uint256 indexed dividendsProposalId, uint256 indexed snapId, uint256 indexed dividends); event voteForAdjustProtoFeeSucc(uint256 indexed adjustProtoFeeProposalId, bool indexed increase); event sendToDividendsPoolSucc(uint256 indexed amount); /** * @dev Constructor to mint initial supply of tokens and set up initial proposals. * @param _initialSupply Initial amount of tokens to mint. * @param _dividendsPool Address of the dividends pool contract. */ constructor(uint256 _initialSupply, address _dividendsPool) ERC20("PepeOption", "PEOP") { _mint(msg.sender, _initialSupply); dividendsPool = IDividendsPool(_dividendsPool); _createdividendProposal(); _createAdjustProtoFeeProposal(); } /** * @dev Sets the PEOP option contract address. * @param _peopOptionAddr Address of the PEOP option contract. */ function setPeopOptionContract(address _peopOptionAddr) external onlyOwner { peopOption = IPeopOption(_peopOptionAddr); } /** * @dev Retrieve the IDs of the latest proposals for dividends and fee adjustments. * @return dividendsProposalId The ID of the latest dividends proposal. * @return adjustFeeProposalId The ID of the latest fee adjustment proposal. */ function getProposalId() external view returns (uint256, uint256) { uint256 dividendsProposalId = 0; uint256 adjustFeeProposalId = 0; if (dividendsProposals.length > 0) { dividendsProposalId = dividendsProposals.length - 1; } if (adjustFeeProposals.length > 0) { adjustFeeProposalId = adjustFeeProposals.length - 1; } return (dividendsProposalId, adjustFeeProposalId); } /** * @dev Retrieves the voting status for a specific address from both dividends and fee adjustment proposals. * This function is used to check whether an address has voted on specific proposals and the status of those votes. * * @param dividendsProposalId The ID of the dividends proposal to check the status for. * @param adjustFeeProposalId The ID of the fee adjustment proposal to check the status for. * @param addr The address of the user whose status is to be checked. * * @return eStatus The voting status in the dividends proposal for the specified address. * @return eStatus The voting status in the fee adjustment proposal for the specified address. * * @notice This function requires the proposal IDs to be valid (i.e., the ID should exist within the array bounds). * It ensures data integrity by confirming that the provided IDs correspond to actual proposals. * * @custom:error "invalid dividendsProposalId" Indicates that the provided dividends proposal ID does not exist. * @custom:error "invalid adjustFeeProposalId" Indicates that the provided fee adjustment proposal ID does not exist. */ function getProposalStatus(uint256 dividendsProposalId, uint256 adjustFeeProposalId, address addr) external view returns (eStatus, eStatus) { require(dividendsProposalId < dividendsProposals.length, "invalid dividendsProposalId"); require(adjustFeeProposalId < adjustFeeProposals.length, "invalid adjustFeeProposalId"); eStatus dStatus = dividendsProposals[dividendsProposalId].status[addr]; eStatus aStatus = adjustFeeProposals[adjustFeeProposalId].status[addr]; return (dStatus, aStatus); } /** * @dev Allows a token holder to vote on the current dividends proposal. Each token holder can only vote once per proposal. * Voting also involves checking if the voter's weight is sufficient to make decisions for the proposal. * If the voted weight reaches more than half of the total supply, the proposal is considered accepted, * and the dividends are distributed accordingly. * * @notice This function is protected against reentrancy attacks. * It ensures that a voter can only participate if they haven't voted yet and possess tokens at the snapshot time. * * @custom:error "No proposal exists" Thrown if there are no active dividend proposals to vote on. * @custom:error "You already voted" Thrown if the caller has already participated in the current proposal. * @custom:error "No voting rights" Thrown if the caller does not have any tokens at the time of the proposal snapshot. */ function voteForDividends() public nonReentrant { require(dividendsProposals.length > 0, "No proposal exists"); uint256 proposalId = dividendsProposals.length - 1; Proposal storage proposal = dividendsProposals[proposalId]; require(proposal.status[msg.sender] == eStatus.notVoted, "You already voted"); uint256 voterWeight = balanceOfAt(msg.sender, proposal.sid); require(voterWeight > 0, "No voting rights"); proposal.status[msg.sender] = eStatus.voted; proposal.votedWeight += voterWeight; if (proposal.votedWeight >= totalSupply() / 2) { uint256 availableDividends = address(this).balance; proposal.dividends = availableDividends; emit voteForDividendsSucc(proposal.id, proposal.sid, proposal.dividends); snapshotDividends[proposal.sid] = availableDividends; if (availableDividends > 0) { _sendToDividendsPool(); } _createdividendProposal(); } } function _createdividendProposal() private { uint256 _sid = _snapshot(); uint256 proposalId = dividendsProposals.length; dividendsProposals.push(); Proposal storage newProposal = dividendsProposals[proposalId]; newProposal.id = proposalId; newProposal.sid = _sid; } /** * @dev Allows token holders to vote on adjusting the protocol fee. This function can be used to increase or decrease * the protocol fee based on the majority vote. * @param increase Boolean value where true represents a vote to increase the fee and false to decrease it. * * @notice This function is protected against reentrancy attacks. * It requires: * - At least one adjust fee proposal to exist. * - The caller not to have voted already on the current proposal. * - The caller to have voting rights, i.e., a non-zero balance at the time of the proposal's snapshot. * * Events: * - voteForAdjustProtoFeeSucc: Emitted when a decision on fee adjustment is reached. * * @custom:error "No proposal exists" - Thrown if there are no active fee adjustment proposals. * @custom:error "You already voted" - Thrown if the caller has already voted in the current proposal. * @custom:error "No voting rights" - Thrown if the caller does not have any tokens at the time of the proposal snapshot. */ function voteForAdjustProtoFee(bool increase) public nonReentrant { require(adjustFeeProposals.length > 0, "No proposal exists"); uint256 proposalId = adjustFeeProposals.length - 1; Proposal storage proposal = adjustFeeProposals[proposalId]; require(proposal.status[msg.sender] == eStatus.notVoted, "You already voted"); uint256 voterWeight = balanceOfAt(msg.sender, proposal.sid); require(voterWeight > 0, "No voting rights"); proposal.status[msg.sender] = eStatus.voted; if (increase) { votesForIncrease += voterWeight; } else { votesForDecrease += voterWeight; } if ((votesForIncrease + votesForDecrease) >= totalSupply() / 2) { if (votesForIncrease > votesForDecrease) { peopOption.adjustProtocolFee(true); emit voteForAdjustProtoFeeSucc(proposalId, true); } else { peopOption.adjustProtocolFee(false); emit voteForAdjustProtoFeeSucc(proposalId, false); } votesForIncrease = 0; votesForDecrease = 0; _createAdjustProtoFeeProposal(); } } function _createAdjustProtoFeeProposal() private { uint256 _sid = _snapshot(); uint256 proposalId = adjustFeeProposals.length; adjustFeeProposals.push(); Proposal storage newProposal = adjustFeeProposals[proposalId]; newProposal.id = proposalId; newProposal.sid = _sid; } /** * @dev Allows a token holder to claim their dividends from a specific dividends proposal. * This function ensures that dividends are distributed only once per proposal to each eligible token holder, * based on their token balance at the time of the snapshot associated with the proposal. * * @param dividendsProposalId The ID of the dividends proposal from which to claim dividends. * * @custom:error "invalid proposalId" - Thrown if the specified proposal ID does not exist. * @custom:error "you have claimed" - Thrown if the caller has already claimed their dividends for this proposal. * @custom:error "You had no tokens at this snapshot." - Thrown if the caller did not have any tokens at the time of the snapshot, * which is necessary to be eligible for dividends. */ function claimDividends(uint256 dividendsProposalId) public nonReentrant { require(dividendsProposalId < dividendsProposals.length, "invalid proposalId"); Proposal storage p = dividendsProposals[dividendsProposalId]; require(p.status[msg.sender] != eStatus.claimed, "you have claimed"); require(balanceOfAt(msg.sender, p.sid) > 0, "You had no tokens at this snapshot."); uint256 totalSupplyAtSnapshot = totalSupplyAt(p.sid); uint256 userBalanceAtSnapshot = balanceOfAt(msg.sender, p.sid); uint256 dividendPortion = (snapshotDividends[p.sid] * userBalanceAtSnapshot) / totalSupplyAtSnapshot; p.status[msg.sender] = eStatus.claimed; dividendsPool.sendDividends(msg.sender, dividendPortion); } /** * @dev Calculates the amount of dividends an address is entitled to from a specific dividends proposal, * based on their token balance at the snapshot associated with that proposal. * * This function is useful for querying the amount of dividends that an address can claim before actually * making a claim. It ensures transparency and allows token holders to verify their dividend entitlements. * * @param addr The address of the token holder whose dividend entitlement is being calculated. * @param dividendsProposalId The ID of the dividends proposal from which the dividend entitlement is calculated. * * @return uint256 The calculated dividend amount that the address can claim from the specified proposal. * * @notice This function only calculates and returns the dividend amount, and does not involve any state changes or * token transfers. * * @custom:error "invalid proposalId" - Thrown if the specified dividends proposal ID does not exist within * the array of proposals. This ensures the function operates on valid data. */ function dividends(address addr, uint256 dividendsProposalId) external view returns (uint256){ require(dividendsProposalId < dividendsProposals.length, "invalid proposalId"); Proposal storage p = dividendsProposals[dividendsProposalId]; uint256 snapBalance = balanceOfAt(addr, p.sid); uint256 totalSupplyAtSnapshot = totalSupplyAt(p.sid); uint256 dividendPortion = (snapshotDividends[p.sid] * snapBalance) / totalSupplyAtSnapshot; return dividendPortion; } function _sendToDividendsPool() internal { uint256 balance = address(this).balance; require(balance > 0, "_sendTodividendsPool: no ETH available"); emit sendToDividendsPoolSucc(balance); (bool sent, ) = payable(address(dividendsPool)).call{value: balance}(""); require(sent, "_sendTodividendsPool failed"); } }
// 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 v4.4.1 (interfaces/IERC1155.sol) pragma solidity ^0.8.0; import "../token/ERC1155/IERC1155.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// 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/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.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC20Snapshot.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Arrays.sol"; import "../../../utils/Counters.sol"; /** * @dev This contract extends an ERC20 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive implementations it's possible to perform a "double spend" attack by reusing the same balance from different * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be * used to create an efficient ERC20 forking mechanism. * * Snapshots are created by the internal {_snapshot} function, which will emit the {Snapshot} event and return a * snapshot id. To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with the snapshot * id. To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with the snapshot id * and the account address. * * NOTE: Snapshot policy can be customized by overriding the {_getCurrentSnapshotId} method. For example, having it * return `block.number` will trigger the creation of snapshot at the beginning of each new block. When overriding this * function, be careful about the monotonicity of its result. Non-monotonic snapshot ids will break the contract. * * Implementing snapshots for every block using this method will incur significant gas costs. For a gas-efficient * alternative consider {ERC20Votes}. * * ==== Gas Costs * * Snapshots are efficient. Snapshot creation is _O(1)_. Retrieval of balances or total supply from a snapshot is _O(log * n)_ in the number of snapshots that have been created, although _n_ for a specific account will generally be much * smaller since identical balances in subsequent snapshots are stored as a single entry. * * There is a constant overhead for normal ERC20 transfers due to the additional snapshot bookkeeping. This overhead is * only significant for the first transfer that immediately follows a snapshot for a particular account. Subsequent * transfers will have normal cost until the next snapshot, and so on. */ abstract contract ERC20Snapshot is ERC20 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using Arrays for uint256[]; using Counters for Counters.Counter; // Snapshotted values have arrays of ids and the value corresponding to that id. These could be an array of a // Snapshot struct, but that would impede usage of functions that work on an array. struct Snapshots { uint256[] ids; uint256[] values; } mapping(address => Snapshots) private _accountBalanceSnapshots; Snapshots private _totalSupplySnapshots; // Snapshot ids increase monotonically, with the first value being 1. An id of 0 is invalid. Counters.Counter private _currentSnapshotId; /** * @dev Emitted by {_snapshot} when a snapshot identified by `id` is created. */ event Snapshot(uint256 id); /** * @dev Creates a new snapshot and returns its snapshot id. * * Emits a {Snapshot} event that contains the same id. * * {_snapshot} is `internal` and you have to decide how to expose it externally. Its usage may be restricted to a * set of accounts, for example using {AccessControl}, or it may be open to the public. * * [WARNING] * ==== * While an open way of calling {_snapshot} is required for certain trust minimization mechanisms such as forking, * you must consider that it can potentially be used by attackers in two ways. * * First, it can be used to increase the cost of retrieval of values from snapshots, although it will grow * logarithmically thus rendering this attack ineffective in the long term. Second, it can be used to target * specific accounts and increase the cost of ERC20 transfers for them, in the ways specified in the Gas Costs * section above. * * We haven't measured the actual numbers; if this is something you're interested in please reach out to us. * ==== */ function _snapshot() internal virtual returns (uint256) { _currentSnapshotId.increment(); uint256 currentId = _getCurrentSnapshotId(); emit Snapshot(currentId); return currentId; } /** * @dev Get the current snapshotId */ function _getCurrentSnapshotId() internal view virtual returns (uint256) { return _currentSnapshotId.current(); } /** * @dev Retrieves the balance of `account` at the time `snapshotId` was created. */ function balanceOfAt(address account, uint256 snapshotId) public view virtual returns (uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _accountBalanceSnapshots[account]); return snapshotted ? value : balanceOf(account); } /** * @dev Retrieves the total supply at the time `snapshotId` was created. */ function totalSupplyAt(uint256 snapshotId) public view virtual returns (uint256) { (bool snapshotted, uint256 value) = _valueAt(snapshotId, _totalSupplySnapshots); return snapshotted ? value : totalSupply(); } // Update balance and/or total supply snapshots before the values are modified. This is implemented // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations. function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); if (from == address(0)) { // mint _updateAccountSnapshot(to); _updateTotalSupplySnapshot(); } else if (to == address(0)) { // burn _updateAccountSnapshot(from); _updateTotalSupplySnapshot(); } else { // transfer _updateAccountSnapshot(from); _updateAccountSnapshot(to); } } function _valueAt(uint256 snapshotId, Snapshots storage snapshots) private view returns (bool, uint256) { require(snapshotId > 0, "ERC20Snapshot: id is 0"); require(snapshotId <= _getCurrentSnapshotId(), "ERC20Snapshot: nonexistent id"); // When a valid snapshot is queried, there are three possibilities: // a) The queried value was not modified after the snapshot was taken. Therefore, a snapshot entry was never // created for this id, and all stored snapshot ids are smaller than the requested one. The value that corresponds // to this id is the current one. // b) The queried value was modified after the snapshot was taken. Therefore, there will be an entry with the // requested id, and its value is the one to return. // c) More snapshots were created after the requested one, and the queried value was later modified. There will be // no entry for the requested id: the value that corresponds to it is that of the smallest snapshot id that is // larger than the requested one. // // In summary, we need to find an element in an array, returning the index of the smallest value that is larger if // it is not found, unless said value doesn't exist (e.g. when all values are smaller). Arrays.findUpperBound does // exactly this. uint256 index = snapshots.ids.findUpperBound(snapshotId); if (index == snapshots.ids.length) { return (false, 0); } else { return (true, snapshots.values[index]); } } function _updateAccountSnapshot(address account) private { _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); } function _updateTotalSupplySnapshot() private { _updateSnapshot(_totalSupplySnapshots, totalSupply()); } function _updateSnapshot(Snapshots storage snapshots, uint256 currentValue) private { uint256 currentId = _getCurrentSnapshotId(); if (_lastSnapshotId(snapshots.ids) < currentId) { snapshots.ids.push(currentId); snapshots.values.push(currentValue); } } function _lastSnapshotId(uint256[] storage ids) private view returns (uint256) { if (ids.length == 0) { return 0; } else { return ids[ids.length - 1]; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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/Arrays.sol) pragma solidity ^0.8.0; import "./StorageSlot.sol"; import "./math/Math.sol"; /** * @dev Collection of functions related to array types. */ library Arrays { using StorageSlot for bytes32; /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in ascending order, and to contain no * repeated elements. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { if (array.length == 0) { return 0; } uint256 low = 0; uint256 high = array.length; while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds down (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && unsafeAccess(array, low - 1).value == element) { return low - 1; } else { return low; } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getAddressSlot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getBytes32Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getUint256Slot(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// 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.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "@openzeppelin/contracts/interfaces/IERC1155.sol"; interface IERC20Extended is IERC20 { function decimals() external view returns (uint8); } interface PeopOptionExtended is IERC1155 { function expiredTs(uint optionId) external view returns (uint); } /** * @title IPeopOption * @dev Interface for the PeopOption contract to adjust protocol fees. */ interface IPeopOption { /** * @dev Adjusts the protocol fee based on a boolean flag. * @param increase True to increase the fee, false to decrease. */ function adjustProtocolFee(bool increase) external; } interface IDividendsPool { function sendDividends(address target, uint256 amount) external; }
{ "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_initialSupply","type":"uint256"},{"internalType":"address","name":"_dividendsPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendToDividendsPoolSucc","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"adjustProtoFeeProposalId","type":"uint256"},{"indexed":true,"internalType":"bool","name":"increase","type":"bool"}],"name":"voteForAdjustProtoFeeSucc","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dividendsProposalId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"snapId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"dividends","type":"uint256"}],"name":"voteForDividendsSucc","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"adjustFeeProposals","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256","name":"votedWeight","type":"uint256"},{"internalType":"uint256","name":"dividends","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dividendsProposalId","type":"uint256"}],"name":"claimDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"dividendsProposalId","type":"uint256"}],"name":"dividends","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dividendsPool","outputs":[{"internalType":"contract IDividendsPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dividendsProposals","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256","name":"votedWeight","type":"uint256"},{"internalType":"uint256","name":"dividends","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProposalId","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dividendsProposalId","type":"uint256"},{"internalType":"uint256","name":"adjustFeeProposalId","type":"uint256"},{"internalType":"address","name":"addr","type":"address"}],"name":"getProposalStatus","outputs":[{"internalType":"enum Peop.eStatus","name":"","type":"uint8"},{"internalType":"enum Peop.eStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"peopOption","outputs":[{"internalType":"contract IPeopOption","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_peopOptionAddr","type":"address"}],"name":"setPeopOptionContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"snapshotDividends","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"increase","type":"bool"}],"name":"voteForAdjustProtoFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteForDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"votesForDecrease","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"votesForIncrease","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002cce38038062002cce833981016040819052620000349162000455565b6040518060400160405280600a8152602001692832b832a7b83a34b7b760b11b81525060405180604001604052806004815260200163050454f560e41b815250816003908162000085919062000538565b50600462000094828262000538565b505050620000b1620000ab620000f960201b60201c565b620000fd565b6001600a55620000c233836200014f565b600b80546001600160a01b0319166001600160a01b038316179055620000e762000223565b620000f162000273565b505062000662565b3390565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620001aa5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b620001b860008383620002a9565b8060026000828254620001cc91906200061a565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60006200022f62000302565b600d8054600181018083556000838152939450909291908390811062000259576200025962000636565b600091825260209091206005909102019182555060010155565b60006200027f62000302565b600e8054600181018083556000838152939450909291908390811062000259576200025962000636565b6001600160a01b038316620002d257620002c38262000360565b620002cd62000398565b505050565b6001600160a01b038216620002ec57620002c38362000360565b620002f78362000360565b620002cd8262000360565b600062000313600880546001019055565b60006200031f620003aa565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67816040516200035391815260200190565b60405180910390a1919050565b6001600160a01b03811660009081526005602090815260408083209183905290912054620003959190620003bb565b620003bb565b50565b620003a860066200038f60025490565b565b6000620003b660085490565b905090565b6000620003c7620003aa565b905080620003d5846200040a565b1015620002cd578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b805460009081036200041e57506000919050565b8154829062000430906001906200064c565b8154811062000443576200044362000636565b90600052602060002001549050919050565b600080604083850312156200046957600080fd5b825160208401519092506001600160a01b03811681146200048957600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004bf57607f821691505b602082108103620004e057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002cd57600081815260208120601f850160051c810160208610156200050f5750805b601f850160051c820191505b8181101562000530578281556001016200051b565b505050505050565b81516001600160401b0381111562000554576200055462000494565b6200056c81620005658454620004aa565b84620004e6565b602080601f831160018114620005a457600084156200058b5750858301515b600019600386901b1c1916600185901b17855562000530565b600085815260208120601f198616915b82811015620005d557888601518255948401946001909101908401620005b4565b5085821015620005f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000630576200063062000604565b92915050565b634e487b7160e01b600052603260045260246000fd5b8181038181111562000630576200063062000604565b61265c80620006726000396000f3fe6080604052600436106101d15760003560e01c80639364c86c116100f7578063bd7047c411610095578063dd62ed3e11610064578063dd62ed3e146105b2578063f0e8f82514610605578063f2fde38b14610625578063f374a6ec1461064557600080fd5b8063bd7047c414610539578063bf20d56714610559578063c7f166dc1461056e578063ca4cadf21461059c57600080fd5b8063a457c2d7116100d1578063a457c2d7146104b9578063a7b964ba146104d9578063a9059cbb146104f9578063aa15ba221461051957600080fd5b80639364c86c1461045757806395d89b4114610484578063981b24d01461049957600080fd5b80634ee2cd7e1161016f57806370a082311161013e57806370a0823114610392578063715018a6146103d55780638da5cb5b146103ec5780638df21f5f1461041757600080fd5b80634ee2cd7e14610305578063532c27b8146103255780635641b6e31461034f5780635af5ef261461036557600080fd5b806318160ddd116101ab57806318160ddd1461028a57806323b872dd146102a9578063313ce567146102c957806339509351146102e557600080fd5b806306fdde03146101dd578063095ea7b314610208578063165dbc781461023857600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b506101f2610665565b6040516101ff91906122c4565b60405180910390f35b34801561021457600080fd5b50610228610223366004612354565b6106f7565b60405190151581526020016101ff565b34801561024457600080fd5b50600b546102659073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ff565b34801561029657600080fd5b506002545b6040519081526020016101ff565b3480156102b557600080fd5b506102286102c436600461237e565b610711565b3480156102d557600080fd5b50604051601281526020016101ff565b3480156102f157600080fd5b50610228610300366004612354565b610737565b34801561031157600080fd5b5061029b610320366004612354565b610783565b34801561033157600080fd5b5061033a6107f6565b604080519283526020830191909152016101ff565b34801561035b57600080fd5b5061029b60105481565b34801561037157600080fd5b5061029b6103803660046123ba565b60116020526000908152604090205481565b34801561039e57600080fd5b5061029b6103ad3660046123d3565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3480156103e157600080fd5b506103ea61083c565b005b3480156103f857600080fd5b5060095473ffffffffffffffffffffffffffffffffffffffff16610265565b34801561042357600080fd5b506104376104323660046123ba565b610850565b6040805194855260208501939093529183015260608201526080016101ff565b34801561046357600080fd5b50600c546102659073ffffffffffffffffffffffffffffffffffffffff1681565b34801561049057600080fd5b506101f261088a565b3480156104a557600080fd5b5061029b6104b43660046123ba565b610899565b3480156104c557600080fd5b506102286104d4366004612354565b6108c4565b3480156104e557600080fd5b506103ea6104f43660046123ee565b6109a5565b34801561050557600080fd5b50610228610514366004612354565b610d88565b34801561052557600080fd5b506103ea6105343660046123d3565b610d96565b34801561054557600080fd5b506103ea6105543660046123ba565b610de5565b34801561056557600080fd5b506103ea6110d6565b34801561057a57600080fd5b5061058e610589366004612410565b61136c565b6040516101ff9291906124af565b3480156105a857600080fd5b5061029b600f5481565b3480156105be57600080fd5b5061029b6105cd3660046124ca565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b34801561061157600080fd5b5061029b610620366004612354565b6114f5565b34801561063157600080fd5b506103ea6106403660046123d3565b6115e3565b34801561065157600080fd5b506104376106603660046123ba565b611697565b606060038054610674906124fd565b80601f01602080910402602001604051908101604052809291908181526020018280546106a0906124fd565b80156106ed5780601f106106c2576101008083540402835291602001916106ed565b820191906000526020600020905b8154815290600101906020018083116106d057829003601f168201915b5050505050905090565b6000336107058185856116a7565b60019150505b92915050565b60003361071f85828561185a565b61072a858585611931565b60019150505b9392505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610705908290869061077e90879061257f565b6116a7565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600560205260408120819081906107b7908590611bab565b91509150816107eb5773ffffffffffffffffffffffffffffffffffffffff85166000908152602081905260409020546107ed565b805b95945050505050565b600d546000908190819081901561081957600d5461081690600190612592565b91505b600e541561083357600e5461083090600190612592565b90505b90939092509050565b610844611cdc565b61084e6000611d5d565b565b600e818154811061086057600080fd5b60009182526020909120600590910201805460018201546002830154600390930154919350919084565b606060048054610674906124fd565b60008060006108a9846006611bab565b91509150816108ba576002546108bc565b805b949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61099a82868684036116a7565b506001949350505050565b6109ad611dd4565b600e54610a16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2070726f706f73616c2065786973747300000000000000000000000000006044820152606401610984565b600e54600090610a2890600190612592565b90506000600e8281548110610a3f57610a3f6125a5565b600091825260208220600590910201915033600090815260048301602052604090205460ff166002811115610a7657610a76612445565b14610add576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f596f7520616c726561647920766f7465640000000000000000000000000000006044820152606401610984565b6000610aed338360010154610783565b905060008111610b59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4e6f20766f74696e6720726967687473000000000000000000000000000000006044820152606401610984565b336000908152600483016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558315610bb65780600f6000828254610bab919061257f565b90915550610bce9050565b8060106000828254610bc8919061257f565b90915550505b60028054610bdc91906125d4565b601054600f54610bec919061257f565b10610d7857601054600f541115610cb457600c546040517fc37481a00000000000000000000000000000000000000000000000000000000081526001600482015273ffffffffffffffffffffffffffffffffffffffff9091169063c37481a090602401600060405180830381600087803b158015610c6957600080fd5b505af1158015610c7d573d6000803e3d6000fd5b5050604051600192508591507f34a64edecb91b687a187ed9c4f55628c4ad389094136a7cd8512f0fcbe328a3990600090a3610d66565b600c546040517fc37481a00000000000000000000000000000000000000000000000000000000081526000600482015273ffffffffffffffffffffffffffffffffffffffff9091169063c37481a090602401600060405180830381600087803b158015610d2057600080fd5b505af1158015610d34573d6000803e3d6000fd5b5050604051600092508591507f34a64edecb91b687a187ed9c4f55628c4ad389094136a7cd8512f0fcbe328a39908390a35b6000600f819055601055610d78611e47565b505050610d856001600a55565b50565b600033610705818585611931565b610d9e611cdc565b600c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610ded611dd4565b600d548110610e58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c496400000000000000000000000000006044820152606401610984565b6000600d8281548110610e6d57610e6d6125a5565b600091825260209091206005909102019050600233600090815260048301602052604090205460ff166002811115610ea757610ea7612445565b03610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f796f75206861766520636c61696d6564000000000000000000000000000000006044820152606401610984565b6000610f1e338360010154610783565b11610fab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f596f7520686164206e6f20746f6b656e73206174207468697320736e6170736860448201527f6f742e00000000000000000000000000000000000000000000000000000000006064820152608401610984565b6000610fba8260010154610899565b90506000610fcc338460010154610783565b6001840154600090815260116020526040812054919250908390610ff190849061260f565b610ffb91906125d4565b336000908152600486016020526040902080549192506002917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001830217905550600b546040517f2c642f510000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff90911690632c642f5190604401600060405180830381600087803b1580156110b057600080fd5b505af11580156110c4573d6000803e3d6000fd5b5050505050505050610d856001600a55565b6110de611dd4565b600d54611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2070726f706f73616c2065786973747300000000000000000000000000006044820152606401610984565b600d5460009061115990600190612592565b90506000600d8281548110611170576111706125a5565b600091825260208220600590910201915033600090815260048301602052604090205460ff1660028111156111a7576111a7612445565b1461120e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f596f7520616c726561647920766f7465640000000000000000000000000000006044820152606401610984565b600061121e338360010154610783565b90506000811161128a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4e6f20766f74696e6720726967687473000000000000000000000000000000006044820152606401610984565b336000908152600483016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556002830180548392906112d890849061257f565b9091555050600280546112eb91906125d4565b82600201541061135f57476003830181905560018301548354604051839291907f97c71aae61d10bfaf5baddaeb74cb879e56f5ead6b6efb0bd9a3e0068137ef7a90600090a460018301546000908152601160205260409020819055801561135557611355611e92565b61135d612019565b505b50505061084e6001600a55565b600d54600090819085106113dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c6964206469766964656e647350726f706f73616c496400000000006044820152606401610984565b600e548410611447576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c69642061646a75737446656550726f706f73616c496400000000006044820152606401610984565b6000600d868154811061145c5761145c6125a5565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff8816845260046005909302019190910190526040812054600e805460ff909216935090879081106114ae576114ae6125a5565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff89168452600460059093020191909101905260409020549193505060ff169050935093915050565b600d546000908210611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c496400000000000000000000000000006044820152606401610984565b6000600d8381548110611578576115786125a5565b906000526020600020906005020190506000611598858360010154610783565b905060006115a98360010154610899565b60018401546000908152601160205260408120549192509082906115ce90859061260f565b6115d891906125d4565b979650505050505050565b6115eb611cdc565b73ffffffffffffffffffffffffffffffffffffffff811661168e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610984565b610d8581611d5d565b600d818154811061086057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316611749576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff82166117ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461192b578181101561191e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610984565b61192b84848484036116a7565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166119d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff8216611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610984565b611a8283838361204a565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015611b38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361192b565b60008060008411611c18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433230536e617073686f743a2069642069732030000000000000000000006044820152606401610984565b611c206120b1565b841115611c89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610984565b6000611c9584866120c1565b84549091508103611cad576000809250925050611cd5565b6001846001018281548110611cc457611cc46125a5565b906000526020600020015492509250505b9250929050565b60095473ffffffffffffffffffffffffffffffffffffffff16331461084e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610984565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600a5403611e40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610984565b6002600a55565b6000611e5161216e565b600e80546001810180835560008381529394509092919083908110611e7857611e786125a5565b600091825260209091206005909102019182555060010155565b4780611f20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5f73656e64546f6469766964656e6473506f6f6c3a206e6f204554482061766160448201527f696c61626c6500000000000000000000000000000000000000000000000000006064820152608401610984565b60405181907f03706d9c026b3e4f20f0e2d8fd4ff19b479e82c09a6e268bb15943ff6e1d1caf90600090a2600b5460405160009173ffffffffffffffffffffffffffffffffffffffff169083908381818185875af1925050503d8060008114611fa5576040519150601f19603f3d011682016040523d82523d6000602084013e611faa565b606091505b5050905080612015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5f73656e64546f6469766964656e6473506f6f6c206661696c656400000000006044820152606401610984565b5050565b600061202361216e565b600d80546001810180835560008381529394509092919083908110611e7857611e786125a5565b73ffffffffffffffffffffffffffffffffffffffff831661207b5761206e826121c8565b612076612207565b505050565b73ffffffffffffffffffffffffffffffffffffffff821661209f5761206e836121c8565b6120a8836121c8565b612076826121c8565b60006120bc60085490565b905090565b815460009081036120d45750600061070b565b82546000905b808210156121215760006120ee8383612215565b6000878152602090209091508590820154111561210d5780915061211b565b61211881600161257f565b92505b506120da565b60008211801561214d57508361214a8661213c600186612592565b600091825260209091200190565b54145b156121665761215d600183612592565b9250505061070b565b50905061070b565b600061217e600880546001019055565b60006121886120b1565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67816040516121bb91815260200190565b60405180910390a1919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602090815260408083209183905290912054610d859190612230565b612230565b61084e600661220260025490565b600061222460028484186125d4565b6107309084841661257f565b600061223a6120b1565b9050806122468461227a565b1015612076578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090810361228d57506000919050565b8154829061229d90600190612592565b815481106122ad576122ad6125a5565b90600052602060002001549050919050565b919050565b600060208083528351808285015260005b818110156122f1578581018301518582016040015282016122d5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146122bf57600080fd5b6000806040838503121561236757600080fd5b61237083612330565b946020939093013593505050565b60008060006060848603121561239357600080fd5b61239c84612330565b92506123aa60208501612330565b9150604084013590509250925092565b6000602082840312156123cc57600080fd5b5035919050565b6000602082840312156123e557600080fd5b61073082612330565b60006020828403121561240057600080fd5b8135801515811461073057600080fd5b60008060006060848603121561242557600080fd5b833592506020840135915061243c60408501612330565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600381106124ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b604081016124bd8285612474565b6107306020830184612474565b600080604083850312156124dd57600080fd5b6124e683612330565b91506124f460208401612330565b90509250929050565b600181811c9082168061251157607f821691505b60208210810361254a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561070b5761070b612550565b8181038181111561070b5761070b612550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008261260a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761070b5761070b61255056fea264697066735822122022291c5001d3d7daa0ad5955895dba7596ace6b827246061141a940d5588f86964736f6c634300081300330000000000000000000000000000000000000001431e0fae6d7217caa000000000000000000000000000000018ef15f1c35fe5d1c47bf7a8e4f1ccb3a543a698
Deployed Bytecode
0x6080604052600436106101d15760003560e01c80639364c86c116100f7578063bd7047c411610095578063dd62ed3e11610064578063dd62ed3e146105b2578063f0e8f82514610605578063f2fde38b14610625578063f374a6ec1461064557600080fd5b8063bd7047c414610539578063bf20d56714610559578063c7f166dc1461056e578063ca4cadf21461059c57600080fd5b8063a457c2d7116100d1578063a457c2d7146104b9578063a7b964ba146104d9578063a9059cbb146104f9578063aa15ba221461051957600080fd5b80639364c86c1461045757806395d89b4114610484578063981b24d01461049957600080fd5b80634ee2cd7e1161016f57806370a082311161013e57806370a0823114610392578063715018a6146103d55780638da5cb5b146103ec5780638df21f5f1461041757600080fd5b80634ee2cd7e14610305578063532c27b8146103255780635641b6e31461034f5780635af5ef261461036557600080fd5b806318160ddd116101ab57806318160ddd1461028a57806323b872dd146102a9578063313ce567146102c957806339509351146102e557600080fd5b806306fdde03146101dd578063095ea7b314610208578063165dbc781461023857600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b506101f2610665565b6040516101ff91906122c4565b60405180910390f35b34801561021457600080fd5b50610228610223366004612354565b6106f7565b60405190151581526020016101ff565b34801561024457600080fd5b50600b546102659073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ff565b34801561029657600080fd5b506002545b6040519081526020016101ff565b3480156102b557600080fd5b506102286102c436600461237e565b610711565b3480156102d557600080fd5b50604051601281526020016101ff565b3480156102f157600080fd5b50610228610300366004612354565b610737565b34801561031157600080fd5b5061029b610320366004612354565b610783565b34801561033157600080fd5b5061033a6107f6565b604080519283526020830191909152016101ff565b34801561035b57600080fd5b5061029b60105481565b34801561037157600080fd5b5061029b6103803660046123ba565b60116020526000908152604090205481565b34801561039e57600080fd5b5061029b6103ad3660046123d3565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3480156103e157600080fd5b506103ea61083c565b005b3480156103f857600080fd5b5060095473ffffffffffffffffffffffffffffffffffffffff16610265565b34801561042357600080fd5b506104376104323660046123ba565b610850565b6040805194855260208501939093529183015260608201526080016101ff565b34801561046357600080fd5b50600c546102659073ffffffffffffffffffffffffffffffffffffffff1681565b34801561049057600080fd5b506101f261088a565b3480156104a557600080fd5b5061029b6104b43660046123ba565b610899565b3480156104c557600080fd5b506102286104d4366004612354565b6108c4565b3480156104e557600080fd5b506103ea6104f43660046123ee565b6109a5565b34801561050557600080fd5b50610228610514366004612354565b610d88565b34801561052557600080fd5b506103ea6105343660046123d3565b610d96565b34801561054557600080fd5b506103ea6105543660046123ba565b610de5565b34801561056557600080fd5b506103ea6110d6565b34801561057a57600080fd5b5061058e610589366004612410565b61136c565b6040516101ff9291906124af565b3480156105a857600080fd5b5061029b600f5481565b3480156105be57600080fd5b5061029b6105cd3660046124ca565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b34801561061157600080fd5b5061029b610620366004612354565b6114f5565b34801561063157600080fd5b506103ea6106403660046123d3565b6115e3565b34801561065157600080fd5b506104376106603660046123ba565b611697565b606060038054610674906124fd565b80601f01602080910402602001604051908101604052809291908181526020018280546106a0906124fd565b80156106ed5780601f106106c2576101008083540402835291602001916106ed565b820191906000526020600020905b8154815290600101906020018083116106d057829003601f168201915b5050505050905090565b6000336107058185856116a7565b60019150505b92915050565b60003361071f85828561185a565b61072a858585611931565b60019150505b9392505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610705908290869061077e90879061257f565b6116a7565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600560205260408120819081906107b7908590611bab565b91509150816107eb5773ffffffffffffffffffffffffffffffffffffffff85166000908152602081905260409020546107ed565b805b95945050505050565b600d546000908190819081901561081957600d5461081690600190612592565b91505b600e541561083357600e5461083090600190612592565b90505b90939092509050565b610844611cdc565b61084e6000611d5d565b565b600e818154811061086057600080fd5b60009182526020909120600590910201805460018201546002830154600390930154919350919084565b606060048054610674906124fd565b60008060006108a9846006611bab565b91509150816108ba576002546108bc565b805b949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091908381101561098d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61099a82868684036116a7565b506001949350505050565b6109ad611dd4565b600e54610a16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2070726f706f73616c2065786973747300000000000000000000000000006044820152606401610984565b600e54600090610a2890600190612592565b90506000600e8281548110610a3f57610a3f6125a5565b600091825260208220600590910201915033600090815260048301602052604090205460ff166002811115610a7657610a76612445565b14610add576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f596f7520616c726561647920766f7465640000000000000000000000000000006044820152606401610984565b6000610aed338360010154610783565b905060008111610b59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4e6f20766f74696e6720726967687473000000000000000000000000000000006044820152606401610984565b336000908152600483016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558315610bb65780600f6000828254610bab919061257f565b90915550610bce9050565b8060106000828254610bc8919061257f565b90915550505b60028054610bdc91906125d4565b601054600f54610bec919061257f565b10610d7857601054600f541115610cb457600c546040517fc37481a00000000000000000000000000000000000000000000000000000000081526001600482015273ffffffffffffffffffffffffffffffffffffffff9091169063c37481a090602401600060405180830381600087803b158015610c6957600080fd5b505af1158015610c7d573d6000803e3d6000fd5b5050604051600192508591507f34a64edecb91b687a187ed9c4f55628c4ad389094136a7cd8512f0fcbe328a3990600090a3610d66565b600c546040517fc37481a00000000000000000000000000000000000000000000000000000000081526000600482015273ffffffffffffffffffffffffffffffffffffffff9091169063c37481a090602401600060405180830381600087803b158015610d2057600080fd5b505af1158015610d34573d6000803e3d6000fd5b5050604051600092508591507f34a64edecb91b687a187ed9c4f55628c4ad389094136a7cd8512f0fcbe328a39908390a35b6000600f819055601055610d78611e47565b505050610d856001600a55565b50565b600033610705818585611931565b610d9e611cdc565b600c80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610ded611dd4565b600d548110610e58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c496400000000000000000000000000006044820152606401610984565b6000600d8281548110610e6d57610e6d6125a5565b600091825260209091206005909102019050600233600090815260048301602052604090205460ff166002811115610ea757610ea7612445565b03610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f796f75206861766520636c61696d6564000000000000000000000000000000006044820152606401610984565b6000610f1e338360010154610783565b11610fab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f596f7520686164206e6f20746f6b656e73206174207468697320736e6170736860448201527f6f742e00000000000000000000000000000000000000000000000000000000006064820152608401610984565b6000610fba8260010154610899565b90506000610fcc338460010154610783565b6001840154600090815260116020526040812054919250908390610ff190849061260f565b610ffb91906125d4565b336000908152600486016020526040902080549192506002917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001830217905550600b546040517f2c642f510000000000000000000000000000000000000000000000000000000081523360048201526024810183905273ffffffffffffffffffffffffffffffffffffffff90911690632c642f5190604401600060405180830381600087803b1580156110b057600080fd5b505af11580156110c4573d6000803e3d6000fd5b5050505050505050610d856001600a55565b6110de611dd4565b600d54611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2070726f706f73616c2065786973747300000000000000000000000000006044820152606401610984565b600d5460009061115990600190612592565b90506000600d8281548110611170576111706125a5565b600091825260208220600590910201915033600090815260048301602052604090205460ff1660028111156111a7576111a7612445565b1461120e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f596f7520616c726561647920766f7465640000000000000000000000000000006044820152606401610984565b600061121e338360010154610783565b90506000811161128a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4e6f20766f74696e6720726967687473000000000000000000000000000000006044820152606401610984565b336000908152600483016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556002830180548392906112d890849061257f565b9091555050600280546112eb91906125d4565b82600201541061135f57476003830181905560018301548354604051839291907f97c71aae61d10bfaf5baddaeb74cb879e56f5ead6b6efb0bd9a3e0068137ef7a90600090a460018301546000908152601160205260409020819055801561135557611355611e92565b61135d612019565b505b50505061084e6001600a55565b600d54600090819085106113dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c6964206469766964656e647350726f706f73616c496400000000006044820152606401610984565b600e548410611447576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c69642061646a75737446656550726f706f73616c496400000000006044820152606401610984565b6000600d868154811061145c5761145c6125a5565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff8816845260046005909302019190910190526040812054600e805460ff909216935090879081106114ae576114ae6125a5565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff89168452600460059093020191909101905260409020549193505060ff169050935093915050565b600d546000908210611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c496400000000000000000000000000006044820152606401610984565b6000600d8381548110611578576115786125a5565b906000526020600020906005020190506000611598858360010154610783565b905060006115a98360010154610899565b60018401546000908152601160205260408120549192509082906115ce90859061260f565b6115d891906125d4565b979650505050505050565b6115eb611cdc565b73ffffffffffffffffffffffffffffffffffffffff811661168e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610984565b610d8581611d5d565b600d818154811061086057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8316611749576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff82166117ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461192b578181101561191e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610984565b61192b84848484036116a7565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166119d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff8216611a77576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610984565b611a8283838361204a565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015611b38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610984565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361192b565b60008060008411611c18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4552433230536e617073686f743a2069642069732030000000000000000000006044820152606401610984565b611c206120b1565b841115611c89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610984565b6000611c9584866120c1565b84549091508103611cad576000809250925050611cd5565b6001846001018281548110611cc457611cc46125a5565b906000526020600020015492509250505b9250929050565b60095473ffffffffffffffffffffffffffffffffffffffff16331461084e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610984565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600a5403611e40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610984565b6002600a55565b6000611e5161216e565b600e80546001810180835560008381529394509092919083908110611e7857611e786125a5565b600091825260209091206005909102019182555060010155565b4780611f20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5f73656e64546f6469766964656e6473506f6f6c3a206e6f204554482061766160448201527f696c61626c6500000000000000000000000000000000000000000000000000006064820152608401610984565b60405181907f03706d9c026b3e4f20f0e2d8fd4ff19b479e82c09a6e268bb15943ff6e1d1caf90600090a2600b5460405160009173ffffffffffffffffffffffffffffffffffffffff169083908381818185875af1925050503d8060008114611fa5576040519150601f19603f3d011682016040523d82523d6000602084013e611faa565b606091505b5050905080612015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5f73656e64546f6469766964656e6473506f6f6c206661696c656400000000006044820152606401610984565b5050565b600061202361216e565b600d80546001810180835560008381529394509092919083908110611e7857611e786125a5565b73ffffffffffffffffffffffffffffffffffffffff831661207b5761206e826121c8565b612076612207565b505050565b73ffffffffffffffffffffffffffffffffffffffff821661209f5761206e836121c8565b6120a8836121c8565b612076826121c8565b60006120bc60085490565b905090565b815460009081036120d45750600061070b565b82546000905b808210156121215760006120ee8383612215565b6000878152602090209091508590820154111561210d5780915061211b565b61211881600161257f565b92505b506120da565b60008211801561214d57508361214a8661213c600186612592565b600091825260209091200190565b54145b156121665761215d600183612592565b9250505061070b565b50905061070b565b600061217e600880546001019055565b60006121886120b1565b90507f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67816040516121bb91815260200190565b60405180910390a1919050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602090815260408083209183905290912054610d859190612230565b612230565b61084e600661220260025490565b600061222460028484186125d4565b6107309084841661257f565b600061223a6120b1565b9050806122468461227a565b1015612076578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090810361228d57506000919050565b8154829061229d90600190612592565b815481106122ad576122ad6125a5565b90600052602060002001549050919050565b919050565b600060208083528351808285015260005b818110156122f1578581018301518582016040015282016122d5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146122bf57600080fd5b6000806040838503121561236757600080fd5b61237083612330565b946020939093013593505050565b60008060006060848603121561239357600080fd5b61239c84612330565b92506123aa60208501612330565b9150604084013590509250925092565b6000602082840312156123cc57600080fd5b5035919050565b6000602082840312156123e557600080fd5b61073082612330565b60006020828403121561240057600080fd5b8135801515811461073057600080fd5b60008060006060848603121561242557600080fd5b833592506020840135915061243c60408501612330565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600381106124ab577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b604081016124bd8285612474565b6107306020830184612474565b600080604083850312156124dd57600080fd5b6124e683612330565b91506124f460208401612330565b90509250929050565b600181811c9082168061251157607f821691505b60208210810361254a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561070b5761070b612550565b8181038181111561070b5761070b612550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008261260a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761070b5761070b61255056fea264697066735822122022291c5001d3d7daa0ad5955895dba7596ace6b827246061141a940d5588f86964736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000001431e0fae6d7217caa000000000000000000000000000000018ef15f1c35fe5d1c47bf7a8e4f1ccb3a543a698
-----Decoded View---------------
Arg [0] : _initialSupply (uint256): 100000000000000000000000000000
Arg [1] : _dividendsPool (address): 0x18Ef15f1C35Fe5D1c47bf7A8E4f1cCB3A543A698
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000001431e0fae6d7217caa0000000
Arg [1] : 00000000000000000000000018ef15f1c35fe5d1c47bf7a8e4f1ccb3a543a698
Loading...
Loading
Loading...
Loading
[ 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.