Contract Structure & Versions
Code License
Specify a license at the top of every file.
Solidity Versions
Contract Template
Import
When you have multiple files and you want to import one file into another, Solidity uses the
import
keyword:
So if we had a file named
someothercontract.sol
in the same directory as this contract (that's what the./
means), it would get imported by the compiler.Imports can also be renamed when being imported:
Contract Layout
license
version
imports
errors
interfaces, libraries, contracts
type declarations
state variables
events
modifiers
functions
Function Layout
constructor
receive function (if exists)
fallback function (if exists)
external
public
internal
private
view & pure functions
Last updated