Documentation ¶
Index ¶
- Constants
- func ExtractAbi(c ast.Contract) (*abi.ABI, error)
- type Asm
- func (a *Asm) Emerge(operator opcode.Type, operands ...[]byte) int
- func (a *Asm) EmergeAt(index int, operator opcode.Type, operands ...[]byte) int
- func (a *Asm) Equal(a1 Asm) bool
- func (a *Asm) ReplaceOperandAt(index int, operands []byte) error
- func (a *Asm) ReplaceOperatorAt(index int, operator opcode.Type) error
- func (a *Asm) String() string
- func (a *Asm) ToRawByteCode() []byte
- type AsmCode
- type EntryError
- type FuncMap
- type MemDefiner
- type MemEntry
- type MemEntryTable
- type MemGetter
- type MemTracer
Constants ¶
const EntrySize = 8
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Asm ¶
type Asm struct {
AsmCodes []AsmCode
}
Asm is generated by compiling.
func CompileContract ¶
TODO: implement me w/ test cases :-) CompileContract() compiles a smart contract. returns bytecode and error.
func (*Asm) Emerge ¶
Emerge() translates instruction to bytecode An operand of operands should be 4 bytes.
func (*Asm) EmergeAt ¶
EmergeAt() translates instruction to bytecode and append at index An operand of operands should be 4 bytes.
func (*Asm) ReplaceOperatorAt ¶
func (*Asm) ToRawByteCode ¶
type EntryError ¶
type EntryError struct {
Id string
}
func (EntryError) Error ¶
func (e EntryError) Error() string
type MemDefiner ¶
Define() saves an variable to EntryMap and increase the MemoryCounter. This should be used when compiles the assign statement. ex) a = 5 -> Define("a", 5) b = "abc" -> Define("b", "abc")
type MemEntryTable ¶
MemEntryTable is used to know the location of the memory
func NewMemEntryTable ¶
func NewMemEntryTable() *MemEntryTable
func (*MemEntryTable) Define ¶
func (m *MemEntryTable) Define(id string) MemEntry
type MemGetter ¶
MemGetter gets the data of the memory entry. GetOffsetOfEntry() returns the offset of the memory entry corresponding the Id. GetSizeOfEntry() returns the size of the memory entry corresponding the Id.
type MemTracer ¶
type MemTracer interface { MemDefiner MemGetter }