# Anti-bot

Our tokens features an anti-bot.\
\
Is based on Max transaction size, but notice that can **only be set higher**, never lower. That prevents us from blocking sells, a common rugpull technique.

{% hint style="success" %}
You can find the **anti-bot at PPEGG** contract from lines **912 to 976**\
<https://arbiscan.io/address/0x78055daa07035aa5ebc3e5139c281ce6312e1b22#code>
{% endhint %}

```
    /**
     * @dev Sets the maxTransactionSize
     * 
     * This prevents users to buy and transfer before the dev allows it.
     * Can also prevent masive buys from bots.
     * The maxTransactionSize can only increase, so the dev can't block transaction.
     *
     * Requirements
     *
     * - `msg.sender` must be the token owner
     * - `maxTransactionSize` value must be higher than current value
     * - `msg.sender` must be the maxTransactionSizeOwner
     */
    function setMaxTransactionSize(uint256 _maxTransactionSize) public  {
        require(msg.sender == maxTransactionSizeOwner);
        require(_maxTransactionSize > maxTransactionSize, "New maxTransactionSize value must be higher than current value");
        maxTransactionSize = _maxTransactionSize;
    }
    
    
    /**
     * @dev renounces the maxTransactionSizeOwner
     * 
     * This sends the ownership of the maxTransactionSizeOwner to the zero address
     *
     * Requirements
     *
     * - `msg.sender` must be maxTransactionSizeOwner
     */
    function renounceMaxTransactionSizeOwner() public {
        require (msg.sender == maxTransactionSizeOwner);
        maxTransactionSizeOwner = address(0);
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is 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`.
     * - `amount` must be lower than maxTransactionSize
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "BEP20: transfer from the zero address");
        require(recipient != address(0), "BEP20: transfer to the zero address");
        require(amount <= maxTransactionSize || sender == owner(), "BEP20: transfer amount over maxTransactionSize");

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

The function has an owner, we did it this way to avoid conflicts with transferring ownership to masterchef.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://parrotdefi.gitbook.io/parrotdefi/general-info/security-1/anti-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
