├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── codegen ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ └── codegen │ │ ├── AbiTypesGenerator.java │ │ ├── AbiTypesMapperGenerator.java │ │ ├── Console.java │ │ ├── FunctionWrapperGenerator.java │ │ ├── GenerationReporter.java │ │ ├── Generator.java │ │ ├── LogGenerationReporter.java │ │ ├── SolidityFunctionWrapper.java │ │ ├── SolidityFunctionWrapperGenerator.java │ │ ├── TruffleJsonFunctionWrapperGenerator.java │ │ ├── TupleGenerator.java │ │ ├── WasmFunctionWrapper.java │ │ └── WasmFunctionWrapperGenerator.java │ └── test │ ├── java │ └── com │ │ └── platon │ │ └── codegen │ │ ├── AbiTypesGeneratorTest.java │ │ ├── AbiTypesMapperGeneratorTest.java │ │ ├── ContractJsonParseTest.java │ │ ├── SolidityFunctionWrapperGeneratorTest.java │ │ ├── SolidityFunctionWrapperTest.java │ │ ├── TruffleJsonFunctionWrapperGeneratorTest.java │ │ ├── TupleGeneratorTest.java │ │ └── WasmFunctionWrapperGeneratorTest.java │ └── resources │ ├── solidity │ ├── admin.json │ ├── arrays │ │ └── Arrays.sol │ ├── build.sh │ ├── fibonacci │ │ └── Fibonacci.sol │ ├── greeter │ │ └── Greeter.sol │ ├── humanStandardToken │ │ ├── HumanStandardToken.sol │ │ ├── HumanStandardTokenFactory.sol │ │ ├── SampleRecipientSuccess.sol │ │ ├── SampleRecipientThrow.sol │ │ ├── StandardToken.sol │ │ └── Token.sol │ ├── shipit │ │ └── ShipIt.sol │ ├── simplestorage │ │ └── SimpleStorage.sol │ └── solEvent │ │ └── SolEvent.sol │ ├── truffle │ ├── MetaCoin │ │ ├── ConvertLib.sol │ │ └── MetaCoin.sol │ └── build.sh │ ├── wallet │ ├── admin.json │ └── owner.json │ └── wasm │ ├── contractEmitEventWithAddr │ └── ContractEmitEventWithAddr.cpp │ ├── eventTopic │ └── eventTopic.cpp │ └── tweetAccount │ └── TweetAccount.cpp ├── config └── checkstyle │ ├── checkstyle.xml │ └── suppressions.xml ├── console ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ └── console │ │ ├── ConsoleDevice.java │ │ ├── IODevice.java │ │ ├── KeyImporter.java │ │ ├── Runner.java │ │ ├── WalletCreator.java │ │ ├── WalletManager.java │ │ ├── WalletRunner.java │ │ ├── WalletSendFunds.java │ │ └── WalletUpdater.java │ └── test │ ├── java │ └── com │ │ └── platon │ │ └── console │ │ ├── KeyImporterTest.java │ │ ├── RunnerTest.java │ │ ├── WalletCreatorTest.java │ │ ├── WalletTester.java │ │ └── WalletUpdaterTest.java │ └── resources │ ├── contract │ ├── ContractDistory.abi.json │ ├── ContractDistory.wasm │ ├── HumanStandardToken.abi │ ├── HumanStandardToken.bin │ ├── HumanStandardToken.sol │ ├── HumanStandardTokenFactory.sol │ ├── SampleRecipientSuccess.sol │ ├── SampleRecipientThrow.sol │ ├── StandardToken.abi │ ├── StandardToken.bin │ ├── StandardToken.sol │ ├── Token.abi │ ├── Token.bin │ └── Token.sol │ └── keyfiles │ ├── UTC--2016-11-03T05-55-06.340672473Z--ef678007d18427e6022059dbc264f27507cd1ffc │ └── UTC--2016-11-03T07-47-45.988Z--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818 ├── core ├── build.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── platon │ │ │ ├── contracts │ │ │ ├── ppos │ │ │ │ ├── BaseContract.java │ │ │ │ ├── DelegateContract.java │ │ │ │ ├── NodeContract.java │ │ │ │ ├── ProposalContract.java │ │ │ │ ├── RestrictingPlanContract.java │ │ │ │ ├── RewardContract.java │ │ │ │ ├── SlashContract.java │ │ │ │ ├── StakingContract.java │ │ │ │ ├── abi │ │ │ │ │ ├── CustomStaticArray.java │ │ │ │ │ ├── CustomType.java │ │ │ │ │ ├── Function.java │ │ │ │ │ └── custom │ │ │ │ │ │ └── NodeId.java │ │ │ │ ├── dto │ │ │ │ │ ├── BaseResponse.java │ │ │ │ │ ├── CallResponse.java │ │ │ │ │ ├── RestrictingPlan.java │ │ │ │ │ ├── TransactionResponse.java │ │ │ │ │ ├── common │ │ │ │ │ │ ├── DuplicateSignType.java │ │ │ │ │ │ ├── ErrorCode.java │ │ │ │ │ │ ├── FunctionType.java │ │ │ │ │ │ └── ProposalType.java │ │ │ │ │ ├── enums │ │ │ │ │ │ ├── DelegateAmountType.java │ │ │ │ │ │ ├── GovernParamItemSupported.java │ │ │ │ │ │ ├── StakingAmountType.java │ │ │ │ │ │ └── VoteOption.java │ │ │ │ │ ├── req │ │ │ │ │ │ ├── CreateRestrictingParam.java │ │ │ │ │ │ ├── StakingParam.java │ │ │ │ │ │ └── UpdateStakingParam.java │ │ │ │ │ └── resp │ │ │ │ │ │ ├── Delegation.java │ │ │ │ │ │ ├── DelegationIdInfo.java │ │ │ │ │ │ ├── DelegationLockInfo.java │ │ │ │ │ │ ├── DelegationLockItem.java │ │ │ │ │ │ ├── GovernParam.java │ │ │ │ │ │ ├── Node.java │ │ │ │ │ │ ├── ParamItem.java │ │ │ │ │ │ ├── ParamValue.java │ │ │ │ │ │ ├── Proposal.java │ │ │ │ │ │ ├── RedeemDelegation.java │ │ │ │ │ │ ├── RestrictingInfo.java │ │ │ │ │ │ ├── RestrictingItem.java │ │ │ │ │ │ ├── Reward.java │ │ │ │ │ │ ├── TallyResult.java │ │ │ │ │ │ └── UnDelegation.java │ │ │ │ ├── exception │ │ │ │ │ ├── EstimateGasException.java │ │ │ │ │ └── NoSupportFunctionType.java │ │ │ │ └── utils │ │ │ │ │ ├── DecoderUtils.java │ │ │ │ │ ├── EncoderUtils.java │ │ │ │ │ ├── EstimateGasUtil.java │ │ │ │ │ └── ProposalUtils.java │ │ │ └── token │ │ │ │ ├── ERC20BasicInterface.java │ │ │ │ └── ERC20Interface.java │ │ │ ├── protocol │ │ │ ├── ObjectMapperFactory.java │ │ │ ├── Service.java │ │ │ ├── Web3j.java │ │ │ ├── Web3jService.java │ │ │ ├── admin │ │ │ │ ├── Admin.java │ │ │ │ ├── JsonRpc2_0Admin.java │ │ │ │ └── methods │ │ │ │ │ └── response │ │ │ │ │ ├── BooleanResponse.java │ │ │ │ │ ├── NewAccountIdentifier.java │ │ │ │ │ ├── PersonalEcRecover.java │ │ │ │ │ ├── PersonalImportRawKey.java │ │ │ │ │ ├── PersonalListAccounts.java │ │ │ │ │ ├── PersonalListWallets.java │ │ │ │ │ ├── PersonalSign.java │ │ │ │ │ ├── PersonalUnlockAccount.java │ │ │ │ │ ├── TxPoolContent.java │ │ │ │ │ ├── TxPoolStatus.java │ │ │ │ │ └── admin │ │ │ │ │ └── AdminDataDir.java │ │ │ ├── core │ │ │ │ ├── DefaultBlockParameter.java │ │ │ │ ├── DefaultBlockParameterName.java │ │ │ │ ├── DefaultBlockParameterNumber.java │ │ │ │ ├── JsonRpc2_0Web3j.java │ │ │ │ ├── Platon.java │ │ │ │ ├── RemoteCall.java │ │ │ │ ├── Request.java │ │ │ │ ├── Response.java │ │ │ │ ├── RpcErrors.java │ │ │ │ ├── filters │ │ │ │ │ ├── BlockFilter.java │ │ │ │ │ ├── Callback.java │ │ │ │ │ ├── Filter.java │ │ │ │ │ ├── FilterException.java │ │ │ │ │ ├── LogFilter.java │ │ │ │ │ └── PendingTransactionFilter.java │ │ │ │ └── methods │ │ │ │ │ ├── request │ │ │ │ │ ├── Filter.java │ │ │ │ │ ├── PlatonFilter.java │ │ │ │ │ ├── ShhFilter.java │ │ │ │ │ ├── ShhPost.java │ │ │ │ │ └── Transaction.java │ │ │ │ │ └── response │ │ │ │ │ ├── AbiDefinition.java │ │ │ │ │ ├── AdminNodeInfo.java │ │ │ │ │ ├── AdminPeerEvents.java │ │ │ │ │ ├── AdminPeers.java │ │ │ │ │ ├── AdminProgramVersion.java │ │ │ │ │ ├── AdminSchnorrNIZKProve.java │ │ │ │ │ ├── DbGetHex.java │ │ │ │ │ ├── DbGetString.java │ │ │ │ │ ├── DbPutHex.java │ │ │ │ │ ├── DbPutString.java │ │ │ │ │ ├── DebugEconomicConfig.java │ │ │ │ │ ├── DebugWaitSlashingNodeList.java │ │ │ │ │ ├── Log.java │ │ │ │ │ ├── NetListening.java │ │ │ │ │ ├── NetPeerCount.java │ │ │ │ │ ├── NetVersion.java │ │ │ │ │ ├── PlatonAccounts.java │ │ │ │ │ ├── PlatonBlock.java │ │ │ │ │ ├── PlatonBlockNumber.java │ │ │ │ │ ├── PlatonCall.java │ │ │ │ │ ├── PlatonChainId.java │ │ │ │ │ ├── PlatonEstimateGas.java │ │ │ │ │ ├── PlatonEvidences.java │ │ │ │ │ ├── PlatonFilter.java │ │ │ │ │ ├── PlatonGasPrice.java │ │ │ │ │ ├── PlatonGetAddressHrp.java │ │ │ │ │ ├── PlatonGetBalance.java │ │ │ │ │ ├── PlatonGetBlockTransactionCountByHash.java │ │ │ │ │ ├── PlatonGetBlockTransactionCountByNumber.java │ │ │ │ │ ├── PlatonGetCode.java │ │ │ │ │ ├── PlatonGetStorageAt.java │ │ │ │ │ ├── PlatonGetTransactionCount.java │ │ │ │ │ ├── PlatonGetTransactionReceipt.java │ │ │ │ │ ├── PlatonLog.java │ │ │ │ │ ├── PlatonPendingTransactions.java │ │ │ │ │ ├── PlatonProtocolVersion.java │ │ │ │ │ ├── PlatonRawTransaction.java │ │ │ │ │ ├── PlatonSendRawTransaction.java │ │ │ │ │ ├── PlatonSendTransaction.java │ │ │ │ │ ├── PlatonSign.java │ │ │ │ │ ├── PlatonSignTransaction.java │ │ │ │ │ ├── PlatonSubscribe.java │ │ │ │ │ ├── PlatonSyncing.java │ │ │ │ │ ├── PlatonTransaction.java │ │ │ │ │ ├── PlatonUninstallFilter.java │ │ │ │ │ ├── PlatonUnsubscribe.java │ │ │ │ │ ├── ShhAddToGroup.java │ │ │ │ │ ├── ShhHasIdentity.java │ │ │ │ │ ├── ShhMessages.java │ │ │ │ │ ├── ShhNewFilter.java │ │ │ │ │ ├── ShhNewGroup.java │ │ │ │ │ ├── ShhNewIdentity.java │ │ │ │ │ ├── ShhPost.java │ │ │ │ │ ├── ShhUninstallFilter.java │ │ │ │ │ ├── ShhVersion.java │ │ │ │ │ ├── Transaction.java │ │ │ │ │ ├── TransactionReceipt.java │ │ │ │ │ ├── VoidResponse.java │ │ │ │ │ ├── WasmAbiDefinition.java │ │ │ │ │ ├── Web3ClientVersion.java │ │ │ │ │ ├── Web3Sha3.java │ │ │ │ │ └── bean │ │ │ │ │ ├── EconomicConfig.java │ │ │ │ │ ├── Evidences.java │ │ │ │ │ ├── ProgramVersion.java │ │ │ │ │ └── WaitSlashingNode.java │ │ │ ├── deserializer │ │ │ │ ├── KeepAsJsonDeserialzier.java │ │ │ │ └── RawResponseDeserializer.java │ │ │ ├── exceptions │ │ │ │ ├── ClientConnectionException.java │ │ │ │ ├── NoTransactionReceiptException.java │ │ │ │ ├── TransactionException.java │ │ │ │ └── UnableParseLogException.java │ │ │ ├── http │ │ │ │ └── HttpService.java │ │ │ ├── ipc │ │ │ │ ├── IOFacade.java │ │ │ │ ├── IpcService.java │ │ │ │ ├── UnixDomainSocket.java │ │ │ │ ├── UnixIpcService.java │ │ │ │ ├── WindowsIpcService.java │ │ │ │ └── WindowsNamedPipe.java │ │ │ ├── rx │ │ │ │ ├── JsonRpc2_0Rx.java │ │ │ │ └── Web3jRx.java │ │ │ └── websocket │ │ │ │ ├── WebSocketClient.java │ │ │ │ ├── WebSocketListener.java │ │ │ │ ├── WebSocketRequest.java │ │ │ │ ├── WebSocketService.java │ │ │ │ ├── WebSocketSubscription.java │ │ │ │ └── events │ │ │ │ ├── Log.java │ │ │ │ ├── LogNotification.java │ │ │ │ ├── NewHead.java │ │ │ │ ├── NewHeadsNotification.java │ │ │ │ ├── Notification.java │ │ │ │ ├── NotificationParams.java │ │ │ │ ├── PendingTransactionNotification.java │ │ │ │ └── SyncingNotfication.java │ │ │ ├── tx │ │ │ ├── ChainId.java │ │ │ ├── ClientTransactionManager.java │ │ │ ├── Contract.java │ │ │ ├── FastRawTransactionManager.java │ │ │ ├── ManagedTransaction.java │ │ │ ├── RawTransactionManager.java │ │ │ ├── ReadonlyTransactionManager.java │ │ │ ├── TransactionManager.java │ │ │ ├── Transfer.java │ │ │ ├── WasmContract.java │ │ │ ├── exceptions │ │ │ │ ├── ContractCallException.java │ │ │ │ ├── PlatonCallException.java │ │ │ │ ├── PlatonCallTimeoutException.java │ │ │ │ └── TxHashMismatchException.java │ │ │ ├── gas │ │ │ │ ├── ContractGasProvider.java │ │ │ │ ├── DefaultGasProvider.java │ │ │ │ ├── DefaultWasmGasProvider.java │ │ │ │ └── GasProvider.java │ │ │ └── response │ │ │ │ ├── Callback.java │ │ │ │ ├── EmptyTransactionReceipt.java │ │ │ │ ├── NoOpProcessor.java │ │ │ │ ├── PollingTransactionReceiptProcessor.java │ │ │ │ ├── QueuingTransactionReceiptProcessor.java │ │ │ │ └── TransactionReceiptProcessor.java │ │ │ └── utils │ │ │ ├── AsciiUtil.java │ │ │ ├── Async.java │ │ │ ├── ByteUtil.java │ │ │ ├── Collection.java │ │ │ ├── Files.java │ │ │ ├── JSONUtil.java │ │ │ ├── NodeIdTool.java │ │ │ ├── Observables.java │ │ │ ├── TXTypeEnum.java │ │ │ ├── TxHashVerifier.java │ │ │ └── Version.java │ └── resources │ │ └── solidity │ │ ├── build.sh │ │ └── ens │ │ ├── AbstractENS.sol │ │ ├── ENS.sol │ │ └── PublicResolver.sol │ └── test │ ├── java │ └── com │ │ └── platon │ │ ├── TempFileProvider.java │ │ ├── contracts │ │ ├── evm │ │ │ ├── BaseContractTest.java │ │ │ ├── SolEvent.java │ │ │ └── SolEventTest.java │ │ ├── ppos │ │ │ ├── DelegateContractTest.java │ │ │ ├── NodeContractTest.java │ │ │ ├── ProposalContractTest.java │ │ │ ├── RestrictingPlanContractTest.java │ │ │ ├── RewardContractTest.java │ │ │ ├── SlashContractTest.java │ │ │ ├── StakingContractTest.java │ │ │ └── UpdateStakingParamTest.java │ │ └── wasm │ │ │ ├── BaseContractTest.java │ │ │ ├── ContractEmitEventWithAddr.java │ │ │ ├── ContractEmitEventWithAddrTest.java │ │ │ ├── EventTopic.java │ │ │ ├── EvnetTopicTest.java │ │ │ ├── TweetAccount.java │ │ │ └── TweetAccountTest.java │ │ ├── platon │ │ └── contracts │ │ │ ├── CandidateContractTest.java │ │ │ ├── QueryTest.java │ │ │ ├── TicketContractTest.java │ │ │ ├── bean │ │ │ └── Node.java │ │ │ ├── data │ │ │ └── TestData.java │ │ │ └── util │ │ │ ├── ECKeyPairGenerator.java │ │ │ ├── FakeNodeGenerator.java │ │ │ └── IPGenerator.java │ │ ├── protocol │ │ ├── RequestTester.java │ │ ├── ResponseTester.java │ │ ├── admin │ │ │ ├── RequestTest.java │ │ │ └── ResponseTest.java │ │ ├── core │ │ │ ├── EqualsVerifierResponseTest.java │ │ │ ├── JsonRpc2_0ApiTest.java │ │ │ ├── JsonRpc2_0Web3jTest.java │ │ │ ├── RawResponseTest.java │ │ │ ├── RequestTest.java │ │ │ ├── ResponseTest.java │ │ │ ├── WebSocketEventTest.java │ │ │ └── filters │ │ │ │ ├── BlockFilterTest.java │ │ │ │ ├── FilterTester.java │ │ │ │ ├── LogFilterTest.java │ │ │ │ └── PendingTransactionFilterTest.java │ │ ├── http │ │ │ └── HttpServiceTest.java │ │ ├── ipc │ │ │ ├── IpcServiceTest.java │ │ │ └── UnixDomainSocketTest.java │ │ ├── rx │ │ │ └── JsonRpc2_0RxTest.java │ │ └── websocket │ │ │ ├── WebSocketClientTest.java │ │ │ └── WebSocketServiceTest.java │ │ ├── tx │ │ ├── ContractTest.java │ │ ├── ManagedTransactionTester.java │ │ ├── RawTransactionManagerTest.java │ │ ├── TransferTest.java │ │ └── response │ │ │ └── PollingTransactionReceiptProcessorTest.java │ │ └── utils │ │ ├── AsyncTest.java │ │ ├── CollectionTest.java │ │ ├── ObservablesTests.java │ │ └── VersionTest.java │ └── resources │ ├── docker │ ├── Dockerfile │ └── config │ │ ├── data │ │ ├── keystore │ │ │ └── UTC--2019-04-17T07-48-34.556577331Z--f462b59140246f648f3573b4a38e861161304e79 │ │ └── platon │ │ │ └── nodekey │ │ └── platon.json │ ├── platon │ └── contracts │ │ ├── evm │ │ ├── HumanStandardToken.sol │ │ ├── HumanStandardTokenFactory.sol │ │ ├── PayWages.sol │ │ ├── SampleRecipientSuccess.sol │ │ ├── SampleRecipientThrow.sol │ │ ├── StandardToken.sol │ │ └── Token.sol │ │ └── wasm │ │ ├── TweetAccount.abi.json │ │ ├── TweetAccount.cpp │ │ └── TweetAccount.wasm │ ├── wallet │ ├── admin-docker.json │ ├── admin-test.json │ ├── admin.json.bak │ ├── employee.json │ ├── financer.json │ ├── owner.json │ └── personnel.json │ └── web3j-version.properties ├── crypto ├── build.gradle └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── platon │ │ │ └── crypto │ │ │ ├── Address.java │ │ │ ├── Base58.java │ │ │ ├── Bip32ECKeyPair.java │ │ │ ├── Bip39Wallet.java │ │ │ ├── Bip44WalletUtils.java │ │ │ ├── CipherException.java │ │ │ ├── ContractUtils.java │ │ │ ├── Credentials.java │ │ │ ├── ECDSASignature.java │ │ │ ├── ECKeyPair.java │ │ │ ├── Keys.java │ │ │ ├── LinuxSecureRandom.java │ │ │ ├── MnemonicUtils.java │ │ │ ├── RawTransaction.java │ │ │ ├── SecureRandomUtils.java │ │ │ ├── Sign.java │ │ │ ├── SignedRawTransaction.java │ │ │ ├── TransactionDecoder.java │ │ │ ├── TransactionEncoder.java │ │ │ ├── TransactionUtils.java │ │ │ ├── Wallet.java │ │ │ ├── WalletFile.java │ │ │ ├── WalletFileInterface.java │ │ │ └── WalletUtils.java │ └── resources │ │ └── en-mnemonic-word-list.txt │ └── test │ ├── java │ └── com │ │ └── platon │ │ └── crypto │ │ ├── Bip32Test.java │ │ ├── Bip44WalletUtilsTest.java │ │ ├── ContractUtilsTest.java │ │ ├── CredentialsTest.java │ │ ├── ECRecoverTest.java │ │ ├── KeysTest.java │ │ ├── MnemonicUtilsTest.java │ │ ├── SampleKeys.java │ │ ├── SecureRandomUtilsTest.java │ │ ├── SignTest.java │ │ ├── TransactionDecoderTest.java │ │ ├── TransactionEncoderTest.java │ │ ├── TransactionUtilsTest.java │ │ ├── WalletTest.java │ │ └── WalletUtilsTest.java │ └── resources │ ├── eth.json │ ├── keyfiles │ ├── UTC--2016-11-03T05-55-06.340672473Z--ef678007d18427e6022059dbc264f27507cd1ffc │ ├── UTC--2016-11-03T07-47-45.988Z--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818 │ ├── old-format-wallet--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818.json │ └── old-format-wallet--ef678007d18427e6022059dbc264f27507cd1ffc.json │ ├── main_test.json │ └── new.json ├── doc ├── Java-SDK-en.md └── Java-SDK-zh.md ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── integration-tests ├── build.gradle ├── scripts │ └── generateWrappers.sh └── src │ └── test │ ├── java │ └── com │ │ └── platon │ │ ├── contracts │ │ └── ppos │ │ │ ├── ContractCallScenario.java │ │ │ ├── ProposalScenario.java │ │ │ ├── RestrictingScenario.java │ │ │ ├── Scenario.java │ │ │ ├── SlashScenario.java │ │ │ └── StakingScenario.java │ │ └── protocol │ │ ├── RpcScenario.java │ │ ├── WebSocketServiceTest.java │ │ └── core │ │ ├── GasProviderTest.java │ │ └── JsonRpc2_0Web3jTest.java │ └── resources │ └── logback-test.xml ├── local.properties ├── logos ├── web3j-black.png ├── web3j-orange.png └── web3j-small.png ├── settings.gradle ├── solidity-abi ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ └── abi │ │ └── solidity │ │ ├── EventEncoder.java │ │ ├── EventValues.java │ │ ├── FunctionEncoder.java │ │ ├── FunctionReturnDecoder.java │ │ ├── PlatOnEventEncoder.java │ │ ├── PlatOnTypeDecoder.java │ │ ├── PlatOnTypeEncoder.java │ │ ├── TypeDecoder.java │ │ ├── TypeEncoder.java │ │ ├── TypeMappingException.java │ │ ├── TypeReference.java │ │ ├── Utils.java │ │ └── datatypes │ │ ├── Address.java │ │ ├── Array.java │ │ ├── Bool.java │ │ ├── Bytes.java │ │ ├── BytesType.java │ │ ├── DynamicArray.java │ │ ├── DynamicBytes.java │ │ ├── Event.java │ │ ├── Fixed.java │ │ ├── FixedPointType.java │ │ ├── Function.java │ │ ├── Int.java │ │ ├── IntType.java │ │ ├── NumericType.java │ │ ├── StaticArray.java │ │ ├── Type.java │ │ ├── Ufixed.java │ │ ├── Uint.java │ │ ├── Utf8String.java │ │ └── generated │ │ ├── AbiTypes.java │ │ ├── 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 │ └── test │ └── java │ └── com │ └── platon │ └── abi │ └── solidity │ ├── EventEncoderTest.java │ ├── FunctionEncoderTest.java │ ├── FunctionReturnDecoderTest.java │ ├── PlatOnTypeDecoderTest.java │ ├── PlatOnTypeEncoderTest.java │ ├── TypeDecoderTest.java │ ├── TypeEncoderTest.java │ ├── UtilsTest.java │ └── datatypes │ ├── AddressTest.java │ ├── FixedPointTypeTest.java │ ├── StaticArrayTest.java │ └── Utf8StringTest.java ├── solidity-rlp ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ └── rlp │ │ └── solidity │ │ ├── RlpDecoder.java │ │ ├── RlpEncoder.java │ │ ├── RlpList.java │ │ ├── RlpString.java │ │ └── RlpType.java │ └── test │ └── java │ └── com │ └── platon │ └── rlp │ └── solidity │ ├── RlpDecoderTest.java │ └── RlpEncoderTest.java ├── tuples ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── platon │ └── tuples │ ├── EmptyTuple.java │ ├── Tuple.java │ └── generated │ ├── Tuple1.java │ ├── Tuple10.java │ ├── Tuple11.java │ ├── Tuple12.java │ ├── Tuple13.java │ ├── Tuple14.java │ ├── Tuple15.java │ ├── Tuple16.java │ ├── Tuple17.java │ ├── Tuple18.java │ ├── Tuple19.java │ ├── Tuple2.java │ ├── Tuple20.java │ ├── Tuple3.java │ ├── Tuple4.java │ ├── Tuple5.java │ ├── Tuple6.java │ ├── Tuple7.java │ ├── Tuple8.java │ └── Tuple9.java ├── utils ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ ├── bech32 │ │ └── Bech32.java │ │ ├── crypto │ │ └── Hash.java │ │ ├── exceptions │ │ ├── MessageDecodingException.java │ │ └── MessageEncodingException.java │ │ ├── parameters │ │ ├── InnerContracts.java │ │ └── NetworkParameters.java │ │ └── utils │ │ ├── Assertions.java │ │ ├── Bytes.java │ │ ├── Convert.java │ │ ├── Files.java │ │ ├── Numeric.java │ │ └── Strings.java │ └── test │ └── java │ └── com │ └── platon │ ├── bech32 │ └── Bech32Test.java │ ├── crypto │ └── HashTest.java │ └── utils │ ├── AssertionsTest.java │ ├── BytesTest.java │ ├── ConvertTest.java │ ├── NumericTest.java │ └── StringsTest.java ├── wasm-abi ├── build.gradle └── src │ ├── main │ └── java │ │ └── com │ │ └── platon │ │ └── abi │ │ └── wasm │ │ ├── WasmEventDecoder.java │ │ ├── WasmEventEncoder.java │ │ ├── WasmEventValues.java │ │ ├── WasmFunctionEncoder.java │ │ ├── WasmReturnDecoder.java │ │ └── datatypes │ │ ├── WasmAddress.java │ │ ├── WasmEvent.java │ │ ├── WasmEventParameter.java │ │ ├── WasmFunction.java │ │ └── generated │ │ └── WasmAbiTypes.java │ └── test │ └── java │ └── com │ └── platon │ └── abi │ └── wasm │ ├── WasmEventDecoderTest.java │ └── WasmEventEncoderTest.java └── wasm-rlp ├── build.gradle └── src └── main └── java └── com └── platon └── rlp └── wasm ├── CollectionContainer.java ├── Container.java ├── ContainerType.java ├── LazyByteArray.java ├── LazyElement.java ├── MapContainer.java ├── PairContainer.java ├── ParameterizedTypeImpl.java ├── RLP.java ├── RLPCodec.java ├── RLPConstants.java ├── RLPDecoder.java ├── RLPDecoding.java ├── RLPElement.java ├── RLPEncoder.java ├── RLPEncoding.java ├── RLPIgnored.java ├── RLPItem.java ├── RLPList.java ├── RLPParser.java ├── RLPUtils.java ├── Raw.java └── datatypes ├── Int.java ├── Int128.java ├── Int16.java ├── Int32.java ├── Int64.java ├── Int8.java ├── Pair.java ├── Uint.java ├── Uint128.java ├── Uint16.java ├── Uint32.java ├── Uint64.java ├── Uint8.java └── WasmAddress.java /codegen/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | description 'web3j project code generators' 3 | 4 | dependencies { 5 | compile project(':core'), 6 | "com.squareup:javapoet:$javapoetVersion" 7 | testCompile project(path: ':core', configuration: 'testArtifacts') 8 | testCompile group: 'com.alibaba', name: 'fastjson', version: '2.0.4' 9 | } 10 | -------------------------------------------------------------------------------- /codegen/src/main/java/com/platon/codegen/Console.java: -------------------------------------------------------------------------------- 1 | package com.platon.codegen; 2 | 3 | /** 4 | * Command line utility classes. 5 | */ 6 | public class Console { 7 | public static void exitError(String message) { 8 | System.err.println(message); 9 | System.exit(1); 10 | } 11 | 12 | public static void exitError(Throwable throwable) { 13 | exitError(throwable.getMessage()); 14 | } 15 | 16 | public static void exitSuccess(String message) { 17 | System.out.println(message); 18 | System.exit(0); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /codegen/src/main/java/com/platon/codegen/GenerationReporter.java: -------------------------------------------------------------------------------- 1 | package com.platon.codegen; 2 | 3 | /** 4 | * Can be used to provide report about a code generation process. 5 | */ 6 | interface GenerationReporter { 7 | void report(String msg); 8 | } 9 | -------------------------------------------------------------------------------- /codegen/src/main/java/com/platon/codegen/LogGenerationReporter.java: -------------------------------------------------------------------------------- 1 | package com.platon.codegen; 2 | 3 | import org.slf4j.Logger; 4 | 5 | /** 6 | * A reporter generation that outputs messages using a logger instance. 7 | */ 8 | class LogGenerationReporter implements GenerationReporter { 9 | 10 | private final Logger logger; 11 | 12 | public LogGenerationReporter(Logger logger) { 13 | this.logger = logger; 14 | } 15 | 16 | @Override 17 | public void report(String msg) { 18 | logger.warn(msg); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /codegen/src/test/java/com/platon/codegen/AbiTypesGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.codegen; 2 | 3 | import com.platon.TempFileProvider; 4 | import org.junit.Test; 5 | 6 | import static org.hamcrest.core.Is.is; 7 | import static org.junit.Assert.assertThat; 8 | 9 | 10 | public class AbiTypesGeneratorTest extends TempFileProvider { 11 | 12 | @Test 13 | public void testGetPackageName() { 14 | assertThat(com.platon.codegen.AbiTypesGenerator.getPackageName(String.class), is("java.lang")); 15 | } 16 | 17 | @Test 18 | public void testCreatePackageName() { 19 | assertThat(com.platon.codegen.AbiTypesGenerator.createPackageName(String.class), is("java.lang.generated")); 20 | } 21 | 22 | @Test 23 | public void testGeneration() throws Exception { 24 | com.platon.codegen.AbiTypesGenerator.main(new String[] { tempDirPath }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /codegen/src/test/java/com/platon/codegen/AbiTypesMapperGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.codegen; 2 | 3 | import com.platon.TempFileProvider; 4 | import org.junit.Test; 5 | 6 | 7 | public class AbiTypesMapperGeneratorTest extends TempFileProvider { 8 | 9 | @Test 10 | public void testGeneration() throws Exception { 11 | com.platon.codegen.AbiTypesMapperGenerator.main(new String[] { tempDirPath }); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/admin.json: -------------------------------------------------------------------------------- 1 | {"address":"493301712671ada506ba6ca7891f436d29185821","crypto":{"cipher":"aes-128-ctr","ciphertext":"a4def93021c1d5d2516e6f4deb2504341045569b8e55841b3c92c26382cefe3f","cipherparams":{"iv":"e5cd5c324e8a754ace63864cd3b6ce3a"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"19eaa76bf2238d30ba1e83c0f63f2ccc612c4673cdde994b9d1342aa343c5a00"},"mac":"dd1ce25074f67f93d4f3ce7b315e9408fd137b0f189a74f97a15c1c19390e09a"},"id":"b008bc00-72bb-48e7-b310-4c7cc9d5ca1b","version":3} -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | targets=" 4 | arrays/Arrays 5 | contracts/HumanStandardToken 6 | fibonacci/Fibonacci 7 | greeter/Greeter 8 | shipit/ShipIt 9 | simplestorage/SimpleStorage 10 | " 11 | 12 | for target in ${targets}; do 13 | dirName=$(dirname $target) 14 | fileName=$(basename $target) 15 | 16 | cd $dirName 17 | echo "Compiling Solidity files in ${dirName}:" 18 | solc --bin --abi --optimize --overwrite ${fileName}.sol -o build/ 19 | echo "Complete" 20 | 21 | echo "Generating web3j bindings" 22 | web3j solidity generate \ 23 | build/${fileName}.bin \ 24 | build/${fileName}.abi \ 25 | -p org.web3j.generated \ 26 | -o ../../../../../../integration-tests/src/test/java/ > /dev/null 27 | echo "Complete" 28 | 29 | cd - 30 | done 31 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/fibonacci/Fibonacci.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | contract Fibonacci { 4 | 5 | event Notify(uint input, uint result); 6 | 7 | function fibonacci(uint number) public constant returns(uint result) { 8 | if (number == 0) return 0; 9 | else if (number == 1) return 1; 10 | else return Fibonacci.fibonacci(number - 1) + Fibonacci.fibonacci(number - 2); 11 | } 12 | 13 | function fibonacciNotify(uint number) public returns(uint result) { 14 | result = fibonacci(number); 15 | emit Notify(number, result); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/humanStandardToken/SampleRecipientSuccess.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one assumes successful receival of approval. 6 | */ 7 | contract SampleRecipientSuccess { 8 | /* A Generic receiving function for contracts that accept tokens */ 9 | address public from; 10 | uint256 public value; 11 | address public tokenContract; 12 | bytes public extraData; 13 | 14 | event ReceivedApproval(uint256 _value); 15 | 16 | function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) { 17 | from = _from; 18 | value = _value; 19 | tokenContract = _tokenContract; 20 | extraData = _extraData; 21 | ReceivedApproval(_value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/humanStandardToken/SampleRecipientThrow.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one will throw and thus needs to propagate the error up. 6 | */ 7 | contract SampleRecipientThrow { 8 | function () { 9 | throw; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/shipit/ShipIt.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | contract ShipIt { 3 | 4 | enum Status{ 5 | SHIPMENT_CREATED 6 | } 7 | 8 | struct Shipment{ 9 | address sender; 10 | address receiver; 11 | uint creationDate; 12 | uint departureDate; 13 | Status status; 14 | uint packageWeight; 15 | string depot; 16 | bytes32 receiverHash; 17 | } 18 | 19 | mapping(address => Shipment) public shipments; 20 | } 21 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/simplestorage/SimpleStorage.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.0; 2 | 3 | contract SimpleStorage { 4 | uint storedData; 5 | 6 | constructor() public { 7 | storedData = 5; 8 | } 9 | 10 | function set(uint x) public { 11 | storedData = x; 12 | } 13 | 14 | function get() public view returns (uint retVal) { 15 | return storedData; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /codegen/src/test/resources/solidity/solEvent/SolEvent.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.13; 2 | 3 | contract SolEvent { 4 | 5 | uint256 public result; 6 | string name; 7 | 8 | event FundTransfer(address sender, uint result); 9 | event SetNameEvent(string name1,string name2,address addr); 10 | 11 | 12 | function add(uint amount) public { 13 | 14 | result += amount; 15 | 16 | emit FundTransfer(msg.sender, result); 17 | } 18 | 19 | function setNameAndEmitAddress(string memory _name,address _address) public { 20 | name = _name; 21 | emit SetNameEvent(name,name,_address); 22 | } 23 | 24 | function getName() public view returns(string memory) { 25 | return name; 26 | } 27 | 28 | function getAddress() public view returns(address){ 29 | return msg.sender; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /codegen/src/test/resources/truffle/MetaCoin/ConvertLib.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | library ConvertLib{ 4 | function convert(uint amount,uint conversionRate) pure public returns (uint convertedAmount) 5 | { 6 | return amount * conversionRate; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /codegen/src/test/resources/truffle/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | targets=" 4 | MetaCoin/MetaCoin 5 | " 6 | 7 | for target in ${targets}; do 8 | dirName=$(dirname $target) 9 | fileName=$(basename $target) 10 | 11 | cd $dirName 12 | echo "Generating web3j bindings" 13 | web3j truffle generate \ 14 | build/contracts/${fileName}.json \ 15 | -p org.web3j.generated \ 16 | -o ../../../../../../integration-tests/src/test/java/ > /dev/null 17 | echo "Complete" 18 | 19 | cd - 20 | done 21 | -------------------------------------------------------------------------------- /codegen/src/test/resources/wallet/admin.json: -------------------------------------------------------------------------------- 1 | {"address":"493301712671ada506ba6ca7891f436d29185821","crypto":{"cipher":"aes-128-ctr","ciphertext":"a4def93021c1d5d2516e6f4deb2504341045569b8e55841b3c92c26382cefe3f","cipherparams":{"iv":"e5cd5c324e8a754ace63864cd3b6ce3a"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"19eaa76bf2238d30ba1e83c0f63f2ccc612c4673cdde994b9d1342aa343c5a00"},"mac":"dd1ce25074f67f93d4f3ce7b315e9408fd137b0f189a74f97a15c1c19390e09a"},"id":"b008bc00-72bb-48e7-b310-4c7cc9d5ca1b","version":3} -------------------------------------------------------------------------------- /codegen/src/test/resources/wallet/owner.json: -------------------------------------------------------------------------------- 1 | {"address":"f8f3978c14f585c920718c27853e2380d6f5db36","id":"79a799a1-4b80-403a-8ccb-2a3a9230b329","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"a9b3e8e652b02bb609f80a56253b1d7641a34b0b7b8ad3025af61feee9b15e12","cipherparams":{"iv":"e19d6a0cfc21e4ce2a3288a776791d10"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"05db233c5af0e2ee5b66bf024b2f40aa11fcb142a8db54f21b1d3f67d2026705"},"mac":"7777213a18048f2a62f8e153cb14282c5edaa1b270505641919a1ae77572609c"}} -------------------------------------------------------------------------------- /codegen/src/test/resources/wasm/contractEmitEventWithAddr/ContractEmitEventWithAddr.cpp: -------------------------------------------------------------------------------- 1 | #define TESTNET 2 | #include 3 | #include 4 | using namespace platon; 5 | 6 | 7 | CONTRACT ContractEmitEvent : public platon::Contract{ 8 | public: 9 | PLATON_EVENT0(transfer,std::string,std::string,Address) 10 | 11 | ACTION void init(){} 12 | 13 | ACTION void setNameAndEmitAddress(std::string name, Address address){ 14 | stringstorage.self() = name; 15 | PLATON_EMIT_EVENT0(transfer,name,name,address); 16 | } 17 | 18 | CONST std::string getName(){ 19 | return stringstorage.self(); 20 | } 21 | 22 | CONST Address getAddress(){ 23 | return platon_caller(); 24 | } 25 | 26 | private: 27 | platon::StorageType<"sstorage"_n, std::string> stringstorage; 28 | }; 29 | 30 | PLATON_DISPATCH(ContractEmitEvent, (init)(setNameAndEmitAddress)(getName)(getAddress)) 31 | -------------------------------------------------------------------------------- /config/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /console/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | description 'web3j command line tools' 4 | 5 | dependencies { 6 | compile project(':codegen') 7 | runtime "org.slf4j:slf4j-nop:$slf4jVersion" // prevent logging of the library to the console 8 | testCompile project(path: ':crypto', configuration: 'testArtifacts'), 9 | project(path: ':core', configuration: 'testArtifacts') 10 | } 11 | 12 | // Build command line library release with target distShadowZip 13 | mainClassName = 'com.platon.console.Runner' 14 | applicationName = 'platon-web3j' -------------------------------------------------------------------------------- /console/src/main/java/com/platon/console/ConsoleDevice.java: -------------------------------------------------------------------------------- 1 | package com.platon.console; 2 | 3 | import java.io.Console; 4 | 5 | /** 6 | * System Console device wrapper. 7 | */ 8 | public class ConsoleDevice implements IODevice { 9 | 10 | private Console console = System.console(); 11 | 12 | @Override 13 | public void printf(String format, Object... args) { 14 | console.printf(format, args); 15 | } 16 | 17 | @Override 18 | public String readLine(String fmt, Object... args) { 19 | return console.readLine(fmt, args); 20 | } 21 | 22 | @Override 23 | public char[] readPassword(String fmt, Object... args) { 24 | return console.readPassword(fmt, args); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /console/src/main/java/com/platon/console/IODevice.java: -------------------------------------------------------------------------------- 1 | package com.platon.console; 2 | 3 | /** 4 | * IO device abstraction. 5 | */ 6 | public interface IODevice { 7 | void printf(String format, Object... args); 8 | 9 | String readLine(String fmt, Object... args); 10 | 11 | char[] readPassword(String fmt, Object... args); 12 | } 13 | -------------------------------------------------------------------------------- /console/src/test/java/com/platon/console/WalletCreatorTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.console; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.mockito.Matchers.contains; 6 | import static org.mockito.Matchers.startsWith; 7 | import static org.mockito.Mockito.verify; 8 | import static org.mockito.Mockito.when; 9 | 10 | public class WalletCreatorTest extends WalletTester { 11 | 12 | @Test 13 | public void testWalletCreation() { 14 | when(console.readPassword(contains("password"))) 15 | .thenReturn(WALLET_PASSWORD, WALLET_PASSWORD); 16 | when(console.readLine(startsWith("Please enter a destination directory "))) 17 | .thenReturn(tempDirPath); 18 | 19 | WalletCreator.main(console); 20 | 21 | verify(console).printf(contains("successfully created in")); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /console/src/test/java/com/platon/console/WalletTester.java: -------------------------------------------------------------------------------- 1 | package com.platon.console; 2 | 3 | import com.platon.TempFileProvider; 4 | import com.platon.crypto.SampleKeys; 5 | import org.junit.Before; 6 | 7 | import static org.mockito.Mockito.mock; 8 | 9 | public abstract class WalletTester extends TempFileProvider { 10 | 11 | static final char[] WALLET_PASSWORD = SampleKeys.PASSWORD.toCharArray(); 12 | 13 | IODevice console; 14 | 15 | @Before 16 | public void setUp() throws Exception { 17 | super.setUp(); 18 | 19 | console = mock(IODevice.class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /console/src/test/resources/contract/ContractDistory.abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "input": [], 5 | "name": "get_string", 6 | "output": "string", 7 | "type": "Action" 8 | }, 9 | { 10 | "constant": false, 11 | "input": [], 12 | "name": "init", 13 | "output": "void", 14 | "type": "Action" 15 | }, 16 | { 17 | "constant": false, 18 | "input": [], 19 | "name": "distory_contract", 20 | "output": "int32", 21 | "type": "Action" 22 | }, 23 | { 24 | "constant": false, 25 | "input": [ 26 | { 27 | "name": "name", 28 | "type": "string" 29 | } 30 | ], 31 | "name": "set_string", 32 | "output": "void", 33 | "type": "Action" 34 | } 35 | ] -------------------------------------------------------------------------------- /console/src/test/resources/contract/ContractDistory.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/console/src/test/resources/contract/ContractDistory.wasm -------------------------------------------------------------------------------- /console/src/test/resources/contract/SampleRecipientSuccess.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one assumes successful receival of approval. 6 | */ 7 | contract SampleRecipientSuccess { 8 | /* A Generic receiving function for contracts that accept tokens */ 9 | address public from; 10 | uint256 public value; 11 | address public tokenContract; 12 | bytes public extraData; 13 | 14 | event ReceivedApproval(uint256 _value); 15 | 16 | function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) { 17 | from = _from; 18 | value = _value; 19 | tokenContract = _tokenContract; 20 | extraData = _extraData; 21 | ReceivedApproval(_value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /console/src/test/resources/contract/SampleRecipientThrow.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one will throw and thus needs to propagate the error up. 6 | */ 7 | contract SampleRecipientThrow { 8 | function () { 9 | throw; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /console/src/test/resources/contract/Token.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/console/src/test/resources/contract/Token.bin -------------------------------------------------------------------------------- /console/src/test/resources/keyfiles/UTC--2016-11-03T05-55-06.340672473Z--ef678007d18427e6022059dbc264f27507cd1ffc: -------------------------------------------------------------------------------- 1 | {"address":"ef678007d18427e6022059dbc264f27507cd1ffc","crypto":{"cipher":"aes-128-ctr","ciphertext":"e1a92bbba0920bdd234b792eac5c662511cffc8714e83e668ddae0507abe91e3","cipherparams":{"iv":"683392b3259b5dcc48516b22b0835972"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f89eaf8557a983755043ed490cbaf2c075f6ee5e53bc354c4f9d485f9d6d3b1b"},"mac":"f8fe5929187d70ee1e659e6d2e669e778e8792012ecfc1a7b1bb0ee8d4a1e454"},"id":"6ded30ab-7bdc-47da-b7ff-ccfdb2e62f56","version":3} -------------------------------------------------------------------------------- /console/src/test/resources/keyfiles/UTC--2016-11-03T07-47-45.988Z--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818: -------------------------------------------------------------------------------- 1 | {"version":3,"id":"cb3dff1c-f9f8-42a1-9bf7-a5b9838697b9","address":"4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818","Crypto":{"ciphertext":"ac2973d1fff7a826fa19cb548fec4d341fbf16f2cf5031d4a902312a0416a78a","cipherparams":{"iv":"86c8eb32a78eb5a6eaa7de29f92318f4"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"37a6ce728936771a8337397449525bc6879196fb7b57070ddb0d38d3a94f4642","n":1024,"r":8,"p":1},"mac":"59b6206df4a55abf40357e56ce96a6637600579872243e163bbbbd9c39975019"}} -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/abi/CustomType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.abi; 2 | 3 | import com.platon.rlp.solidity.RlpType; 4 | 5 | public abstract class CustomType { 6 | 7 | public abstract RlpType getRlpEncodeData(); 8 | } 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/abi/Function.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.abi; 2 | 3 | import com.platon.abi.solidity.datatypes.Type; 4 | 5 | import java.util.List; 6 | 7 | public class Function { 8 | 9 | private int type; 10 | 11 | private List inputParameters; 12 | 13 | public Function(int type) { 14 | this.type = type; 15 | } 16 | 17 | public Function(int type, List inputParameters) { 18 | this.type = type; 19 | this.inputParameters = inputParameters; 20 | } 21 | 22 | public int getType() { 23 | return type; 24 | } 25 | 26 | public void setType(int type) { 27 | this.type = type; 28 | } 29 | 30 | public List getInputParameters() { 31 | return inputParameters; 32 | } 33 | 34 | public void setInputParameters(List inputParameters) { 35 | this.inputParameters = inputParameters; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/abi/custom/NodeId.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.abi.custom; 2 | 3 | import com.platon.contracts.ppos.abi.CustomType; 4 | import com.platon.rlp.solidity.RlpString; 5 | import com.platon.rlp.solidity.RlpType; 6 | import com.platon.utils.Numeric; 7 | 8 | public class NodeId extends CustomType { 9 | 10 | private String nodeId; 11 | 12 | public NodeId(String nodeId) { 13 | this.nodeId = nodeId; 14 | } 15 | 16 | @Override 17 | public RlpType getRlpEncodeData() { 18 | return RlpString.create(Numeric.hexStringToByteArray(nodeId)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto; 2 | 3 | import com.platon.contracts.ppos.dto.common.ErrorCode; 4 | 5 | public class BaseResponse { 6 | 7 | private int code; 8 | private String errMsg; 9 | 10 | public boolean isStatusOk() { 11 | return code == ErrorCode.SUCCESS; 12 | } 13 | public int getCode() { 14 | return code; 15 | } 16 | public void setCode(int code) { 17 | this.code = code; 18 | } 19 | public String getErrMsg() { 20 | return errMsg; 21 | } 22 | public void setErrMsg(String errMsg) { 23 | this.errMsg = errMsg; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return "BaseResponse [code=" + code + ", errMsg=" + errMsg + "]"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/CallResponse.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto; 2 | 3 | public class CallResponse extends BaseResponse { 4 | 5 | private T data; 6 | 7 | public T getData() { 8 | return data; 9 | } 10 | public void setData(T data) { 11 | this.data = data; 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "CallResponse [data=" + data + ", getCode()=" + getCode() + ", getErrMsg()=" + getErrMsg() + "]"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/TransactionResponse.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto; 2 | 3 | import com.platon.protocol.core.methods.response.TransactionReceipt; 4 | 5 | public class TransactionResponse extends BaseResponse { 6 | 7 | private TransactionReceipt transactionReceipt; 8 | 9 | public TransactionReceipt getTransactionReceipt() { 10 | return transactionReceipt; 11 | } 12 | public void setTransactionReceipt(TransactionReceipt transactionReceipt) { 13 | this.transactionReceipt = transactionReceipt; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "TransactionResponse [transactionReceipt=" + transactionReceipt + ", getCode()=" + getCode() 19 | + ", getErrMsg()=" + getErrMsg() + "]"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/common/DuplicateSignType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto.common; 2 | 3 | public enum DuplicateSignType { 4 | 5 | PREPARE_BLOCK(1), PREPARE_VOTE(2),VIEW_CHANGE(3); 6 | 7 | int value; 8 | 9 | DuplicateSignType(int val) { 10 | this.value = val; 11 | } 12 | 13 | public int getValue() { 14 | return value; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/common/ProposalType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto.common; 2 | 3 | public class ProposalType { 4 | 5 | /** 6 | * 文本提案 7 | */ 8 | public final static int TEXT_PROPOSAL = 0x01; 9 | /** 10 | * 版本提案 11 | */ 12 | public final static int VERSION_PROPOSAL = 0x02; 13 | /** 14 | * 参数提案 15 | */ 16 | public final static int PARAM_PROPOSAL = 0x03; 17 | /** 18 | * 取消提案 19 | */ 20 | public final static int CANCEL_PROPOSAL = 0x04; 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/enums/DelegateAmountType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto.enums; 2 | 3 | public enum DelegateAmountType { 4 | 5 | FREE_AMOUNT_TYPE(0), RESTRICTING_AMOUNT_TYPE(1), DELEGATE_LOCK_AMOUNT_TYPE(3); 6 | 7 | int value; 8 | 9 | DelegateAmountType(int val) { 10 | this.value = val; 11 | } 12 | 13 | public int getValue() { 14 | return value; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/enums/StakingAmountType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto.enums; 2 | 3 | public enum StakingAmountType { 4 | 5 | FREE_AMOUNT_TYPE(0), RESTRICTING_AMOUNT_TYPE(1), AUTO_AMOUNT_TYPE(2); 6 | 7 | int value; 8 | 9 | StakingAmountType(int val) { 10 | this.value = val; 11 | } 12 | 13 | public int getValue() { 14 | return value; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/dto/enums/VoteOption.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.dto.enums; 2 | 3 | public enum VoteOption { 4 | 5 | YEAS(1), NAYS(2), ABSTENTIONS(3); 6 | 7 | int value; 8 | 9 | VoteOption(int val) { 10 | this.value = val; 11 | } 12 | 13 | public int getValue() { 14 | return value; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/exception/EstimateGasException.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.exception; 2 | 3 | import com.platon.protocol.exceptions.TransactionException; 4 | 5 | public class EstimateGasException extends TransactionException { 6 | public EstimateGasException(String message) { 7 | super(message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/exception/NoSupportFunctionType.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.exception; 2 | 3 | import com.platon.protocol.exceptions.TransactionException; 4 | 5 | public class NoSupportFunctionType extends TransactionException { 6 | 7 | public NoSupportFunctionType(int type) { 8 | super(String.valueOf(type)); 9 | } 10 | 11 | /*public NoSupportFunctionType(String message) { 12 | super(message); 13 | } 14 | 15 | public NoSupportFunctionType(String message, Throwable cause) { 16 | super(message, cause); 17 | } 18 | 19 | public NoSupportFunctionType(Throwable cause) { 20 | super(cause); 21 | }*/ 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/contracts/ppos/utils/DecoderUtils.java: -------------------------------------------------------------------------------- 1 | package com.platon.contracts.ppos.utils; 2 | 3 | public class DecoderUtils { 4 | 5 | 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/BooleanResponse.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * Boolean response type. 7 | */ 8 | public class BooleanResponse extends Response { 9 | public boolean success() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/NewAccountIdentifier.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * personal_newAccount 7 | * parity_newAccountFromPhrase 8 | * parity_newAccountFromSecret 9 | * parity_newAccountFromWallet. 10 | */ 11 | public class NewAccountIdentifier extends Response { 12 | public String getAccountId() { 13 | return getResult(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/PersonalEcRecover.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | 4 | import com.platon.protocol.core.Response; 5 | 6 | /** personal_ecRecover. */ 7 | public class PersonalEcRecover extends Response { 8 | public String getRecoverAccountId() { 9 | return getResult(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/PersonalImportRawKey.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | 4 | import com.platon.protocol.core.Response; 5 | 6 | /** personal_importRawKey. */ 7 | public class PersonalImportRawKey extends Response { 8 | public String getAccountId() { 9 | return getResult(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/PersonalListAccounts.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * personal_listAccounts. 9 | */ 10 | public class PersonalListAccounts extends Response> { 11 | public List getAccountIds() { 12 | return getResult(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/PersonalSign.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * personal_sign 7 | * parity_signMessage. 8 | */ 9 | public class PersonalSign extends Response { 10 | public String getSignedMessage() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/admin/methods/response/PersonalUnlockAccount.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.admin.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * personal_unlockAccount. 7 | */ 8 | public class PersonalUnlockAccount extends Response { 9 | public Boolean accountUnlocked() { 10 | return getResult(); 11 | } 12 | } -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/DefaultBlockParameter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * Wrapper for parameter that takes either a block number or block name as input 7 | * 8 | *

See the 9 | * specification for further information. 10 | */ 11 | public interface DefaultBlockParameter { 12 | static DefaultBlockParameter valueOf(BigInteger blockNumber) { 13 | return new DefaultBlockParameterNumber(blockNumber); 14 | } 15 | 16 | static DefaultBlockParameter valueOf(String blockName) { 17 | return DefaultBlockParameterName.fromString(blockName); 18 | } 19 | 20 | String getValue(); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/DefaultBlockParameterNumber.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core; 2 | 3 | import com.fasterxml.jackson.annotation.JsonValue; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * DefaultBlockParameter implementation that takes a numeric value. 10 | */ 11 | public class DefaultBlockParameterNumber implements DefaultBlockParameter { 12 | 13 | private BigInteger blockNumber; 14 | 15 | public DefaultBlockParameterNumber(BigInteger blockNumber) { 16 | this.blockNumber = blockNumber; 17 | } 18 | 19 | public DefaultBlockParameterNumber(long blockNumber) { 20 | this(BigInteger.valueOf(blockNumber)); 21 | } 22 | 23 | @Override 24 | @JsonValue 25 | public String getValue() { 26 | return Numeric.encodeQuantity(blockNumber); 27 | } 28 | 29 | public BigInteger getBlockNumber() { 30 | return blockNumber; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/RpcErrors.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core; 2 | 3 | public final class RpcErrors { 4 | private RpcErrors() {} 5 | 6 | public static final int FILTER_NOT_FOUND = -32000; 7 | 8 | public static final int PARSE_ERROR = -32700; 9 | 10 | public static final int INVALID_REQUEST = -32601; 11 | 12 | public static final int INVALID_PARAMS = -32602; 13 | 14 | public static final int INTERNAL_ERROR = -32603; 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/filters/Callback.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.filters; 2 | 3 | /** 4 | * Filter callback interface. 5 | */ 6 | public interface Callback { 7 | void onEvent(T value); 8 | } 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/filters/FilterException.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.filters; 2 | 3 | /** 4 | * Filter exception wrapper. 5 | */ 6 | public class FilterException extends RuntimeException { 7 | 8 | public FilterException(String message) { 9 | super(message); 10 | } 11 | 12 | public FilterException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/request/ShhFilter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.request; 2 | 3 | /** 4 | * Filter implementation as per docs 5 | */ 6 | public class ShhFilter extends Filter { 7 | private String to; 8 | 9 | public ShhFilter(String to) { 10 | super(); 11 | this.to = to; 12 | } 13 | 14 | public String getTo() { 15 | return to; 16 | } 17 | 18 | @Override 19 | ShhFilter getThis() { 20 | return this; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/AdminPeerEvents.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.protocol.core.methods.response.bean.ProgramVersion; 5 | 6 | /** 7 | * @Author liushuyu 8 | * @Date 2021/9/16 11:37 9 | * @Version 10 | * @Desc 11 | */ 12 | public class AdminPeerEvents extends Response { 13 | } 14 | 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/AdminProgramVersion.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.protocol.core.methods.response.bean.ProgramVersion; 5 | 6 | /** 7 | * platon_evidences. 8 | */ 9 | public class AdminProgramVersion extends Response { 10 | 11 | public ProgramVersion getAdminProgramVersion() { 12 | return getResult(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/AdminSchnorrNIZKProve.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * platon_evidences. 7 | */ 8 | public class AdminSchnorrNIZKProve extends Response { 9 | 10 | public String getAdminSchnorrNIZKProve() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DbGetHex.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * db_getHex. 7 | */ 8 | public class DbGetHex extends Response { 9 | 10 | public String getStoredValue() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DbGetString.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * db_getString. 7 | */ 8 | public class DbGetString extends Response { 9 | 10 | public String getStoredValue() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DbPutHex.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * db_putHex. 7 | */ 8 | public class DbPutHex extends Response { 9 | 10 | public boolean valueStored() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DbPutString.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * db_putString. 7 | */ 8 | public class DbPutString extends Response { 9 | 10 | public boolean valueStored() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DebugEconomicConfig.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.protocol.core.methods.response.bean.EconomicConfig; 5 | import com.platon.utils.JSONUtil; 6 | 7 | /** 8 | * platon_evidences. 9 | */ 10 | public class DebugEconomicConfig extends Response { 11 | 12 | public EconomicConfig getEconomicConfig() { 13 | return JSONUtil.parseObject(getResult(), EconomicConfig.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/DebugWaitSlashingNodeList.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.protocol.core.methods.response.bean.WaitSlashingNode; 5 | import com.platon.utils.JSONUtil; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * debug_getWaitSlashingNodeList 11 | */ 12 | public class DebugWaitSlashingNodeList extends Response { 13 | 14 | public List get() { 15 | return JSONUtil.parseArray(getResult(), WaitSlashingNode.class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/NetListening.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * net_listening. 7 | */ 8 | public class NetListening extends Response { 9 | public boolean isListening() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/NetPeerCount.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * net_peerCount. 10 | */ 11 | public class NetPeerCount extends Response { 12 | 13 | public BigInteger getQuantity() { 14 | return Numeric.decodeQuantity(getResult()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/NetVersion.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * net_version. 7 | */ 8 | public class NetVersion extends Response { 9 | public String getNetVersion() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonAccounts.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * eth_accounts. 9 | */ 10 | public class PlatonAccounts extends Response> { 11 | public List getAccounts() { 12 | return getResult(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonBlockNumber.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_blockNumber. 10 | */ 11 | public class PlatonBlockNumber extends Response { 12 | public BigInteger getBlockNumber() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonCall.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_call. 7 | */ 8 | public class PlatonCall extends Response { 9 | public String getValue() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonEstimateGas.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_estimateGas. 7 | */ 8 | public class PlatonEstimateGas extends Response { 9 | /*public BigInteger getAmountUsed() throws EstimateGasException { 10 | String result = getResult(); 11 | if(hasError()){ 12 | throw new EstimateGasException(result); 13 | }else{ 14 | return Numeric.decodeQuantity(getResult()); 15 | } 16 | }*/ 17 | } 18 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonEvidences.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.platon.protocol.core.Response; 5 | import com.platon.protocol.core.methods.response.bean.Evidences; 6 | 7 | /** 8 | * platon_evidences. 9 | */ 10 | public class PlatonEvidences extends Response { 11 | 12 | public String getEvidencesStr() { 13 | return getResult(); 14 | } 15 | 16 | public Evidences getEvidences() { 17 | return JSON.parseObject(getResult(), Evidences.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonFilter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_newFilter. 10 | */ 11 | public class PlatonFilter extends Response { 12 | public BigInteger getFilterId() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGasPrice.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_gasPrice. 10 | */ 11 | public class PlatonGasPrice extends Response { 12 | public BigInteger getGasPrice() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetAddressHrp.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** platon_getAddressHrp **/ 6 | public class PlatonGetAddressHrp extends Response { 7 | } 8 | 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetBalance.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_getBalance. 10 | */ 11 | public class PlatonGetBalance extends Response { 12 | public BigInteger getBalance() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetBlockTransactionCountByHash.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_getBlockTransactionCountByHash. 10 | */ 11 | public class PlatonGetBlockTransactionCountByHash extends Response { 12 | public BigInteger getTransactionCount() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetBlockTransactionCountByNumber.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_getBlockTransactionCountByNumber. 10 | */ 11 | public class PlatonGetBlockTransactionCountByNumber extends Response { 12 | public BigInteger getTransactionCount() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetCode.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_getCode. 7 | */ 8 | public class PlatonGetCode extends Response { 9 | public String getCode() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetStorageAt.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_getStorageAt. 7 | */ 8 | public class PlatonGetStorageAt extends Response { 9 | public String getData() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonGetTransactionCount.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * eth_getTransactionCount. 10 | */ 11 | public class PlatonGetTransactionCount extends Response { 12 | public BigInteger getTransactionCount() { 13 | return Numeric.decodeQuantity(getResult()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonPendingTransactions.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * User: dongqile 9 | * Date: 2018/11/12 10 | * Time: 14:19 11 | */ 12 | public class PlatonPendingTransactions extends Response> { 13 | public List getTransactions() { 14 | return getResult(); 15 | } 16 | } -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonProtocolVersion.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_protocolVersion. 7 | */ 8 | public class PlatonProtocolVersion extends Response { 9 | public String getProtocolVersion() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonRawTransaction.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | 4 | import com.platon.protocol.core.Response; 5 | 6 | /** platon_getRawTransactionByHash **/ 7 | public class PlatonRawTransaction extends Response { 8 | } 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonSendRawTransaction.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_sendRawTransaction. 7 | */ 8 | public class PlatonSendRawTransaction extends Response { 9 | public String getTransactionHash() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonSendTransaction.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_sendTransaction. 7 | */ 8 | public class PlatonSendTransaction extends Response { 9 | public String getTransactionHash() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonSign.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_sign. 7 | */ 8 | public class PlatonSign extends Response { 9 | public String getSignature() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonSignTransaction.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * @Author liushuyu 7 | * @Date 2021/9/16 11:21 8 | * @Version 9 | * @Desc 10 | */ 11 | public class PlatonSignTransaction extends Response { 12 | 13 | public static class SignTransaction { 14 | private String raw; 15 | private Transaction tx; 16 | 17 | public String getRaw() { 18 | return raw; 19 | } 20 | 21 | public void setRaw(String raw) { 22 | this.raw = raw; 23 | } 24 | 25 | public Transaction getTx() { 26 | return tx; 27 | } 28 | 29 | public void setTx(Transaction tx) { 30 | this.tx = tx; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonSubscribe.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | public class PlatonSubscribe extends Response { 6 | public String getSubscriptionId() { 7 | return getResult(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonUninstallFilter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * eth_uninstallFilter. 7 | */ 8 | public class PlatonUninstallFilter extends Response { 9 | public boolean isUninstalled() { 10 | return getResult(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/PlatonUnsubscribe.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | public class PlatonUnsubscribe extends Response { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhAddToGroup.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_addToGroup. 7 | */ 8 | public class ShhAddToGroup extends Response { 9 | 10 | public boolean addedToGroup() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhHasIdentity.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_hasIdentity. 7 | */ 8 | public class ShhHasIdentity extends Response { 9 | 10 | public boolean hasPrivateKeyForIdentity() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhNewFilter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * shh_newFilter. 10 | */ 11 | public class ShhNewFilter extends Response { 12 | 13 | public BigInteger getFilterId() { 14 | return Numeric.decodeQuantity(getResult()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhNewGroup.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_newGroup. 7 | */ 8 | public class ShhNewGroup extends Response { 9 | 10 | public String getAddress() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhNewIdentity.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_newIdentity. 7 | */ 8 | public class ShhNewIdentity extends Response { 9 | 10 | public String getAddress() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhPost.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_post. 7 | */ 8 | public class ShhPost extends Response { 9 | 10 | public boolean messageSent() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhUninstallFilter.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_uninstallFilter. 7 | */ 8 | public class ShhUninstallFilter extends Response { 9 | 10 | public boolean isUninstalled() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/ShhVersion.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * shh_version. 7 | */ 8 | public class ShhVersion extends Response { 9 | 10 | public String getVersion() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/VoidResponse.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * Null response object returned by the below methods. 7 | *

    8 | *
  • personal_setAccountName
  • 9 | *
  • personal_setAccountMeta
  • 10 | *
11 | */ 12 | public class VoidResponse extends Response { 13 | public boolean isValid() { 14 | return !hasError(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/Web3ClientVersion.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * web3_clientVersion. 7 | */ 8 | public class Web3ClientVersion extends Response { 9 | 10 | public String getWeb3ClientVersion() { 11 | return getResult(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/core/methods/response/Web3Sha3.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.methods.response; 2 | 3 | import com.platon.protocol.core.Response; 4 | 5 | /** 6 | * web3_sha3. 7 | */ 8 | public class Web3Sha3 extends Response { 9 | } 10 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/deserializer/KeepAsJsonDeserialzier.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.deserializer; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.core.JsonProcessingException; 5 | import com.fasterxml.jackson.core.TreeNode; 6 | import com.fasterxml.jackson.databind.DeserializationContext; 7 | import com.fasterxml.jackson.databind.JsonDeserializer; 8 | 9 | import java.io.IOException; 10 | 11 | public class KeepAsJsonDeserialzier extends JsonDeserializer { 12 | 13 | @Override 14 | public String deserialize(JsonParser jp, DeserializationContext ctxt) 15 | throws IOException, JsonProcessingException { 16 | 17 | TreeNode tree = jp.getCodec().readTree(jp); 18 | return tree.toString(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/exceptions/ClientConnectionException.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.exceptions; 2 | 3 | /** 4 | * Client connection exception. 5 | */ 6 | public class ClientConnectionException extends RuntimeException { 7 | public ClientConnectionException(String message) { 8 | super(message); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/exceptions/NoTransactionReceiptException.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.exceptions; 2 | 3 | /** 4 | * Transaction timeout exception indicates that we have breached some threshold waiting for a 5 | * transaction to execute. 6 | */ 7 | public class NoTransactionReceiptException extends TransactionException { 8 | public NoTransactionReceiptException(String message) { 9 | super(message); 10 | } 11 | 12 | public NoTransactionReceiptException(Throwable cause) { 13 | super(cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/exceptions/TransactionException.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.exceptions; 2 | 3 | /** 4 | * Transaction timeout exception indicates that we have breached some threshold waiting for a 5 | * transaction to execute. 6 | */ 7 | public class TransactionException extends Exception { 8 | public TransactionException(String message) { 9 | super(message); 10 | } 11 | 12 | public TransactionException(Throwable cause) { 13 | super(cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/exceptions/UnableParseLogException.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.exceptions; 2 | 3 | public class UnableParseLogException extends TransactionException { 4 | 5 | public UnableParseLogException(String message) { 6 | super(message); 7 | } 8 | 9 | public UnableParseLogException(Throwable cause) { 10 | super(cause); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/ipc/IOFacade.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.ipc; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * Simple IO facade for the *nix and Windows IPC implementations. 7 | */ 8 | public interface IOFacade { 9 | void write(String payload) throws IOException; 10 | 11 | String read() throws IOException; 12 | 13 | void close() throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/ipc/UnixIpcService.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.ipc; 2 | 3 | /** 4 | * Unix domain socket implementation of our services API. 5 | */ 6 | public class UnixIpcService extends IpcService { 7 | private final String ipcSocketPath; 8 | 9 | public UnixIpcService(String ipcSocketPath) { 10 | super(); 11 | this.ipcSocketPath = ipcSocketPath; 12 | } 13 | 14 | public UnixIpcService(String ipcSocketPath, boolean includeRawResponse) { 15 | super(includeRawResponse); 16 | this.ipcSocketPath = ipcSocketPath; 17 | } 18 | 19 | @Override 20 | protected IOFacade getIO() { 21 | return new UnixDomainSocket(ipcSocketPath); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/ipc/WindowsIpcService.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.ipc; 2 | 3 | /** 4 | * Windows named pipe implementation of our services API. 5 | * 6 | *

This implementation is experimental. 7 | */ 8 | public class WindowsIpcService extends IpcService { 9 | private final String ipcSocketPath; 10 | 11 | public WindowsIpcService(String ipcSocketPath) { 12 | super(); 13 | this.ipcSocketPath = ipcSocketPath; 14 | } 15 | 16 | public WindowsIpcService(String ipcSocketPath, boolean includeRawResponse) { 17 | super(includeRawResponse); 18 | this.ipcSocketPath = ipcSocketPath; 19 | } 20 | 21 | @Override 22 | protected IOFacade getIO() { 23 | return new WindowsNamedPipe(ipcSocketPath); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/WebSocketListener.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * A listener used to notify about about new WebSocket messages. 7 | */ 8 | public interface WebSocketListener { 9 | 10 | /** 11 | * Called when a new WebSocket message is delivered. 12 | * 13 | * @param message new WebSocket message 14 | * @throws IOException thrown if an observer failed to process the message 15 | */ 16 | void onMessage(String message) throws IOException; 17 | 18 | void onError(Exception e); 19 | 20 | void onClose(); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/WebSocketRequest.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket; 2 | 3 | import java.util.concurrent.CompletableFuture; 4 | 5 | /** 6 | * Objects necessary to process a reply for a request sent via WebSocket protocol. 7 | * 8 | * @param type of a data item that should be returned by the sent request 9 | */ 10 | class WebSocketRequest { 11 | private CompletableFuture onReply; 12 | private Class responseType; 13 | 14 | public WebSocketRequest(CompletableFuture onReply, Class responseType) { 15 | this.onReply = onReply; 16 | this.responseType = responseType; 17 | } 18 | 19 | public CompletableFuture getOnReply() { 20 | return onReply; 21 | } 22 | 23 | public Class getResponseType() { 24 | return responseType; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/LogNotification.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | public class LogNotification extends Notification { 4 | } 5 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/NewHeadsNotification.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | public class NewHeadsNotification 4 | extends Notification { 5 | } 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/Notification.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | /** 6 | * Base class for WebSocket notifications. 7 | * 8 | * @param type of data return by a particular subscription 9 | */ 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Notification { 12 | private String jsonrpc; 13 | private String method; 14 | private NotificationParams params; 15 | 16 | public String getJsonrpc() { 17 | return jsonrpc; 18 | } 19 | 20 | public String getMethod() { 21 | return method; 22 | } 23 | 24 | public NotificationParams getParams() { 25 | return params; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/NotificationParams.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | 5 | /** 6 | * Generic class for a notification param. Contains a subscription id and a data item. 7 | * 8 | * @param type of data return by a particular subscription 9 | */ 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class NotificationParams { 12 | private T result; 13 | private String subsciption; 14 | 15 | public T getResult() { 16 | return result; 17 | } 18 | 19 | public String getSubsciption() { 20 | return subsciption; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/PendingTransactionNotification.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | public class PendingTransactionNotification extends Notification { 4 | } 5 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/protocol/websocket/events/SyncingNotfication.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.websocket.events; 2 | 3 | import com.platon.protocol.core.methods.response.PlatonSyncing; 4 | 5 | public class SyncingNotfication extends Notification { 6 | } 7 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/ChainId.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx; 2 | 3 | /** 4 | * Ethereum chain ids as per 5 | * EIP-155. 6 | */ 7 | public class ChainId { 8 | public static final byte NONE = -1; 9 | public static final byte MAINNET = 1; 10 | public static final byte EXPANSE_MAINNET = 2; 11 | public static final byte ROPSTEN = 3; 12 | public static final byte RINKEBY = 4; 13 | public static final byte ROOTSTOCK_MAINNET = 30; 14 | public static final byte ROOTSTOCK_TESTNET = 31; 15 | public static final byte KOVAN = 42; 16 | public static final byte ETHEREUM_CLASSIC_MAINNET = 61; 17 | public static final byte ETHEREUM_CLASSIC_TESTNET = 62; 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/ReadonlyTransactionManager.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx; 2 | 3 | import com.platon.protocol.Web3j; 4 | import com.platon.protocol.core.methods.response.PlatonSendTransaction; 5 | 6 | import java.io.IOException; 7 | import java.math.BigInteger; 8 | 9 | /** 10 | * Transaction manager implementation for read-only operations on smart contracts. 11 | */ 12 | public class ReadonlyTransactionManager extends TransactionManager { 13 | 14 | public ReadonlyTransactionManager(Web3j web3j, String fromAddress) { 15 | super(web3j, fromAddress); 16 | } 17 | 18 | @Override 19 | public PlatonSendTransaction sendTransaction( 20 | BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) 21 | throws IOException { 22 | throw new UnsupportedOperationException( 23 | "Only read operations are supported by this transaction manager"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/exceptions/ContractCallException.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.exceptions; 2 | 3 | /** 4 | * Exception resulting from issues calling methods on Smart Contracts. 5 | */ 6 | public class ContractCallException extends RuntimeException { 7 | 8 | public ContractCallException(String message) { 9 | super(message); 10 | } 11 | 12 | public ContractCallException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/exceptions/TxHashMismatchException.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.exceptions; 2 | 3 | import java.io.IOException; 4 | 5 | public class TxHashMismatchException extends IOException { 6 | private String txHashLocal; 7 | private String txHashRemote; 8 | 9 | public TxHashMismatchException(String txHashLocal, String txHashRemote) { 10 | this.txHashLocal = txHashLocal; 11 | this.txHashRemote = txHashRemote; 12 | } 13 | 14 | public String getTxHashLocal() { 15 | return txHashLocal; 16 | } 17 | 18 | public String getTxHashRemote() { 19 | return txHashRemote; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/gas/ContractGasProvider.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.gas; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class ContractGasProvider implements GasProvider { 6 | 7 | private BigInteger gasPrice; 8 | private BigInteger gasLimit; 9 | 10 | public ContractGasProvider(BigInteger gasPrice, BigInteger gasLimit) { 11 | this.gasPrice = gasPrice; 12 | this.gasLimit = gasLimit; 13 | } 14 | 15 | @Override 16 | public BigInteger getGasPrice() { 17 | return gasPrice; 18 | } 19 | 20 | @Override 21 | public BigInteger getGasLimit() { 22 | return gasLimit; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/gas/DefaultGasProvider.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.gas; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class DefaultGasProvider extends ContractGasProvider { 6 | 7 | public static final BigInteger GAS_LIMIT = BigInteger.valueOf(210000); 8 | 9 | public static final BigInteger GAS_PRICE = BigInteger.valueOf(500000000000L); 10 | 11 | public DefaultGasProvider() { 12 | super(GAS_PRICE, GAS_LIMIT); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/gas/DefaultWasmGasProvider.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.gas; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class DefaultWasmGasProvider implements GasProvider { 6 | private BigInteger gasPrice = BigInteger.valueOf(1_000_000_000L); 7 | private BigInteger invokeGasLimit = BigInteger.valueOf(2_000_000L); 8 | 9 | public DefaultWasmGasProvider() { 10 | 11 | } 12 | 13 | public DefaultWasmGasProvider(BigInteger gasPrice, BigInteger invokeGasLimit) { 14 | this.gasPrice = gasPrice; 15 | this.invokeGasLimit = invokeGasLimit; 16 | } 17 | 18 | @Override 19 | public BigInteger getGasPrice() { 20 | return gasPrice; 21 | } 22 | 23 | 24 | @Override 25 | public BigInteger getGasLimit() { 26 | return invokeGasLimit; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/gas/GasProvider.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.gas; 2 | 3 | import java.math.BigInteger; 4 | 5 | public interface GasProvider { 6 | 7 | BigInteger getGasPrice(); 8 | 9 | BigInteger getGasLimit(); 10 | } 11 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/response/Callback.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.response; 2 | 3 | import com.platon.protocol.core.methods.response.TransactionReceipt; 4 | 5 | /** 6 | * Transaction receipt processor callback. 7 | */ 8 | public interface Callback { 9 | void accept(TransactionReceipt transactionReceipt); 10 | 11 | void exception(Exception exception); 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/tx/response/NoOpProcessor.java: -------------------------------------------------------------------------------- 1 | package com.platon.tx.response; 2 | 3 | import com.platon.protocol.Web3j; 4 | import com.platon.protocol.core.methods.response.TransactionReceipt; 5 | import com.platon.protocol.exceptions.TransactionException; 6 | 7 | import java.io.IOException; 8 | 9 | /** 10 | * Return an {@link EmptyTransactionReceipt} receipt back to callers containing only the 11 | * transaction hash. 12 | */ 13 | public class NoOpProcessor extends TransactionReceiptProcessor { 14 | 15 | public NoOpProcessor(Web3j web3j) { 16 | super(web3j); 17 | } 18 | 19 | @Override 20 | public TransactionReceipt waitForTransactionReceipt(String transactionHash) 21 | throws IOException, TransactionException { 22 | return new EmptyTransactionReceipt(transactionHash); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/com/platon/utils/AsciiUtil.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | public class AsciiUtil { 4 | public static int toAscii(String character){ 5 | byte[] bytestr = character.getBytes(); 6 | int sum = 0; 7 | for(int i=0;i /dev/null 26 | echo "Complete" 27 | 28 | cd - 29 | done 30 | -------------------------------------------------------------------------------- /core/src/test/java/com/platon/TempFileProvider.java: -------------------------------------------------------------------------------- 1 | package com.platon; 2 | 3 | import org.junit.After; 4 | import org.junit.Before; 5 | 6 | import java.io.File; 7 | import java.nio.file.Files; 8 | 9 | /** 10 | * Base class for tests wishing to use temporary file locations. 11 | */ 12 | public class TempFileProvider { 13 | private File tempDir; 14 | protected String tempDirPath; 15 | 16 | @Before 17 | public void setUp() throws Exception { 18 | tempDir = Files.createTempDirectory( 19 | TempFileProvider.class.getSimpleName()).toFile(); 20 | tempDirPath = tempDir.getPath(); 21 | } 22 | 23 | @After 24 | public void tearDown() throws Exception { 25 | for (File file:tempDir.listFiles()) { 26 | file.delete(); 27 | } 28 | tempDir.delete(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/java/com/platon/platon/contracts/bean/Node.java: -------------------------------------------------------------------------------- 1 | package com.platon.platon.contracts.bean; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Node { 7 | // 节点ID 8 | private String id; 9 | // 节点ID 10 | private String name; 11 | // 节点IP 12 | private String ip; 13 | // 节点端口 14 | private String p2pPort; 15 | 16 | public Node(String id, String name, String ip, String p2pPort) { 17 | this.id = id; 18 | this.name = name; 19 | this.ip = ip; 20 | this.p2pPort = p2pPort; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/src/test/java/com/platon/protocol/core/filters/BlockFilterTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.protocol.core.filters; 2 | 3 | import com.platon.protocol.core.methods.response.PlatonLog; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.mockito.runners.MockitoJUnitRunner; 7 | 8 | @RunWith(MockitoJUnitRunner.class) 9 | public class BlockFilterTest extends FilterTester { 10 | 11 | @Test 12 | public void testBlockFilter() throws Exception { 13 | 14 | PlatonLog ethLog = objectMapper.readValue( 15 | "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":[" 16 | + "\"0x31c2342b1e0b8ffda1507fbffddf213c4b3c1e819ff6a84b943faabb0ebf2403\"," 17 | + "\"0xccc0d2e07c1febcaca0c3341c4e1268204b06fefa4bb0c8c0d693d8e581c82da\"" 18 | + "]}", 19 | PlatonLog.class); 20 | 21 | runTest(ethLog, web3j.platonBlockHashObservable()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/test/java/com/platon/utils/AsyncTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.concurrent.ExecutionException; 6 | 7 | import static org.hamcrest.core.Is.is; 8 | import static org.junit.Assert.assertThat; 9 | 10 | public class AsyncTest { 11 | 12 | @Test 13 | public void testRun() throws Exception { 14 | assertThat(Async.run(() -> "").get(), is("")); 15 | } 16 | 17 | @Test(expected = ExecutionException.class) 18 | public void testRunException() throws Exception { 19 | Async.run(() -> { 20 | throw new RuntimeException(""); 21 | }).get(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/test/java/com/platon/utils/VersionTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import org.hamcrest.core.Is; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | import static org.hamcrest.core.Is.is; 9 | import static org.junit.Assert.assertThat; 10 | 11 | public class VersionTest { 12 | 13 | @Test 14 | public void testGetVersion() throws IOException { 15 | assertThat(Version.getVersion(), Is.is(Version.DEFAULT)); 16 | } 17 | 18 | @Test 19 | public void testGetTimestamp() throws IOException { 20 | assertThat(Version.getTimestamp(), is("2017-01-31 01:21:09.843 UTC")); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /core/src/test/resources/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | WORKDIR /root 3 | RUN set -ex \ 4 | && apt-get update \ 5 | && apt-get -y install software-properties-common \ 6 | && add-apt-repository ppa:platonnetwork/platon 7 | ADD config . 8 | RUN set -ex \ 9 | && apt-get update \ 10 | && apt-get -y install platon \ 11 | && platon --datadir ./data init platon.json 12 | ENTRYPOINT ["/usr/bin/platon","--identity","platon","--datadir","./data","--port","16789","--rpcaddr","0.0.0.0","--rpcport","6789","--rpcapi","db,eth,net,web3,admin,personal","--rpc","--nodiscover","--nodekey","./data/platon/nodekey"] 13 | -------------------------------------------------------------------------------- /core/src/test/resources/docker/config/data/keystore/UTC--2019-04-17T07-48-34.556577331Z--f462b59140246f648f3573b4a38e861161304e79: -------------------------------------------------------------------------------- 1 | {"address":"f462b59140246f648f3573b4a38e861161304e79","crypto":{"cipher":"aes-128-ctr","ciphertext":"39ffcdfb9ce4f2d930108ba35516248b10ad161bd2d5bfdb837e310842951df8","cipherparams":{"iv":"4c6cb7bcebaff373f848533bbac04833"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"2730402c9846848b13106626b9ddd6e559ab481c04532cdaa0ccd9fa301b1da5"},"mac":"74efd428067f079ef5bfd1e78088c01812c608d643e85ff97abdcf583bb810b3"},"id":"9148dfc5-0ecb-4cad-8e21-10cfa6afc165","version":3} 2 | -------------------------------------------------------------------------------- /core/src/test/resources/docker/config/data/platon/nodekey: -------------------------------------------------------------------------------- 1 | fa323e27536785564ee98fa8f4192fc2eaca750cfac0c9993aafa2e391fb3012 2 | -------------------------------------------------------------------------------- /core/src/test/resources/platon/contracts/evm/SampleRecipientSuccess.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one assumes successful receival of approval. 6 | */ 7 | contract SampleRecipientSuccess { 8 | /* A Generic receiving function for contracts that accept tokens */ 9 | address public from; 10 | uint256 public value; 11 | address public tokenContract; 12 | bytes public extraData; 13 | 14 | event ReceivedApproval(uint256 _value); 15 | 16 | function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) { 17 | from = _from; 18 | value = _value; 19 | tokenContract = _tokenContract; 20 | extraData = _extraData; 21 | ReceivedApproval(_value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/test/resources/platon/contracts/evm/SampleRecipientThrow.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | /* 4 | This is an example contract that helps test the functionality of the approveAndCall() functionality of HumanStandardToken.sol. 5 | This one will throw and thus needs to propagate the error up. 6 | */ 7 | contract SampleRecipientThrow { 8 | function () { 9 | throw; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /core/src/test/resources/platon/contracts/wasm/TweetAccount.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/core/src/test/resources/platon/contracts/wasm/TweetAccount.wasm -------------------------------------------------------------------------------- /core/src/test/resources/wallet/admin-docker.json: -------------------------------------------------------------------------------- 1 | {"address":"f462b59140246f648f3573b4a38e861161304e79","crypto":{"cipher":"aes-128-ctr","ciphertext":"39ffcdfb9ce4f2d930108ba35516248b10ad161bd2d5bfdb837e310842951df8","cipherparams":{"iv":"4c6cb7bcebaff373f848533bbac04833"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"2730402c9846848b13106626b9ddd6e559ab481c04532cdaa0ccd9fa301b1da5"},"mac":"74efd428067f079ef5bfd1e78088c01812c608d643e85ff97abdcf583bb810b3"},"id":"9148dfc5-0ecb-4cad-8e21-10cfa6afc165","version":3} 2 | -------------------------------------------------------------------------------- /core/src/test/resources/wallet/admin-test.json: -------------------------------------------------------------------------------- 1 | {"address":"493301712671ada506ba6ca7891f436d29185821","crypto":{"cipher":"aes-128-ctr","ciphertext":"a4def93021c1d5d2516e6f4deb2504341045569b8e55841b3c92c26382cefe3f","cipherparams":{"iv":"e5cd5c324e8a754ace63864cd3b6ce3a"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"19eaa76bf2238d30ba1e83c0f63f2ccc612c4673cdde994b9d1342aa343c5a00"},"mac":"dd1ce25074f67f93d4f3ce7b315e9408fd137b0f189a74f97a15c1c19390e09a"},"id":"b008bc00-72bb-48e7-b310-4c7cc9d5ca1b","version":3} -------------------------------------------------------------------------------- /core/src/test/resources/wallet/admin.json.bak: -------------------------------------------------------------------------------- 1 | {"address":"493301712671ada506ba6ca78f436d29185821","crypto":{"cipher":"aes-128-ctr","ciphertext":"a4def93021c1d5d2516e6f4deb2504341045569b8e55841b3c92c26382cefe3f","cipherparams":{"iv":"e5cd5c324e8a754ace63864cd3b6ce3a"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"19eaa76bf2238d30ba1e83c0f63f2ccc612c4673cdde994b9d1342aa343c5a00"},"mac":"dd1ce25074f67f93d4f3ce7b315e9408fd137b0f189a74f97a15c1c19390e09a"},"id":"b008bc00-72bb-48e7-b310-4c7cc9d5ca1b","version":3} -------------------------------------------------------------------------------- /core/src/test/resources/wallet/employee.json: -------------------------------------------------------------------------------- 1 | {"address":"a495ca5aad3e8d3e14255072e713245154fdbf00","id":"61a2596a-321e-42fb-853d-4f9ae1baf8ea","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"301316e4650fa72db4f3265ddb28efff20785dd3846da16f7896d724bbe738bc","cipherparams":{"iv":"72503f15a2b0e2d5ac2e9fa29864a424"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":4096,"p":6,"r":8,"salt":"0e3e24d22ac0ff6840d7ec0e0e94300f2b9261a7fb63a7b2d8b0ccd19583b835"},"mac":"457d5793639efaef82379c707258edb5f59558bf5df541aea7cc11b643cc3018"}} -------------------------------------------------------------------------------- /core/src/test/resources/wallet/financer.json: -------------------------------------------------------------------------------- 1 | {"address":"a9e7ddbc25fb75bed0d7967c9722a573b4bbdb5c","id":"011d5e93-bdb3-47dd-910f-ba875f84b83b","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"805b5cb1c459257f46361b10619b902793aba604808b9e524acea516f8013dc2","cipherparams":{"iv":"f94176c116076ff6e59c3be367c27523"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":4096,"p":6,"r":8,"salt":"39d1b7d541693a32d6d9faec0a78d0d736bc0477f22aff056d014acc4a01bd38"},"mac":"03da021798f7767a6d4e77f0c25545c70f25daf9badb3a7e963f4ea31d0a2f4e"}} -------------------------------------------------------------------------------- /core/src/test/resources/wallet/owner.json: -------------------------------------------------------------------------------- 1 | {"address":"f8f3978c14f585c920718c27853e2380d6f5db36","id":"79a799a1-4b80-403a-8ccb-2a3a9230b329","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"a9b3e8e652b02bb609f80a56253b1d7641a34b0b7b8ad3025af61feee9b15e12","cipherparams":{"iv":"e19d6a0cfc21e4ce2a3288a776791d10"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"05db233c5af0e2ee5b66bf024b2f40aa11fcb142a8db54f21b1d3f67d2026705"},"mac":"7777213a18048f2a62f8e153cb14282c5edaa1b270505641919a1ae77572609c"}} -------------------------------------------------------------------------------- /core/src/test/resources/wallet/personnel.json: -------------------------------------------------------------------------------- 1 | {"address":"85fad5acd0421555453aeb0948c1229ab1fde4fb","id":"990c80ef-7b0b-40a2-816e-d64081921206","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"6548796a08b38ef0292dc09f6740b8531bb997263f43c488c3079c81be1f14cd","cipherparams":{"iv":"402828446ea075486dab4c68932f1001"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":4096,"p":6,"r":8,"salt":"8119331911efeb9b39fc8abeb78048b669a9601da0cd7a51369143b74191b070"},"mac":"77a87e0d1b1f7dd7ce5b5fe08d9c81a5ea6d327b5b82262a224f6fa9b8fa4844"}} -------------------------------------------------------------------------------- /core/src/test/resources/web3j-version.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 31 12:21:09 AEDT 2017 2 | version=none 3 | timestamp=2017-01-31 01\:21\:09.843 UTC 4 | -------------------------------------------------------------------------------- /crypto/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':solidity-rlp'), 3 | project(':utils'), 4 | "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion", 5 | "org.slf4j:slf4j-api:$slf4jVersion" 6 | } 7 | 8 | configurations { 9 | testArtifacts.extendsFrom testRuntime 10 | } 11 | 12 | artifacts { 13 | testArtifacts testJar 14 | } -------------------------------------------------------------------------------- /crypto/src/main/java/com/platon/crypto/Address.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | public class Address { 4 | private String mainnet; 5 | private String testnet; 6 | public Address(){}; 7 | public Address(String mainnetAddress, String testnetAddress) { 8 | this.mainnet=mainnetAddress; 9 | this.testnet=testnetAddress; 10 | } 11 | 12 | public String getMainnet() { 13 | return mainnet; 14 | } 15 | 16 | public void setMainnet(String mainnet) { 17 | this.mainnet = mainnet; 18 | } 19 | 20 | public String getTestnet() { 21 | return testnet; 22 | } 23 | 24 | public void setTestnet(String testnet) { 25 | this.testnet = testnet; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crypto/src/main/java/com/platon/crypto/Bip39Wallet.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | /** 4 | * Data class encapsulating a BIP-39 compatible Ethereum wallet. 5 | */ 6 | public class Bip39Wallet { 7 | 8 | /** 9 | * Path to wallet file. 10 | */ 11 | private final String filename; 12 | 13 | /** 14 | * Generated BIP-39 mnemonic for the wallet. 15 | */ 16 | private final String mnemonic; 17 | 18 | public Bip39Wallet(String filename, String mnemonic) { 19 | this.filename = filename; 20 | this.mnemonic = mnemonic; 21 | } 22 | 23 | public String getFilename() { 24 | return filename; 25 | } 26 | 27 | public String getMnemonic() { 28 | return mnemonic; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /crypto/src/main/java/com/platon/crypto/CipherException.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | /** 4 | * Cipher exception wrapper. 5 | */ 6 | public class CipherException extends Exception { 7 | 8 | public CipherException(String message) { 9 | super(message); 10 | } 11 | 12 | public CipherException(Throwable cause) { 13 | super(cause); 14 | } 15 | 16 | public CipherException(String message, Throwable cause) { 17 | super(message, cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crypto/src/main/java/com/platon/crypto/WalletFileInterface.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | public interface WalletFileInterface { 4 | public String getAddress(); 5 | 6 | public void setAddress(String address); 7 | 8 | public WalletFile.Crypto getCrypto(); 9 | 10 | //@JsonSetter("crypto") 11 | public void setCrypto(WalletFile.Crypto crypto); 12 | 13 | /*@JsonSetter("Crypto") // older wallet files may have this attribute name 14 | public void setCryptoV1(WalletFile.Crypto crypto);*/ 15 | 16 | public String getId() ; 17 | 18 | public void setId(String id); 19 | public int getVersion(); 20 | 21 | public void setVersion(int version); 22 | } 23 | -------------------------------------------------------------------------------- /crypto/src/test/java/com/platon/crypto/ContractUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | import org.junit.Test; 4 | 5 | import java.math.BigInteger; 6 | 7 | import static com.platon.crypto.ContractUtils.generateContractAddress; 8 | import static org.hamcrest.CoreMatchers.is; 9 | import static org.junit.Assert.assertThat; 10 | 11 | public class ContractUtilsTest { 12 | 13 | @Test 14 | public void testCreateContractAddress() { 15 | String address = "0x19e03255f667bdfd50a32722df860b1eeaf4d635"; 16 | 17 | assertThat(generateContractAddress(address, BigInteger.valueOf(209)), 18 | is("0xe41e694d8fa4337b7bffc7483d3609ae1ea068d5")); 19 | 20 | assertThat(generateContractAddress(address, BigInteger.valueOf(257)), 21 | is("0x59c21d36fbe415218e834683cb6616f2bc971ca9")); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crypto/src/test/java/com/platon/crypto/CredentialsTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.core.Is.is; 6 | import static org.junit.Assert.assertEquals; 7 | import static org.junit.Assert.assertThat; 8 | 9 | public class CredentialsTest { 10 | @Test 11 | public void testCredentialsFromString() { 12 | Credentials credentials = Credentials.create(SampleKeys.KEY_PAIR); 13 | verify(credentials); 14 | } 15 | 16 | @Test 17 | public void testCredentialsFromECKeyPair() { 18 | Credentials credentials = Credentials.create( 19 | SampleKeys.PRIVATE_KEY_STRING, SampleKeys.PUBLIC_KEY_STRING); 20 | verify(credentials); 21 | } 22 | 23 | private void verify(Credentials credentials) { 24 | assertEquals(credentials.getAddress(),SampleKeys.BECH32_ADDRESS); 25 | assertThat(credentials.getEcKeyPair(), is(SampleKeys.KEY_PAIR)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crypto/src/test/java/com/platon/crypto/SecureRandomUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.crypto; 2 | 3 | import org.junit.Test; 4 | 5 | import static com.platon.crypto.SecureRandomUtils.isAndroidRuntime; 6 | import static com.platon.crypto.SecureRandomUtils.secureRandom; 7 | import static org.junit.Assert.assertFalse; 8 | 9 | public class SecureRandomUtilsTest { 10 | 11 | @Test 12 | public void testSecureRandom() { 13 | secureRandom().nextInt(); 14 | } 15 | 16 | @Test 17 | public void testIsNotAndroidRuntime() { 18 | assertFalse(isAndroidRuntime()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crypto/src/test/resources/eth.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "id": "a1741eec-3252-4e0e-b0cf-d506631be3e3", 4 | "crypto": { 5 | "ciphertext": "c73370daf300641796e4d5faff7f16a0aeaf1cad97ef1a4b3ac2eaa3e92fc0de", 6 | "cipherparams": { 7 | "iv": "6b7c2ea412fe341a768b105a84c54aba" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "r": 8, 12 | "p": 1, 13 | "n": 16384, 14 | "dklen": 32, 15 | "salt": "c5b8ffbca4a3f107f55fbbe277ad7a24cb978514d6b45f257f026e78f5f560d9" 16 | }, 17 | "mac": "091a8f80f552e7284110c9b6b3dba324d49a434890bad427dcb2bcc96a964216", 18 | "cipher": "aes-128-ctr" 19 | }, 20 | "address": "0x5accfe6cf8e85b01d924ad096e95276c4b048003" 21 | } -------------------------------------------------------------------------------- /crypto/src/test/resources/keyfiles/UTC--2016-11-03T05-55-06.340672473Z--ef678007d18427e6022059dbc264f27507cd1ffc: -------------------------------------------------------------------------------- 1 | {"address":{"mainnet":"lat1aancqp73ssn7vq3qt8duye8jw5ru68lueylpyy","testnet":"lax1aancqp73ssn7vq3qt8duye8jw5ru68lukpdw2t"},"crypto":{"cipher":"aes-128-ctr","ciphertext":"e1a92bbba0920bdd234b792eac5c662511cffc8714e83e668ddae0507abe91e3","cipherparams":{"iv":"683392b3259b5dcc48516b22b0835972"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f89eaf8557a983755043ed490cbaf2c075f6ee5e53bc354c4f9d485f9d6d3b1b"},"mac":"f8fe5929187d70ee1e659e6d2e669e778e8792012ecfc1a7b1bb0ee8d4a1e454"},"id":"6ded30ab-7bdc-47da-b7ff-ccfdb2e62f56","version":3} -------------------------------------------------------------------------------- /crypto/src/test/resources/keyfiles/UTC--2016-11-03T07-47-45.988Z--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818: -------------------------------------------------------------------------------- 1 | {"version":3,"id":"cb3dff1c-f9f8-42a1-9bf7-a5b9838697b9","address":{"mainnet":"lat1f7wp58h65lvphgw2hurl9sa943w0f7qc7gn7tq","testnet":"lax1f7wp58h65lvphgw2hurl9sa943w0f7qc3dp390"},"Crypto":{"ciphertext":"ac2973d1fff7a826fa19cb548fec4d341fbf16f2cf5031d4a902312a0416a78a","cipherparams":{"iv":"86c8eb32a78eb5a6eaa7de29f92318f4"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"37a6ce728936771a8337397449525bc6879196fb7b57070ddb0d38d3a94f4642","n":1024,"r":8,"p":1},"mac":"59b6206df4a55abf40357e56ce96a6637600579872243e163bbbbd9c39975019"}} -------------------------------------------------------------------------------- /crypto/src/test/resources/keyfiles/old-format-wallet--4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818.json: -------------------------------------------------------------------------------- 1 | {"version":3,"id":"cb3dff1c-f9f8-42a1-9bf7-a5b9838697b9","address":"4f9c1a1efaa7d81ba1cabf07f2c3a5ac5cf4f818","Crypto":{"ciphertext":"ac2973d1fff7a826fa19cb548fec4d341fbf16f2cf5031d4a902312a0416a78a","cipherparams":{"iv":"86c8eb32a78eb5a6eaa7de29f92318f4"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"37a6ce728936771a8337397449525bc6879196fb7b57070ddb0d38d3a94f4642","n":1024,"r":8,"p":1},"mac":"59b6206df4a55abf40357e56ce96a6637600579872243e163bbbbd9c39975019"}} 2 | 3 | // lax1f7wp58h65lvphgw2hurl9sa943w0f7qc3dp390 4 | // lat1f7wp58h65lvphgw2hurl9sa943w0f7qc7gn7tq -------------------------------------------------------------------------------- /crypto/src/test/resources/keyfiles/old-format-wallet--ef678007d18427e6022059dbc264f27507cd1ffc.json: -------------------------------------------------------------------------------- 1 | {"address":"ef678007d18427e6022059dbc264f27507cd1ffc","crypto":{"cipher":"aes-128-ctr","ciphertext":"e1a92bbba0920bdd234b792eac5c662511cffc8714e83e668ddae0507abe91e3","cipherparams":{"iv":"683392b3259b5dcc48516b22b0835972"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f89eaf8557a983755043ed490cbaf2c075f6ee5e53bc354c4f9d485f9d6d3b1b"},"mac":"f8fe5929187d70ee1e659e6d2e669e778e8792012ecfc1a7b1bb0ee8d4a1e454"},"id":"6ded30ab-7bdc-47da-b7ff-ccfdb2e62f56","version":3} -------------------------------------------------------------------------------- /crypto/src/test/resources/main_test.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "id": "a1741eec-3252-4e0e-b0cf-d506631be3e3", 4 | "crypto": { 5 | "ciphertext": "c73370daf300641796e4d5faff7f16a0aeaf1cad97ef1a4b3ac2eaa3e92fc0de", 6 | "cipherparams": { 7 | "iv": "6b7c2ea412fe341a768b105a84c54aba" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "r": 8, 12 | "p": 1, 13 | "n": 16384, 14 | "dklen": 32, 15 | "salt": "c5b8ffbca4a3f107f55fbbe277ad7a24cb978514d6b45f257f026e78f5f560d9" 16 | }, 17 | "mac": "091a8f80f552e7284110c9b6b3dba324d49a434890bad427dcb2bcc96a964216", 18 | "cipher": "aes-128-ctr" 19 | }, 20 | "address": { 21 | "mainnet": "atp1ttx0um8capdsrkfy45yka9f8d39sfqqrklwg98", 22 | "testnet": "atx1ttx0um8capdsrkfy45yka9f8d39sfqqruejzkd" 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /crypto/src/test/resources/new.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "id": "a1741eec-3252-4e0e-b0cf-d506631be3e3", 4 | "crypto": { 5 | "ciphertext": "c73370daf300641796e4d5faff7f16a0aeaf1cad97ef1a4b3ac2eaa3e92fc0de", 6 | "cipherparams": { 7 | "iv": "6b7c2ea412fe341a768b105a84c54aba" 8 | }, 9 | "kdf": "scrypt", 10 | "kdfparams": { 11 | "r": 8, 12 | "p": 1, 13 | "n": 16384, 14 | "dklen": 32, 15 | "salt": "c5b8ffbca4a3f107f55fbbe277ad7a24cb978514d6b45f257f026e78f5f560d9" 16 | }, 17 | "mac": "091a8f80f552e7284110c9b6b3dba324d49a434890bad427dcb2bcc96a964216", 18 | "cipher": "aes-128-ctr" 19 | }, 20 | "address": "atp1ttx0um8capdsrkfy45yka9f8d39sfqqrklwg98" 21 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | group=com.platon.sdk 2 | version=1.3.0.4 3 | mavenReleases=https://sdk.platon.network/nexus/content/repositories/releases/ 4 | mavenSnapshots=https://sdk.platon.network/nexus/content/repositories/snapshots/ 5 | systemProp.sonar.host.url=http://192.168.16.173:9000 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jul 15 15:59:02 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip 7 | -------------------------------------------------------------------------------- /integration-tests/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | description 'web3j integration tests' 3 | 4 | dependencies { 5 | compile project(':core') 6 | testCompile "ch.qos.logback:logback-core:$logbackVersion", 7 | "ch.qos.logback:logback-classic:$logbackVersion", 8 | "com.carrotsearch:junit-benchmarks:$junitBenchmarkVersion" 9 | } 10 | 11 | // we don't want integration tests to run by default 12 | test.enabled = project.hasProperty('integration-tests') ? 13 | project.getProperty('integration-tests') : false 14 | -------------------------------------------------------------------------------- /integration-tests/scripts/generateWrappers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | targets=" 4 | arrays/build/Arrays 5 | contracts/build/HumanStandardToken 6 | fibonacci/build/Fibonacci 7 | greeter/build/Greeter 8 | shipit/build/ShipIt 9 | simplestorage/build/SimpleStorage 10 | " 11 | 12 | for target in ${targets}; do 13 | 14 | web3j solidity generate \ 15 | ../../codegen/src/test/resources/solidity/${target}.bin \ 16 | ../../codegen/src/test/resources/solidity/${target}.abi \ 17 | -o /Users/Conor/code/java/web3j/integration-tests/src/test/java \ 18 | -p org.web3j.generated 19 | 20 | done -------------------------------------------------------------------------------- /integration-tests/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Tue Nov 22 16:04:04 CST 2022 8 | -------------------------------------------------------------------------------- /logos/web3j-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/logos/web3j-black.png -------------------------------------------------------------------------------- /logos/web3j-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/logos/web3j-orange.png -------------------------------------------------------------------------------- /logos/web3j-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PlatONnetwork/client-sdk-java/6fc336b86474a6cab8973c97f93469eb36096fb2/logos/web3j-small.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'platon-sdk-java' 2 | 3 | include 'integration-tests' 4 | include 'console' 5 | include 'codegen' 6 | include 'core' 7 | include 'solidity-abi' 8 | include 'wasm-abi' 9 | include 'crypto' 10 | include 'solidity-rlp' 11 | include 'wasm-rlp' 12 | include 'utils' 13 | include 'tuples' 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /solidity-abi/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':solidity-rlp') 3 | } 4 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/EventValues.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity; 2 | 3 | import com.platon.abi.solidity.datatypes.Type; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Persisted solidity event parameters. 9 | */ 10 | public class EventValues { 11 | private final List indexedValues; 12 | private final List nonIndexedValues; 13 | 14 | public EventValues(List indexedValues, List nonIndexedValues) { 15 | this.indexedValues = indexedValues; 16 | this.nonIndexedValues = nonIndexedValues; 17 | } 18 | 19 | public List getIndexedValues() { 20 | return indexedValues; 21 | } 22 | 23 | public List getNonIndexedValues() { 24 | return nonIndexedValues; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/TypeMappingException.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity; 2 | 3 | public class TypeMappingException extends RuntimeException { 4 | 5 | public TypeMappingException(Exception e) { 6 | super(e); 7 | } 8 | 9 | public TypeMappingException(String message) { 10 | super(message); 11 | } 12 | 13 | public TypeMappingException(String message, Exception e) { 14 | super(message, e); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/Bytes.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | /** 4 | * Statically allocated sequence of bytes. 5 | */ 6 | public class Bytes extends BytesType { 7 | 8 | public static final String TYPE_NAME = "bytes"; 9 | 10 | protected Bytes(int byteSize, byte[] value) { 11 | super(value, TYPE_NAME + value.length); 12 | if (!isValid(byteSize, value)) { 13 | throw new UnsupportedOperationException( 14 | "Input byte array must be in range 0 < M <= 32 and length must match type"); 15 | } 16 | } 17 | 18 | private boolean isValid(int byteSize, byte[] value) { 19 | int length = value.length; 20 | return length > 0 && length <= 32 && length == byteSize; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/DynamicBytes.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | /** 4 | * Dynamically allocated sequence of bytes. 5 | */ 6 | public class DynamicBytes extends BytesType { 7 | 8 | public static final String TYPE_NAME = "bytes"; 9 | public static final DynamicBytes DEFAULT = new DynamicBytes(new byte[]{}); 10 | 11 | public DynamicBytes(byte[] value) { 12 | super(value, TYPE_NAME); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/Fixed.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * Signed fixed type. 7 | */ 8 | public class Fixed extends FixedPointType { 9 | 10 | public static final String TYPE_NAME = "fixed"; 11 | public static final Fixed DEFAULT = new Fixed(BigInteger.ZERO); 12 | 13 | protected Fixed(int mBitSize, int nBitSize, BigInteger value) { 14 | super(TYPE_NAME , mBitSize, nBitSize, value); 15 | } 16 | 17 | public Fixed(BigInteger value) { 18 | this(DEFAULT_BIT_LENGTH, DEFAULT_BIT_LENGTH, value); 19 | } 20 | 21 | public Fixed(BigInteger m, BigInteger n) { 22 | this(convert(m, n)); 23 | } 24 | 25 | protected Fixed(int mBitSize, int nBitSize, BigInteger m, BigInteger n) { 26 | this(convert(mBitSize, nBitSize, m, n)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/Int.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | /** 6 | * Integer type. 7 | */ 8 | public class Int extends IntType { 9 | 10 | public static final String TYPE_NAME = "int"; 11 | public static final Int DEFAULT = new Int(BigInteger.ZERO); 12 | 13 | public Int(BigInteger value) { 14 | // "int" values should be declared as int256 in computing function selectors 15 | this(MAX_BIT_LENGTH, value); 16 | } 17 | 18 | protected Int(int bitSize, BigInteger value) { 19 | super(TYPE_NAME, bitSize, value); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/Type.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | /** ABI Types. */ 4 | public interface Type { 5 | int MAX_BIT_LENGTH = 256; 6 | int MAX_BYTE_LENGTH = MAX_BIT_LENGTH / 8; 7 | 8 | default int bytes32PaddedLength() { 9 | return MAX_BYTE_LENGTH; 10 | } 11 | 12 | T getValue(); 13 | 14 | String getTypeAsString(); 15 | } 16 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes1.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes10.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes11.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes12.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes13.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes14.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes15.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes16.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes17.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes18.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes19.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes2.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes20.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes21.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes22.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes23.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes24.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes25.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes26.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes27.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes28.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes29.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes3.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes30.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes31.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes32.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes4.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes5.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes6.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes7.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes8.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Bytes9.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Bytes; 4 | 5 | /** 6 | * Auto generated code. 7 | *

Do not modifiy! 8 | *

Please use org.web3j.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 | -------------------------------------------------------------------------------- /solidity-abi/src/main/java/com/platon/abi/solidity/datatypes/generated/Int104.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes.generated; 2 | 3 | import com.platon.abi.solidity.datatypes.Int; 4 | 5 | import java.math.BigInteger; 6 | 7 | /** 8 | * Auto generated code. 9 | *

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

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

Do not modifiy! 10 | *

Please use org.web3j.codegen.AbiTypesGenerator in the 11 | * codegen module to update. 12 | */ 13 | public class Uint96 extends Uint { 14 | public static final Uint96 DEFAULT = new Uint96(BigInteger.ZERO); 15 | 16 | public Uint96(BigInteger value) { 17 | super(96, value); 18 | } 19 | 20 | public Uint96(long value) { 21 | this(BigInteger.valueOf(value)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /solidity-abi/src/test/java/com/platon/abi/solidity/EventEncoderTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.CoreMatchers.is; 6 | import static org.hamcrest.MatcherAssert.assertThat; 7 | 8 | public class EventEncoderTest { 9 | 10 | @Test 11 | public void testBuildEventSignature() { 12 | assertThat(EventEncoder.buildEventSignature("Deposit(address,hash256,uint256)"), 13 | is("0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20")); 14 | 15 | assertThat(EventEncoder.buildEventSignature("Notify(uint256,uint256)"), 16 | is("0x71e71a8458267085d5ab16980fd5f114d2d37f232479c245d523ce8d23ca40ed")); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /solidity-abi/src/test/java/com/platon/abi/solidity/datatypes/AddressTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.core.Is.is; 6 | import static org.junit.Assert.assertThat; 7 | 8 | public class AddressTest { 9 | 10 | @Test 11 | public void testToString() { 12 | assertThat(new Address("lat1qqzjkzpnpczawv0r3jzkcyzr9z8hm96yzdxuyk").toString(), 13 | is("lat1qqzjkzpnpczawv0r3jzkcyzr9z8hm96yzdxuyk")); 14 | assertThat(new Address("lat1qqzjkzpnpczawv0r3jzkcyzr9z8hm96yzdxuyk").toString(), 15 | is("lat1qqzjkzpnpczawv0r3jzkcyzr9z8hm96yzdxuyk")); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /solidity-abi/src/test/java/com/platon/abi/solidity/datatypes/Utf8StringTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.solidity.datatypes; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.core.Is.is; 6 | import static org.junit.Assert.assertThat; 7 | 8 | public class Utf8StringTest { 9 | 10 | @Test 11 | public void testToString() { 12 | assertThat(new Utf8String("").toString(), is("")); 13 | assertThat(new Utf8String("string").toString(), is("string")); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /solidity-rlp/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':utils') 3 | compileOnly "org.projectlombok:lombok:1.18.10" 4 | } 5 | -------------------------------------------------------------------------------- /solidity-rlp/src/main/java/com/platon/rlp/solidity/RlpList.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.solidity; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | /** 7 | * RLP list type. 8 | */ 9 | public class RlpList implements RlpType { 10 | private final List values; 11 | 12 | public RlpList(RlpType... values) { 13 | this.values = Arrays.asList(values); 14 | } 15 | 16 | public RlpList(List values) { 17 | this.values = values; 18 | } 19 | 20 | public List getValues() { 21 | return values; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /solidity-rlp/src/main/java/com/platon/rlp/solidity/RlpType.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.solidity; 2 | 3 | /** 4 | * Base RLP type. 5 | */ 6 | public interface RlpType { 7 | } 8 | -------------------------------------------------------------------------------- /tuples/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | description 'Simple Java tuples library' 3 | -------------------------------------------------------------------------------- /tuples/src/main/java/com/platon/tuples/EmptyTuple.java: -------------------------------------------------------------------------------- 1 | package com.platon.tuples; 2 | 3 | /** 4 | * Empty Tuple type. 5 | */ 6 | public class EmptyTuple implements Tuple { 7 | 8 | @Override 9 | public int getSize() { 10 | return 0; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tuples/src/main/java/com/platon/tuples/Tuple.java: -------------------------------------------------------------------------------- 1 | package com.platon.tuples; 2 | 3 | /** 4 | * Tuple abstraction. 5 | */ 6 | public interface Tuple { 7 | 8 | int getSize(); 9 | } 10 | -------------------------------------------------------------------------------- /utils/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile "org.bouncycastle:bcprov-jdk15on:$bouncycastleVersion" 3 | } 4 | -------------------------------------------------------------------------------- /utils/src/main/java/com/platon/exceptions/MessageDecodingException.java: -------------------------------------------------------------------------------- 1 | package com.platon.exceptions; 2 | 3 | /** 4 | * Encoding exception. 5 | */ 6 | public class MessageDecodingException extends RuntimeException { 7 | public MessageDecodingException(String message) { 8 | super(message); 9 | } 10 | 11 | public MessageDecodingException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /utils/src/main/java/com/platon/exceptions/MessageEncodingException.java: -------------------------------------------------------------------------------- 1 | package com.platon.exceptions; 2 | 3 | /** 4 | * Encoding exception. 5 | */ 6 | public class MessageEncodingException extends RuntimeException { 7 | public MessageEncodingException(String message) { 8 | super(message); 9 | } 10 | 11 | public MessageEncodingException(String message, Throwable cause) { 12 | super(message, cause); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /utils/src/main/java/com/platon/utils/Assertions.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | /** 4 | * Assertion utility functions. 5 | */ 6 | public class Assertions { 7 | 8 | /** 9 | * Verify that the provided precondition holds true. 10 | * 11 | * @param assertionResult assertion value 12 | * @param errorMessage error message if precondition failure 13 | */ 14 | public static void verifyPrecondition(boolean assertionResult, String errorMessage) { 15 | if (!assertionResult) { 16 | throw new RuntimeException(errorMessage); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /utils/src/main/java/com/platon/utils/Bytes.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import java.util.Arrays; 4 | 5 | /** 6 | * Byte array utility functions. 7 | */ 8 | public class Bytes { 9 | 10 | private Bytes() {} 11 | 12 | public static byte[] trimLeadingBytes(byte[] bytes, byte b) { 13 | int offset = 0; 14 | for (; offset < bytes.length - 1; offset++) { 15 | if (bytes[offset] != b) { 16 | break; 17 | } 18 | } 19 | return Arrays.copyOfRange(bytes, offset, bytes.length); 20 | } 21 | 22 | public static byte[] trimLeadingZeroes(byte[] bytes) { 23 | return trimLeadingBytes(bytes, (byte) 0); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /utils/src/main/java/com/platon/utils/Files.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.IOException; 6 | 7 | /** 8 | * File utility functions. 9 | */ 10 | public class Files { 11 | 12 | private Files() { } 13 | 14 | public static byte[] readBytes(File file) throws IOException { 15 | byte[] bytes = new byte[(int) file.length()]; 16 | try (FileInputStream fileInputStream = new FileInputStream(file)) { 17 | fileInputStream.read(bytes); 18 | } 19 | return bytes; 20 | } 21 | 22 | public static String readString(File file) throws IOException { 23 | return new String(readBytes(file)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /utils/src/test/java/com/platon/utils/AssertionsTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import static com.platon.utils.Assertions.verifyPrecondition; 6 | 7 | public class AssertionsTest { 8 | 9 | @Test 10 | public void testVerifyPrecondition() { 11 | verifyPrecondition(true, ""); 12 | } 13 | 14 | @Test(expected = RuntimeException.class) 15 | public void testVerifyPreconditionFailure() { 16 | verifyPrecondition(false, ""); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /utils/src/test/java/com/platon/utils/BytesTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import static com.platon.utils.Bytes.trimLeadingZeroes; 6 | import static org.hamcrest.CoreMatchers.is; 7 | import static org.junit.Assert.assertThat; 8 | 9 | public class BytesTest { 10 | 11 | @Test 12 | public void testTrimLeadingZeroes() { 13 | assertThat(trimLeadingZeroes(new byte[]{}), is(new byte[]{})); 14 | assertThat(trimLeadingZeroes(new byte[]{0}), is(new byte[]{0})); 15 | assertThat(trimLeadingZeroes(new byte[]{1}), is(new byte[]{1})); 16 | assertThat(trimLeadingZeroes(new byte[]{0, 1}), is(new byte[]{1})); 17 | assertThat(trimLeadingZeroes(new byte[]{0, 0, 1}), is(new byte[]{1})); 18 | assertThat(trimLeadingZeroes(new byte[]{0, 0, 1, 0}), is(new byte[]{1, 0})); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /wasm-abi/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':wasm-rlp') 3 | } 4 | -------------------------------------------------------------------------------- /wasm-abi/src/main/java/com/platon/abi/wasm/WasmEventValues.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.wasm; 2 | 3 | import java.util.List; 4 | 5 | public class WasmEventValues { 6 | private List indexedValues; 7 | private List nonIndexedValues; 8 | 9 | public WasmEventValues(List indexedValues, List nonIndexedValues) { 10 | this.indexedValues = indexedValues; 11 | this.nonIndexedValues = nonIndexedValues; 12 | } 13 | 14 | public List getIndexedValues() { 15 | return indexedValues; 16 | } 17 | 18 | public void setIndexedValues(List indexedValues) { 19 | this.indexedValues = indexedValues; 20 | } 21 | 22 | public List getNonIndexedValues() { 23 | return nonIndexedValues; 24 | } 25 | 26 | public void setNonIndexedValues(List nonIndexedValues) { 27 | this.nonIndexedValues = nonIndexedValues; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /wasm-abi/src/main/java/com/platon/abi/wasm/WasmReturnDecoder.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.wasm; 2 | 3 | import com.platon.rlp.wasm.RLPCodec; 4 | import com.platon.utils.Numeric; 5 | 6 | import java.lang.reflect.ParameterizedType; 7 | 8 | public class WasmReturnDecoder { 9 | public static T decode(String input, Class clazz) { 10 | byte[] data = Numeric.hexStringToByteArray(input); 11 | return RLPCodec.decode(data, clazz); 12 | } 13 | 14 | @SuppressWarnings("unchecked") 15 | public static T decode(String input, Class clazz, ParameterizedType parameterizedType) { 16 | byte[] data = Numeric.hexStringToByteArray(input); 17 | return (T) RLPCodec.decodeContainer(data, parameterizedType); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /wasm-abi/src/test/java/com/platon/abi/wasm/WasmEventDecoderTest.java: -------------------------------------------------------------------------------- 1 | package com.platon.abi.wasm; 2 | 3 | import org.junit.Test; 4 | 5 | public class WasmEventDecoderTest { 6 | 7 | @Test 8 | public void encodeIntUint8List() { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /wasm-rlp/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':utils') 3 | compileOnly "org.projectlombok:lombok:1.18.10" 4 | } 5 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/ContainerType.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | public enum ContainerType { 4 | RAW, 5 | COLLECTION, 6 | MAP, 7 | PAIR 8 | } 9 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/LazyByteArray.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | import java.util.Arrays; 4 | 5 | // reduce byte array copy by lazy loading 6 | final class LazyByteArray { 7 | private byte[] data; 8 | private int offset; 9 | private int limit; 10 | 11 | static LazyByteArray EMPTY = new LazyByteArray(new byte[0]); 12 | 13 | LazyByteArray(byte[] data) { 14 | this.data = data; 15 | this.limit = data.length; 16 | } 17 | 18 | LazyByteArray(byte[] data, int offset, int limit) { 19 | this.data = data; 20 | this.offset = offset; 21 | this.limit = limit; 22 | } 23 | 24 | byte[] get() { 25 | if (offset == 0 && limit == data.length) 26 | return data; 27 | data = Arrays.copyOfRange(data, offset, limit); 28 | offset = 0; 29 | limit = data.length; 30 | return data; 31 | } 32 | 33 | int size() { 34 | return limit - offset; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLP.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ ElementType.FIELD }) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface RLP { 11 | // the order of fields in rlp list 12 | // starts from 0 and increment strictly 13 | int value() default 0; 14 | } 15 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLPDecoder.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | public interface RLPDecoder { 4 | T decode(RLPElement element); 5 | 6 | class None implements RLPDecoder { 7 | @Override 8 | public Object decode(RLPElement element) { 9 | return null; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLPDecoding.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ ElementType.FIELD, ElementType.TYPE }) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @SuppressWarnings("rawtypes") 11 | public @interface RLPDecoding { 12 | Class value() default RLPDecoder.None.class; 13 | 14 | Class as() default Void.class; 15 | } 16 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLPEncoder.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | public interface RLPEncoder { 4 | RLPElement encode(T o); 5 | 6 | class None implements RLPEncoder { 7 | @Override 8 | public RLPElement encode(Object o) { 9 | return null; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLPEncoding.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import java.util.Comparator; 8 | 9 | @Target({ java.lang.annotation.ElementType.FIELD, ElementType.TYPE }) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @SuppressWarnings("rawtypes") 12 | public @interface RLPEncoding { 13 | Class value() default RLPEncoder.None.class; 14 | 15 | Class keyOrdering() default None.class; 16 | 17 | class None implements Comparator { 18 | @Override 19 | public int compare(Object o1, Object o2) { 20 | return 0; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/RLPIgnored.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target({ElementType.FIELD}) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface RLPIgnored { 11 | } 12 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Pair.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | public class Pair { 4 | private K key; 5 | private V value; 6 | 7 | public Pair() { 8 | 9 | } 10 | 11 | public Pair(K key, V value) { 12 | this.key = key; 13 | this.value = value; 14 | } 15 | 16 | public K getKey() { 17 | return key; 18 | } 19 | 20 | public void setKey(K key) { 21 | this.key = key; 22 | } 23 | 24 | public V getValue() { 25 | return value; 26 | } 27 | 28 | public void setValue(V value) { 29 | this.value = value; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Uint128.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class Uint128 extends Uint { 6 | public Uint128(BigInteger value) { 7 | super(128, value); 8 | } 9 | 10 | public static Uint128 of(long val) { 11 | return new Uint128(BigInteger.valueOf(val)); 12 | } 13 | 14 | public static Uint128 of(BigInteger val) { 15 | return new Uint128(val); 16 | } 17 | 18 | public static Uint128 of(String val) { 19 | return new Uint128(new BigInteger(val)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Uint16.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class Uint16 extends Uint { 6 | public Uint16(BigInteger value) { 7 | super(16, value); 8 | } 9 | 10 | public static Uint16 of(long val) { 11 | return new Uint16(BigInteger.valueOf(val)); 12 | } 13 | 14 | public static Uint16 of(BigInteger val) { 15 | return new Uint16(val); 16 | } 17 | 18 | public static Uint16 of(String val) { 19 | return new Uint16(new BigInteger(val)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Uint32.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class Uint32 extends Uint { 6 | public Uint32(BigInteger value) { 7 | super(32, value); 8 | } 9 | 10 | public static Uint32 of(long val) { 11 | return new Uint32(BigInteger.valueOf(val)); 12 | } 13 | 14 | public static Uint32 of(BigInteger val) { 15 | return new Uint32(val); 16 | } 17 | 18 | public static Uint32 of(String val) { 19 | return new Uint32(new BigInteger(val)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Uint64.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class Uint64 extends Uint { 6 | public Uint64(BigInteger value) { 7 | super(64, value); 8 | } 9 | 10 | public static Uint64 of(long val) { 11 | return new Uint64(BigInteger.valueOf(val)); 12 | } 13 | 14 | public static Uint64 of(BigInteger val) { 15 | return new Uint64(val); 16 | } 17 | 18 | public static Uint64 of(String val) { 19 | return new Uint64(new BigInteger(val)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wasm-rlp/src/main/java/com/platon/rlp/wasm/datatypes/Uint8.java: -------------------------------------------------------------------------------- 1 | package com.platon.rlp.wasm.datatypes; 2 | 3 | import java.math.BigInteger; 4 | 5 | public class Uint8 extends Uint { 6 | public Uint8(BigInteger value) { 7 | super(8, value); 8 | } 9 | 10 | public static Uint8 of(long val) { 11 | return new Uint8(BigInteger.valueOf(val)); 12 | } 13 | 14 | public static Uint8 of(BigInteger val) { 15 | return new Uint8(val); 16 | } 17 | 18 | public static Uint8 of(String val) { 19 | return new Uint8(new BigInteger(val)); 20 | } 21 | 22 | } 23 | --------------------------------------------------------------------------------