> For the complete documentation index, see [llms.txt](https://financiyo.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://financiyo.gitbook.io/docs/smart-contracts/evm-extensions/authorization.md).

# Authorization

The user should grant authorization to allow smart contracts (including precompiled ones) to send messages on behalf of a user account. This is achieved by the `Authorization.sol` and `GenericAuthorization.sol` that provide the necessary functions to grant approvals and allowances. The precompiled contracts use these interfaces, `AuthorizationI` and `GenericAuthorizationI`, to allow users to approve the corresponding messages and amounts if needed.

### Solidity Interfaces[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#solidity-interfaces) <a href="#solidity-interfaces" id="solidity-interfaces"></a>

#### `Authorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#authorizationsol) <a href="#authorizationsol" id="authorizationsol"></a>

Find the [Solidity interface in the evmos/extensions repo](https://github.com/evmos/extensions/blob/main/precompiles/common/Authorization.sol).

#### `GenericAuthorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#genericauthorizationsol) <a href="#genericauthorizationsol" id="genericauthorizationsol"></a>

Find the [Solidity interface in the evmos/extensions repo](https://github.com/evmos/extensions/blob/main/precompiles/common/GenericAuthorization.sol).

### Transactions[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#transactions) <a href="#transactions" id="transactions"></a>

#### `Authorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#authorizationsol-1) <a href="#authorizationsol-1" id="authorizationsol-1"></a>

* `approve`

  Approves a list of Cosmos or IBC transactions with a specific amount of tokens

  ```
  function approve(
          address spender,
          uint256 amount,
          string[] calldata methods
      ) external returns (bool approved);
  ```
* `increaseAllowance`

  Increase the allowance of a given spender by a specific amount of tokens for IBC transfer methods or staking

  ```
  function increaseAllowance(
          address spender,
          uint256 amount,
          string[] calldata methods
      ) external returns (bool approved);
  ```
* `decreaseAllowance`

  Decreases the allowance of a given spender by a specific amount of tokens for IBC transfer methods or staking

  ```
  function decreaseAllowance(
          address spender,
          uint256 amount,
          string[] calldata methods
      ) external returns (bool approved);
  ```

#### `GenericAuthorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#genericauthorizationsol-1) <a href="#genericauthorizationsol-1" id="genericauthorizationsol-1"></a>

* `approve`

  Approves a list of Cosmos message

  ```
  function approve(
          address spender,
          string[] calldata methods
      ) external returns (bool approved);
  ```

### Queries[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#queries) <a href="#queries" id="queries"></a>

#### `Authorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#authorizationsol-2) <a href="#authorizationsol-2" id="authorizationsol-2"></a>

* `allowance`

  Returns the remaining number of tokens that the spender will be allowed to spend on behalf of the owner through IBC transfer methods or staking. This is zero by default

  ```
  function allowance(
          address owner,
          address spender,
          string calldata method
  ) external view returns (uint256 remaining);
  ```

### Events[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#events) <a href="#events" id="events"></a>

#### `Authorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#authorizationsol-3) <a href="#authorizationsol-3" id="authorizationsol-3"></a>

* `Approval`

  This event is emitted when the allowance of a spender is set by a call to the `approve` method. The `value` field specifies the new allowance and the `methods` field holds the information for which methods the approval was set.

  ```
  event Approval(
          address indexed owner,
          address indexed spender,
          string[] methods,
          uint256 value
      );
  ```
* `AllowanceChange`

  This event is emitted when the allowance of a spender is changed by a call to the decrease or increase allowance method. The `values` field specifies the new allowances and the `methods` field holds the information for which methods the approval was set.

  ```
  event AllowanceChange(
          address indexed owner,
          address indexed spender,
          string[] methods,
          uint256[] values
      );
  ```

#### `GenericAuthorization.sol`[​](https://docs.evmos.org/develop/smart-contracts/evm-extensions/authorization#genericauthorizationsol-2) <a href="#genericauthorizationsol-2" id="genericauthorizationsol-2"></a>

* `Approval`

  This event is emitted when the allowance of a spender is set by a call to the `approve` method. The `methods` field holds the information for which methods the approval was set.

  ```
  event Approval(
          address indexed owner,
          address indexed spender,
          string[] methods
      );
  ```


---

# 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://financiyo.gitbook.io/docs/smart-contracts/evm-extensions/authorization.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.
