Docs Técnicas
Syntax Reference
``python @describe("optional contract description") contract Name: ``
O conteúdo abaixo vem das fontes técnicas do repositório e é prerenderizado no site para leitura direta por pessoas, crawlers e agentes.
Contract
python
@describe("optional contract description")
contract Name:@describe is optional at contract level and must appear immediately before contract Name:.
Comments
python
# line comment
self.value = 1 # trailing commentStorage
python
storage:
field: Type = defaultView
python
@describe("optional wallet description")
@view
def name(args...) -> Type:
return exprTransaction
python
@describe("optional wallet description")
@tx
def name(args...):
statementConstructor
python
@describe("optional wallet description")
@construct
def initialize(args...):
statement@construct functions must not return values. A contract may declare at most one. @init remains a compatibility alias for older source files.
Function descriptions may reference parameters with {param} placeholders.
Let Binding
python
let name = expr
let name: Type = exprAssignment
python
self.field = expr
self.field[index] = exprLoop
python
for i in range(N):
statement
for item in self.vector:
statement