Currently, there is no definite or enforced style guide when writing Asteroid code.
However, there are some generally preferred conventions:
- Opening braces should be on the same line as the declaration
Functions should begin with a lower-case letter.
func add(a, b, c int) int {
return a + b + c
}Events should begin with an upper-case letter.
event Add(a, b, c int)Classes should begin with an upper-case letter.
class OrderBook {
}Interfaces should begin with an upper-case letter.
interface OrderBook {
}Contracts should begin with an upper-case letter.
contract OrderBook {
}