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
Constants (7) keyboard_arrow_up
_PERMIT_TYPEHASH Constant
bytes32 help
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9
State Variables (15) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
getDeploymentStartTime keyboard_arrow_up
getLpRewardsEntitlement keyboard_arrow_up
transfer keyboard_arrow_up
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;
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 amount)
external
override
returns (bool)
{
if (_isFirstYear()) {
_requireCallerIsNotMultisig();
}
_approve(msg.sender, spender, amount);
return true;
}
transferFrom keyboard_arrow_up
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;
}
increaseAllowance keyboard_arrow_up
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;
}
decreaseAllowance keyboard_arrow_up
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
Requirements help
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.
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
Requirements help
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
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
version keyboard_arrow_up
Internal Functions
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
internal LQTYToken._buildDomainSeparator keyboard_arrow_up
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
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
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
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
internal LQTYToken._isFirstYear keyboard_arrow_up
internal LQTYToken._requireValidRecipient keyboard_arrow_up
Requirements help
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
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
Requirements help
Source Code
function _requireSenderIsNotMultisig(address _sender) internal view {
require(
_sender != multisigAddress,
"LQTYToken: sender must not be the multisig"
);
}
internal LQTYToken._requireCallerIsNotMultisig keyboard_arrow_up
internal LQTYToken._requireCallerIsLQTYStaking keyboard_arrow_up
internal CheckContract.checkContract keyboard_arrow_up
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");
}