- Contract name:
- SingleToken
- Optimization enabled
- true
- Compiler version
- v0.8.4+commit.c7e474f2
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2022-01-19T08:28:50.392132Z
Constructor Arguments
0000000000000000000000000000000000000000000000040d2614056e0cd0000000000000000000000000000000000000000000000000000000000062099b80
Arg [0] (uint256) : 74734443080000000000
Arg [1] (uint256) : 1644796800
Contract source code
pragma solidity ^0.8.0; // File @openzeppelin/contracts/utils/[email protected] // SPDX-License-Identifier: MIT /** _____ _ __ _______ / ___/(_)___ ____ _/ /__ / ____(_)___ ____ _____ ________ \__ \/ / __ \/ __ `/ / _ \/ /_ / / __ \/ __ `/ __ \/ ___/ _ \ ___/ / / / / / /_/ / / __/ __/ / / / / / /_/ / / / / /__/ __/ /____/_/_/ /_/\__, /_/\___/_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ /____/ */ /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File @openzeppelin/contracts/access/[email protected] /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File @openzeppelin/contracts/utils/math/[email protected] // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } // File @openzeppelin/contracts/token/ERC20/[email protected] /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); } // File @openzeppelin/contracts/token/ERC20/extensions/[email protected] /** * @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); } // File @openzeppelin/contracts/token/ERC20/[email protected] /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract 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}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ 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 value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, 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}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), 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}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - 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) { _approve(_msgSender(), spender, _allowances[_msgSender()][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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev 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 {} } // File contracts/SingleToken.sol pragma solidity ^0.8.0; // import "hardhat/console.sol"; /** * Single Finance token with Governance. */ contract SingleToken is ERC20("SINGLE Token", "SINGLE"), Ownable { using SafeMath for uint256; uint256 private constant CAP = 1000_000_000e18; uint256 public constant INVESTOR_MINT_CAP = 137_000_000e18; uint256 public constant LIQUIDITY_MINT_CAP = 20_000_000e18; uint256 public startMiningTimestamp; // uint256 public startReleaseTimestamp; uint256 public launchPeriodEndTimestamp; uint256 public nextAdjustTimestamp; uint256 public INITIAL_SUPPLY_PER_BLOCK; uint256 public SUPPLY_PER_BLOCK; uint256 public constant LAUNCH_PERIOD_ADJUST_WINDOW = 365 days / 12; uint256 public constant SUPPLY_HALVING_WINDOW = 365 days / 2; uint256 public constant ECOSYSTEM_TGE_RELEASE = 11_150_000e18; uint256 public constant ECOSYSTEM_VESTING_AMT = 211_850_000e18; uint256 public constant ECOSYSTEM_VESTING_PERIOD = 365 days *2; // 24 months uint256 public constant TEAM_TGE_RELEASE = 2_200_000e18; uint256 public constant TEAM_VESTING_AMT = 217_800_000e18; uint256 public constant TEAM_VESTING_PERIOD = 365 days *2; // 24 months uint256 public investorMinted = 0; uint256 public liquidityMinted = 0; uint256 public teamMinted = 0; uint256 public ecosystemMinted = 0; event SupplyAdjusted(uint256 supplyPerBlock, uint256 nextAdjustTs); constructor( uint256 initialSupplyPerBlock, uint256 _startMiningTimestamp ) { if(_startMiningTimestamp == 0){ _startMiningTimestamp = block.timestamp; } require(block.timestamp <= _startMiningTimestamp, "cannot set past block number"); startMiningTimestamp = _startMiningTimestamp; launchPeriodEndTimestamp = startMiningTimestamp.add(SUPPLY_HALVING_WINDOW); // available for first adjustment after mining started nextAdjustTimestamp = startMiningTimestamp; INITIAL_SUPPLY_PER_BLOCK = initialSupplyPerBlock; SUPPLY_PER_BLOCK = 0; } function cap() public pure returns (uint256) { return CAP; } function mint(address _to, uint256 _amount) public onlyOwner { require(totalSupply().add(_amount) <= cap(), "cap exceeded"); _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } function mintForLiquidity(address _to, uint256 _amount) public onlyOwner { require(liquidityMinted.add(_amount) <= LIQUIDITY_MINT_CAP, "mint limit exceeded"); liquidityMinted = liquidityMinted.add(_amount); mint(_to, _amount); } function mintForInvestor(address _to, uint256 _amount) public onlyOwner { require(investorMinted.add(_amount) <= INVESTOR_MINT_CAP, "mint limit exceeded"); investorMinted = investorMinted.add(_amount); mint(_to, _amount); } function mintForEcosystem(address _to, uint256 _amount) public onlyOwner { require(ecosystemMinted.add(_amount) <= ECOSYSTEM_VESTING_AMT.add(ECOSYSTEM_TGE_RELEASE), "mint limit exceeded"); require(_amount <= pendingEcosystemTokens(), "available limit exceeded"); ecosystemMinted = ecosystemMinted.add(_amount); mint(_to, _amount); } function mintForTeam(address _to, uint256 _amount) public onlyOwner { require(teamMinted.add(_amount) <= TEAM_VESTING_AMT.add(TEAM_TGE_RELEASE), "mint limit exceeded"); require(_amount <= pendingTeamTokens(), "available limit exceeded"); teamMinted = teamMinted.add(_amount); mint(_to, _amount); } function burn(address _account, uint256 _amount) external onlyOwner { _burn(_account, _amount); _moveDelegates(_delegates[_account], address(0), _amount); } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { require(recipient != address(this), "ERC20: transfer to the token contract"); _transfer(_msgSender(), recipient, amount); _moveDelegates(_delegates[_msgSender()], _delegates[recipient], amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { require(recipient != address(this), "ERC20: transfer to the token contract"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), allowance(sender, _msgSender()).sub(amount, "ERC20: transfer amount exceeds allowance")); _moveDelegates(_delegates[sender], _delegates[recipient], amount); return true; } function pendingEcosystemTokens() public view returns (uint256) { if(block.timestamp < startMiningTimestamp){ return 0; } uint256 singlePerSec = ECOSYSTEM_VESTING_AMT.div(ECOSYSTEM_VESTING_PERIOD); uint256 timePast = uint256(block.timestamp).sub(startMiningTimestamp); if(timePast >= ECOSYSTEM_VESTING_PERIOD){ return ECOSYSTEM_VESTING_AMT.add(ECOSYSTEM_TGE_RELEASE).sub(ecosystemMinted); } return timePast.mul(singlePerSec).add(ECOSYSTEM_TGE_RELEASE).sub(ecosystemMinted); } function pendingTeamTokens() public view returns (uint256) { if(block.timestamp < startMiningTimestamp){ return 0; } uint256 singlePerSec = TEAM_VESTING_AMT.div(TEAM_VESTING_PERIOD); uint256 timePast = uint256(block.timestamp).sub(startMiningTimestamp); if(timePast >= TEAM_VESTING_PERIOD){ return TEAM_VESTING_AMT.add(TEAM_TGE_RELEASE).sub(teamMinted); } return timePast.mul(singlePerSec).add(TEAM_TGE_RELEASE).sub(teamMinted); } /** * Perform adjust on token supply once invoked */ function supplyAdjust() public onlyOwner { require(block.timestamp >= nextAdjustTimestamp, "SingleToken: not yet"); if(block.timestamp < launchPeriodEndTimestamp) { launchPeriodSupplyAdjust(); }else { // first halving if( (block.timestamp - launchPeriodEndTimestamp) < SUPPLY_HALVING_WINDOW ){ SUPPLY_PER_BLOCK = INITIAL_SUPPLY_PER_BLOCK.div(2); }else{ // halving SUPPLY_PER_BLOCK = SUPPLY_PER_BLOCK.div(2); } nextAdjustTimestamp = nextAdjustTimestamp.add(SUPPLY_HALVING_WINDOW); emit SupplyAdjusted(SUPPLY_PER_BLOCK, nextAdjustTimestamp); } } function launchPeriodSupplyAdjust() internal{ uint256 N = 6 - (launchPeriodEndTimestamp - block.timestamp).mul(100).div(LAUNCH_PERIOD_ADJUST_WINDOW).div(100); // multiplier = ( 32 + p(3.5-N) ) / 32 // p = 5 uint256 multiplier = uint256(3200).add(1750).sub(N.mul(500)).mul(1e12).div(3200); SUPPLY_PER_BLOCK = INITIAL_SUPPLY_PER_BLOCK.mul(multiplier).div(1e12); // advance the next adjust time nextAdjustTimestamp = nextAdjustTimestamp.add(LAUNCH_PERIOD_ADJUST_WINDOW); emit SupplyAdjusted(SUPPLY_PER_BLOCK, nextAdjustTimestamp); } // Copied and modified from YAM code: // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol // Which is copied and modified from COMPOUND: // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol /// @notice A record of each accounts delegate mapping (address => address) internal _delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint256 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegator The address to get delegatee for */ function delegates(address delegator) external view returns (address) { return _delegates[delegator]; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())), // getChainId(), block.chainid, address(this) ) ); bytes32 structHash = keccak256( abi.encode( DELEGATION_TYPEHASH, delegatee, nonce, expiry ) ); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", domainSeparator, structHash ) ); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "SINGLE::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "SINGLE::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "SINGLE::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "SINGLE::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = _delegates[delegator]; uint256 delegatorBalance = balanceOf(delegator); // balance of underlying YAMs (not scaled); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { // decrease old representative uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint256 srcRepNew = srcRepOld.sub(amount); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { // increase new representative uint32 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld.add(amount); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint( address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes ) internal { uint32 blockNumber = safe32(block.number, "SINGLE::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint256","name":"initialSupplyPerBlock","internalType":"uint256"},{"type":"uint256","name":"_startMiningTimestamp","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DelegateChanged","inputs":[{"type":"address","name":"delegator","internalType":"address","indexed":true},{"type":"address","name":"fromDelegate","internalType":"address","indexed":true},{"type":"address","name":"toDelegate","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"DelegateVotesChanged","inputs":[{"type":"address","name":"delegate","internalType":"address","indexed":true},{"type":"uint256","name":"previousBalance","internalType":"uint256","indexed":false},{"type":"uint256","name":"newBalance","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SupplyAdjusted","inputs":[{"type":"uint256","name":"supplyPerBlock","internalType":"uint256","indexed":false},{"type":"uint256","name":"nextAdjustTs","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DELEGATION_TYPEHASH","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DOMAIN_TYPEHASH","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ECOSYSTEM_TGE_RELEASE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ECOSYSTEM_VESTING_AMT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ECOSYSTEM_VESTING_PERIOD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INITIAL_SUPPLY_PER_BLOCK","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"INVESTOR_MINT_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"LAUNCH_PERIOD_ADJUST_WINDOW","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"LIQUIDITY_MINT_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"SUPPLY_HALVING_WINDOW","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"SUPPLY_PER_BLOCK","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TEAM_TGE_RELEASE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TEAM_VESTING_AMT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TEAM_VESTING_PERIOD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"_account","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cap","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"fromBlock","internalType":"uint32"},{"type":"uint256","name":"votes","internalType":"uint256"}],"name":"checkpoints","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint32","name":"","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"delegate","inputs":[{"type":"address","name":"delegatee","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"delegateBySig","inputs":[{"type":"address","name":"delegatee","internalType":"address"},{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"delegates","inputs":[{"type":"address","name":"delegator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ecosystemMinted","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCurrentVotes","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPriorVotes","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"blockNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"investorMinted","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"launchPeriodEndTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"liquidityMinted","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintForEcosystem","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintForInvestor","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintForLiquidity","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintForTeam","inputs":[{"type":"address","name":"_to","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextAdjustTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nonces","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint32","name":"","internalType":"uint32"}],"name":"numCheckpoints","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingEcosystemTokens","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingTeamTokens","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startMiningTimestamp","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"supplyAdjust","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"teamMinted","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106103275760003560e01c80638da5cb5b116101b8578063d743b81b11610104578063e7a324dc116100a2578063f1127ed81161007c578063f1127ed8146106f8578063f2fde38b1461074f578063f73acdc714610762578063f7ecc4281461076b57600080fd5b8063e7a324dc146106b6578063e8b5498d146106dd578063f05affac146106e657600080fd5b8063e0664b74116100de578063e0664b7414610699578063e3348889146106a3578063e559c7241461036d578063e6956bf7146106ac57600080fd5b8063d743b81b14610645578063dc04b8e114610658578063dd62ed3e1461066057600080fd5b8063a9059cbb11610171578063c3cda5201161014b578063c3cda5201461060f578063c7952e9e14610622578063cda1a7a61461062b578063d6cd62441461063357600080fd5b8063a9059cbb146105d7578063b4b5ea57146105ea578063b9d592bb146105fd57600080fd5b80638da5cb5b146105865780638eab07511461059757806395d89b41146105a05780639dc29fac146105a8578063a3a57c64146105bb578063a457c2d7146105c457600080fd5b806344d79c3811610277578063715018a61161023057806377641b6a1161020a57806377641b6a14610538578063782d6fe1146105415780637ecebe0014610554578063893507fe1461057457600080fd5b8063715018a61461050c578063720315c514610514578063727d5fcc1461052657600080fd5b806344d79c381461043f578063587cde1e146104485780635c19a95c1461048c5780636687fb531461049f5780636fcfff45146104a857806370a08231146104e357600080fd5b806323b872dd116102e4578063313ce567116102be578063313ce567146103f8578063355274ea14610407578063395093511461041957806340c10f191461042c57600080fd5b806323b872dd146103ca5780632c1a0137146103dd5780632c27e40e146103e557600080fd5b806306fdde031461032c578063095ea7b31461034a57806317a9b9db1461036d57806318160ddd1461038657806319e6af1c1461038e57806320606b70146103a3575b600080fd5b61033461077e565b604051610341919061228e565b60405180910390f35b61035d6103583660046121c9565b610810565b6040519015158152602001610341565b6103786303c2670081565b604051908152602001610341565b600254610378565b6103a161039c3660046121c9565b610827565b005b6103787f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b61035d6103d836600461218e565b610915565b6103786109bf565b6103a16103f33660046121c9565b610a6c565b60405160128152602001610341565b6b033b2e3c9fd0803ce8000000610378565b61035d6104273660046121c9565b610ae8565b6103a161043a3660046121c9565b610b1f565b61037860075481565b610474610456366004612142565b6001600160a01b039081166000908152600f60205260409020541690565b6040516001600160a01b039091168152602001610341565b6103a161049a366004612142565b610bcf565b610378600a5481565b6104ce6104b6366004612142565b60116020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610341565b6103786104f1366004612142565b6001600160a01b031660009081526020819052604090205490565b6103a1610bdc565b6103786ab428f1a88abfc52d00000081565b6103786a7152e0e1abab2b2900000081565b61037860065481565b61037861054f3660046121c9565b610c12565b610378610562366004612142565b60126020526000908152604090205481565b6103786a09391ab60ea0265cc0000081565b6005546001600160a01b0316610474565b610378600c5481565b610334610e79565b6103a16105b63660046121c9565b610e88565b610378600e5481565b61035d6105d23660046121c9565b610ee2565b61035d6105e53660046121c9565b610f71565b6103786105f8366004612142565b610fd8565b6103786aaf3cfb8315e2d8e240000081565b6103a161061d3660046121f2565b61104d565b610378600b5481565b610378611317565b6103786a01d1de3d2d5c712f00000081565b6103a16106533660046121c9565b6113b1565b6103a1611492565b61037861066e36600461215c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610378622819a081565b61037860085481565b61037862f099c081565b6103787fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b610378600d5481565b6103786a108b2a2c2802909400000081565b610733610706366004612250565b60106020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6040805163ffffffff9093168352602083019190915201610341565b6103a161075d366004612142565b6115af565b61037860095481565b6103a16107793660046121c9565b611647565b60606003805461078d9061245a565b80601f01602080910402602001604051908101604052809291908181526020018280546107b99061245a565b80156108065780601f106107db57610100808354040283529160200191610806565b820191906000526020600020905b8154815290600101906020018083116107e957829003601f168201915b5050505050905090565b600061081d3384846116cf565b5060015b92915050565b6005546001600160a01b0316331461085a5760405162461bcd60e51b815260040161085190612326565b60405180910390fd5b61087a6aaf3cfb8315e2d8e24000006a09391ab60ea0265cc000006116c3565b600e5461088790836116c3565b11156108a55760405162461bcd60e51b81526004016108519061235b565b6108ad611317565b8111156108f75760405162461bcd60e51b8152602060048201526018602482015277185d985a5b18589b19481b1a5b5a5d08195e18d95959195960421b6044820152606401610851565b600e5461090490826116c3565b600e556109118282610b1f565b5050565b60006001600160a01b0383163014156109405760405162461bcd60e51b8152600401610851906122e1565b61094b8484846117f3565b610983843361097e856040518060600160405280602881526020016124dd602891396109778a3361066e565b91906119c3565b6116cf565b6001600160a01b038085166000908152600f60205260408082205486841683529120546109b5929182169116846119ef565b5060019392505050565b60006006544210156109d15750600090565b60006109ec6ab428f1a88abfc52d0000006303c26700611b53565b90506000610a0560065442611b5f90919063ffffffff16565b90506303c267008110610a4657600d54610a3f90610a396ab428f1a88abfc52d0000006a01d1de3d2d5c712f0000006116c3565b90611b5f565b9250505090565b600d54610a3f90610a396a01d1de3d2d5c712f000000610a668587611b6b565b906116c3565b6005546001600160a01b03163314610a965760405162461bcd60e51b815260040161085190612326565b600c546a108b2a2c2802909400000090610ab090836116c3565b1115610ace5760405162461bcd60e51b81526004016108519061235b565b600c54610adb90826116c3565b600c556109118282610b1f565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161081d91859061097e908690612388565b6005546001600160a01b03163314610b495760405162461bcd60e51b815260040161085190612326565b6b033b2e3c9fd0803ce8000000610b6382610a6660025490565b1115610ba05760405162461bcd60e51b815260206004820152600c60248201526b18d85c08195e18d95959195960a21b6044820152606401610851565b610baa8282611b77565b6001600160a01b038083166000908152600f60205260408120546109119216836119ef565b610bd93382611c56565b50565b6005546001600160a01b03163314610c065760405162461bcd60e51b815260040161085190612326565b610c106000611ccf565b565b6000438210610c755760405162461bcd60e51b815260206004820152602960248201527f53494e474c453a3a6765745072696f72566f7465733a206e6f74207965742064604482015268195d195c9b5a5b995960ba1b6064820152608401610851565b6001600160a01b03831660009081526011602052604090205463ffffffff1680610ca3576000915050610821565b6001600160a01b03841660009081526010602052604081208491610cc8600185612435565b63ffffffff90811682526020820192909252604001600020541611610d31576001600160a01b038416600090815260106020526040812090610d0b600184612435565b63ffffffff1663ffffffff16815260200190815260200160002060010154915050610821565b6001600160a01b038416600090815260106020908152604080832083805290915290205463ffffffff16831015610d6c576000915050610821565b600080610d7a600184612435565b90505b8163ffffffff168163ffffffff161115610e425760006002610d9f8484612435565b610da991906123dc565b610db39083612435565b6001600160a01b038816600090815260106020908152604080832063ffffffff8086168552908352928190208151808301909252805490931680825260019093015491810191909152919250871415610e16576020015194506108219350505050565b805163ffffffff16871115610e2d57819350610e3b565b610e38600183612435565b92505b5050610d7d565b506001600160a01b038516600090815260106020908152604080832063ffffffff9094168352929052206001015491505092915050565b60606004805461078d9061245a565b6005546001600160a01b03163314610eb25760405162461bcd60e51b815260040161085190612326565b610ebc8282611d21565b6001600160a01b038083166000908152600f6020526040812054610911921690836119ef565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610f645760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610851565b6109b533858584036116cf565b60006001600160a01b038316301415610f9c5760405162461bcd60e51b8152600401610851906122e1565b610fa73384846117f3565b336000908152600f6020526040808220546001600160a01b038681168452919092205461081d9282169116846119ef565b6001600160a01b03811660009081526011602052604081205463ffffffff1680611003576000611046565b6001600160a01b038316600090815260106020526040812090611027600184612435565b63ffffffff1663ffffffff168152602001908152602001600020600101545b9392505050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86661107861077e565b8051602091820120604080518084019490945283810191909152466060840152306080808501919091528151808503909101815260a0840182528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08501526001600160a01b038b1660e085015261010084018a90526101208085018a90528251808603909101815261014085019092528151919092012061190160f01b61016084015261016283018290526101828301819052909250906000906101a20160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa1580156111a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661121d5760405162461bcd60e51b815260206004820152602860248201527f53494e474c453a3a64656c656761746542795369673a20696e76616c6964207360448201526769676e617475726560c01b6064820152608401610851565b6001600160a01b038116600090815260126020526040812080549161124183612495565b91905055891461129f5760405162461bcd60e51b8152602060048201526024808201527f53494e474c453a3a64656c656761746542795369673a20696e76616c6964206e6044820152636f6e636560e01b6064820152608401610851565b874211156113005760405162461bcd60e51b815260206004820152602860248201527f53494e474c453a3a64656c656761746542795369673a207369676e617475726560448201526708195e1c1a5c995960c21b6064820152608401610851565b61130a818b611c56565b505050505b505050505050565b60006006544210156113295750600090565b60006113446aaf3cfb8315e2d8e24000006303c26700611b53565b9050600061135d60065442611b5f90919063ffffffff16565b90506303c26700811061139157600e54610a3f90610a396aaf3cfb8315e2d8e24000006a09391ab60ea0265cc000006116c3565b600e54610a3f90610a396a09391ab60ea0265cc00000610a668587611b6b565b6005546001600160a01b031633146113db5760405162461bcd60e51b815260040161085190612326565b6113fb6ab428f1a88abfc52d0000006a01d1de3d2d5c712f0000006116c3565b600d5461140890836116c3565b11156114265760405162461bcd60e51b81526004016108519061235b565b61142e6109bf565b8111156114785760405162461bcd60e51b8152602060048201526018602482015277185d985a5b18589b19481b1a5b5a5d08195e18d95959195960421b6044820152606401610851565b600d5461148590826116c3565b600d556109118282610b1f565b6005546001600160a01b031633146114bc5760405162461bcd60e51b815260040161085190612326565b6008544210156115055760405162461bcd60e51b815260206004820152601460248201527314da5b99db19551bdad95b8e881b9bdd081e595d60621b6044820152606401610851565b60075442101561151757610c10611e6f565b62f099c060075442611529919061241e565b10156115455760095461153d906002611b53565b600a55611557565b600a54611553906002611b53565b600a555b6008546115679062f099c06116c3565b6008819055600a546040517f9cd8d3fc4ba7908f75314e1c9a0c1ea439763c16945a6d4c8cd12a90fcfde9ae926115a5928252602082015260400190565b60405180910390a1565b6005546001600160a01b031633146115d95760405162461bcd60e51b815260040161085190612326565b6001600160a01b03811661163e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610851565b610bd981611ccf565b6005546001600160a01b031633146116715760405162461bcd60e51b815260040161085190612326565b600b546a7152e0e1abab2b290000009061168b90836116c3565b11156116a95760405162461bcd60e51b81526004016108519061235b565b600b546116b690826116c3565b600b556109118282610b1f565b60006110468284612388565b6001600160a01b0383166117315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610851565b6001600160a01b0382166117925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610851565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166118575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610851565b6001600160a01b0382166118b95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610851565b6001600160a01b038316600090815260208190526040902054818110156119315760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610851565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611968908490612388565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119b491815260200190565b60405180910390a35b50505050565b600081848411156119e75760405162461bcd60e51b8152600401610851919061228e565b505050900390565b816001600160a01b0316836001600160a01b031614158015611a115750600081115b15611b4e576001600160a01b03831615611ab4576001600160a01b03831660009081526011602052604081205463ffffffff169081611a51576000611a94565b6001600160a01b038516600090815260106020526040812090611a75600185612435565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90506000611aa28285611b5f565b9050611ab086848484611f54565b5050505b6001600160a01b03821615611b4e576001600160a01b03821660009081526011602052604081205463ffffffff169081611aef576000611b32565b6001600160a01b038416600090815260106020526040812090611b13600185612435565b63ffffffff1663ffffffff168152602001908152602001600020600101545b90506000611b4082856116c3565b905061130f85848484611f54565b505050565b600061104682846123c8565b6000611046828461241e565b600061104682846123ff565b6001600160a01b038216611bcd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610851565b8060026000828254611bdf9190612388565b90915550506001600160a01b03821660009081526020819052604081208054839290611c0c908490612388565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038281166000818152600f60208181526040808420805485845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46119bd8284836119ef565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216611d815760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610851565b6001600160a01b03821660009081526020819052604090205481811015611df55760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610851565b6001600160a01b0383166000908152602081905260408120838303905560028054849290611e2490849061241e565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6000611e9c6064611e96622819a0611e96606442600754611e90919061241e565b90611b6b565b90611b53565b611ea790600661241e565b90506000611ed7610c80611e9664e8d4a51000611e90611ec9876101f4611b6b565b610a39610c806106d66116c3565b9050611ef764e8d4a51000611e9683600954611b6b90919063ffffffff16565b600a55600854611f0a90622819a06116c3565b6008819055600a546040517f9cd8d3fc4ba7908f75314e1c9a0c1ea439763c16945a6d4c8cd12a90fcfde9ae92611f48928252602082015260400190565b60405180910390a15050565b6000611f7843604051806060016040528060368152602001612505603691396120f6565b905060008463ffffffff16118015611fd257506001600160a01b038516600090815260106020526040812063ffffffff831691611fb6600188612435565b63ffffffff908116825260208201929092526040016000205416145b1561201b576001600160a01b03851660009081526010602052604081208391611ffc600188612435565b63ffffffff1681526020810191909152604001600020600101556120ab565b60408051808201825263ffffffff838116825260208083018681526001600160a01b038a166000908152601083528581208a851682529092529390209151825463ffffffff19169116178155905160019182015561207a9085906123a0565b6001600160a01b0386166000908152601160205260409020805463ffffffff191663ffffffff929092169190911790555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a25050505050565b600081640100000000841061211e5760405162461bcd60e51b8152600401610851919061228e565b509192915050565b80356001600160a01b038116811461213d57600080fd5b919050565b600060208284031215612153578081fd5b61104682612126565b6000806040838503121561216e578081fd5b61217783612126565b915061218560208401612126565b90509250929050565b6000806000606084860312156121a2578081fd5b6121ab84612126565b92506121b960208501612126565b9150604084013590509250925092565b600080604083850312156121db578182fd5b6121e483612126565b946020939093013593505050565b60008060008060008060c0878903121561220a578182fd5b61221387612126565b95506020870135945060408701359350606087013560ff81168114612236578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215612262578182fd5b61226b83612126565b9150602083013563ffffffff81168114612283578182fd5b809150509250929050565b6000602080835283518082850152825b818110156122ba5785810183015185820160400152820161229e565b818111156122cb5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526025908201527f45524332303a207472616e7366657220746f2074686520746f6b656e20636f6e6040820152641d1c9858dd60da1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601390820152721b5a5b9d081b1a5b5a5d08195e18d959591959606a1b604082015260600190565b6000821982111561239b5761239b6124b0565b500190565b600063ffffffff8083168185168083038211156123bf576123bf6124b0565b01949350505050565b6000826123d7576123d76124c6565b500490565b600063ffffffff808416806123f3576123f36124c6565b92169190910492915050565b6000816000190483118215151615612419576124196124b0565b500290565b600082821015612430576124306124b0565b500390565b600063ffffffff83811690831681811015612452576124526124b0565b039392505050565b600181811c9082168061246e57607f821691505b6020821081141561248f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156124a9576124a96124b0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636553494e474c453a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a2646970667358221220b0ffc8b251c78c9c9cbf24ad1050431896eb16e11c726ca4f54922ae091d01c564736f6c63430008040033