pub enum Item {
Contract(ItemContract),
Enum(ItemEnum),
Error(ItemError),
Event(ItemEvent),
Function(ItemFunction),
Import(ImportDirective),
Pragma(PragmaDirective),
Struct(ItemStruct),
Udt(ItemUdt),
Using(UsingDirective),
Variable(VariableDefinition),
}
Expand description
An AST item. A more expanded version of a Solidity source unit.
Variants§
Contract(ItemContract)
A contract, abstract contract, interface, or library definition:
contract Foo is Bar, Baz { ... }
Enum(ItemEnum)
An enum definition: enum Foo { A, B, C }
Error(ItemError)
An error definition: error Foo(uint256 a, uint256 b);
Event(ItemEvent)
An event definition: event Transfer(address indexed from, address indexed to, uint256 value);
Function(ItemFunction)
A function, constructor, fallback, receive, or modifier definition:
function helloWorld() external pure returns(string memory);
Import(ImportDirective)
An import directive: import "foo.sol";
Pragma(PragmaDirective)
A pragma directive: pragma solidity ^0.8.0;
Struct(ItemStruct)
A struct definition: struct Foo { uint256 bar; }
Udt(ItemUdt)
A user-defined value type definition: type Foo is uint256;
Using(UsingDirective)
A using
directive: using { A, B.mul as * } for uint256 global;
Variable(VariableDefinition)
A state variable or constant definition: uint256 constant FOO = 42;