Blockwell

LQTY

ERC20

This contract is an ERC20 token.

Name LQTY
Symbol LQTY
Decimals 18
Total Supply 100,000,000 LQTY

About link description

Liquity (LQTY) is a cryptocurrency and operates on the Ethereum platform. Liquity has a current supply of 100,000,000 with 7,273,885.61928708 in circulation. The last known price of Liquity is 5.0253009 USD and is down -1.20 over the last 24 hours. It is currently trading on 3 active market(s) with $146,393.09 traded over the last 24 hours. More information can be found at https://www.liquity.org/.

Stats

Public Functions 19
Event Types 5
Code Size 103,747 bytes

Library Use

Uses SafeMath for uint256.

Events (5) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

CommunityIssuanceAddressSet Event

Parameters help
_communityIssuanceAddress
address help

LQTYStakingAddressSet Event

Parameters help
_lqtyStakingAddress
address help

LockupContractFactoryAddressSet Event

Parameters help
_lockupContractFactoryAddress
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

_NAME Constant

string help
LQTY

_SYMBOL Constant

string help
LQTY

_VERSION Constant

string help
1

_DECIMALS Constant

uint8 help
18

_PERMIT_TYPEHASH Constant

bytes32 help
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9

_TYPE_HASH Constant

bytes32 help
0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f

ONE_YEAR_IN_SECONDS Constant

uint help
31536000

multisigAddress Variable

address help

communityIssuanceAddress Variable

address help

lqtyStakingAddress Variable

address help

lockupContractFactory Variable

address help

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowances Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

_totalSupply Variable

uint help
Internal Variable

_CACHED_DOMAIN_SEPARATOR Variable

bytes32 help
Internal Variable

_CACHED_CHAIN_ID Variable

uint256 help
Internal Variable

_HASHED_NAME Variable

bytes32 help
Internal Variable

_HASHED_VERSION Variable

bytes32 help
Internal Variable

_nonces Variable

mapping(address => uint256) help
Internal Variable

_1_MILLION Variable

uint help
Internal Variable

deploymentStartTime Variable

uint help
Internal Variable

lpRewardsEntitlement Variable

uint help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() external view override returns (uint256) {
  return _totalSupply;
}

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address account) external view override returns (uint256) {
  return _balances[account];
}

getDeploymentStartTime keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function getDeploymentStartTime() external view override returns (uint256) {
  return deploymentStartTime;
}

getLpRewardsEntitlement keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function getLpRewardsEntitlement() external view override returns (uint256) {
  return lpRewardsEntitlement;
}

Parameters help

Name Type
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address recipient, uint256 amount)
  external
  override
  returns (bool)
{
  // Restrict the multisig's transfers in first year
  if (_callerIsMultisig() && _isFirstYear()) {
    _requireRecipientIsRegisteredLC(recipient);
  }

  _requireValidRecipient(recipient);

  // Otherwise, standard transfer functionality
  _transfer(msg.sender, recipient, amount);
  return true;
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  external
  view
  override
  returns (uint256)
{
  return _allowances[owner][spender];
}

Parameters help

Name Type
spender
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 amount)
  external
  override
  returns (bool)
{
  if (_isFirstYear()) {
    _requireCallerIsNotMultisig();
  }

  _approve(msg.sender, spender, amount);
  return true;
}

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferFrom(
  address sender,
  address recipient,
  uint256 amount
) external override returns (bool) {
  if (_isFirstYear()) {
    _requireSenderIsNotMultisig(sender);
  }

  _requireValidRecipient(recipient);

  _transfer(sender, recipient, amount);
  _approve(
    sender,
    msg.sender,
    _allowances[sender][msg.sender].sub(
      amount,
      "ERC20: transfer amount exceeds allowance"
    )
  );
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseAllowance(address spender, uint256 addedValue)
  external
  override
  returns (bool)
{
  if (_isFirstYear()) {
    _requireCallerIsNotMultisig();
  }

  _approve(
    msg.sender,
    spender,
    _allowances[msg.sender][spender].add(addedValue)
  );
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  external
  override
  returns (bool)
{
  if (_isFirstYear()) {
    _requireCallerIsNotMultisig();
  }

  _approve(
    msg.sender,
    spender,
    _allowances[msg.sender][spender].sub(
      subtractedValue,
      "ERC20: decreased allowance below zero"
    )
  );
  return true;
}

sendToLQTYStaking keyboard_arrow_up

Parameters help

Name Type
_sender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function sendToLQTYStaking(address _sender, uint256 _amount) external override {
  _requireCallerIsLQTYStaking();
  if (_isFirstYear()) {
    _requireSenderIsNotMultisig(_sender);
  } // Prevent the multisig from staking LQTY
  _transfer(_sender, lqtyStakingAddress, _amount);
}

domainSeparator keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function domainSeparator() public view override returns (bytes32) {
  if (_chainID() == _CACHED_CHAIN_ID) {
    return _CACHED_DOMAIN_SEPARATOR;
  } else {
    return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
  }
}

permit keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint help
deadline
uint help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function permit(
  address owner,
  address spender,
  uint256 amount,
  uint256 deadline,
  uint8 v,
  bytes32 r,
  bytes32 s
) external override {
  require(deadline >= now, "LQTY: expired deadline");
  bytes32 digest = keccak256(
    abi.encodePacked(
      "\x19\x01",
      domainSeparator(),
      keccak256(
        abi.encode(
          _PERMIT_TYPEHASH,
          owner,
          spender,
          amount,
          _nonces[owner]++,
          deadline
        )
      )
    )
  );
  address recoveredAddress = ecrecover(digest, v, r, s);
  require(recoveredAddress == owner, "LQTY: invalid signature");
  _approve(owner, spender, amount);
}

nonces keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

Visibility help public
Mutability help view
Source Code
function nonces(address owner) external view override returns (uint256) {
  // FOR EIP 2612
  return _nonces[owner];
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() external view override returns (string memory) {
  return _NAME;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() external view override returns (string memory) {
  return _SYMBOL;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() external view override returns (uint8) {
  return _DECIMALS;
}

version keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function version() external view override returns (string memory) {
  return _VERSION;
}

permitTypeHash keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function permitTypeHash() external view override returns (bytes32) {
  return _PERMIT_TYPEHASH;
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal LQTYToken._chainID keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help private
Mutability help pure
Source Code
function _chainID() private pure returns (uint256 chainID) {
  assembly {
    chainID := chainid()
  }
}

internal LQTYToken._buildDomainSeparator keyboard_arrow_up

Parameters help

Name Type
typeHash
bytes32 help
name
bytes32 help
version
bytes32 help

Properties

Visibility help private
Mutability help view
Source Code
function _buildDomainSeparator(
  bytes32 typeHash,
  bytes32 name,
  bytes32 version
) private view returns (bytes32) {
  return
    keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));
}

internal LQTYToken._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address sender,
  address recipient,
  uint256 amount
) internal {
  require(sender != address(0), "ERC20: transfer from the zero address");
  require(recipient != address(0), "ERC20: transfer to the zero address");

  _balances[sender] = _balances[sender].sub(
    amount,
    "ERC20: transfer amount exceeds balance"
  );
  _balances[recipient] = _balances[recipient].add(amount);
  emit Transfer(sender, recipient, amount);
}

internal LQTYToken._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 amount) internal {
  require(account != address(0), "ERC20: mint to the zero address");

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);
  emit Transfer(address(0), account, amount);
}

internal LQTYToken._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 amount
) internal {
  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);
}

internal LQTYToken._callerIsMultisig keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _callerIsMultisig() internal view returns (bool) {
  return (msg.sender == multisigAddress);
}

internal LQTYToken._isFirstYear keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _isFirstYear() internal view returns (bool) {
  return (block.timestamp.sub(deploymentStartTime) < ONE_YEAR_IN_SECONDS);
}

internal LQTYToken._requireValidRecipient keyboard_arrow_up

Parameters help

Name Type
_recipient
address help

Properties

Visibility help internal
Mutability help view
Source Code
function _requireValidRecipient(address _recipient) internal view {
  require(
    _recipient != address(0) && _recipient != address(this),
    "LQTY: Cannot transfer tokens directly to the LQTY token contract or the zero address"
  );
  require(
    _recipient != communityIssuanceAddress && _recipient != lqtyStakingAddress,
    "LQTY: Cannot transfer tokens directly to the community issuance or staking contract"
  );
}

internal LQTYToken._requireRecipientIsRegisteredLC keyboard_arrow_up

Parameters help

Name Type
_recipient
address help

Properties

Visibility help internal
Mutability help view
Source Code
function _requireRecipientIsRegisteredLC(address _recipient) internal view {
  require(
    lockupContractFactory.isRegisteredLockup(_recipient),
    "LQTYToken: recipient must be a LockupContract registered in the Factory"
  );
}

internal LQTYToken._requireSenderIsNotMultisig keyboard_arrow_up

Parameters help

Name Type
_sender
address help

Properties

Visibility help internal
Mutability help view
Source Code
function _requireSenderIsNotMultisig(address _sender) internal view {
  require(
    _sender != multisigAddress,
    "LQTYToken: sender must not be the multisig"
  );
}

internal LQTYToken._requireCallerIsNotMultisig keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view

Requirements help

Source Code
function _requireCallerIsNotMultisig() internal view {
  require(!_callerIsMultisig(), "LQTYToken: caller must not be the multisig");
}

internal LQTYToken._requireCallerIsLQTYStaking keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _requireCallerIsLQTYStaking() internal view {
  require(
    msg.sender == lqtyStakingAddress,
    "LQTYToken: caller must be the LQTYStaking contract"
  );
}

internal CheckContract.checkContract keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help internal
Mutability help view

Requirements help

Source Code
function checkContract(address _account) internal view {
  require(_account != address(0), "Account cannot be zero address");

  uint256 size;
  // solhint-disable-next-line no-inline-assembly
  assembly {
    size := extcodesize(_account)
  }
  require(size > 0, "Account code size cannot be zero");
}