# How to use solidity latest version with openzeppelin

**URL:** <https://forum.openzeppelin.com/t/how-to-use-solidity-latest-version-with-openzeppelin/28695>\
**Category:** Smart Contracts\
**Tags:** erc20\
**Created:** [May 13, 2022, 1:39pm UTC](https://forum.openzeppelin.com/t/how-to-use-solidity-latest-version-with-openzeppelin/28695 "2022-05-13T13:39:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![selv](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/selv/32/3598_2.png) [@selv](https://forum.openzeppelin.com/u/selv)\
**Post date:** [May 13, 2022, 1:39pm UTC](https://forum.openzeppelin.com/t/how-to-use-solidity-latest-version-with-openzeppelin/28695/1 "2022-05-13T13:39:17Z")

</div>

I have imported openzeppelin's ERC20 contract into my own contract like the following,

```auto
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.13;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract GLDToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
        _mint(msg.sender, initialSupply);
    }
}

```

The used slither analyzer tool to validate the above contract. I am getting the following output,

Different versions of Solidity is used:  
- Version used: ['0.8.13', '^0.8.0']  
- 0.8.13 (contracts/GLDToken.sol#3)  
- ^0.8.0 (node\_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#4)  
- ^0.8.0 (node\_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#4)  
- ^0.8.0 (node\_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#4)  
- ^0.8.0 (node\_modules/@openzeppelin/contracts/utils/Context.sol#4)  
Reference: [https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used](https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used)

From the above statments I am having the following doubts,

1. Can we use different solidity version?
2. How to use latest solidity version when using openzeppelin? Because highest version in openzeppelin is 0.8.0

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [May 14, 2022, 1:38am UTC](https://forum.openzeppelin.com/t/how-to-use-solidity-latest-version-with-openzeppelin/28695/2 "2022-05-14T01:38:24Z")

</div>

> [@selv](#):
>
> Can we use different solidity version?

Yes, I think so.

> [@selv](#):
>
> How to use latest solidity version when using openzeppelin? Because highest version in openzeppelin is 0.8.0

I think in order to make good backward compatibility, they use `^0.8.0`, and this means you can use any versions of the 0.8.x.

It seems like you used Slither to analyze your contracts, so it threw out this error. In deed, we are recommended to specify the Solidity version, but just like I said above, for compatibility, they use `pragma solidity ^0.8.0;` rather than `pragma solidity 0.8.0;`, and I do not think they have a version use `0.8.13`.
