Skip to content

TRC-013 SaleRestriction

Description

SaleRestriction prevents users from selling all their tokens in a single sale. Users may be required to retain a certain percentage, such as 10%, or a fixed number of tokens, such as 10 tokens.

Risk Pattern

function _transfer(address from, address recipient, uint256 amount) internal virtual override returns (bool) {
  require(_balances[_msgSender()] >= amount, );
  require(_balances(from).sub(amount)>=1*10**18,);
  _balances[_msgSender()] -= amount;
  _balances[recipient] += amount;
  emit Transfer(_msgSender(), recipient, amount);
  return true;
}

Risk Samples