Class SolidityType

java.lang.Object
net.osslabz.evm.abi.definition.SolidityType
Direct Known Subclasses:
SolidityType.ArrayType, SolidityType.Bytes32Type, SolidityType.BytesType, SolidityType.NumericType, SolidityType.TupleType

public abstract class SolidityType extends Object
  • Field Details

    • name

      protected String name
  • Constructor Details

    • SolidityType

      public SolidityType(String name)
  • Method Details

    • getType

      public static SolidityType getType(String typeName)
    • getName

      public String getName()
      The type name as it was specified in the interface description
    • getCanonicalName

      public String getCanonicalName()
      The canonical type name (used for the method signature creation) E.g. 'int' - canonical 'int256'
    • encode

      public abstract byte[] encode(Object value)
      Encodes the value according to specific type rules
      Parameters:
      value -
    • decode

      public abstract Object decode(byte[] encoded, int offset)
    • decode

      public Object decode(byte[] encoded)
    • getFixedSize

      public int getFixedSize()
      Returns:
      fixed size in bytes. For the dynamic types returns IntType.getFixedSize() which is effectively the int offset to dynamic data
    • isDynamicType

      public boolean isDynamicType()
    • toString

      public String toString()
      Overrides:
      toString in class Object