# Security Model

Given the context where bridges have been the focus of numerous attacks throughout 2022 and 2023, emphasizing security within the Glacis infrastructure is paramount.

As a response to these security challenges, every Smart Contract function within Glacis has undergone rigorous access control measures. These measures are designed to tightly restrict access to each function, ensuring that only the specifically designated and authorized component can interact with it.

This security-first philosophy reflects an understanding of the critical importance of trust and reliability in the blockchain ecosystem, where any breach can have far-reaching consequences.

To enforce Solidity best practices security policies, the following modifiers have been implemented:

* onlyAuthorizedAdapter: Verifies that the source address of a request is an authorized component (the address is in the authorizedRemoteAddresses list for the source chain)

```solidity
    modifier onlyAuthorizedRemoteAddress(uint256 sourceChainId, address sourceAddress) {
        if (
            sourceChainId == 0 ||
            remoteCounterpart[chainId] == address(0) ||
            sourceAddress != remoteCounterpart[chainId]
        ) {
            revert GlacisAbstractAdapter__OnlyAdapterAllowed();
        }
        _;
    }
```

* onlyGlacisRouter: Verifies that the sender of the request to an Adapter send function is always GlacisRouter

```solidity
    modifier onlyGlacisRouter() {
        if (msg.sender != address(GLACIS_ROUTER))
            revert GlacisAbstractAdapter__OnlyGlacisRouterAllowed();
        _;
    }
```

* onlyAdapter: Verifies that the sender of the request to a GlacisRouter receive function is one of the registered GMP adapters

```solidity
    modifier onlyAdapter() {
        if (adapterToGlacisGMPId[msg.sender] == 0)
            revert GlacisAbstractRouter__OnlyAdaptersAllowed();
        _;
    }
```

This diagram serves as a comprehensive visual guide illustrating the various layers and mechanisms of security restrictions implemented within the Glacis protocol:

![](/files/5aQxnLPX2DMa7RKJef8p)


---

# Agent Instructions: 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://docs.glacislabs.com/glacis-core/concepts/security-model.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.
