import { Variable , DecodedVariable } from "../variable" ; import { BN } from "bn.js" ; import { LibSdbInterface } from "../../../interface" ; export class ContractDetail { variable : Variable ; position : BN ; offset : number | null ; id : number ; name : string ; storageLength : number ; memoryLength : number ; constructor ( variable ) { this . variable = variable ; this . position = new BN ( 0 ) ; this . id = Variable . nextId ++ ; this . memoryLength = 32 ; this . storageLength = 20 ; } getStorageUsed ( ) { return this . storageLength ; } childIds ( ) { let ids = [ ] ; return ids ; } clone ( variable = this . variable ) { let clone = new ContractDetail ( variable ) ; clone . position = this . position ; clone . offset = this . offset ; clone . name = this . name ; clone . storageLength = this . storageLength ; clone . memoryLength = this . memoryLength ; return clone ; } async decodeChildren ( stack , memory , _interface , address ) { let decodedVariables = [ ] ; return decodedVariables ; } async decode ( stack , memory , _interface , address ) { let decodedVariable = < DecodedVariable > { name : this . variable . name , type : this . name , variablesReference : 0 , value : "Contract" + ( this . name ? ( " " + this . name ) : "" ) , result : "" } ; return decodedVariable ; } }