├── .gitignore ├── LICENSE ├── LICENSE.web3j ├── README.md ├── abi ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ ├── main │ └── java │ │ └── org │ │ └── tron │ │ └── tronj │ │ └── abi │ │ ├── DefaultFunctionEncoder.java │ │ ├── DefaultFunctionReturnDecoder.java │ │ ├── EventEncoder.java │ │ ├── EventValues.java │ │ ├── FunctionEncoder.java │ │ ├── FunctionReturnDecoder.java │ │ ├── TypeDecoder.java │ │ ├── TypeEncoder.java │ │ ├── TypeMappingException.java │ │ ├── TypeReference.java │ │ ├── Utils.java │ │ ├── datatypes │ │ ├── AbiTypes.java │ │ ├── Address.java │ │ ├── Array.java │ │ ├── Bool.java │ │ ├── Bytes.java │ │ ├── BytesType.java │ │ ├── DynamicArray.java │ │ ├── DynamicBytes.java │ │ ├── DynamicStruct.java │ │ ├── Event.java │ │ ├── Fixed.java │ │ ├── FixedPointType.java │ │ ├── Function.java │ │ ├── Int.java │ │ ├── IntType.java │ │ ├── NumericType.java │ │ ├── StaticArray.java │ │ ├── StaticStruct.java │ │ ├── StructType.java │ │ ├── TrcToken.java │ │ ├── Type.java │ │ ├── Ufixed.java │ │ ├── Uint.java │ │ ├── Utf8String.java │ │ ├── generated │ │ │ ├── Bytes1.java │ │ │ ├── Bytes10.java │ │ │ ├── Bytes11.java │ │ │ ├── Bytes12.java │ │ │ ├── Bytes13.java │ │ │ ├── Bytes14.java │ │ │ ├── Bytes15.java │ │ │ ├── Bytes16.java │ │ │ ├── Bytes17.java │ │ │ ├── Bytes18.java │ │ │ ├── Bytes19.java │ │ │ ├── Bytes2.java │ │ │ ├── Bytes20.java │ │ │ ├── Bytes21.java │ │ │ ├── Bytes22.java │ │ │ ├── Bytes23.java │ │ │ ├── Bytes24.java │ │ │ ├── Bytes25.java │ │ │ ├── Bytes26.java │ │ │ ├── Bytes27.java │ │ │ ├── Bytes28.java │ │ │ ├── Bytes29.java │ │ │ ├── Bytes3.java │ │ │ ├── Bytes30.java │ │ │ ├── Bytes31.java │ │ │ ├── Bytes32.java │ │ │ ├── Bytes4.java │ │ │ ├── Bytes5.java │ │ │ ├── Bytes6.java │ │ │ ├── Bytes7.java │ │ │ ├── Bytes8.java │ │ │ ├── Bytes9.java │ │ │ ├── Int104.java │ │ │ ├── Int112.java │ │ │ ├── Int120.java │ │ │ ├── Int128.java │ │ │ ├── Int136.java │ │ │ ├── Int144.java │ │ │ ├── Int152.java │ │ │ ├── Int16.java │ │ │ ├── Int160.java │ │ │ ├── Int168.java │ │ │ ├── Int176.java │ │ │ ├── Int184.java │ │ │ ├── Int192.java │ │ │ ├── Int200.java │ │ │ ├── Int208.java │ │ │ ├── Int216.java │ │ │ ├── Int224.java │ │ │ ├── Int232.java │ │ │ ├── Int24.java │ │ │ ├── Int240.java │ │ │ ├── Int248.java │ │ │ ├── Int256.java │ │ │ ├── Int32.java │ │ │ ├── Int40.java │ │ │ ├── Int48.java │ │ │ ├── Int56.java │ │ │ ├── Int64.java │ │ │ ├── Int72.java │ │ │ ├── Int8.java │ │ │ ├── Int80.java │ │ │ ├── Int88.java │ │ │ ├── Int96.java │ │ │ ├── StaticArray1.java │ │ │ ├── StaticArray10.java │ │ │ ├── StaticArray11.java │ │ │ ├── StaticArray12.java │ │ │ ├── StaticArray13.java │ │ │ ├── StaticArray14.java │ │ │ ├── StaticArray15.java │ │ │ ├── StaticArray16.java │ │ │ ├── StaticArray17.java │ │ │ ├── StaticArray18.java │ │ │ ├── StaticArray19.java │ │ │ ├── StaticArray2.java │ │ │ ├── StaticArray20.java │ │ │ ├── StaticArray21.java │ │ │ ├── StaticArray22.java │ │ │ ├── StaticArray23.java │ │ │ ├── StaticArray24.java │ │ │ ├── StaticArray25.java │ │ │ ├── StaticArray26.java │ │ │ ├── StaticArray27.java │ │ │ ├── StaticArray28.java │ │ │ ├── StaticArray29.java │ │ │ ├── StaticArray3.java │ │ │ ├── StaticArray30.java │ │ │ ├── StaticArray31.java │ │ │ ├── StaticArray32.java │ │ │ ├── StaticArray4.java │ │ │ ├── StaticArray5.java │ │ │ ├── StaticArray6.java │ │ │ ├── StaticArray7.java │ │ │ ├── StaticArray8.java │ │ │ ├── StaticArray9.java │ │ │ ├── Uint104.java │ │ │ ├── Uint112.java │ │ │ ├── Uint120.java │ │ │ ├── Uint128.java │ │ │ ├── Uint136.java │ │ │ ├── Uint144.java │ │ │ ├── Uint152.java │ │ │ ├── Uint16.java │ │ │ ├── Uint160.java │ │ │ ├── Uint168.java │ │ │ ├── Uint176.java │ │ │ ├── Uint184.java │ │ │ ├── Uint192.java │ │ │ ├── Uint200.java │ │ │ ├── Uint208.java │ │ │ ├── Uint216.java │ │ │ ├── Uint224.java │ │ │ ├── Uint232.java │ │ │ ├── Uint24.java │ │ │ ├── Uint240.java │ │ │ ├── Uint248.java │ │ │ ├── Uint256.java │ │ │ ├── Uint32.java │ │ │ ├── Uint40.java │ │ │ ├── Uint48.java │ │ │ ├── Uint56.java │ │ │ ├── Uint64.java │ │ │ ├── Uint72.java │ │ │ ├── Uint8.java │ │ │ ├── Uint80.java │ │ │ ├── Uint88.java │ │ │ └── Uint96.java │ │ └── primitive │ │ │ ├── Byte.java │ │ │ ├── Char.java │ │ │ ├── Double.java │ │ │ ├── Float.java │ │ │ ├── Int.java │ │ │ ├── Long.java │ │ │ ├── Number.java │ │ │ ├── PrimitiveType.java │ │ │ └── Short.java │ │ └── spi │ │ ├── FunctionEncoderProvider.java │ │ └── FunctionReturnDecoderProvider.java │ └── test │ └── java │ └── org │ └── tron │ └── tronj │ └── abi │ ├── AbiV2TestFixture.java │ ├── DefaultFunctionEncoderTest.java │ ├── EventEncoderTest.java │ ├── FunctionReturnDecoderTest.java │ ├── TypeDecoderTest.java │ ├── TypeEncoderTest.java │ ├── UtilsTest.java │ └── datatypes │ ├── AddressTest.java │ ├── EventTest.java │ ├── FixedPointTypeTest.java │ ├── StaticArrayTest.java │ └── Utf8StringTest.java ├── build.gradle ├── client ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ ├── main │ ├── grpc │ │ └── org │ │ │ └── tron │ │ │ └── tronj │ │ │ └── api │ │ │ ├── WalletGrpc.java │ │ │ └── WalletSolidityGrpc.java │ ├── java │ │ └── org │ │ │ └── tron │ │ │ └── tronj │ │ │ ├── api │ │ │ └── GrpcAPI.java │ │ │ ├── client │ │ │ ├── Transaction │ │ │ │ └── TransactionBuilder.java │ │ │ ├── TronClient.java │ │ │ ├── contract │ │ │ │ ├── Contract.java │ │ │ │ ├── ContractFunction.java │ │ │ │ └── Trc20Contract.java │ │ │ └── exceptions │ │ │ │ └── IllegalException.java │ │ │ └── proto │ │ │ ├── Chain.java │ │ │ ├── Common.java │ │ │ ├── Contract.java │ │ │ └── Response.java │ └── proto │ │ ├── api │ │ └── api.proto │ │ └── core │ │ ├── chain.proto │ │ ├── common.proto │ │ ├── contract.proto │ │ └── response.proto │ └── test │ └── java │ └── org │ └── tron │ └── tronj │ └── client │ └── ClientTest.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── utils ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src ├── main └── java │ └── org │ └── tron │ └── tronj │ ├── commons │ └── JavaVersion.java │ ├── crypto │ ├── Hash.java │ ├── Pair.java │ ├── SECP256K1.java │ └── tuweniTypes │ │ ├── AbstractBytes.java │ │ ├── ArrayWrappingBytes.java │ │ ├── ArrayWrappingBytes32.java │ │ ├── BufferWrappingBytes.java │ │ ├── ByteBufWrappingBytes.java │ │ ├── ByteBufferWrappingBytes.java │ │ ├── Bytes.java │ │ ├── Bytes32.java │ │ ├── BytesValues.java │ │ ├── ConcatenatedBytes.java │ │ ├── DelegatingBytes32.java │ │ ├── DelegatingMutableBytes32.java │ │ ├── MutableArrayWrappingBytes.java │ │ ├── MutableArrayWrappingBytes32.java │ │ ├── MutableBufferWrappingBytes.java │ │ ├── MutableByteBufWrappingBytes.java │ │ ├── MutableByteBufferWrappingBytes.java │ │ ├── MutableBytes.java │ │ ├── MutableBytes32.java │ │ ├── UInt256.java │ │ └── UInt256Value.java │ ├── exceptions │ ├── MessageDecodingException.java │ └── MessageEncodingException.java │ └── utils │ ├── Assertions.java │ ├── Base58Check.java │ ├── Bytes.java │ ├── Convert.java │ ├── Numeric.java │ └── Strings.java └── test └── java └── org └── tron └── tronj ├── crypto └── HashTest.java └── utils ├── AssertionsTest.java ├── Base58CheckTest.java ├── BytesTest.java ├── ConvertTest.java ├── NumericTest.java └── StringsTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.war 15 | *.nar 16 | *.ear 17 | *.zip 18 | *.tar.gz 19 | *.rar 20 | 21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 22 | hs_err_pid* 23 | 24 | build/ 25 | .gradle/ 26 | .idea 27 | .vscode 28 | -------------------------------------------------------------------------------- /abi/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.jfrog.bintray' 3 | } 4 | 5 | description 'TRON Application Binary Interface (ABI) for working with smart contracts' 6 | 7 | dependencies { 8 | implementation project(':utils') 9 | } 10 | 11 | /* 12 | publishing { 13 | publications { 14 | MyPublication(MavenPublication) { 15 | from components.java 16 | groupId 'org.tron.tronj' 17 | artifactId 'abi' 18 | version '0.0.1' 19 | } 20 | } 21 | } 22 | */ 23 | 24 | bintray { 25 | user = System.getenv('BINTRAY_USER_TRON') 26 | key = System.getenv('BINTRAY_KEY_TRON') 27 | 28 | configurations = ['archives'] 29 | 30 | pkg { 31 | repo = 'tronj' 32 | name = 'abi' 33 | // userOrg = 'tronj' 34 | // configurations = ['archives'] 35 | desc = description 36 | websiteUrl = 'https://github.com/tronprotocol/tronj' 37 | vcsUrl = 'https://github.com/tronprotocol/tronj.git' 38 | licenses = ['Apache-2.0'] 39 | publish = true 40 | publicDownloadNumbers = true 41 | version { 42 | afterEvaluate { 43 | name = "${project.version}" 44 | released = new Date() 45 | } 46 | } 47 | } 48 | } 49 | 50 | tasks.create('buildLib', Jar) { 51 | baseName = 'tronj' 52 | version = null 53 | from(sourceSets.main.output) { 54 | include '/**' 55 | } 56 | 57 | from { 58 | configurations.compile.collect { 59 | it.isDirectory() ? it : zipTree(it) 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /abi/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tronprotocol/tronj/e2ea227dde7d83a880685bd84e44ef10dc4ff4c7/abi/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /abi/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/EventEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi; 14 | 15 | import java.util.List; 16 | import java.util.stream.Collectors; 17 | 18 | import org.tron.tronj.abi.datatypes.Event; 19 | import org.tron.tronj.abi.datatypes.Type; 20 | import org.tron.tronj.crypto.Hash; 21 | import org.tron.tronj.utils.Numeric; 22 | 23 | /** 24 | * Ethereum filter encoding. Further limited details are available here. 26 | */ 27 | public class EventEncoder { 28 | 29 | private EventEncoder() {} 30 | 31 | public static String encode(Event event) { 32 | 33 | String methodSignature = buildMethodSignature(event.getName(), event.getParameters()); 34 | 35 | return buildEventSignature(methodSignature); 36 | } 37 | 38 | static String buildMethodSignature( 39 | String methodName, List> parameters) { 40 | 41 | StringBuilder result = new StringBuilder(); 42 | result.append(methodName); 43 | result.append("("); 44 | String params = 45 | parameters.stream().map(p -> Utils.getTypeName(p)).collect(Collectors.joining(",")); 46 | result.append(params); 47 | result.append(")"); 48 | return result.toString(); 49 | } 50 | 51 | public static String buildEventSignature(String methodSignature) { 52 | byte[] input = methodSignature.getBytes(); 53 | byte[] hash = Hash.sha3(input); 54 | return Numeric.toHexString(hash); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/EventValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi; 14 | 15 | import java.util.List; 16 | 17 | import org.tron.tronj.abi.datatypes.Type; 18 | 19 | /** Persisted solidity event parameters. */ 20 | public class EventValues { 21 | private final List indexedValues; 22 | private final List nonIndexedValues; 23 | 24 | public EventValues(List indexedValues, List nonIndexedValues) { 25 | this.indexedValues = indexedValues; 26 | this.nonIndexedValues = nonIndexedValues; 27 | } 28 | 29 | public List getIndexedValues() { 30 | return indexedValues; 31 | } 32 | 33 | public List getNonIndexedValues() { 34 | return nonIndexedValues; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/TypeMappingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi; 14 | 15 | public class TypeMappingException extends RuntimeException { 16 | 17 | public TypeMappingException(Exception e) { 18 | super(e); 19 | } 20 | 21 | public TypeMappingException(String message) { 22 | super(message); 23 | } 24 | 25 | public TypeMappingException(String message, Exception e) { 26 | super(message, e); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Bool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | /** Boolean type. */ 16 | public class Bool implements Type { 17 | 18 | public static final String TYPE_NAME = "bool"; 19 | public static final Bool DEFAULT = new Bool(false); 20 | 21 | private boolean value; 22 | 23 | public Bool(boolean value) { 24 | this.value = value; 25 | } 26 | 27 | public Bool(Boolean value) { 28 | this.value = value; 29 | } 30 | 31 | @Override 32 | public String getTypeAsString() { 33 | return TYPE_NAME; 34 | } 35 | 36 | @Override 37 | public Boolean getValue() { 38 | return value; 39 | } 40 | 41 | @Override 42 | public boolean equals(Object o) { 43 | if (this == o) { 44 | return true; 45 | } 46 | if (o == null || getClass() != o.getClass()) { 47 | return false; 48 | } 49 | 50 | Bool bool = (Bool) o; 51 | 52 | return value == bool.value; 53 | } 54 | 55 | @Override 56 | public int hashCode() { 57 | return (value ? 1 : 0); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Bytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | /** Statically allocated sequence of bytes. */ 16 | public class Bytes extends BytesType { 17 | 18 | public static final String TYPE_NAME = "bytes"; 19 | 20 | protected Bytes(int byteSize, byte[] value) { 21 | super(value, TYPE_NAME + value.length); 22 | if (!isValid(byteSize)) { 23 | throw new UnsupportedOperationException( 24 | "Input byte array must be in range 0 < M <= 32 and length must match type"); 25 | } 26 | } 27 | 28 | private boolean isValid(int byteSize) { 29 | int length = getValue().length; 30 | return length > 0 && length <= 32 && length == byteSize; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/BytesType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.Arrays; 16 | 17 | /** Binary sequence of bytes. */ 18 | public abstract class BytesType implements Type { 19 | 20 | private byte[] value; 21 | private String type; 22 | 23 | public BytesType(byte[] src, String type) { 24 | this.value = src; 25 | this.type = type; 26 | } 27 | 28 | @Override 29 | public int bytes32PaddedLength() { 30 | return value.length * 32; 31 | } 32 | 33 | @Override 34 | public byte[] getValue() { 35 | return value; 36 | } 37 | 38 | @Override 39 | public String getTypeAsString() { 40 | return type; 41 | } 42 | 43 | @Override 44 | public boolean equals(Object o) { 45 | if (this == o) { 46 | return true; 47 | } 48 | if (o == null || getClass() != o.getClass()) { 49 | return false; 50 | } 51 | 52 | BytesType bytesType = (BytesType) o; 53 | 54 | if (!Arrays.equals(value, bytesType.value)) { 55 | return false; 56 | } 57 | return type.equals(bytesType.type); 58 | } 59 | 60 | @Override 61 | public int hashCode() { 62 | int result = Arrays.hashCode(value); 63 | result = 31 * result + type.hashCode(); 64 | return result; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/DynamicArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.List; 16 | 17 | /** Dynamic array type. */ 18 | public class DynamicArray extends Array { 19 | 20 | @Deprecated 21 | @SafeVarargs 22 | @SuppressWarnings({"unchecked"}) 23 | public DynamicArray(T... values) { 24 | super((Class) AbiTypes.getType(values[0].getTypeAsString()), values); 25 | } 26 | 27 | @Deprecated 28 | @SuppressWarnings("unchecked") 29 | public DynamicArray(List values) { 30 | super((Class) AbiTypes.getType(values.get(0).getTypeAsString()), values); 31 | } 32 | 33 | @Deprecated 34 | @SuppressWarnings("unchecked") 35 | private DynamicArray(String type) { 36 | super((Class) AbiTypes.getType(type)); 37 | } 38 | 39 | @Deprecated 40 | public static DynamicArray empty(String type) { 41 | return new DynamicArray(type); 42 | } 43 | 44 | public DynamicArray(Class type, List values) { 45 | super(type, values); 46 | } 47 | 48 | @Override 49 | public int bytes32PaddedLength() { 50 | return super.bytes32PaddedLength() + MAX_BYTE_LENGTH; 51 | } 52 | 53 | @SafeVarargs 54 | public DynamicArray(Class type, T... values) { 55 | super(type, values); 56 | } 57 | 58 | @Override 59 | public String getTypeAsString() { 60 | return AbiTypes.getTypeAString(getComponentType()) + "[]"; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/DynamicBytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | /** Dynamically allocated sequence of bytes. */ 16 | public class DynamicBytes extends BytesType { 17 | 18 | public static final String TYPE_NAME = "bytes"; 19 | public static final DynamicBytes DEFAULT = new DynamicBytes(new byte[] {}); 20 | 21 | public DynamicBytes(byte[] value) { 22 | super(value, TYPE_NAME); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/DynamicStruct.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | public class DynamicStruct extends DynamicArray implements StructType { 20 | 21 | private final List> itemTypes = new ArrayList<>(); 22 | 23 | public DynamicStruct(List values) { 24 | this(Type.class, values); 25 | } 26 | 27 | private DynamicStruct(Class type, List values) { 28 | super(type, values); 29 | for (Type value : values) { 30 | itemTypes.add((Class) value.getClass()); 31 | } 32 | } 33 | 34 | @Override 35 | public int bytes32PaddedLength() { 36 | return super.bytes32PaddedLength() + 32; 37 | } 38 | 39 | public DynamicStruct(Type... values) { 40 | this(Arrays.asList(values)); 41 | } 42 | 43 | @SafeVarargs 44 | public DynamicStruct(Class type, Type... values) { 45 | this(type, Arrays.asList(values)); 46 | } 47 | 48 | @Override 49 | public String getTypeAsString() { 50 | final StringBuilder type = new StringBuilder("("); 51 | for (int i = 0; i < itemTypes.size(); ++i) { 52 | final Class cls = itemTypes.get(i); 53 | if (StructType.class.isAssignableFrom(cls)) { 54 | type.append(getValue().get(i).getTypeAsString()); 55 | } else { 56 | type.append(AbiTypes.getTypeAString(cls)); 57 | } 58 | if (i < itemTypes.size() - 1) { 59 | type.append(","); 60 | } 61 | } 62 | type.append(")"); 63 | return type.toString(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.List; 16 | import java.util.stream.Collectors; 17 | 18 | import org.tron.tronj.abi.TypeReference; 19 | 20 | import static org.tron.tronj.abi.Utils.convert; 21 | 22 | /** Event wrapper type. */ 23 | public class Event { 24 | private String name; 25 | private List> parameters; 26 | 27 | public Event(String name, List> parameters) { 28 | this.name = name; 29 | this.parameters = convert(parameters); 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public List> getParameters() { 37 | return parameters; 38 | } 39 | 40 | public List> getIndexedParameters() { 41 | return parameters.stream().filter(TypeReference::isIndexed).collect(Collectors.toList()); 42 | } 43 | 44 | public List> getNonIndexedParameters() { 45 | return parameters.stream().filter(p -> !p.isIndexed()).collect(Collectors.toList()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Fixed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Signed fixed type. */ 18 | public class Fixed extends FixedPointType { 19 | 20 | public static final String TYPE_NAME = "fixed"; 21 | public static final Fixed DEFAULT = new Fixed(BigInteger.ZERO); 22 | 23 | protected Fixed(int mBitSize, int nBitSize, BigInteger value) { 24 | super(TYPE_NAME, mBitSize, nBitSize, value); 25 | } 26 | 27 | public Fixed(BigInteger value) { 28 | this(DEFAULT_BIT_LENGTH, DEFAULT_BIT_LENGTH, value); 29 | } 30 | 31 | public Fixed(BigInteger m, BigInteger n) { 32 | this(convert(m, n)); 33 | } 34 | 35 | protected Fixed(int mBitSize, int nBitSize, BigInteger m, BigInteger n) { 36 | this(convert(mBitSize, nBitSize, m, n)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/FixedPointType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Common fixed-point type properties. */ 18 | public abstract class FixedPointType extends NumericType { 19 | 20 | static final int DEFAULT_BIT_LENGTH = MAX_BIT_LENGTH >> 1; 21 | 22 | private final int bitSize; 23 | 24 | public FixedPointType(String typePrefix, int mBitSize, int nBitSize, BigInteger value) { 25 | super(typePrefix + mBitSize + "x" + nBitSize, value); 26 | this.bitSize = mBitSize + nBitSize; 27 | if (!valid(mBitSize, nBitSize, value)) { 28 | throw new UnsupportedOperationException( 29 | "Bitsize must be 8 bit aligned, and in range 0 < bitSize <= 256"); 30 | } 31 | } 32 | 33 | @Override 34 | public int getBitSize() { 35 | return bitSize; 36 | } 37 | 38 | boolean valid(int mBitSize, int nBitSize, BigInteger value) { 39 | return isValidBitSize(mBitSize, nBitSize) && isValidBitCount(mBitSize, nBitSize, value); 40 | } 41 | 42 | private boolean isValidBitSize(int mBitSize, int nBitSize) { 43 | return mBitSize % 8 == 0 && nBitSize % 8 == 0 && bitSize > 0 && bitSize <= MAX_BIT_LENGTH; 44 | } 45 | 46 | private static boolean isValidBitCount(int mBitSize, int nBitSize, BigInteger value) { 47 | return value.bitCount() <= mBitSize + nBitSize; 48 | } 49 | 50 | static BigInteger convert(BigInteger m, BigInteger n) { 51 | return convert(DEFAULT_BIT_LENGTH, DEFAULT_BIT_LENGTH, m, n); 52 | } 53 | 54 | static BigInteger convert(int mBitSize, int nBitSize, BigInteger m, BigInteger n) { 55 | BigInteger mPadded = m.shiftLeft(nBitSize); 56 | int nBitLength = n.bitLength(); 57 | 58 | // find next multiple of 4 59 | int shift = (nBitLength + 3) & ~0x03; 60 | return mPadded.or(n.shiftLeft(nBitSize - shift)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.List; 16 | 17 | import org.tron.tronj.abi.TypeReference; 18 | 19 | import static org.tron.tronj.abi.Utils.convert; 20 | 21 | /** Function type. */ 22 | public class Function { 23 | private String name; 24 | private List inputParameters; 25 | private List> outputParameters; 26 | 27 | public Function( 28 | String name, List inputParameters, List> outputParameters) { 29 | this.name = name; 30 | this.inputParameters = inputParameters; 31 | this.outputParameters = convert(outputParameters); 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public List getInputParameters() { 39 | return inputParameters; 40 | } 41 | 42 | public List> getOutputParameters() { 43 | return outputParameters; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Int.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Integer type. */ 18 | public class Int extends IntType { 19 | 20 | public static final String TYPE_NAME = "int"; 21 | public static final Int DEFAULT = new Int(BigInteger.ZERO); 22 | 23 | public Int(BigInteger value) { 24 | // "int" values should be declared as int256 in computing function selectors 25 | this(MAX_BIT_LENGTH, value); 26 | } 27 | 28 | protected Int(int bitSize, BigInteger value) { 29 | super(TYPE_NAME, bitSize, value); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/IntType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Common integer properties. */ 18 | public abstract class IntType extends NumericType { 19 | 20 | private final int bitSize; 21 | 22 | public IntType(String typePrefix, int bitSize, BigInteger value) { 23 | super(typePrefix + bitSize, value); 24 | this.bitSize = bitSize; 25 | if (!valid()) { 26 | throw new UnsupportedOperationException( 27 | "Bit size must be 8 bit aligned, " 28 | + "and in range 0 < bitSize <= " 29 | + MAX_BIT_LENGTH); 30 | } 31 | } 32 | 33 | public int getBitSize() { 34 | return bitSize; 35 | } 36 | 37 | protected boolean valid() { 38 | return isValidBitSize(bitSize) && isValidBitCount(bitSize, value); 39 | } 40 | 41 | private static boolean isValidBitSize(int bitSize) { 42 | return bitSize % 8 == 0 && bitSize > 0 && bitSize <= MAX_BIT_LENGTH; 43 | } 44 | 45 | private static boolean isValidBitCount(int bitSize, BigInteger value) { 46 | return value.bitLength() <= bitSize; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/NumericType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Common numeric type. */ 18 | public abstract class NumericType implements Type { 19 | 20 | private String type; 21 | BigInteger value; 22 | 23 | public NumericType(String type, BigInteger value) { 24 | this.type = type; 25 | this.value = value; 26 | } 27 | 28 | @Override 29 | public String getTypeAsString() { 30 | return type; 31 | } 32 | 33 | @Override 34 | public BigInteger getValue() { 35 | return value; 36 | } 37 | 38 | public abstract int getBitSize(); 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | if (this == o) { 43 | return true; 44 | } 45 | if (o == null || getClass() != o.getClass()) { 46 | return false; 47 | } 48 | 49 | NumericType that = (NumericType) o; 50 | 51 | if (!type.equals(that.type)) { 52 | return false; 53 | } 54 | 55 | return value != null ? value.equals(that.value) : that.value == null; 56 | } 57 | 58 | @Override 59 | public int hashCode() { 60 | int result = type.hashCode(); 61 | result = 31 * result + (value != null ? value.hashCode() : 0); 62 | return result; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/StaticStruct.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | public class StaticStruct extends StaticArray implements StructType { 20 | 21 | private final List> itemTypes = new ArrayList<>(); 22 | 23 | public StaticStruct(List values) { 24 | super(Type.class, values.size(), values); 25 | for (Type value : values) { 26 | itemTypes.add((Class) value.getClass()); 27 | } 28 | } 29 | 30 | @SafeVarargs 31 | public StaticStruct(Type... values) { 32 | this(Arrays.asList(values)); 33 | } 34 | 35 | @Override 36 | public String getTypeAsString() { 37 | final StringBuilder type = new StringBuilder("("); 38 | for (int i = 0; i < itemTypes.size(); ++i) { 39 | final Class cls = itemTypes.get(i); 40 | if (StructType.class.isAssignableFrom(cls)) { 41 | type.append(getValue().get(i).getTypeAsString()); 42 | } else { 43 | type.append(AbiTypes.getTypeAString(cls)); 44 | } 45 | if (i < itemTypes.size() - 1) { 46 | type.append(","); 47 | } 48 | } 49 | type.append(")"); 50 | return type.toString(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/StructType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | public interface StructType {} 16 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/TrcToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Unsigned integer type. */ 18 | public class TrcToken extends IntType { 19 | 20 | public static final String TYPE_NAME = "trcToken"; 21 | public static final Uint DEFAULT = new Uint(BigInteger.ZERO); 22 | 23 | protected TrcToken(int bitSize, BigInteger value) { 24 | super(TYPE_NAME, bitSize, value); 25 | } 26 | 27 | public TrcToken(int value) { 28 | this(BigInteger.valueOf(value)); 29 | } 30 | 31 | public TrcToken(BigInteger value) { 32 | // "int" values should be declared as int256 in computing function selectors 33 | this(MAX_BIT_LENGTH, value); 34 | } 35 | 36 | @Override 37 | protected boolean valid() { 38 | return super.valid() && 0 <= value.signum(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | /** ABI Types. */ 16 | public interface Type { 17 | int MAX_BIT_LENGTH = 256; 18 | int MAX_BYTE_LENGTH = MAX_BIT_LENGTH / 8; 19 | 20 | default int bytes32PaddedLength() { 21 | return MAX_BYTE_LENGTH; 22 | } 23 | 24 | T getValue(); 25 | 26 | String getTypeAsString(); 27 | } 28 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Ufixed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Signed fixed type. */ 18 | public class Ufixed extends FixedPointType { 19 | 20 | public static final String TYPE_NAME = "ufixed"; 21 | public static final Ufixed DEFAULT = new Ufixed(BigInteger.ZERO); 22 | 23 | protected Ufixed(int mBitSize, int nBitSize, BigInteger value) { 24 | super(TYPE_NAME, mBitSize, nBitSize, value); 25 | } 26 | 27 | public Ufixed(BigInteger value) { 28 | this(DEFAULT_BIT_LENGTH, DEFAULT_BIT_LENGTH, value); 29 | } 30 | 31 | public Ufixed(BigInteger m, BigInteger n) { 32 | this(convert(m, n)); 33 | } 34 | 35 | protected Ufixed(int mBitSize, int nBitSize, BigInteger m, BigInteger n) { 36 | this(convert(mBitSize, nBitSize, m, n)); 37 | } 38 | 39 | @Override 40 | boolean valid(int mBitSize, int nBitSize, BigInteger value) { 41 | return super.valid(mBitSize, nBitSize, value) && value.signum() != -1; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Uint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | /** Unsigned integer type. */ 18 | public class Uint extends IntType { 19 | 20 | public static final String TYPE_NAME = "uint"; 21 | public static final Uint DEFAULT = new Uint(BigInteger.ZERO); 22 | 23 | protected Uint(int bitSize, BigInteger value) { 24 | super(TYPE_NAME, bitSize, value); 25 | } 26 | 27 | public Uint(BigInteger value) { 28 | // "int" values should be declared as int256 in computing function selectors 29 | this(MAX_BIT_LENGTH, value); 30 | } 31 | 32 | @Override 33 | protected boolean valid() { 34 | return super.valid() && 0 <= value.signum(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/Utf8String.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | /** UTF-8 encoded string type. */ 16 | public class Utf8String implements Type { 17 | 18 | public static final String TYPE_NAME = "string"; 19 | public static final Utf8String DEFAULT = new Utf8String(""); 20 | 21 | private String value; 22 | 23 | public Utf8String(String value) { 24 | this.value = value; 25 | } 26 | 27 | @Override 28 | public int bytes32PaddedLength() { 29 | return 2 * MAX_BYTE_LENGTH; 30 | } 31 | 32 | @Override 33 | public String getValue() { 34 | return value; 35 | } 36 | 37 | @Override 38 | public String getTypeAsString() { 39 | return TYPE_NAME; 40 | } 41 | 42 | @Override 43 | public boolean equals(Object o) { 44 | if (this == o) { 45 | return true; 46 | } 47 | if (o == null || getClass() != o.getClass()) { 48 | return false; 49 | } 50 | 51 | Utf8String that = (Utf8String) o; 52 | 53 | return value != null ? value.equals(that.value) : that.value == null; 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return value != null ? value.hashCode() : 0; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return value; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes1.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes1 extends Bytes { 12 | public static final Bytes1 DEFAULT = new Bytes1(new byte[1]); 13 | 14 | public Bytes1(byte[] value) { 15 | super(1, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes10.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes10 extends Bytes { 12 | public static final Bytes10 DEFAULT = new Bytes10(new byte[10]); 13 | 14 | public Bytes10(byte[] value) { 15 | super(10, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes11.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes11 extends Bytes { 12 | public static final Bytes11 DEFAULT = new Bytes11(new byte[11]); 13 | 14 | public Bytes11(byte[] value) { 15 | super(11, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes12.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes12 extends Bytes { 12 | public static final Bytes12 DEFAULT = new Bytes12(new byte[12]); 13 | 14 | public Bytes12(byte[] value) { 15 | super(12, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes13.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes13 extends Bytes { 12 | public static final Bytes13 DEFAULT = new Bytes13(new byte[13]); 13 | 14 | public Bytes13(byte[] value) { 15 | super(13, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes14.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes14 extends Bytes { 12 | public static final Bytes14 DEFAULT = new Bytes14(new byte[14]); 13 | 14 | public Bytes14(byte[] value) { 15 | super(14, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes15.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes15 extends Bytes { 12 | public static final Bytes15 DEFAULT = new Bytes15(new byte[15]); 13 | 14 | public Bytes15(byte[] value) { 15 | super(15, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes16.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes16 extends Bytes { 12 | public static final Bytes16 DEFAULT = new Bytes16(new byte[16]); 13 | 14 | public Bytes16(byte[] value) { 15 | super(16, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes17.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes17 extends Bytes { 12 | public static final Bytes17 DEFAULT = new Bytes17(new byte[17]); 13 | 14 | public Bytes17(byte[] value) { 15 | super(17, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes18.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes18 extends Bytes { 12 | public static final Bytes18 DEFAULT = new Bytes18(new byte[18]); 13 | 14 | public Bytes18(byte[] value) { 15 | super(18, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes19.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes19 extends Bytes { 12 | public static final Bytes19 DEFAULT = new Bytes19(new byte[19]); 13 | 14 | public Bytes19(byte[] value) { 15 | super(19, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes2.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes2 extends Bytes { 12 | public static final Bytes2 DEFAULT = new Bytes2(new byte[2]); 13 | 14 | public Bytes2(byte[] value) { 15 | super(2, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes20.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes20 extends Bytes { 12 | public static final Bytes20 DEFAULT = new Bytes20(new byte[20]); 13 | 14 | public Bytes20(byte[] value) { 15 | super(20, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes21.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes21 extends Bytes { 12 | public static final Bytes21 DEFAULT = new Bytes21(new byte[21]); 13 | 14 | public Bytes21(byte[] value) { 15 | super(21, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes22.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes22 extends Bytes { 12 | public static final Bytes22 DEFAULT = new Bytes22(new byte[22]); 13 | 14 | public Bytes22(byte[] value) { 15 | super(22, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes23.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes23 extends Bytes { 12 | public static final Bytes23 DEFAULT = new Bytes23(new byte[23]); 13 | 14 | public Bytes23(byte[] value) { 15 | super(23, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes24.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes24 extends Bytes { 12 | public static final Bytes24 DEFAULT = new Bytes24(new byte[24]); 13 | 14 | public Bytes24(byte[] value) { 15 | super(24, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes25.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes25 extends Bytes { 12 | public static final Bytes25 DEFAULT = new Bytes25(new byte[25]); 13 | 14 | public Bytes25(byte[] value) { 15 | super(25, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes26.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes26 extends Bytes { 12 | public static final Bytes26 DEFAULT = new Bytes26(new byte[26]); 13 | 14 | public Bytes26(byte[] value) { 15 | super(26, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes27.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes27 extends Bytes { 12 | public static final Bytes27 DEFAULT = new Bytes27(new byte[27]); 13 | 14 | public Bytes27(byte[] value) { 15 | super(27, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes28.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes28 extends Bytes { 12 | public static final Bytes28 DEFAULT = new Bytes28(new byte[28]); 13 | 14 | public Bytes28(byte[] value) { 15 | super(28, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes29.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes29 extends Bytes { 12 | public static final Bytes29 DEFAULT = new Bytes29(new byte[29]); 13 | 14 | public Bytes29(byte[] value) { 15 | super(29, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes3.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes3 extends Bytes { 12 | public static final Bytes3 DEFAULT = new Bytes3(new byte[3]); 13 | 14 | public Bytes3(byte[] value) { 15 | super(3, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes30.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes30 extends Bytes { 12 | public static final Bytes30 DEFAULT = new Bytes30(new byte[30]); 13 | 14 | public Bytes30(byte[] value) { 15 | super(30, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes31.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes31 extends Bytes { 12 | public static final Bytes31 DEFAULT = new Bytes31(new byte[31]); 13 | 14 | public Bytes31(byte[] value) { 15 | super(31, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes32.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes32 extends Bytes { 12 | public static final Bytes32 DEFAULT = new Bytes32(new byte[32]); 13 | 14 | public Bytes32(byte[] value) { 15 | super(32, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes4.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes4 extends Bytes { 12 | public static final Bytes4 DEFAULT = new Bytes4(new byte[4]); 13 | 14 | public Bytes4(byte[] value) { 15 | super(4, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes5.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes5 extends Bytes { 12 | public static final Bytes5 DEFAULT = new Bytes5(new byte[5]); 13 | 14 | public Bytes5(byte[] value) { 15 | super(5, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes6.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes6 extends Bytes { 12 | public static final Bytes6 DEFAULT = new Bytes6(new byte[6]); 13 | 14 | public Bytes6(byte[] value) { 15 | super(6, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes7.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes7 extends Bytes { 12 | public static final Bytes7 DEFAULT = new Bytes7(new byte[7]); 13 | 14 | public Bytes7(byte[] value) { 15 | super(7, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes8.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes8 extends Bytes { 12 | public static final Bytes8 DEFAULT = new Bytes8(new byte[8]); 13 | 14 | public Bytes8(byte[] value) { 15 | super(8, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Bytes9.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import org.tron.tronj.abi.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 9 | * codegen module to update. 10 | */ 11 | public class Bytes9 extends Bytes { 12 | public static final Bytes9 DEFAULT = new Bytes9(new byte[9]); 13 | 14 | public Bytes9(byte[] value) { 15 | super(9, value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int104.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int104 extends Int { 13 | public static final Int104 DEFAULT = new Int104(BigInteger.ZERO); 14 | 15 | public Int104(BigInteger value) { 16 | super(104, value); 17 | } 18 | 19 | public Int104(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int112.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int112 extends Int { 13 | public static final Int112 DEFAULT = new Int112(BigInteger.ZERO); 14 | 15 | public Int112(BigInteger value) { 16 | super(112, value); 17 | } 18 | 19 | public Int112(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int120.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int120 extends Int { 13 | public static final Int120 DEFAULT = new Int120(BigInteger.ZERO); 14 | 15 | public Int120(BigInteger value) { 16 | super(120, value); 17 | } 18 | 19 | public Int120(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int128.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int128 extends Int { 13 | public static final Int128 DEFAULT = new Int128(BigInteger.ZERO); 14 | 15 | public Int128(BigInteger value) { 16 | super(128, value); 17 | } 18 | 19 | public Int128(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int136.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int136 extends Int { 13 | public static final Int136 DEFAULT = new Int136(BigInteger.ZERO); 14 | 15 | public Int136(BigInteger value) { 16 | super(136, value); 17 | } 18 | 19 | public Int136(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int144.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int144 extends Int { 13 | public static final Int144 DEFAULT = new Int144(BigInteger.ZERO); 14 | 15 | public Int144(BigInteger value) { 16 | super(144, value); 17 | } 18 | 19 | public Int144(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int152.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int152 extends Int { 13 | public static final Int152 DEFAULT = new Int152(BigInteger.ZERO); 14 | 15 | public Int152(BigInteger value) { 16 | super(152, value); 17 | } 18 | 19 | public Int152(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int16.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int16 extends Int { 13 | public static final Int16 DEFAULT = new Int16(BigInteger.ZERO); 14 | 15 | public Int16(BigInteger value) { 16 | super(16, value); 17 | } 18 | 19 | public Int16(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int160.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int160 extends Int { 13 | public static final Int160 DEFAULT = new Int160(BigInteger.ZERO); 14 | 15 | public Int160(BigInteger value) { 16 | super(160, value); 17 | } 18 | 19 | public Int160(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int168.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int168 extends Int { 13 | public static final Int168 DEFAULT = new Int168(BigInteger.ZERO); 14 | 15 | public Int168(BigInteger value) { 16 | super(168, value); 17 | } 18 | 19 | public Int168(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int176.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int176 extends Int { 13 | public static final Int176 DEFAULT = new Int176(BigInteger.ZERO); 14 | 15 | public Int176(BigInteger value) { 16 | super(176, value); 17 | } 18 | 19 | public Int176(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int184.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int184 extends Int { 13 | public static final Int184 DEFAULT = new Int184(BigInteger.ZERO); 14 | 15 | public Int184(BigInteger value) { 16 | super(184, value); 17 | } 18 | 19 | public Int184(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int192.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int192 extends Int { 13 | public static final Int192 DEFAULT = new Int192(BigInteger.ZERO); 14 | 15 | public Int192(BigInteger value) { 16 | super(192, value); 17 | } 18 | 19 | public Int192(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int200.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int200 extends Int { 13 | public static final Int200 DEFAULT = new Int200(BigInteger.ZERO); 14 | 15 | public Int200(BigInteger value) { 16 | super(200, value); 17 | } 18 | 19 | public Int200(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int208.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int208 extends Int { 13 | public static final Int208 DEFAULT = new Int208(BigInteger.ZERO); 14 | 15 | public Int208(BigInteger value) { 16 | super(208, value); 17 | } 18 | 19 | public Int208(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int216.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int216 extends Int { 13 | public static final Int216 DEFAULT = new Int216(BigInteger.ZERO); 14 | 15 | public Int216(BigInteger value) { 16 | super(216, value); 17 | } 18 | 19 | public Int216(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int224.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int224 extends Int { 13 | public static final Int224 DEFAULT = new Int224(BigInteger.ZERO); 14 | 15 | public Int224(BigInteger value) { 16 | super(224, value); 17 | } 18 | 19 | public Int224(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int232.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int232 extends Int { 13 | public static final Int232 DEFAULT = new Int232(BigInteger.ZERO); 14 | 15 | public Int232(BigInteger value) { 16 | super(232, value); 17 | } 18 | 19 | public Int232(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int24.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int24 extends Int { 13 | public static final Int24 DEFAULT = new Int24(BigInteger.ZERO); 14 | 15 | public Int24(BigInteger value) { 16 | super(24, value); 17 | } 18 | 19 | public Int24(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int240.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int240 extends Int { 13 | public static final Int240 DEFAULT = new Int240(BigInteger.ZERO); 14 | 15 | public Int240(BigInteger value) { 16 | super(240, value); 17 | } 18 | 19 | public Int240(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int248.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int248 extends Int { 13 | public static final Int248 DEFAULT = new Int248(BigInteger.ZERO); 14 | 15 | public Int248(BigInteger value) { 16 | super(248, value); 17 | } 18 | 19 | public Int248(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int256.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int256 extends Int { 13 | public static final Int256 DEFAULT = new Int256(BigInteger.ZERO); 14 | 15 | public Int256(BigInteger value) { 16 | super(256, value); 17 | } 18 | 19 | public Int256(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int32.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int32 extends Int { 13 | public static final Int32 DEFAULT = new Int32(BigInteger.ZERO); 14 | 15 | public Int32(BigInteger value) { 16 | super(32, value); 17 | } 18 | 19 | public Int32(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int40.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int40 extends Int { 13 | public static final Int40 DEFAULT = new Int40(BigInteger.ZERO); 14 | 15 | public Int40(BigInteger value) { 16 | super(40, value); 17 | } 18 | 19 | public Int40(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int48.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int48 extends Int { 13 | public static final Int48 DEFAULT = new Int48(BigInteger.ZERO); 14 | 15 | public Int48(BigInteger value) { 16 | super(48, value); 17 | } 18 | 19 | public Int48(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int56.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int56 extends Int { 13 | public static final Int56 DEFAULT = new Int56(BigInteger.ZERO); 14 | 15 | public Int56(BigInteger value) { 16 | super(56, value); 17 | } 18 | 19 | public Int56(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int64.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int64 extends Int { 13 | public static final Int64 DEFAULT = new Int64(BigInteger.ZERO); 14 | 15 | public Int64(BigInteger value) { 16 | super(64, value); 17 | } 18 | 19 | public Int64(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int72.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int72 extends Int { 13 | public static final Int72 DEFAULT = new Int72(BigInteger.ZERO); 14 | 15 | public Int72(BigInteger value) { 16 | super(72, value); 17 | } 18 | 19 | public Int72(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int8.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int8 extends Int { 13 | public static final Int8 DEFAULT = new Int8(BigInteger.ZERO); 14 | 15 | public Int8(BigInteger value) { 16 | super(8, value); 17 | } 18 | 19 | public Int8(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int80.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int80 extends Int { 13 | public static final Int80 DEFAULT = new Int80(BigInteger.ZERO); 14 | 15 | public Int80(BigInteger value) { 16 | super(80, value); 17 | } 18 | 19 | public Int80(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int88.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int88 extends Int { 13 | public static final Int88 DEFAULT = new Int88(BigInteger.ZERO); 14 | 15 | public Int88(BigInteger value) { 16 | super(88, value); 17 | } 18 | 19 | public Int88(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Int96.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Int; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Int96 extends Int { 13 | public static final Int96 DEFAULT = new Int96(BigInteger.ZERO); 14 | 15 | public Int96(BigInteger value) { 16 | super(96, value); 17 | } 18 | 19 | public Int96(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray1.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray1 extends StaticArray { 14 | @Deprecated 15 | public StaticArray1(List values) { 16 | super(1, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray1(T... values) { 22 | super(1, values); 23 | } 24 | 25 | public StaticArray1(Class type, List values) { 26 | super(type, 1, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray1(Class type, T... values) { 31 | super(type, 1, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray10.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray10 extends StaticArray { 14 | @Deprecated 15 | public StaticArray10(List values) { 16 | super(10, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray10(T... values) { 22 | super(10, values); 23 | } 24 | 25 | public StaticArray10(Class type, List values) { 26 | super(type, 10, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray10(Class type, T... values) { 31 | super(type, 10, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray11.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray11 extends StaticArray { 14 | @Deprecated 15 | public StaticArray11(List values) { 16 | super(11, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray11(T... values) { 22 | super(11, values); 23 | } 24 | 25 | public StaticArray11(Class type, List values) { 26 | super(type, 11, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray11(Class type, T... values) { 31 | super(type, 11, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray12.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray12 extends StaticArray { 14 | @Deprecated 15 | public StaticArray12(List values) { 16 | super(12, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray12(T... values) { 22 | super(12, values); 23 | } 24 | 25 | public StaticArray12(Class type, List values) { 26 | super(type, 12, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray12(Class type, T... values) { 31 | super(type, 12, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray13.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray13 extends StaticArray { 14 | @Deprecated 15 | public StaticArray13(List values) { 16 | super(13, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray13(T... values) { 22 | super(13, values); 23 | } 24 | 25 | public StaticArray13(Class type, List values) { 26 | super(type, 13, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray13(Class type, T... values) { 31 | super(type, 13, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray14.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray14 extends StaticArray { 14 | @Deprecated 15 | public StaticArray14(List values) { 16 | super(14, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray14(T... values) { 22 | super(14, values); 23 | } 24 | 25 | public StaticArray14(Class type, List values) { 26 | super(type, 14, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray14(Class type, T... values) { 31 | super(type, 14, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray15.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray15 extends StaticArray { 14 | @Deprecated 15 | public StaticArray15(List values) { 16 | super(15, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray15(T... values) { 22 | super(15, values); 23 | } 24 | 25 | public StaticArray15(Class type, List values) { 26 | super(type, 15, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray15(Class type, T... values) { 31 | super(type, 15, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray16.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray16 extends StaticArray { 14 | @Deprecated 15 | public StaticArray16(List values) { 16 | super(16, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray16(T... values) { 22 | super(16, values); 23 | } 24 | 25 | public StaticArray16(Class type, List values) { 26 | super(type, 16, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray16(Class type, T... values) { 31 | super(type, 16, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray17.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray17 extends StaticArray { 14 | @Deprecated 15 | public StaticArray17(List values) { 16 | super(17, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray17(T... values) { 22 | super(17, values); 23 | } 24 | 25 | public StaticArray17(Class type, List values) { 26 | super(type, 17, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray17(Class type, T... values) { 31 | super(type, 17, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray18.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray18 extends StaticArray { 14 | @Deprecated 15 | public StaticArray18(List values) { 16 | super(18, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray18(T... values) { 22 | super(18, values); 23 | } 24 | 25 | public StaticArray18(Class type, List values) { 26 | super(type, 18, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray18(Class type, T... values) { 31 | super(type, 18, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray19.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray19 extends StaticArray { 14 | @Deprecated 15 | public StaticArray19(List values) { 16 | super(19, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray19(T... values) { 22 | super(19, values); 23 | } 24 | 25 | public StaticArray19(Class type, List values) { 26 | super(type, 19, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray19(Class type, T... values) { 31 | super(type, 19, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray2.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray2 extends StaticArray { 14 | @Deprecated 15 | public StaticArray2(List values) { 16 | super(2, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray2(T... values) { 22 | super(2, values); 23 | } 24 | 25 | public StaticArray2(Class type, List values) { 26 | super(type, 2, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray2(Class type, T... values) { 31 | super(type, 2, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray20.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray20 extends StaticArray { 14 | @Deprecated 15 | public StaticArray20(List values) { 16 | super(20, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray20(T... values) { 22 | super(20, values); 23 | } 24 | 25 | public StaticArray20(Class type, List values) { 26 | super(type, 20, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray20(Class type, T... values) { 31 | super(type, 20, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray21.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray21 extends StaticArray { 14 | @Deprecated 15 | public StaticArray21(List values) { 16 | super(21, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray21(T... values) { 22 | super(21, values); 23 | } 24 | 25 | public StaticArray21(Class type, List values) { 26 | super(type, 21, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray21(Class type, T... values) { 31 | super(type, 21, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray22.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray22 extends StaticArray { 14 | @Deprecated 15 | public StaticArray22(List values) { 16 | super(22, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray22(T... values) { 22 | super(22, values); 23 | } 24 | 25 | public StaticArray22(Class type, List values) { 26 | super(type, 22, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray22(Class type, T... values) { 31 | super(type, 22, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray23.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray23 extends StaticArray { 14 | @Deprecated 15 | public StaticArray23(List values) { 16 | super(23, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray23(T... values) { 22 | super(23, values); 23 | } 24 | 25 | public StaticArray23(Class type, List values) { 26 | super(type, 23, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray23(Class type, T... values) { 31 | super(type, 23, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray24.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray24 extends StaticArray { 14 | @Deprecated 15 | public StaticArray24(List values) { 16 | super(24, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray24(T... values) { 22 | super(24, values); 23 | } 24 | 25 | public StaticArray24(Class type, List values) { 26 | super(type, 24, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray24(Class type, T... values) { 31 | super(type, 24, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray25.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray25 extends StaticArray { 14 | @Deprecated 15 | public StaticArray25(List values) { 16 | super(25, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray25(T... values) { 22 | super(25, values); 23 | } 24 | 25 | public StaticArray25(Class type, List values) { 26 | super(type, 25, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray25(Class type, T... values) { 31 | super(type, 25, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray26.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray26 extends StaticArray { 14 | @Deprecated 15 | public StaticArray26(List values) { 16 | super(26, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray26(T... values) { 22 | super(26, values); 23 | } 24 | 25 | public StaticArray26(Class type, List values) { 26 | super(type, 26, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray26(Class type, T... values) { 31 | super(type, 26, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray27.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray27 extends StaticArray { 14 | @Deprecated 15 | public StaticArray27(List values) { 16 | super(27, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray27(T... values) { 22 | super(27, values); 23 | } 24 | 25 | public StaticArray27(Class type, List values) { 26 | super(type, 27, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray27(Class type, T... values) { 31 | super(type, 27, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray28.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray28 extends StaticArray { 14 | @Deprecated 15 | public StaticArray28(List values) { 16 | super(28, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray28(T... values) { 22 | super(28, values); 23 | } 24 | 25 | public StaticArray28(Class type, List values) { 26 | super(type, 28, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray28(Class type, T... values) { 31 | super(type, 28, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray29.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray29 extends StaticArray { 14 | @Deprecated 15 | public StaticArray29(List values) { 16 | super(29, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray29(T... values) { 22 | super(29, values); 23 | } 24 | 25 | public StaticArray29(Class type, List values) { 26 | super(type, 29, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray29(Class type, T... values) { 31 | super(type, 29, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray3.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray3 extends StaticArray { 14 | @Deprecated 15 | public StaticArray3(List values) { 16 | super(3, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray3(T... values) { 22 | super(3, values); 23 | } 24 | 25 | public StaticArray3(Class type, List values) { 26 | super(type, 3, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray3(Class type, T... values) { 31 | super(type, 3, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray30.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray30 extends StaticArray { 14 | @Deprecated 15 | public StaticArray30(List values) { 16 | super(30, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray30(T... values) { 22 | super(30, values); 23 | } 24 | 25 | public StaticArray30(Class type, List values) { 26 | super(type, 30, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray30(Class type, T... values) { 31 | super(type, 30, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray31.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray31 extends StaticArray { 14 | @Deprecated 15 | public StaticArray31(List values) { 16 | super(31, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray31(T... values) { 22 | super(31, values); 23 | } 24 | 25 | public StaticArray31(Class type, List values) { 26 | super(type, 31, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray31(Class type, T... values) { 31 | super(type, 31, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray32.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray32 extends StaticArray { 14 | @Deprecated 15 | public StaticArray32(List values) { 16 | super(32, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray32(T... values) { 22 | super(32, values); 23 | } 24 | 25 | public StaticArray32(Class type, List values) { 26 | super(type, 32, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray32(Class type, T... values) { 31 | super(type, 32, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray4.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray4 extends StaticArray { 14 | @Deprecated 15 | public StaticArray4(List values) { 16 | super(4, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray4(T... values) { 22 | super(4, values); 23 | } 24 | 25 | public StaticArray4(Class type, List values) { 26 | super(type, 4, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray4(Class type, T... values) { 31 | super(type, 4, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray5.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray5 extends StaticArray { 14 | @Deprecated 15 | public StaticArray5(List values) { 16 | super(5, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray5(T... values) { 22 | super(5, values); 23 | } 24 | 25 | public StaticArray5(Class type, List values) { 26 | super(type, 5, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray5(Class type, T... values) { 31 | super(type, 5, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray6.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray6 extends StaticArray { 14 | @Deprecated 15 | public StaticArray6(List values) { 16 | super(6, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray6(T... values) { 22 | super(6, values); 23 | } 24 | 25 | public StaticArray6(Class type, List values) { 26 | super(type, 6, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray6(Class type, T... values) { 31 | super(type, 6, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray7.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray7 extends StaticArray { 14 | @Deprecated 15 | public StaticArray7(List values) { 16 | super(7, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray7(T... values) { 22 | super(7, values); 23 | } 24 | 25 | public StaticArray7(Class type, List values) { 26 | super(type, 7, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray7(Class type, T... values) { 31 | super(type, 7, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray8.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray8 extends StaticArray { 14 | @Deprecated 15 | public StaticArray8(List values) { 16 | super(8, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray8(T... values) { 22 | super(8, values); 23 | } 24 | 25 | public StaticArray8(Class type, List values) { 26 | super(type, 8, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray8(Class type, T... values) { 31 | super(type, 8, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/StaticArray9.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.util.List; 4 | import org.tron.tronj.abi.datatypes.StaticArray; 5 | import org.tron.tronj.abi.datatypes.Type; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class StaticArray9 extends StaticArray { 14 | @Deprecated 15 | public StaticArray9(List values) { 16 | super(9, values); 17 | } 18 | 19 | @Deprecated 20 | @SafeVarargs 21 | public StaticArray9(T... values) { 22 | super(9, values); 23 | } 24 | 25 | public StaticArray9(Class type, List values) { 26 | super(type, 9, values); 27 | } 28 | 29 | @SafeVarargs 30 | public StaticArray9(Class type, T... values) { 31 | super(type, 9, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint104.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint104 extends Uint { 13 | public static final Uint104 DEFAULT = new Uint104(BigInteger.ZERO); 14 | 15 | public Uint104(BigInteger value) { 16 | super(104, value); 17 | } 18 | 19 | public Uint104(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint112.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint112 extends Uint { 13 | public static final Uint112 DEFAULT = new Uint112(BigInteger.ZERO); 14 | 15 | public Uint112(BigInteger value) { 16 | super(112, value); 17 | } 18 | 19 | public Uint112(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint120.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint120 extends Uint { 13 | public static final Uint120 DEFAULT = new Uint120(BigInteger.ZERO); 14 | 15 | public Uint120(BigInteger value) { 16 | super(120, value); 17 | } 18 | 19 | public Uint120(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint128.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint128 extends Uint { 13 | public static final Uint128 DEFAULT = new Uint128(BigInteger.ZERO); 14 | 15 | public Uint128(BigInteger value) { 16 | super(128, value); 17 | } 18 | 19 | public Uint128(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint136.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint136 extends Uint { 13 | public static final Uint136 DEFAULT = new Uint136(BigInteger.ZERO); 14 | 15 | public Uint136(BigInteger value) { 16 | super(136, value); 17 | } 18 | 19 | public Uint136(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint144.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint144 extends Uint { 13 | public static final Uint144 DEFAULT = new Uint144(BigInteger.ZERO); 14 | 15 | public Uint144(BigInteger value) { 16 | super(144, value); 17 | } 18 | 19 | public Uint144(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint152.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint152 extends Uint { 13 | public static final Uint152 DEFAULT = new Uint152(BigInteger.ZERO); 14 | 15 | public Uint152(BigInteger value) { 16 | super(152, value); 17 | } 18 | 19 | public Uint152(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint16.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint16 extends Uint { 13 | public static final Uint16 DEFAULT = new Uint16(BigInteger.ZERO); 14 | 15 | public Uint16(BigInteger value) { 16 | super(16, value); 17 | } 18 | 19 | public Uint16(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint160.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint160 extends Uint { 13 | public static final Uint160 DEFAULT = new Uint160(BigInteger.ZERO); 14 | 15 | public Uint160(BigInteger value) { 16 | super(160, value); 17 | } 18 | 19 | public Uint160(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint168.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint168 extends Uint { 13 | public static final Uint168 DEFAULT = new Uint168(BigInteger.ZERO); 14 | 15 | public Uint168(BigInteger value) { 16 | super(168, value); 17 | } 18 | 19 | public Uint168(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint176.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint176 extends Uint { 13 | public static final Uint176 DEFAULT = new Uint176(BigInteger.ZERO); 14 | 15 | public Uint176(BigInteger value) { 16 | super(176, value); 17 | } 18 | 19 | public Uint176(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint184.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint184 extends Uint { 13 | public static final Uint184 DEFAULT = new Uint184(BigInteger.ZERO); 14 | 15 | public Uint184(BigInteger value) { 16 | super(184, value); 17 | } 18 | 19 | public Uint184(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint192.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint192 extends Uint { 13 | public static final Uint192 DEFAULT = new Uint192(BigInteger.ZERO); 14 | 15 | public Uint192(BigInteger value) { 16 | super(192, value); 17 | } 18 | 19 | public Uint192(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint200.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint200 extends Uint { 13 | public static final Uint200 DEFAULT = new Uint200(BigInteger.ZERO); 14 | 15 | public Uint200(BigInteger value) { 16 | super(200, value); 17 | } 18 | 19 | public Uint200(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint208.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint208 extends Uint { 13 | public static final Uint208 DEFAULT = new Uint208(BigInteger.ZERO); 14 | 15 | public Uint208(BigInteger value) { 16 | super(208, value); 17 | } 18 | 19 | public Uint208(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint216.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint216 extends Uint { 13 | public static final Uint216 DEFAULT = new Uint216(BigInteger.ZERO); 14 | 15 | public Uint216(BigInteger value) { 16 | super(216, value); 17 | } 18 | 19 | public Uint216(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint224.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint224 extends Uint { 13 | public static final Uint224 DEFAULT = new Uint224(BigInteger.ZERO); 14 | 15 | public Uint224(BigInteger value) { 16 | super(224, value); 17 | } 18 | 19 | public Uint224(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint232.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint232 extends Uint { 13 | public static final Uint232 DEFAULT = new Uint232(BigInteger.ZERO); 14 | 15 | public Uint232(BigInteger value) { 16 | super(232, value); 17 | } 18 | 19 | public Uint232(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint24.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint24 extends Uint { 13 | public static final Uint24 DEFAULT = new Uint24(BigInteger.ZERO); 14 | 15 | public Uint24(BigInteger value) { 16 | super(24, value); 17 | } 18 | 19 | public Uint24(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint240.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint240 extends Uint { 13 | public static final Uint240 DEFAULT = new Uint240(BigInteger.ZERO); 14 | 15 | public Uint240(BigInteger value) { 16 | super(240, value); 17 | } 18 | 19 | public Uint240(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint248.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint248 extends Uint { 13 | public static final Uint248 DEFAULT = new Uint248(BigInteger.ZERO); 14 | 15 | public Uint248(BigInteger value) { 16 | super(248, value); 17 | } 18 | 19 | public Uint248(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint256.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint256 extends Uint { 13 | public static final Uint256 DEFAULT = new Uint256(BigInteger.ZERO); 14 | 15 | public Uint256(BigInteger value) { 16 | super(256, value); 17 | } 18 | 19 | public Uint256(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint32.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint32 extends Uint { 13 | public static final Uint32 DEFAULT = new Uint32(BigInteger.ZERO); 14 | 15 | public Uint32(BigInteger value) { 16 | super(32, value); 17 | } 18 | 19 | public Uint32(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint40.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint40 extends Uint { 13 | public static final Uint40 DEFAULT = new Uint40(BigInteger.ZERO); 14 | 15 | public Uint40(BigInteger value) { 16 | super(40, value); 17 | } 18 | 19 | public Uint40(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint48.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint48 extends Uint { 13 | public static final Uint48 DEFAULT = new Uint48(BigInteger.ZERO); 14 | 15 | public Uint48(BigInteger value) { 16 | super(48, value); 17 | } 18 | 19 | public Uint48(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint56.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint56 extends Uint { 13 | public static final Uint56 DEFAULT = new Uint56(BigInteger.ZERO); 14 | 15 | public Uint56(BigInteger value) { 16 | super(56, value); 17 | } 18 | 19 | public Uint56(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint64.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint64 extends Uint { 13 | public static final Uint64 DEFAULT = new Uint64(BigInteger.ZERO); 14 | 15 | public Uint64(BigInteger value) { 16 | super(64, value); 17 | } 18 | 19 | public Uint64(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint72.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint72 extends Uint { 13 | public static final Uint72 DEFAULT = new Uint72(BigInteger.ZERO); 14 | 15 | public Uint72(BigInteger value) { 16 | super(72, value); 17 | } 18 | 19 | public Uint72(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint8.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint8 extends Uint { 13 | public static final Uint8 DEFAULT = new Uint8(BigInteger.ZERO); 14 | 15 | public Uint8(BigInteger value) { 16 | super(8, value); 17 | } 18 | 19 | public Uint8(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint80.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint80 extends Uint { 13 | public static final Uint80 DEFAULT = new Uint80(BigInteger.ZERO); 14 | 15 | public Uint80(BigInteger value) { 16 | super(80, value); 17 | } 18 | 19 | public Uint80(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint88.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint88 extends Uint { 13 | public static final Uint88 DEFAULT = new Uint88(BigInteger.ZERO); 14 | 15 | public Uint88(BigInteger value) { 16 | super(88, value); 17 | } 18 | 19 | public Uint88(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/generated/Uint96.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.abi.datatypes.generated; 2 | 3 | import java.math.BigInteger; 4 | import org.tron.tronj.abi.datatypes.Uint; 5 | 6 | /** 7 | * Auto generated code. 8 | *

Do not modifiy! 9 | *

Please use org.tron.tronj.codegen.AbiTypesGenerator in the 10 | * codegen module to update. 11 | */ 12 | public class Uint96 extends Uint { 13 | public static final Uint96 DEFAULT = new Uint96(BigInteger.ZERO); 14 | 15 | public Uint96(BigInteger value) { 16 | super(96, value); 17 | } 18 | 19 | public Uint96(long value) { 20 | this(BigInteger.valueOf(value)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Byte.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.Type; 16 | import org.tron.tronj.abi.datatypes.generated.Bytes1; 17 | 18 | public final class Byte extends PrimitiveType { 19 | 20 | public Byte(byte value) { 21 | super(value); 22 | } 23 | 24 | @Override 25 | public Type toSolidityType() { 26 | return new Bytes1(new byte[] {getValue()}); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Char.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.Type; 16 | import org.tron.tronj.abi.datatypes.Utf8String; 17 | 18 | public final class Char extends PrimitiveType { 19 | 20 | public Char(char value) { 21 | super(value); 22 | } 23 | 24 | @Override 25 | public Type toSolidityType() { 26 | return new Utf8String(String.valueOf(getValue())); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Double.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | 17 | public final class Double extends Number { 18 | 19 | public Double(double value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public NumericType toSolidityType() { 25 | throw new UnsupportedOperationException("Fixed types are not supported"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Float.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | 17 | public class Float extends Number { 18 | 19 | public Float(float value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public NumericType toSolidityType() { 25 | throw new UnsupportedOperationException("Fixed types are not supported"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Int.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | import org.tron.tronj.abi.datatypes.generated.Int32; 17 | 18 | public final class Int extends Number { 19 | 20 | public Int(int value) { 21 | super(value); 22 | } 23 | 24 | @Override 25 | public NumericType toSolidityType() { 26 | return new Int32(getValue()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Long.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | import org.tron.tronj.abi.datatypes.generated.Int64; 17 | 18 | public final class Long extends Number { 19 | 20 | public Long(long value) { 21 | super(value); 22 | } 23 | 24 | @Override 25 | public NumericType toSolidityType() { 26 | return new Int64(getValue()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Number.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | 17 | public abstract class Number> extends PrimitiveType { 18 | Number(T value) { 19 | super(value); 20 | } 21 | 22 | @Override 23 | public abstract NumericType toSolidityType(); 24 | } 25 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/PrimitiveType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import java.io.Serializable; 16 | import java.util.Objects; 17 | 18 | import org.tron.tronj.abi.datatypes.Type; 19 | 20 | public abstract class PrimitiveType> implements Type { 21 | 22 | private final String type; 23 | private final T value; 24 | 25 | PrimitiveType(final T value) { 26 | this.type = getClass().getSimpleName().toLowerCase(); 27 | this.value = value; 28 | } 29 | 30 | @Override 31 | public T getValue() { 32 | return value; 33 | } 34 | 35 | @Override 36 | public String getTypeAsString() { 37 | return type; 38 | } 39 | 40 | public abstract Type toSolidityType(); 41 | 42 | @Override 43 | public boolean equals(final Object o) { 44 | if (this == o) { 45 | return true; 46 | } 47 | if (o == null || getClass() != o.getClass()) { 48 | return false; 49 | } 50 | final PrimitiveType that = (PrimitiveType) o; 51 | return type.equals(that.type) && value.equals(that.value); 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | return Objects.hash(type, value); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/datatypes/primitive/Short.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes.primitive; 14 | 15 | import org.tron.tronj.abi.datatypes.NumericType; 16 | import org.tron.tronj.abi.datatypes.generated.Int16; 17 | 18 | public final class Short extends Number { 19 | 20 | public Short(short value) { 21 | super(value); 22 | } 23 | 24 | @Override 25 | public NumericType toSolidityType() { 26 | return new Int16(getValue()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/spi/FunctionEncoderProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.spi; 14 | 15 | import java.util.function.Supplier; 16 | 17 | import org.tron.tronj.abi.FunctionEncoder; 18 | 19 | /** Function encoding Service Provider Interface. */ 20 | public interface FunctionEncoderProvider extends Supplier {} 21 | -------------------------------------------------------------------------------- /abi/src/main/java/org/tron/tronj/abi/spi/FunctionReturnDecoderProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.spi; 14 | 15 | import java.util.function.Supplier; 16 | 17 | import org.tron.tronj.abi.FunctionReturnDecoder; 18 | 19 | /** Function decoding Service Provider Interface. */ 20 | public interface FunctionReturnDecoderProvider extends Supplier {} 21 | -------------------------------------------------------------------------------- /abi/src/test/java/org/tron/tronj/abi/EventEncoderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi; 14 | 15 | import java.util.Arrays; 16 | import java.util.List; 17 | 18 | import org.junit.jupiter.api.Test; 19 | 20 | import org.tron.tronj.abi.datatypes.Event; 21 | import org.tron.tronj.abi.datatypes.generated.Uint256; 22 | 23 | import static org.junit.jupiter.api.Assertions.assertEquals; 24 | import static org.tron.tronj.abi.Utils.convert; 25 | 26 | public class EventEncoderTest { 27 | 28 | @Test 29 | public void testBuildEventSignature() { 30 | assertEquals( 31 | EventEncoder.buildEventSignature("Deposit(address,hash256,uint256)"), 32 | ("0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20")); 33 | 34 | assertEquals( 35 | EventEncoder.buildEventSignature("Notify(uint256,uint256)"), 36 | ("0x71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed")); 37 | } 38 | 39 | @Test 40 | public void testEncode() { 41 | Event event = 42 | new Event( 43 | "Notify", 44 | Arrays.>asList( 45 | new TypeReference() {}, new TypeReference() {})); 46 | 47 | assertEquals( 48 | EventEncoder.encode(event), 49 | "0x71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed"); 50 | } 51 | 52 | @Test 53 | public void testBuildMethodSignature() { 54 | List> parameters = 55 | Arrays.>asList( 56 | new TypeReference() {}, new TypeReference() {}); 57 | 58 | assertEquals( 59 | EventEncoder.buildMethodSignature("Notify", convert(parameters)), 60 | "Notify(uint256,uint256)"); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /abi/src/test/java/org/tron/tronj/abi/datatypes/AddressTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import static org.junit.jupiter.api.Assertions.assertEquals; 16 | 17 | import org.junit.jupiter.api.Test; 18 | 19 | public class AddressTest { 20 | @Test 21 | public void testToString() { 22 | assertEquals( 23 | new Address("4152b08330e05d731e38c856c1043288f7d9744").toString(), ("T9yKC9LCoVvmhaFxKcdK9iL18TUWtyFtjh")); 24 | assertEquals( 25 | new Address("T9yKC9LCoVvmhaFxKcdK9iL18TUWtyFtjh").toString(), ("T9yKC9LCoVvmhaFxKcdK9iL18TUWtyFtjh")); 26 | assertEquals( 27 | new Address("0x52b08330e05d731e38c856c1043288f7d9744").toString(), ("T9yKC9LCoVvmhaFxKcdK9iL18TUWtyFtjh")); 28 | assertEquals(new Address("0x00052b08330e05d731e38c856c1043288f7d9744").toString(), 29 | ("T9yKC9LCoVvmhaFxKcdK9iL18TUWtyFtjh")); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /abi/src/test/java/org/tron/tronj/abi/datatypes/EventTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.util.Arrays; 16 | import java.util.Iterator; 17 | import java.util.List; 18 | 19 | import org.junit.jupiter.api.Test; 20 | 21 | import org.tron.tronj.abi.TypeReference; 22 | import org.tron.tronj.abi.datatypes.generated.Uint256; 23 | 24 | import static org.junit.jupiter.api.Assertions.assertEquals; 25 | 26 | public class EventTest { 27 | 28 | @Test 29 | public void testCreation() { 30 | 31 | List> parameters = 32 | Arrays.>asList( 33 | new TypeReference

() {}, new TypeReference() {}); 34 | Event event = new Event("testName", parameters); 35 | 36 | assertEquals(event.getName(), "testName"); 37 | 38 | Iterator> expectedParameter = parameters.iterator(); 39 | for (TypeReference actualParameter : event.getParameters()) { 40 | assertEquals(expectedParameter.next(), actualParameter); 41 | } 42 | 43 | assertEquals(0, event.getIndexedParameters().size()); 44 | 45 | for (TypeReference nonIndexedParameter : event.getNonIndexedParameters()) { 46 | assertEquals(false, nonIndexedParameter.isIndexed()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /abi/src/test/java/org/tron/tronj/abi/datatypes/FixedPointTypeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import java.math.BigInteger; 16 | 17 | import org.junit.jupiter.api.Test; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; 20 | 21 | public class FixedPointTypeTest { 22 | 23 | @Test 24 | public void testConvert() { 25 | assertEquals( 26 | FixedPointType.convert(BigInteger.valueOf(0x2), BigInteger.valueOf(0x2)), 27 | (new BigInteger("220000000000000000000000000000000", 16))); 28 | 29 | assertEquals( 30 | FixedPointType.convert(BigInteger.valueOf(0x8), BigInteger.valueOf(0x8)), 31 | (new BigInteger("880000000000000000000000000000000", 16))); 32 | 33 | assertEquals( 34 | FixedPointType.convert(BigInteger.valueOf(0xAAFF), BigInteger.valueOf(0x1111)), 35 | (new BigInteger("AAFF11110000000000000000000000000000", 16))); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /abi/src/test/java/org/tron/tronj/abi/datatypes/Utf8StringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.abi.datatypes; 14 | 15 | import org.junit.jupiter.api.Test; 16 | 17 | import static org.junit.jupiter.api.Assertions.assertEquals; 18 | 19 | public class Utf8StringTest { 20 | 21 | @Test 22 | public void testToString() { 23 | assertEquals(new Utf8String("").toString(), ("")); 24 | assertEquals(new Utf8String("string").toString(), ("string")); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | id 'com.jfrog.bintray' apply false 4 | id 'signing' 5 | } 6 | 7 | ext { 8 | bouncycastleVersion = '1.66' 9 | junitJupiterVersion = '5.4.2' 10 | } 11 | 12 | allprojects { 13 | version '0.1.2' 14 | group = 'org.tron.tronj' 15 | 16 | repositories { 17 | jcenter() 18 | } 19 | 20 | } 21 | 22 | subprojects { 23 | apply plugin: 'java' 24 | apply plugin: 'maven' 25 | apply plugin: 'maven-publish' 26 | apply plugin: 'signing' 27 | 28 | java { 29 | sourceCompatibility = JavaVersion.VERSION_1_8 30 | targetCompatibility = JavaVersion.VERSION_1_8 31 | } 32 | 33 | dependencies { 34 | testImplementation "org.junit.jupiter:junit-jupiter:$junitJupiterVersion" 35 | } 36 | 37 | test { 38 | useJUnitPlatform() 39 | testLogging { 40 | events 'passed', 'skipped', 'failed' 41 | } 42 | } 43 | 44 | task sourcesJar(type: Jar, dependsOn: classes) { 45 | classifier = 'sources' 46 | from sourceSets.main.allSource 47 | } 48 | 49 | task javadocJar(type: Jar, dependsOn: javadoc) { 50 | classifier = 'javadoc' 51 | from javadoc.destinationDir 52 | } 53 | 54 | task wrapper(type: Wrapper) { 55 | gradleVersion = '6.6.1' 56 | } 57 | 58 | artifacts { 59 | archives jar 60 | archives sourcesJar 61 | } 62 | 63 | 64 | // signing { 65 | // useGpgCmd() 66 | // sign configurations.archives 67 | // } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /client/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.jfrog.bintray' 3 | id 'com.google.protobuf' version '0.8.12' 4 | } 5 | 6 | description 'Tronj gRPC client classes' 7 | 8 | dependencies { 9 | implementation 'com.google.guava:guava:29.0-jre' 10 | 11 | implementation project(':utils') 12 | implementation project(':abi') 13 | 14 | implementation 'io.grpc:grpc-netty-shaded:1.31.0' 15 | implementation 'io.grpc:grpc-netty:1.31.0' 16 | implementation 'io.grpc:grpc-okhttp:1.31.0' 17 | implementation 'io.grpc:grpc-protobuf:1.31.0' 18 | implementation 'io.grpc:grpc-stub:1.31.0' 19 | compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+ 20 | //json parsing 21 | implementation 'com.google.protobuf:protobuf-java-util:3.11.0' 22 | 23 | implementation "org.bouncycastle:bcprov-jdk15on:$bouncycastleVersion" 24 | // implementation 'org.apache.tuweni:tuweni-bytes:0.8.2' 25 | } 26 | 27 | protobuf { 28 | protoc { 29 | artifact = 'com.google.protobuf:protoc:3.12.0' 30 | } 31 | plugins { 32 | grpc { 33 | artifact = 'io.grpc:protoc-gen-grpc-java:1.31.0' 34 | } 35 | } 36 | generateProtoTasks { 37 | all()*.plugins { 38 | grpc { } 39 | } 40 | } 41 | generatedFilesBaseDir = "$projectDir/src" 42 | } 43 | 44 | bintray { 45 | user = System.getenv('BINTRAY_USER_TRON') 46 | key = System.getenv('BINTRAY_KEY_TRON') 47 | 48 | configurations = ['archives'] 49 | 50 | pkg { 51 | repo = 'tronj' 52 | name = 'client' 53 | // userOrg = 'tronj' 54 | // configurations = ['archives'] 55 | desc = description 56 | websiteUrl = 'https://github.com/tronprotocol/tronj' 57 | vcsUrl = 'https://github.com/tronprotocol/tronj.git' 58 | licenses = ['Apache-2.0'] 59 | publish = true 60 | publicDownloadNumbers = true 61 | version { 62 | afterEvaluate { 63 | name = "${project.version}" 64 | released = new Date() 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tronprotocol/tronj/e2ea227dde7d83a880685bd84e44ef10dc4ff4c7/client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /client/src/main/java/org/tron/tronj/client/Transaction/TransactionBuilder.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.client.transaction; 2 | 3 | /** 4 | * The {@code TransactionBuilder} class provides mutator methods 5 | * for common used attributes. 6 | * 7 | *

The {@code TransactionBuilder} object are mostly used before signing a 8 | * transaction, for setting attributes values like {@link #setFeeLimit}, {@link 9 | * #setMemo}, Etc.

10 | * 11 | * @since jdk13.0.2+8 12 | * @see org.tron.tronj.proto.Chain.Transaction; 13 | */ 14 | 15 | import com.google.protobuf.ByteString; 16 | import org.tron.tronj.proto.Chain.Transaction; 17 | 18 | public class TransactionBuilder { 19 | private Transaction transaction; 20 | 21 | public TransactionBuilder(Transaction transaction) { 22 | this.transaction = transaction; 23 | } 24 | 25 | public Transaction getTransaction() { 26 | return transaction; 27 | } 28 | 29 | public void setTransaction(Transaction transaction) { 30 | this.transaction = transaction; 31 | } 32 | 33 | public TransactionBuilder setFeeLimit(long feeLimit) { 34 | transaction = transaction.toBuilder() 35 | .setRawData(transaction.getRawData().toBuilder().setFeeLimit(feeLimit)) 36 | .build(); 37 | return this; 38 | } 39 | 40 | public TransactionBuilder setMemo(byte[] memo) { 41 | transaction = transaction.toBuilder() 42 | .setRawData(transaction.getRawData().toBuilder().setData(ByteString.copyFrom(memo))) 43 | .build(); 44 | return this; 45 | } 46 | 47 | public TransactionBuilder setMemo(String memo) { 48 | transaction = transaction.toBuilder() 49 | .setRawData(transaction.getRawData().toBuilder().setData(ByteString.copyFromUtf8(memo))) 50 | .build(); 51 | return this; 52 | } 53 | 54 | public Transaction build() { 55 | return this.transaction; 56 | } 57 | } -------------------------------------------------------------------------------- /client/src/main/java/org/tron/tronj/client/exceptions/IllegalException.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.client.exceptions; 2 | 3 | public class IllegalException extends Exception { 4 | public IllegalException(){ 5 | super("Query failed. Please check the parameters."); 6 | } 7 | 8 | public IllegalException(String message){ 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /client/src/main/proto/core/common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package protocol; 3 | 4 | option java_package = "org.tron.tronj.proto"; 5 | 6 | enum ResourceCode { 7 | BANDWIDTH = 0x00; 8 | ENERGY = 0x01; 9 | } 10 | 11 | enum AccountType { 12 | Normal = 0; 13 | AssetIssue = 1; 14 | Contract = 2; 15 | } 16 | 17 | message AccountId { 18 | bytes name = 1; 19 | bytes address = 2; 20 | } 21 | 22 | message authority { 23 | AccountId account = 1; 24 | bytes permission_name = 2; 25 | } 26 | 27 | message Key { 28 | bytes address = 1; 29 | int64 weight = 2; 30 | } 31 | 32 | message Permission { 33 | enum PermissionType { 34 | Owner = 0; 35 | Witness = 1; 36 | Active = 2; 37 | } 38 | PermissionType type = 1; 39 | int32 id = 2; // Owner id=0, Witness id=1, Active id start by 2 40 | string permission_name = 3; 41 | int64 threshold = 4; 42 | int32 parent_id = 5; 43 | bytes operations = 6; // 1 bit 1 contract 44 | repeated Key keys = 7; 45 | } 46 | 47 | message SmartContract { 48 | message ABI { 49 | message Entry { 50 | enum EntryType { 51 | UnknownEntryType = 0; 52 | Constructor = 1; 53 | Function = 2; 54 | Event = 3; 55 | Fallback = 4; 56 | } 57 | message Param { 58 | bool indexed = 1; 59 | string name = 2; 60 | string type = 3; 61 | // SolidityType type = 3; 62 | } 63 | enum StateMutabilityType { 64 | UnknownMutabilityType = 0; 65 | Pure = 1; 66 | View = 2; 67 | Nonpayable = 3; 68 | Payable = 4; 69 | } 70 | 71 | bool anonymous = 1; 72 | bool constant = 2; 73 | string name = 3; 74 | repeated Param inputs = 4; 75 | repeated Param outputs = 5; 76 | EntryType type = 6; 77 | bool payable = 7; 78 | StateMutabilityType stateMutability = 8; 79 | } 80 | repeated Entry entrys = 1; 81 | } 82 | bytes origin_address = 1; 83 | bytes contract_address = 2; 84 | ABI abi = 3; 85 | bytes bytecode = 4; 86 | int64 call_value = 5; 87 | int64 consume_user_resource_percent = 6; 88 | string name = 7; 89 | int64 origin_energy_limit = 8; 90 | bytes code_hash = 9; 91 | bytes trx_hash = 10; 92 | } 93 | 94 | message Vote { 95 | bytes vote_address = 1; 96 | int64 vote_count = 2; 97 | } 98 | 99 | message Note { 100 | int64 value = 1; 101 | string payment_address = 2; 102 | bytes rcm = 3; // random 32 103 | bytes memo = 4; 104 | } 105 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tronprotocol/tronj/e2ea227dde7d83a880685bd84e44ef10dc4ff4c7/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | plugins { 3 | id 'com.jfrog.bintray' version '1.8.5' 4 | } 5 | } 6 | 7 | rootProject.name = 'tronj' 8 | 9 | include 'utils' 10 | include 'abi' 11 | include 'client' -------------------------------------------------------------------------------- /utils/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.jfrog.bintray' 3 | } 4 | 5 | description 'Minimal set of tronj utility classes' 6 | 7 | dependencies { 8 | implementation 'io.vertx:vertx-core:3.5.0.Beta1' 9 | implementation 'io.netty:netty-all:4.0.15.Final' 10 | implementation 'com.google.guava:guava:29.0-jre' 11 | implementation "org.bouncycastle:bcprov-jdk15on:1.68" 12 | // implementation 'org.apache.tuweni:tuweni-bytes:0.8.2' 13 | // implementation 'org.apache.tuweni:tuweni-units:0.8.2' 14 | 15 | } 16 | 17 | bintray { 18 | user = System.getenv('BINTRAY_USER_TRON') 19 | key = System.getenv('BINTRAY_KEY_TRON') 20 | 21 | configurations = ['archives'] 22 | 23 | pkg { 24 | repo = 'tronj' 25 | name = 'utils' 26 | // userOrg = 'tronj' 27 | // configurations = ['archives'] 28 | desc = description 29 | websiteUrl = 'https://github.com/tronprotocol/tronj' 30 | vcsUrl = 'https://github.com/tronprotocol/tronj.git' 31 | licenses = ['Apache-2.0'] 32 | publish = true 33 | publicDownloadNumbers = true 34 | version { 35 | afterEvaluate { 36 | name = "${project.version}" 37 | released = new Date() 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /utils/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tronprotocol/tronj/e2ea227dde7d83a880685bd84e44ef10dc4ff4c7/utils/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /utils/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/commons/JavaVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.commons; 14 | 15 | public class JavaVersion { 16 | 17 | public static String getJavaVersion() { 18 | return System.getProperty("java.specification.version"); 19 | } 20 | 21 | public static double getJavaVersionAsDouble() { 22 | return Double.parseDouble(System.getProperty("java.specification.version")); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto; 14 | 15 | public class Pair { 16 | private final Object first; 17 | private final Object second; 18 | 19 | public Object getFirst() { 20 | return first; 21 | } 22 | 23 | public Object getSecond() { 24 | return second; 25 | } 26 | 27 | public Pair(Object first, Object second) { 28 | this.first = first; 29 | this.second = second; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/AbstractBytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | /** 16 | * An abstract {@link Bytes} value that provides implementations of {@link #equals(Object)}, {@link #hashCode()} and 17 | * {@link #toString()}. 18 | */ 19 | public abstract class AbstractBytes implements Bytes { 20 | 21 | static final char[] HEX_CODE = "0123456789abcdef".toCharArray(); 22 | 23 | /** 24 | * Compare this value and the provided one for equality. 25 | * 26 | *

27 | * Two {@link Bytes} values are equal is they have contain the exact same bytes. 28 | * 29 | * @param obj The object to test for equality with. 30 | * @return {@code true} if this value and {@code obj} are equal. 31 | */ 32 | @Override 33 | public boolean equals(Object obj) { 34 | if (obj == this) { 35 | return true; 36 | } 37 | if (!(obj instanceof Bytes)) { 38 | return false; 39 | } 40 | 41 | Bytes other = (Bytes) obj; 42 | if (this.size() != other.size()) { 43 | return false; 44 | } 45 | 46 | for (int i = 0; i < size(); i++) { 47 | if (this.get(i) != other.get(i)) { 48 | return false; 49 | } 50 | } 51 | return true; 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | int result = 1; 57 | for (int i = 0; i < size(); i++) { 58 | result = 31 * result + get(i); 59 | } 60 | return result; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | return toHexString(); 66 | } 67 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/ArrayWrappingBytes32.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | import static com.google.common.base.Preconditions.checkArgument; 16 | 17 | final class ArrayWrappingBytes32 extends ArrayWrappingBytes implements Bytes32 { 18 | 19 | ArrayWrappingBytes32(byte[] bytes) { 20 | this(checkLength(bytes), 0); 21 | } 22 | 23 | ArrayWrappingBytes32(byte[] bytes, int offset) { 24 | super(checkLength(bytes, offset), offset, SIZE); 25 | } 26 | 27 | // Ensures a proper error message. 28 | private static byte[] checkLength(byte[] bytes) { 29 | checkArgument(bytes.length == SIZE, "Expected %s bytes but got %s", SIZE, bytes.length); 30 | return bytes; 31 | } 32 | 33 | // Ensures a proper error message. 34 | private static byte[] checkLength(byte[] bytes, int offset) { 35 | checkArgument( 36 | bytes.length - offset >= SIZE, 37 | "Expected at least %s bytes from offset %s but got only %s", 38 | SIZE, 39 | offset, 40 | bytes.length - offset); 41 | return bytes; 42 | } 43 | 44 | @Override 45 | public Bytes32 copy() { 46 | if (offset == 0 && length == bytes.length) { 47 | return this; 48 | } 49 | return new ArrayWrappingBytes32(toArray()); 50 | } 51 | 52 | @Override 53 | public MutableBytes32 mutableCopy() { 54 | return new MutableArrayWrappingBytes32(toArray()); 55 | } 56 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/DelegatingBytes32.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | 16 | 17 | /** 18 | * A class that holds and delegates all operations to its inner bytes field. 19 | * 20 | *

21 | * This class may be used to create more types that represent 32 bytes, but need a different name for business logic. 22 | */ 23 | public class DelegatingBytes32 extends AbstractBytes implements Bytes32 { 24 | 25 | private final Bytes delegate; 26 | 27 | protected DelegatingBytes32(Bytes delegate) { 28 | this.delegate = delegate; 29 | } 30 | 31 | @Override 32 | public int size() { 33 | return Bytes32.SIZE; 34 | } 35 | 36 | @Override 37 | public byte get(int i) { 38 | return delegate.get(i); 39 | } 40 | 41 | @Override 42 | public Bytes slice(int index, int length) { 43 | return delegate.slice(index, length); 44 | } 45 | 46 | @Override 47 | public Bytes32 copy() { 48 | return Bytes32.wrap(toArray()); 49 | } 50 | 51 | @Override 52 | public MutableBytes32 mutableCopy() { 53 | return MutableBytes32.wrap(toArray()); 54 | } 55 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/MutableArrayWrappingBytes32.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | final class MutableArrayWrappingBytes32 extends MutableArrayWrappingBytes implements MutableBytes32 { 16 | 17 | MutableArrayWrappingBytes32(byte[] bytes) { 18 | this(bytes, 0); 19 | } 20 | 21 | MutableArrayWrappingBytes32(byte[] bytes, int offset) { 22 | super(bytes, offset, SIZE); 23 | } 24 | 25 | @Override 26 | public Bytes32 copy() { 27 | return new ArrayWrappingBytes32(toArray()); 28 | } 29 | 30 | @Override 31 | public MutableBytes32 mutableCopy() { 32 | return new MutableArrayWrappingBytes32(toArray()); 33 | } 34 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/MutableBufferWrappingBytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | import static com.google.common.base.Preconditions.checkArgument; 16 | import static com.google.common.base.Preconditions.checkElementIndex; 17 | 18 | import io.vertx.core.buffer.Buffer; 19 | 20 | final class MutableBufferWrappingBytes extends BufferWrappingBytes implements MutableBytes { 21 | 22 | MutableBufferWrappingBytes(Buffer buffer) { 23 | super(buffer); 24 | } 25 | 26 | MutableBufferWrappingBytes(Buffer buffer, int offset, int length) { 27 | super(buffer, offset, length); 28 | } 29 | 30 | @Override 31 | public void set(int i, byte b) { 32 | buffer.setByte(i, b); 33 | } 34 | 35 | @Override 36 | public void setInt(int i, int value) { 37 | buffer.setInt(i, value); 38 | } 39 | 40 | @Override 41 | public void setLong(int i, long value) { 42 | buffer.setLong(i, value); 43 | } 44 | 45 | @Override 46 | public MutableBytes mutableSlice(int i, int length) { 47 | int size = size(); 48 | if (i == 0 && length == size) { 49 | return this; 50 | } 51 | if (length == 0) { 52 | return MutableBytes.EMPTY; 53 | } 54 | 55 | checkElementIndex(i, size); 56 | checkArgument( 57 | i + length <= size, 58 | "Provided length %s is too big: the value has size %s and has only %s bytes from %s", 59 | length, 60 | size, 61 | size - i, 62 | i); 63 | 64 | return new MutableBufferWrappingBytes(buffer.slice(i, i + length)); 65 | } 66 | 67 | @Override 68 | public Bytes copy() { 69 | return Bytes.wrap(toArray()); 70 | } 71 | 72 | @Override 73 | public MutableBytes mutableCopy() { 74 | return MutableBytes.wrap(toArray()); 75 | } 76 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/crypto/tuweniTypes/MutableByteBufferWrappingBytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.crypto.tuweniTypes; 14 | 15 | import static com.google.common.base.Preconditions.checkArgument; 16 | import static com.google.common.base.Preconditions.checkElementIndex; 17 | 18 | import java.nio.ByteBuffer; 19 | 20 | public class MutableByteBufferWrappingBytes extends ByteBufferWrappingBytes implements MutableBytes { 21 | 22 | MutableByteBufferWrappingBytes(ByteBuffer byteBuffer) { 23 | super(byteBuffer); 24 | } 25 | 26 | MutableByteBufferWrappingBytes(ByteBuffer byteBuffer, int offset, int length) { 27 | super(byteBuffer, offset, length); 28 | } 29 | 30 | @Override 31 | public void setInt(int i, int value) { 32 | byteBuffer.putInt(offset + i, value); 33 | } 34 | 35 | @Override 36 | public void setLong(int i, long value) { 37 | byteBuffer.putLong(offset + i, value); 38 | } 39 | 40 | @Override 41 | public void set(int i, byte b) { 42 | byteBuffer.put(offset + i, b); 43 | } 44 | 45 | @Override 46 | public MutableBytes mutableSlice(int i, int length) { 47 | if (i == 0 && length == this.length) { 48 | return this; 49 | } 50 | if (length == 0) { 51 | return MutableBytes.EMPTY; 52 | } 53 | 54 | checkElementIndex(i, this.length); 55 | checkArgument( 56 | i + length <= this.length, 57 | "Provided length %s is too big: the value has size %s and has only %s bytes from %s", 58 | length, 59 | this.length, 60 | this.length - i, 61 | i); 62 | 63 | return new MutableByteBufferWrappingBytes(byteBuffer, offset + i, length); 64 | } 65 | 66 | @Override 67 | public Bytes copy() { 68 | return new ArrayWrappingBytes(toArray()); 69 | } 70 | } -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/exceptions/MessageDecodingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.exceptions; 14 | 15 | /** Encoding exception. */ 16 | public class MessageDecodingException extends RuntimeException { 17 | public MessageDecodingException(String message) { 18 | super(message); 19 | } 20 | 21 | public MessageDecodingException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/exceptions/MessageEncodingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.exceptions; 14 | 15 | /** Encoding exception. */ 16 | public class MessageEncodingException extends RuntimeException { 17 | public MessageEncodingException(String message) { 18 | super(message); 19 | } 20 | 21 | public MessageEncodingException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/utils/Assertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | /** Assertion utility functions. */ 16 | public class Assertions { 17 | 18 | /** 19 | * Verify that the provided precondition holds true. 20 | * 21 | * @param assertionResult assertion value 22 | * @param errorMessage error message if precondition failure 23 | */ 24 | public static void verifyPrecondition(boolean assertionResult, String errorMessage) { 25 | if (!assertionResult) { 26 | throw new RuntimeException(errorMessage); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/utils/Bytes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import java.util.Arrays; 16 | 17 | /** Byte array utility functions. */ 18 | public class Bytes { 19 | 20 | private Bytes() {} 21 | 22 | public static byte[] trimLeadingBytes(byte[] bytes, byte b) { 23 | int offset = 0; 24 | for (; offset < bytes.length - 1; offset++) { 25 | if (bytes[offset] != b) { 26 | break; 27 | } 28 | } 29 | return Arrays.copyOfRange(bytes, offset, bytes.length); 30 | } 31 | 32 | public static byte[] trimLeadingZeroes(byte[] bytes) { 33 | return trimLeadingBytes(bytes, (byte) 0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/utils/Convert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import java.math.BigDecimal; 16 | 17 | /** Ethereum unit conversion functions. */ 18 | public final class Convert { 19 | private Convert() {} 20 | 21 | public static BigDecimal fromSun(String number, Unit unit) { 22 | return fromSun(new BigDecimal(number), unit); 23 | } 24 | 25 | public static BigDecimal fromSun(BigDecimal number, Unit unit) { 26 | return number.divide(unit.getSunFactor()); 27 | } 28 | 29 | public static BigDecimal toSun(String number, Unit unit) { 30 | return toSun(new BigDecimal(number), unit); 31 | } 32 | 33 | public static BigDecimal toSun(BigDecimal number, Unit unit) { 34 | return number.multiply(unit.getSunFactor()); 35 | } 36 | 37 | public enum Unit { 38 | SUN("sun", 0), 39 | TRX("trx", 6); 40 | 41 | private String name; 42 | private BigDecimal sunFactor; 43 | 44 | Unit(String name, int factor) { 45 | this.name = name; 46 | this.sunFactor = BigDecimal.TEN.pow(factor); 47 | } 48 | 49 | public BigDecimal getSunFactor() { 50 | return sunFactor; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return name; 56 | } 57 | 58 | public static Unit fromString(String name) { 59 | if (name != null) { 60 | for (Unit unit : Unit.values()) { 61 | if (name.equalsIgnoreCase(unit.name)) { 62 | return unit; 63 | } 64 | } 65 | } 66 | return Unit.valueOf(name); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /utils/src/main/java/org/tron/tronj/utils/Strings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import java.util.List; 16 | 17 | /** String utility functions. */ 18 | public class Strings { 19 | 20 | private Strings() {} 21 | 22 | public static String toCsv(List src) { 23 | // return src == null ? null : String.join(", ", src.toArray(new String[0])); 24 | return join(src, ", "); 25 | } 26 | 27 | public static String join(List src, String delimiter) { 28 | return src == null ? null : String.join(delimiter, src.toArray(new String[0])); 29 | } 30 | 31 | public static String capitaliseFirstLetter(String string) { 32 | if (string == null || string.length() == 0) { 33 | return string; 34 | } else { 35 | return string.substring(0, 1).toUpperCase() + string.substring(1); 36 | } 37 | } 38 | 39 | public static String lowercaseFirstLetter(String string) { 40 | if (string == null || string.length() == 0) { 41 | return string; 42 | } else { 43 | return string.substring(0, 1).toLowerCase() + string.substring(1); 44 | } 45 | } 46 | 47 | public static String zeros(int n) { 48 | return repeat('0', n); 49 | } 50 | 51 | public static String repeat(char value, int n) { 52 | return new String(new char[n]).replace("\0", String.valueOf(value)); 53 | } 54 | 55 | public static boolean isEmpty(String s) { 56 | return s == null || s.length() == 0; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /utils/src/test/java/org/tron/tronj/utils/AssertionsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import org.junit.jupiter.api.Test; 16 | 17 | import static org.junit.jupiter.api.Assertions.assertThrows; 18 | 19 | public class AssertionsTest { 20 | 21 | @Test 22 | public void testVerifyPrecondition() { 23 | Assertions.verifyPrecondition(true, ""); 24 | } 25 | 26 | @Test 27 | public void testVerifyPreconditionFailure() { 28 | 29 | assertThrows(RuntimeException.class, () -> Assertions.verifyPrecondition(false, "")); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /utils/src/test/java/org/tron/tronj/utils/Base58CheckTest.java: -------------------------------------------------------------------------------- 1 | package org.tron.tronj.utils; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.bouncycastle.util.encoders.Hex; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | import static org.tron.tronj.utils.Base58Check.bytesToBase58; 9 | import static org.tron.tronj.utils.Base58Check.base58ToBytes; 10 | 11 | public class Base58CheckTest { 12 | 13 | @Test 14 | public void testAddressConverting() { 15 | byte[] rawAddr = Hex.decode("4159d3ad9d126e153b9564417d3a05cf51c1964edf"); 16 | assertArrayEquals(rawAddr, base58ToBytes("TJAAinkKN2h9KxtBZXw6SyL7HwCQXnzFsE")); 17 | assertEquals(bytesToBase58(rawAddr), "TJAAinkKN2h9KxtBZXw6SyL7HwCQXnzFsE"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /utils/src/test/java/org/tron/tronj/utils/BytesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import org.junit.jupiter.api.Assertions; 16 | import org.junit.jupiter.api.Test; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; 19 | 20 | public class BytesTest { 21 | 22 | @Test 23 | public void testTrimLeadingZeroes() { 24 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {}), (new byte[] {})); 25 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {0}), (new byte[] {0})); 26 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {1}), (new byte[] {1})); 27 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {0, 1}), (new byte[] {1})); 28 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {0, 0, 1}), (new byte[] {1})); 29 | Assertions.assertArrayEquals(Bytes.trimLeadingZeroes(new byte[] {0, 0, 1, 0}), (new byte[] {1, 0})); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /utils/src/test/java/org/tron/tronj/utils/ConvertTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Web3 Labs Ltd. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package org.tron.tronj.utils; 14 | 15 | import java.math.BigDecimal; 16 | 17 | import org.junit.jupiter.api.Test; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; 20 | 21 | public class ConvertTest { 22 | 23 | @Test 24 | public void testFromSum() { 25 | assertEquals( 26 | Convert.fromSun("21000000000000", Convert.Unit.SUN), 27 | (new BigDecimal("21000000000000"))); 28 | 29 | assertEquals( 30 | Convert.fromSun("21000000000000", Convert.Unit.TRX), 31 | (new BigDecimal("21000000"))); 32 | } 33 | 34 | @Test 35 | public void testToWei() { 36 | assertEquals(Convert.toSun("21", Convert.Unit.SUN), (new BigDecimal("21"))); 37 | assertEquals( 38 | Convert.toSun("21", Convert.Unit.TRX), (new BigDecimal("21000000"))); 39 | } 40 | 41 | @Test 42 | public void testUnit() { 43 | assertEquals(Convert.Unit.fromString("trx"), (Convert.Unit.TRX)); 44 | assertEquals(Convert.Unit.fromString("TRX"), (Convert.Unit.TRX)); 45 | assertEquals(Convert.Unit.fromString("sun"), (Convert.Unit.SUN)); 46 | } 47 | } 48 | --------------------------------------------------------------------------------