Class SmartContract
- java.lang.Object
-
- com.klaytn.caver.tx.ManagedTransaction
-
- com.klaytn.caver.tx.SmartContract
-
@Deprecated public class SmartContract extends ManagedTransaction
Deprecated.This class is deprecated since caver-java:1.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SmartContract.EventValuesWithLog
Deprecated.Adds a log field toEventValues
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BIN_NOT_PROVIDED
Deprecated.protected java.lang.String
contractAddress
Deprecated.protected java.lang.String
contractBinary
Deprecated.protected org.web3j.protocol.core.DefaultBlockParameter
defaultBlockParameter
Deprecated.protected java.util.Map<java.lang.String,java.lang.String>
deployedAddresses
Deprecated.static java.lang.String
FUNC_DEPLOY
Deprecated.static java.math.BigInteger
GAS_LIMIT
Deprecated.protected org.web3j.tx.gas.ContractGasProvider
gasProvider
Deprecated.protected KlayTransactionReceipt.TransactionReceipt
transactionReceipt
Deprecated.-
Fields inherited from class com.klaytn.caver.tx.ManagedTransaction
caver, GAS_PRICE, transactionManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SmartContract(java.lang.String contractAddress, Caver caver, KlayCredentials credentials, int chainId, org.web3j.tx.gas.ContractGasProvider gasProvider)
Deprecated.protected
SmartContract(java.lang.String contractAddress, Caver caver, TransactionManager transactionManager, org.web3j.tx.gas.ContractGasProvider gasProvider)
Deprecated.protected
SmartContract(java.lang.String contractBinary, java.lang.String contractAddress, Caver caver, KlayCredentials credentials, int chainId, org.web3j.tx.gas.ContractGasProvider gasProvider)
Deprecated.protected
SmartContract(java.lang.String contractBinary, java.lang.String contractAddress, Caver caver, TransactionManager transactionManager, org.web3j.tx.gas.ContractGasProvider gasProvider)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static <S extends org.web3j.abi.datatypes.Type,T>
java.util.List<T>convertToNative(java.util.List<S> arr)
Deprecated.static SmartContract
create(Caver caver, KlayCredentials klayCredentials, int chainId)
Deprecated.static SmartContract
create(Caver caver, TransactionManager transactionManager)
Deprecated.protected static <T extends SmartContract>
Tdeploy(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.protected static <T extends SmartContract>
Tdeploy(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.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.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.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.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.protected java.util.List<org.web3j.abi.datatypes.Type>
executeCallMultipleValueReturn(org.web3j.abi.datatypes.Function function)
Deprecated.protected <T extends org.web3j.abi.datatypes.Type>
TexecuteCallSingleValueReturn(org.web3j.abi.datatypes.Function function)
Deprecated.protected <T extends org.web3j.abi.datatypes.Type,R>
RexecuteCallSingleValueReturn(org.web3j.abi.datatypes.Function function, java.lang.Class<R> returnType)
Deprecated.protected org.web3j.protocol.core.RemoteCall<java.util.List<org.web3j.abi.datatypes.Type>>
executeRemoteCallMultipleValueReturn(org.web3j.abi.datatypes.Function function)
Deprecated.protected <T extends org.web3j.abi.datatypes.Type>
org.web3j.protocol.core.RemoteCall<T>executeRemoteCallSingleValueReturn(org.web3j.abi.datatypes.Function function)
Deprecated.protected <T> org.web3j.protocol.core.RemoteCall<T>
executeRemoteCallSingleValueReturn(org.web3j.abi.datatypes.Function function, java.lang.Class<T> returnType)
Deprecated.protected org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
executeRemoteCallTransaction(org.web3j.abi.datatypes.Function function)
Deprecated.protected org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
executeRemoteCallTransaction(org.web3j.abi.datatypes.Function function, java.math.BigInteger weiValue)
Deprecated.protected KlayTransactionReceipt.TransactionReceipt
executeTransaction(org.web3j.abi.datatypes.Function function)
Deprecated.protected org.web3j.abi.EventValues
extractEventParameters(org.web3j.abi.datatypes.Event event, KlayLogs.Log log)
Deprecated.protected java.util.List<org.web3j.abi.EventValues>
extractEventParameters(org.web3j.abi.datatypes.Event event, KlayTransactionReceipt.TransactionReceipt transactionReceipt)
Deprecated.protected SmartContract.EventValuesWithLog
extractEventParametersWithLog(org.web3j.abi.datatypes.Event event, KlayLogs.Log log)
Deprecated.protected java.util.List<SmartContract.EventValuesWithLog>
extractEventParametersWithLog(org.web3j.abi.datatypes.Event event, KlayTransactionReceipt.TransactionReceipt transactionReceipt)
Deprecated.java.lang.String
getContractAddress()
Deprecated.java.lang.String
getContractBinary()
Deprecated.java.lang.String
getDeployedAddress(java.lang.String networkId)
Deprecated.java.math.BigInteger
getGasPrice()
Deprecated.use ContractGasProviderprotected java.lang.String
getStaticDeployedAddress(java.lang.String networkId)
Deprecated.Subclasses should implement this method to return pre-existing addresses for deployed contracts.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.boolean
isValid()
Deprecated.Check that the contract deployed at the address associated with this smart contract wrapper is in fact the contract you believe it is.static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendDeployTransaction(Caver caver, KlayCredentials credentials, SmartContractDeployTransaction transaction)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes.static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendDeployTransaction(Caver caver, KlayCredentials credentials, SmartContractDeployTransaction transaction, ErrorHandler errorHandler)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes.org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendDeployTransaction(SmartContractDeployTransaction transaction)
Deprecated.static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendExecutionTransaction(Caver caver, KlayCredentials credentials, SmartContractExecutionTransaction transaction)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes.static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendExecutionTransaction(Caver caver, KlayCredentials credentials, SmartContractExecutionTransaction transaction, ErrorHandler errorHandler)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes.org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt>
sendExecutionTransaction(SmartContractExecutionTransaction transaction)
Deprecated.void
setContractAddress(java.lang.String contractAddress)
Deprecated.void
setDefaultBlockParameter(org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter)
Deprecated.Sets the default block parameter.void
setDeployedAddress(java.lang.String networkId, java.lang.String address)
Deprecated.void
setGasPrice(java.math.BigInteger newPrice)
Deprecated.use ContractGasProvidervoid
setGasProvider(org.web3j.tx.gas.ContractGasProvider gasProvider)
Deprecated.void
setTransactionReceipt(KlayTransactionReceipt.TransactionReceipt transactionReceipt)
Deprecated.static org.web3j.abi.EventValues
staticExtractEventParameters(org.web3j.abi.datatypes.Event event, KlayLogs.Log log)
Deprecated.-
Methods inherited from class com.klaytn.caver.tx.ManagedTransaction
send
-
-
-
-
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.
-
transactionReceipt
protected KlayTransactionReceipt.TransactionReceipt transactionReceipt
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
-
create
public static SmartContract create(Caver caver, TransactionManager transactionManager)
Deprecated.
-
create
public static SmartContract create(Caver caver, KlayCredentials klayCredentials, int chainId)
Deprecated.
-
sendDeployTransaction
public org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendDeployTransaction(SmartContractDeployTransaction transaction)
Deprecated.
-
sendExecutionTransaction
public org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendExecutionTransaction(SmartContractExecutionTransaction transaction)
Deprecated.
-
sendDeployTransaction
@Deprecated public static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendDeployTransaction(Caver caver, KlayCredentials credentials, SmartContractDeployTransaction transaction)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes. The static methods will be removed.
This deprecated method can be used only for Baobab Testnet.
UsesendDeployTransaction(SmartContractDeployTransaction)
instead.
-
sendDeployTransaction
@Deprecated public static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendDeployTransaction(Caver caver, KlayCredentials credentials, SmartContractDeployTransaction transaction, ErrorHandler errorHandler)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes. The static methods will be removed.
This deprecated method can be used only for Baobab Testnet.
UsesendDeployTransaction(SmartContractDeployTransaction)
instead.
-
sendExecutionTransaction
@Deprecated public static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendExecutionTransaction(Caver caver, KlayCredentials credentials, SmartContractExecutionTransaction transaction)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes. The static methods will be removed.
This deprecated method can be used only for Baobab Testnet.
UsesendExecutionTransaction(SmartContractExecutionTransaction)
instead.
-
sendExecutionTransaction
@Deprecated public static org.web3j.protocol.core.RemoteCall<KlayTransactionReceipt.TransactionReceipt> sendExecutionTransaction(Caver caver, KlayCredentials credentials, SmartContractExecutionTransaction transaction, ErrorHandler errorHandler)
Deprecated.In caver-java 1.0.0, we provided static methods to send transactions for `ValueTransfer`, `Account`, `Cancel`, and `SmartContract` classes. The static methods will be removed.
This deprecated method can be used only for Baobab Testnet.
UsesendExecutionTransaction(SmartContractExecutionTransaction)
instead.
-
setContractAddress
public void setContractAddress(java.lang.String contractAddress)
Deprecated.
-
getContractAddress
public java.lang.String getContractAddress()
Deprecated.
-
setTransactionReceipt
public void setTransactionReceipt(KlayTransactionReceipt.TransactionReceipt transactionReceipt)
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 ContractGasProviderAllowgasPrice
to be set.- Parameters:
newPrice
- gas price to use for subsequent transactions
-
getGasPrice
public java.math.BigInteger getGasPrice()
Deprecated.use ContractGasProviderGet the currentgasPrice
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.
-
extractEventParametersWithLog
protected SmartContract.EventValuesWithLog extractEventParametersWithLog(org.web3j.abi.datatypes.Event event, KlayLogs.Log log)
Deprecated.
-
extractEventParametersWithLog
protected java.util.List<SmartContract.EventValuesWithLog> extractEventParametersWithLog(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.
-
-