Documentation ¶
Index ¶
Constants ¶
const SCAddressNumLeadingZeros = 8
SCAddressNumLeadingZeros is the number of zero bytes every smart contract address begins with.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExprInterpreter ¶
type ExprInterpreter struct {
FileResolver fr.FileResolver
}
ExprInterpreter provides context for computing Mandos values.
func (*ExprInterpreter) InterpretString ¶
func (ei *ExprInterpreter) InterpretString(strRaw string) ([]byte, error)
InterpretString resolves a string to a byte slice according to the Mandos value format. Supported rules are: - numbers: decimal, hex, binary, signed/unsigned - fixed length numbers: "u32:5", "i8:-3", etc. - ascii strings as "str:...", "“...", "”..." - "true"/"false" - "address:..." - "sc:..." (also an address) - "file:..." - "keccak256:..." - concatenation using |
func (*ExprInterpreter) InterpretSubTree ¶
func (ei *ExprInterpreter) InterpretSubTree(obj oj.OJsonObject) ([]byte, error)
InterpretSubTree attempts to produce a value based on a JSON subtree. Subtrees are composed of strings, lists and maps. The idea is to intuitively represent serialized objects. Lists are evaluated by concatenating their items' representations. Maps are evaluated by concatenating their values' representations (keys are ignored). See InterpretString on how strings are being interpreted.