Skip to content

TRC-011 TransferPausable

Description

TransferPausable allows the contract owner to suspend trading at any time, preventing anyone from selling except those with special authority. This function generally relies on ownership. If the contract does not have an owner, or if the owner is a black hole address and cannot be retrieved, this function maybe be disabled.

Risk Pattern

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

function setTradeEnabled(bool _enabled) external onlyOwner {
  tradeEnabled = _enabled;
}

Risk Samples