Class SmartContract

  • Direct Known Subclasses:
    KIP17, KIP7

    @Deprecated
    public class SmartContract
    extends ManagedTransaction
    Deprecated.
    This class is deprecated since caver-java:1.5.0
    • Field Detail

      • GAS_LIMIT

        public static final java.math.BigInteger GAS_LIMIT
        Deprecated.
      • BIN_NOT_PROVIDED

        public static final java.lang.String BIN_NOT_PROVIDED
        Deprecated.
        See Also:
        Constant Field Values
      • FUNC_DEPLOY

        public static final java.lang.String FUNC_DEPLOY
        Deprecated.
        See Also:
        Constant Field Values
      • contractBinary

        protected java.lang.String contractBinary
        Deprecated.
      • contractAddress

        protected java.lang.String contractAddress
        Deprecated.
      • gasProvider

        protected org.web3j.tx.gas.ContractGasProvider gasProvider
        Deprecated.
      • deployedAddresses

        protected java.util.Map<java.lang.String,​java.lang.String> deployedAddresses
        Deprecated.
      • defaultBlockParameter

        protected org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter
        Deprecated.
    • Constructor Detail

      • SmartContract

        protected SmartContract​(java.lang.String contractBinary,
                                java.lang.String contractAddress,
                                Caver caver,
                                TransactionManager transactionManager,
                                org.web3j.tx.gas.ContractGasProvider gasProvider)
        Deprecated.
      • SmartContract

        protected SmartContract​(java.lang.String contractBinary,
                                java.lang.String contractAddress,
                                Caver caver,
                                KlayCredentials credentials,
                                int chainId,
                                org.web3j.tx.gas.ContractGasProvider gasProvider)
        Deprecated.
      • SmartContract

        protected SmartContract​(java.lang.String contractAddress,
                                Caver caver,
                                TransactionManager transactionManager,
                                org.web3j.tx.gas.ContractGasProvider gasProvider)
        Deprecated.
      • SmartContract

        protected SmartContract​(java.lang.String contractAddress,
                                Caver caver,
                                KlayCredentials credentials,
                                int chainId,
                                org.web3j.tx.gas.ContractGasProvider gasProvider)
        Deprecated.
    • Method Detail

      • setContractAddress

        public void setContractAddress​(java.lang.String contractAddress)
        Deprecated.
      • getContractAddress

        public java.lang.String getContractAddress()
        Deprecated.
      • getContractBinary

        public java.lang.String getContractBinary()
        Deprecated.
      • setGasProvider

        public void setGasProvider​(org.web3j.tx.gas.ContractGasProvider gasProvider)
        Deprecated.
      • setGasPrice

        public void setGasPrice​(java.math.BigInteger newPrice)
        Deprecated.
        use ContractGasProvider
        Allow gasPrice to be set.
        Parameters:
        newPrice - gas price to use for subsequent transactions
      • getGasPrice

        public java.math.BigInteger getGasPrice()
        Deprecated.
        use ContractGasProvider
        Get the current gasPrice value this contract uses when executing transactions.
        Returns:
        the gas price set on this contract
      • isValid

        public boolean isValid()
                        throws java.io.IOException
        Deprecated.
        Check that the contract deployed at the address associated with this smart contract wrapper is in fact the contract you believe it is.

        This method uses the klay_getCode method to get the contract byte code and validates it against the byte code stored in this smart contract wrapper.

        Returns:
        true if the contract is valid
        Throws:
        java.io.IOException - if unable to connect to klaytn node
      • getTransactionReceipt

        public java.util.Optional<KlayTransactionReceipt.TransactionReceipt> getTransactionReceipt()
        Deprecated.
        If this Contract instance was created at deployment, the TransactionReceipt associated with the initial creation will be provided, e.g. via a deploy method. This will not persist for Contracts instances constructed via a load method.
        Returns:
        the TransactionReceipt generated at contract deployment
      • setDefaultBlockParameter

        public void setDefaultBlockParameter​(org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter)
        Deprecated.
        Sets the default block parameter. This use useful if one wants to query historical state of a contract.
        Parameters:
        defaultBlockParameter - the default block parameter
      • executeCallSingleValueReturn

        protected <T extends org.web3j.abi.datatypes.Type> T executeCallSingleValueReturn​(org.web3j.abi.datatypes.Function function)
                                                                                   throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • executeCallSingleValueReturn

        protected <T extends org.web3j.abi.datatypes.Type,​R> R executeCallSingleValueReturn​(org.web3j.abi.datatypes.Function function,
                                                                                                  java.lang.Class<R> returnType)
                                                                                           throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • executeCallMultipleValueReturn

        protected java.util.List<org.web3j.abi.datatypes.Type> executeCallMultipleValueReturn​(org.web3j.abi.datatypes.Function function)
                                                                                       throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • executeTransaction

        protected KlayTransactionReceipt.TransactionReceipt executeTransaction​(org.web3j.abi.datatypes.Function function)
                                                                        throws org.web3j.protocol.exceptions.TransactionException
        Deprecated.
        Throws:
        org.web3j.protocol.exceptions.TransactionException
      • executeRemoteCallSingleValueReturn

        protected <T extends org.web3j.abi.datatypes.Type> org.web3j.protocol.core.RemoteCall<T> executeRemoteCallSingleValueReturn​(org.web3j.abi.datatypes.Function function)
        Deprecated.
      • executeRemoteCallSingleValueReturn

        protected <T> org.web3j.protocol.core.RemoteCall<T> executeRemoteCallSingleValueReturn​(org.web3j.abi.datatypes.Function function,
                                                                                               java.lang.Class<T> returnType)
        Deprecated.
      • executeRemoteCallMultipleValueReturn

        protected org.web3j.protocol.core.RemoteCall<java.util.List<org.web3j.abi.datatypes.Type>> executeRemoteCallMultipleValueReturn​(org.web3j.abi.datatypes.Function function)
        Deprecated.
      • executeRemoteCallTransaction

        protected org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> executeRemoteCallTransaction​(org.web3j.abi.datatypes.Function function)
        Deprecated.
      • executeRemoteCallTransaction

        protected org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> executeRemoteCallTransaction​(org.web3j.abi.datatypes.Function function,
                                                                                                                             java.math.BigInteger weiValue)
        Deprecated.
      • deploy

        protected static <T extends SmartContract> T deploy​(java.lang.Class<T> type,
                                                            Caver caver,
                                                            KlayCredentials credentials,
                                                            int chainId,
                                                            org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                            java.lang.String binary,
                                                            java.lang.String encodedConstructor,
                                                            java.math.BigInteger value)
                                                     throws java.lang.RuntimeException,
                                                            org.web3j.protocol.exceptions.TransactionException
        Deprecated.
        Throws:
        java.lang.RuntimeException
        org.web3j.protocol.exceptions.TransactionException
      • deploy

        protected static <T extends SmartContract> T deploy​(java.lang.Class<T> type,
                                                            Caver caver,
                                                            TransactionManager transactionManager,
                                                            org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                            java.lang.String binary,
                                                            java.lang.String encodedConstructor,
                                                            java.math.BigInteger value)
                                                     throws java.lang.RuntimeException,
                                                            org.web3j.protocol.exceptions.TransactionException
        Deprecated.
        Throws:
        java.lang.RuntimeException
        org.web3j.protocol.exceptions.TransactionException
      • deployRemoteCall

        public static <T extends SmartContract> org.web3j.protocol.core.RemoteCall<T> deployRemoteCall​(java.lang.Class<T> type,
                                                                                                       Caver caver,
                                                                                                       KlayCredentials credentials,
                                                                                                       int chainId,
                                                                                                       org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                                                                       java.lang.String binary,
                                                                                                       java.lang.String encodedConstructor,
                                                                                                       java.math.BigInteger value)
        Deprecated.
      • deployRemoteCall

        public static <T extends SmartContract> org.web3j.protocol.core.RemoteCall<T> deployRemoteCall​(java.lang.Class<T> type,
                                                                                                       Caver caver,
                                                                                                       KlayCredentials credentials,
                                                                                                       int chainId,
                                                                                                       org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                                                                       java.lang.String binary,
                                                                                                       java.lang.String encodedConstructor)
        Deprecated.
      • deployRemoteCall

        public static <T extends SmartContract> org.web3j.protocol.core.RemoteCall<T> deployRemoteCall​(java.lang.Class<T> type,
                                                                                                       Caver caver,
                                                                                                       TransactionManager transactionManager,
                                                                                                       org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                                                                       java.lang.String binary,
                                                                                                       java.lang.String encodedConstructor,
                                                                                                       java.math.BigInteger value)
        Deprecated.
      • deployRemoteCall

        public static <T extends SmartContract> org.web3j.protocol.core.RemoteCall<T> deployRemoteCall​(java.lang.Class<T> type,
                                                                                                       Caver caver,
                                                                                                       TransactionManager transactionManager,
                                                                                                       org.web3j.tx.gas.ContractGasProvider contractGasProvider,
                                                                                                       java.lang.String binary,
                                                                                                       java.lang.String encodedConstructor)
        Deprecated.
      • staticExtractEventParameters

        public static org.web3j.abi.EventValues staticExtractEventParameters​(org.web3j.abi.datatypes.Event event,
                                                                             KlayLogs.Log log)
        Deprecated.
      • extractEventParameters

        protected org.web3j.abi.EventValues extractEventParameters​(org.web3j.abi.datatypes.Event event,
                                                                   KlayLogs.Log log)
        Deprecated.
      • extractEventParameters

        protected java.util.List<org.web3j.abi.EventValues> extractEventParameters​(org.web3j.abi.datatypes.Event event,
                                                                                   KlayTransactionReceipt.TransactionReceipt transactionReceipt)
        Deprecated.
      • getStaticDeployedAddress

        protected java.lang.String getStaticDeployedAddress​(java.lang.String networkId)
        Deprecated.
        Subclasses should implement this method to return pre-existing addresses for deployed contracts.
        Parameters:
        networkId - the network id, for example "1" for the main-net, "1001" for baobab.
        Returns:
        the deployed address of the contract, if known, and null otherwise.
      • setDeployedAddress

        public final void setDeployedAddress​(java.lang.String networkId,
                                             java.lang.String address)
        Deprecated.
      • getDeployedAddress

        public final java.lang.String getDeployedAddress​(java.lang.String networkId)
        Deprecated.
      • convertToNative

        protected static <S extends org.web3j.abi.datatypes.Type,​T> java.util.List<T> convertToNative​(java.util.List<S> arr)
        Deprecated.