Version pragma

In order to address compatibility issues that may arise from future versions of the solc version, pragma can be used to specify the version of the compatible compiler as, for example, in the following:

pragma solidity ^0.5.0 

This will ensure that the source file does not compile with versions smaller than 0.5.0 and versions starting from 0.6.0.

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.