Contract.smali
.class public abstract Lorg/web3j/tx/Contract;
.super Lorg/web3j/tx/ManagedTransaction;
.source "Contract.java"
# static fields
.field public static final GAS_LIMIT:Ljava/math/BigInteger;
# instance fields
.field private contractAddress:Ljava/lang/String;
.field private final contractBinary:Ljava/lang/String;
.field private deployedAddresses:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map",
"<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field private final gasLimit:Ljava/math/BigInteger;
.field private final gasPrice:Ljava/math/BigInteger;
.field private transactionReceipt:Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
# direct methods
.method static constructor <clinit>()V
.registers 2
.prologue
.line 40
const-wide/32 v0, 0x419ce0
invoke-static {v0, v1}, Ljava/math/BigInteger;->valueOf(J)Ljava/math/BigInteger;
move-result-object v0
sput-object v0, Lorg/web3j/tx/Contract;->GAS_LIMIT:Ljava/math/BigInteger;
return-void
.end method
.method protected constructor <init>(Ljava/lang/String;Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.registers 14
.prologue
.line 64
new-instance v4, Lorg/web3j/tx/RawTransactionManager;
invoke-direct {v4, p3, p4}, Lorg/web3j/tx/RawTransactionManager;-><init>(Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;)V
move-object v0, p0
move-object v1, p1
move-object v2, p2
move-object v3, p3
move-object v5, p5
move-object v6, p6
invoke-direct/range {v0 .. v6}, Lorg/web3j/tx/Contract;-><init>(Ljava/lang/String;Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 66
return-void
.end method
.method protected constructor <init>(Ljava/lang/String;Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.registers 8
.prologue
.line 52
invoke-direct {p0, p3, p4}, Lorg/web3j/tx/ManagedTransaction;-><init>(Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;)V
.line 54
iget-object v0, p0, Lorg/web3j/tx/Contract;->ensResolver:Lorg/web3j/ens/EnsResolver;
invoke-virtual {v0, p2}, Lorg/web3j/ens/EnsResolver;->resolve(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
.line 56
iput-object p1, p0, Lorg/web3j/tx/Contract;->contractBinary:Ljava/lang/String;
.line 57
iput-object p5, p0, Lorg/web3j/tx/Contract;->gasPrice:Ljava/math/BigInteger;
.line 58
iput-object p6, p0, Lorg/web3j/tx/Contract;->gasLimit:Ljava/math/BigInteger;
.line 59
return-void
.end method
.method protected constructor <init>(Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.registers 13
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 79
const-string v1, ""
new-instance v4, Lorg/web3j/tx/RawTransactionManager;
invoke-direct {v4, p2, p3}, Lorg/web3j/tx/RawTransactionManager;-><init>(Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;)V
move-object v0, p0
move-object v2, p1
move-object v3, p2
move-object v5, p4
move-object v6, p5
invoke-direct/range {v0 .. v6}, Lorg/web3j/tx/Contract;-><init>(Ljava/lang/String;Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 81
return-void
.end method
.method protected constructor <init>(Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.registers 13
.annotation runtime Ljava/lang/Deprecated;
.end annotation
.prologue
.line 72
const-string v1, ""
move-object v0, p0
move-object v2, p1
move-object v3, p2
move-object v4, p3
move-object v5, p4
move-object v6, p5
invoke-direct/range {v0 .. v6}, Lorg/web3j/tx/Contract;-><init>(Ljava/lang/String;Ljava/lang/String;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;)V
.line 73
return-void
.end method
.method static synthetic access$000(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.registers 4
.prologue
.line 37
invoke-direct {p0, p1, p2}, Lorg/web3j/tx/Contract;->executeTransaction(Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
move-result-object v0
return-object v0
.end method
.method private static create(Lorg/web3j/tx/Contract;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/tx/Contract;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(TT;",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/math/BigInteger;",
")TT;"
}
.end annotation
.prologue
.line 276
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-virtual {p0, v0, p3}, Lorg/web3j/tx/Contract;->executeTransaction(Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
move-result-object v0
.line 279
invoke-virtual {v0}, Lorg/web3j/protocol/core/methods/response/TransactionReceipt;->getContractAddress()Ljava/lang/String;
move-result-object v1
.line 280
if-nez v1, :cond_23
.line 281
new-instance v0, Ljava/lang/RuntimeException;
const-string v1, "Empty contract address returned"
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw v0
.line 283
:cond_23
invoke-virtual {p0, v1}, Lorg/web3j/tx/Contract;->setContractAddress(Ljava/lang/String;)V
.line 284
invoke-virtual {p0, v0}, Lorg/web3j/tx/Contract;->setTransactionReceipt(Lorg/web3j/protocol/core/methods/response/TransactionReceipt;)V
.line 286
return-object p0
.end method
.method protected static deploy(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/tx/Contract;
.registers 12
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/crypto/Credentials;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/math/BigInteger;",
")TT;"
}
.end annotation
.prologue
.line 297
const/4 v0, 0x5
:try_start_1
new-array v0, v0, [Ljava/lang/Class;
const/4 v1, 0x0
const-class v2, Ljava/lang/String;
aput-object v2, v0, v1
const/4 v1, 0x1
const-class v2, Lorg/web3j/protocol/Web3j;
aput-object v2, v0, v1
const/4 v1, 0x2
const-class v2, Lorg/web3j/crypto/Credentials;
aput-object v2, v0, v1
const/4 v1, 0x3
const-class v2, Ljava/math/BigInteger;
aput-object v2, v0, v1
const/4 v1, 0x4
const-class v2, Ljava/math/BigInteger;
aput-object v2, v0, v1
invoke-virtual {p0, v0}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
move-result-object v0
.line 301
const/4 v1, 0x1
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->setAccessible(Z)V
.line 304
const/4 v1, 0x5
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
const/4 v3, 0x0
aput-object v3, v1, v2
const/4 v2, 0x1
aput-object p1, v1, v2
const/4 v2, 0x2
aput-object p2, v1, v2
const/4 v2, 0x3
aput-object p3, v1, v2
const/4 v2, 0x4
aput-object p4, v1, v2
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lorg/web3j/tx/Contract;
.line 306
invoke-static {v0, p5, p6, p7}, Lorg/web3j/tx/Contract;->create(Lorg/web3j/tx/Contract;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/tx/Contract;
:try_end_40
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_40} :catch_42
move-result-object v0
return-object v0
.line 307
:catch_42
move-exception v0
.line 308
new-instance v1, Ljava/lang/RuntimeException;
invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw v1
.end method
.method protected static deploy(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/tx/Contract;
.registers 12
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/tx/TransactionManager;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/math/BigInteger;",
")TT;"
}
.end annotation
.prologue
.line 320
const/4 v0, 0x5
:try_start_1
new-array v0, v0, [Ljava/lang/Class;
const/4 v1, 0x0
const-class v2, Ljava/lang/String;
aput-object v2, v0, v1
const/4 v1, 0x1
const-class v2, Lorg/web3j/protocol/Web3j;
aput-object v2, v0, v1
const/4 v1, 0x2
const-class v2, Lorg/web3j/tx/TransactionManager;
aput-object v2, v0, v1
const/4 v1, 0x3
const-class v2, Ljava/math/BigInteger;
aput-object v2, v0, v1
const/4 v1, 0x4
const-class v2, Ljava/math/BigInteger;
aput-object v2, v0, v1
invoke-virtual {p0, v0}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
move-result-object v0
.line 324
const/4 v1, 0x1
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->setAccessible(Z)V
.line 327
const/4 v1, 0x5
new-array v1, v1, [Ljava/lang/Object;
const/4 v2, 0x0
const/4 v3, 0x0
aput-object v3, v1, v2
const/4 v2, 0x1
aput-object p1, v1, v2
const/4 v2, 0x2
aput-object p2, v1, v2
const/4 v2, 0x3
aput-object p3, v1, v2
const/4 v2, 0x4
aput-object p4, v1, v2
invoke-virtual {v0, v1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lorg/web3j/tx/Contract;
.line 329
invoke-static {v0, p5, p6, p7}, Lorg/web3j/tx/Contract;->create(Lorg/web3j/tx/Contract;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/tx/Contract;
:try_end_40
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_40} :catch_42
move-result-object v0
return-object v0
.line 330
:catch_42
move-exception v0
.line 331
new-instance v1, Ljava/lang/RuntimeException;
invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
throw v1
.end method
.method protected static deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;)Lorg/web3j/protocol/core/RemoteCall;
.registers 15
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/crypto/Credentials;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 355
sget-object v7, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
move-object v0, p0
move-object v1, p1
move-object v2, p2
move-object v3, p3
move-object v4, p4
move-object v5, p5
move-object v6, p6
invoke-static/range {v0 .. v7}, Lorg/web3j/tx/Contract;->deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/RemoteCall;
move-result-object v0
return-object v0
.end method
.method protected static deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/RemoteCall;
.registers 18
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/crypto/Credentials;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/math/BigInteger;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 340
new-instance v9, Lorg/web3j/protocol/core/RemoteCall;
new-instance v0, Lorg/web3j/tx/Contract$6;
move-object v1, p0
move-object v2, p1
move-object v3, p2
move-object v4, p3
move-object v5, p4
move-object v6, p5
move-object/from16 v7, p6
move-object/from16 v8, p7
invoke-direct/range {v0 .. v8}, Lorg/web3j/tx/Contract$6;-><init>(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/crypto/Credentials;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)V
invoke-direct {v9, v0}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v9
.end method
.method protected static deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;)Lorg/web3j/protocol/core/RemoteCall;
.registers 15
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/tx/TransactionManager;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 380
sget-object v7, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
move-object v0, p0
move-object v1, p1
move-object v2, p2
move-object v3, p3
move-object v4, p4
move-object v5, p5
move-object v6, p6
invoke-static/range {v0 .. v7}, Lorg/web3j/tx/Contract;->deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/RemoteCall;
move-result-object v0
return-object v0
.end method
.method protected static deployRemoteCall(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/RemoteCall;
.registers 18
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Lorg/web3j/tx/Contract;",
">(",
"Ljava/lang/Class",
"<TT;>;",
"Lorg/web3j/protocol/Web3j;",
"Lorg/web3j/tx/TransactionManager;",
"Ljava/math/BigInteger;",
"Ljava/math/BigInteger;",
"Ljava/lang/String;",
"Ljava/lang/String;",
"Ljava/math/BigInteger;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 365
new-instance v9, Lorg/web3j/protocol/core/RemoteCall;
new-instance v0, Lorg/web3j/tx/Contract$7;
move-object v1, p0
move-object v2, p1
move-object v3, p2
move-object v4, p3
move-object v5, p4
move-object v6, p5
move-object/from16 v7, p6
move-object/from16 v8, p7
invoke-direct/range {v0 .. v8}, Lorg/web3j/tx/Contract$7;-><init>(Ljava/lang/Class;Lorg/web3j/protocol/Web3j;Lorg/web3j/tx/TransactionManager;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;)V
invoke-direct {v9, v0}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v9
.end method
.method private executeCall(Lorg/web3j/abi/datatypes/Function;)Ljava/util/List;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Function;",
")",
"Ljava/util/List",
"<",
"Lorg/web3j/abi/datatypes/Type;",
">;"
}
.end annotation
.prologue
.line 150
invoke-static {p1}, Lorg/web3j/abi/FunctionEncoder;->encode(Lorg/web3j/abi/datatypes/Function;)Ljava/lang/String;
move-result-object v0
.line 151
iget-object v1, p0, Lorg/web3j/tx/Contract;->web3j:Lorg/web3j/protocol/Web3j;
iget-object v2, p0, Lorg/web3j/tx/Contract;->transactionManager:Lorg/web3j/tx/TransactionManager;
invoke-virtual {v2}, Lorg/web3j/tx/TransactionManager;->getFromAddress()Ljava/lang/String;
move-result-object v2
iget-object v3, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
invoke-static {v2, v3, v0}, Lorg/web3j/protocol/core/methods/request/Transaction;->createEthCallTransaction(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/web3j/protocol/core/methods/request/Transaction;
move-result-object v0
sget-object v2, Lorg/web3j/protocol/core/DefaultBlockParameterName;->LATEST:Lorg/web3j/protocol/core/DefaultBlockParameterName;
invoke-interface {v1, v0, v2}, Lorg/web3j/protocol/Web3j;->ethCall(Lorg/web3j/protocol/core/methods/request/Transaction;Lorg/web3j/protocol/core/DefaultBlockParameter;)Lorg/web3j/protocol/core/Request;
move-result-object v0
invoke-virtual {v0}, Lorg/web3j/protocol/core/Request;->send()Lorg/web3j/protocol/core/Response;
move-result-object v0
check-cast v0, Lorg/web3j/protocol/core/methods/response/EthCall;
.line 157
invoke-virtual {v0}, Lorg/web3j/protocol/core/methods/response/EthCall;->getValue()Ljava/lang/String;
move-result-object v0
.line 158
invoke-virtual {p1}, Lorg/web3j/abi/datatypes/Function;->getOutputParameters()Ljava/util/List;
move-result-object v1
invoke-static {v0, v1}, Lorg/web3j/abi/FunctionReturnDecoder;->decode(Ljava/lang/String;Ljava/util/List;)Ljava/util/List;
move-result-object v0
return-object v0
.end method
.method private executeTransaction(Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.registers 4
.prologue
.line 206
invoke-static {p1}, Lorg/web3j/abi/FunctionEncoder;->encode(Lorg/web3j/abi/datatypes/Function;)Ljava/lang/String;
move-result-object v0
invoke-virtual {p0, v0, p2}, Lorg/web3j/tx/Contract;->executeTransaction(Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
move-result-object v0
return-object v0
.end method
# virtual methods
.method protected executeCallMultipleValueReturn(Lorg/web3j/abi/datatypes/Function;)Ljava/util/List;
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Function;",
")",
"Ljava/util/List",
"<",
"Lorg/web3j/abi/datatypes/Type;",
">;"
}
.end annotation
.prologue
.line 194
invoke-direct {p0, p1}, Lorg/web3j/tx/Contract;->executeCall(Lorg/web3j/abi/datatypes/Function;)Ljava/util/List;
move-result-object v0
return-object v0
.end method
.method protected executeCallSingleValueReturn(Lorg/web3j/abi/datatypes/Function;Ljava/lang/Class;)Ljava/lang/Object;
.registers 7
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Lorg/web3j/abi/datatypes/Type;",
"R:",
"Ljava/lang/Object;",
">(",
"Lorg/web3j/abi/datatypes/Function;",
"Ljava/lang/Class",
"<TR;>;)TR;"
}
.end annotation
.prologue
.line 175
invoke-virtual {p0, p1}, Lorg/web3j/tx/Contract;->executeCallSingleValueReturn(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/abi/datatypes/Type;
move-result-object v1
.line 176
if-nez v1, :cond_e
.line 177
new-instance v0, Lorg/web3j/tx/exceptions/ContractCallException;
const-string v1, "Empty value (0x) returned from contract"
invoke-direct {v0, v1}, Lorg/web3j/tx/exceptions/ContractCallException;-><init>(Ljava/lang/String;)V
throw v0
.line 180
:cond_e
invoke-interface {v1}, Lorg/web3j/abi/datatypes/Type;->getValue()Ljava/lang/Object;
move-result-object v0
.line 181
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v2
invoke-virtual {p2, v2}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
move-result v2
if-eqz v2, :cond_1d
.line 184
:goto_1c
return-object v0
.line 183
:cond_1d
invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v2
const-class v3, Lorg/web3j/abi/datatypes/Address;
invoke-virtual {v2, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_36
const-class v2, Ljava/lang/String;
invoke-virtual {p2, v2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_36
.line 184
invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
goto :goto_1c
.line 186
:cond_36
new-instance v1, Lorg/web3j/tx/exceptions/ContractCallException;
new-instance v2, Ljava/lang/StringBuilder;
const-string v3, "Unable to convert response: "
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v2, " to expected type: "
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {p2}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {v1, v0}, Lorg/web3j/tx/exceptions/ContractCallException;-><init>(Ljava/lang/String;)V
throw v1
.end method
.method protected executeCallSingleValueReturn(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/abi/datatypes/Type;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Lorg/web3j/abi/datatypes/Type;",
">(",
"Lorg/web3j/abi/datatypes/Function;",
")TT;"
}
.end annotation
.prologue
.line 164
invoke-direct {p0, p1}, Lorg/web3j/tx/Contract;->executeCall(Lorg/web3j/abi/datatypes/Function;)Ljava/util/List;
move-result-object v0
.line 165
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v1
if-nez v1, :cond_12
.line 166
const/4 v1, 0x0
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lorg/web3j/abi/datatypes/Type;
.line 168
:goto_11
return-object v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
.method protected executeRemoteCallMultipleValueReturn(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/protocol/core/RemoteCall;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Function;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<",
"Ljava/util/List",
"<",
"Lorg/web3j/abi/datatypes/Type;",
">;>;"
}
.end annotation
.prologue
.line 246
new-instance v0, Lorg/web3j/protocol/core/RemoteCall;
new-instance v1, Lorg/web3j/tx/Contract$3;
invoke-direct {v1, p0, p1}, Lorg/web3j/tx/Contract$3;-><init>(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;)V
invoke-direct {v0, v1}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v0
.end method
.method protected executeRemoteCallSingleValueReturn(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/protocol/core/RemoteCall;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"<T::",
"Lorg/web3j/abi/datatypes/Type;",
">(",
"Lorg/web3j/abi/datatypes/Function;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 227
new-instance v0, Lorg/web3j/protocol/core/RemoteCall;
new-instance v1, Lorg/web3j/tx/Contract$1;
invoke-direct {v1, p0, p1}, Lorg/web3j/tx/Contract$1;-><init>(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;)V
invoke-direct {v0, v1}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v0
.end method
.method protected executeRemoteCallSingleValueReturn(Lorg/web3j/abi/datatypes/Function;Ljava/lang/Class;)Lorg/web3j/protocol/core/RemoteCall;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Lorg/web3j/abi/datatypes/Function;",
"Ljava/lang/Class",
"<TT;>;)",
"Lorg/web3j/protocol/core/RemoteCall",
"<TT;>;"
}
.end annotation
.prologue
.line 237
new-instance v0, Lorg/web3j/protocol/core/RemoteCall;
new-instance v1, Lorg/web3j/tx/Contract$2;
invoke-direct {v1, p0, p1, p2}, Lorg/web3j/tx/Contract$2;-><init>(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;Ljava/lang/Class;)V
invoke-direct {v0, v1}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v0
.end method
.method protected executeRemoteCallTransaction(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/protocol/core/RemoteCall;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Function;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<",
"Lorg/web3j/protocol/core/methods/response/TransactionReceipt;",
">;"
}
.end annotation
.prologue
.line 255
new-instance v0, Lorg/web3j/protocol/core/RemoteCall;
new-instance v1, Lorg/web3j/tx/Contract$4;
invoke-direct {v1, p0, p1}, Lorg/web3j/tx/Contract$4;-><init>(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;)V
invoke-direct {v0, v1}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v0
.end method
.method protected executeRemoteCallTransaction(Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/RemoteCall;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Function;",
"Ljava/math/BigInteger;",
")",
"Lorg/web3j/protocol/core/RemoteCall",
"<",
"Lorg/web3j/protocol/core/methods/response/TransactionReceipt;",
">;"
}
.end annotation
.prologue
.line 265
new-instance v0, Lorg/web3j/protocol/core/RemoteCall;
new-instance v1, Lorg/web3j/tx/Contract$5;
invoke-direct {v1, p0, p1, p2}, Lorg/web3j/tx/Contract$5;-><init>(Lorg/web3j/tx/Contract;Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)V
invoke-direct {v0, v1}, Lorg/web3j/protocol/core/RemoteCall;-><init>(Ljava/util/concurrent/Callable;)V
return-object v0
.end method
.method executeTransaction(Ljava/lang/String;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.registers 9
.prologue
.line 222
iget-object v1, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
iget-object v4, p0, Lorg/web3j/tx/Contract;->gasPrice:Ljava/math/BigInteger;
iget-object v5, p0, Lorg/web3j/tx/Contract;->gasLimit:Ljava/math/BigInteger;
move-object v0, p0
move-object v2, p1
move-object v3, p2
invoke-virtual/range {v0 .. v5}, Lorg/web3j/tx/Contract;->send(Ljava/lang/String;Ljava/lang/String;Ljava/math/BigInteger;Ljava/math/BigInteger;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
move-result-object v0
return-object v0
.end method
.method protected executeTransaction(Lorg/web3j/abi/datatypes/Function;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.registers 3
.prologue
.line 200
sget-object v0, Ljava/math/BigInteger;->ZERO:Ljava/math/BigInteger;
invoke-direct {p0, p1, v0}, Lorg/web3j/tx/Contract;->executeTransaction(Lorg/web3j/abi/datatypes/Function;Ljava/math/BigInteger;)Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
move-result-object v0
return-object v0
.end method
.method protected extractEventParameters(Lorg/web3j/abi/datatypes/Event;Lorg/web3j/protocol/core/methods/response/TransactionReceipt;)Ljava/util/List;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/web3j/abi/datatypes/Event;",
"Lorg/web3j/protocol/core/methods/response/TransactionReceipt;",
")",
"Ljava/util/List",
"<",
"Lorg/web3j/abi/EventValues;",
">;"
}
.end annotation
.prologue
.line 410
invoke-virtual {p2}, Lorg/web3j/protocol/core/methods/response/TransactionReceipt;->getLogs()Ljava/util/List;
move-result-object v0
.line 411
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.line 412
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_d
:goto_d
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_23
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lorg/web3j/protocol/core/methods/response/Log;
.line 413
invoke-virtual {p0, p1, v0}, Lorg/web3j/tx/Contract;->extractEventParameters(Lorg/web3j/abi/datatypes/Event;Lorg/web3j/protocol/core/methods/response/Log;)Lorg/web3j/abi/EventValues;
move-result-object v0
.line 414
if-eqz v0, :cond_d
.line 415
invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_d
.line 419
:cond_23
return-object v1
.end method
.method protected extractEventParameters(Lorg/web3j/abi/datatypes/Event;Lorg/web3j/protocol/core/methods/response/Log;)Lorg/web3j/abi/EventValues;
.registers 10
.prologue
const/4 v1, 0x0
.line 388
invoke-virtual {p2}, Lorg/web3j/protocol/core/methods/response/Log;->getTopics()Ljava/util/List;
move-result-object v3
.line 389
invoke-static {p1}, Lorg/web3j/abi/EventEncoder;->encode(Lorg/web3j/abi/datatypes/Event;)Ljava/lang/String;
move-result-object v2
.line 390
invoke-interface {v3, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_17
.line 391
const/4 v0, 0x0
.line 404
:goto_16
return-object v0
.line 394
:cond_17
new-instance v4, Ljava/util/ArrayList;
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
.line 395
invoke-virtual {p2}, Lorg/web3j/protocol/core/methods/response/Log;->getData()Ljava/lang/String;
move-result-object v0
invoke-virtual {p1}, Lorg/web3j/abi/datatypes/Event;->getNonIndexedParameters()Ljava/util/List;
move-result-object v2
invoke-static {v0, v2}, Lorg/web3j/abi/FunctionReturnDecoder;->decode(Ljava/lang/String;Ljava/util/List;)Ljava/util/List;
move-result-object v5
.line 398
invoke-virtual {p1}, Lorg/web3j/abi/datatypes/Event;->getIndexedParameters()Ljava/util/List;
move-result-object v6
move v2, v1
.line 399
:goto_2d
invoke-interface {v6}, Ljava/util/List;->size()I
move-result v0
if-ge v2, v0, :cond_4c
.line 400
add-int/lit8 v0, v2, 0x1
invoke-interface {v3, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-interface {v6, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lorg/web3j/abi/TypeReference;
invoke-static {v0, v1}, Lorg/web3j/abi/FunctionReturnDecoder;->decodeIndexedValue(Ljava/lang/String;Lorg/web3j/abi/TypeReference;)Lorg/web3j/abi/datatypes/Type;
move-result-object v0
.line 402
invoke-interface {v4, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 399
add-int/lit8 v0, v2, 0x1
move v2, v0
goto :goto_2d
.line 404
:cond_4c
new-instance v0, Lorg/web3j/abi/EventValues;
invoke-direct {v0, v4, v5}, Lorg/web3j/abi/EventValues;-><init>(Ljava/util/List;Ljava/util/List;)V
goto :goto_16
.end method
.method public getContractAddress()Ljava/lang/String;
.registers 2
.prologue
.line 88
iget-object v0, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
return-object v0
.end method
.method public getContractBinary()Ljava/lang/String;
.registers 2
.prologue
.line 96
iget-object v0, p0, Lorg/web3j/tx/Contract;->contractBinary:Ljava/lang/String;
return-object v0
.end method
.method public final getDeployedAddress(Ljava/lang/String;)Ljava/lang/String;
.registers 4
.prologue
.line 441
const/4 v0, 0x0
.line 442
iget-object v1, p0, Lorg/web3j/tx/Contract;->deployedAddresses:Ljava/util/Map;
if-eqz v1, :cond_d
.line 443
iget-object v0, p0, Lorg/web3j/tx/Contract;->deployedAddresses:Ljava/util/Map;
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
.line 445
:cond_d
if-nez v0, :cond_13
invoke-virtual {p0, p1}, Lorg/web3j/tx/Contract;->getStaticDeployedAddress(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
:cond_13
return-object v0
.end method
.method protected getStaticDeployedAddress(Ljava/lang/String;)Ljava/lang/String;
.registers 3
.prologue
.line 430
const/4 v0, 0x0
return-object v0
.end method
.method public getTransactionReceipt()Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.registers 2
.prologue
.line 139
iget-object v0, p0, Lorg/web3j/tx/Contract;->transactionReceipt:Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
return-object v0
.end method
.method public isValid()Z
.registers 5
.prologue
const/4 v1, 0x0
.line 112
iget-object v0, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
const-string v2, ""
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_13
.line 113
new-instance v0, Ljava/lang/UnsupportedOperationException;
const-string v1, "Contract binary not present, you will need to regenerate your smart contract wrapper with web3j v2.2.0+"
invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw v0
.line 118
:cond_13
iget-object v0, p0, Lorg/web3j/tx/Contract;->web3j:Lorg/web3j/protocol/Web3j;
iget-object v2, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
sget-object v3, Lorg/web3j/protocol/core/DefaultBlockParameterName;->LATEST:Lorg/web3j/protocol/core/DefaultBlockParameterName;
invoke-interface {v0, v2, v3}, Lorg/web3j/protocol/Web3j;->ethGetCode(Ljava/lang/String;Lorg/web3j/protocol/core/DefaultBlockParameter;)Lorg/web3j/protocol/core/Request;
move-result-object v0
invoke-virtual {v0}, Lorg/web3j/protocol/core/Request;->send()Lorg/web3j/protocol/core/Response;
move-result-object v0
check-cast v0, Lorg/web3j/protocol/core/methods/response/EthGetCode;
.line 121
invoke-virtual {v0}, Lorg/web3j/protocol/core/methods/response/EthGetCode;->hasError()Z
move-result v2
if-eqz v2, :cond_2b
move v0, v1
.line 128
:goto_2a
return v0
.line 125
:cond_2b
invoke-virtual {v0}, Lorg/web3j/protocol/core/methods/response/EthGetCode;->getCode()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lorg/web3j/utils/Numeric;->cleanHexPrefix(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 128
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v2
if-nez v2, :cond_43
iget-object v2, p0, Lorg/web3j/tx/Contract;->contractBinary:Ljava/lang/String;
invoke-virtual {v2, v0}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_43
const/4 v0, 0x1
goto :goto_2a
:cond_43
move v0, v1
goto :goto_2a
.end method
.method public setContractAddress(Ljava/lang/String;)V
.registers 2
.prologue
.line 84
iput-object p1, p0, Lorg/web3j/tx/Contract;->contractAddress:Ljava/lang/String;
.line 85
return-void
.end method
.method public final setDeployedAddress(Ljava/lang/String;Ljava/lang/String;)V
.registers 4
.prologue
.line 434
iget-object v0, p0, Lorg/web3j/tx/Contract;->deployedAddresses:Ljava/util/Map;
if-nez v0, :cond_b
.line 435
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
iput-object v0, p0, Lorg/web3j/tx/Contract;->deployedAddresses:Ljava/util/Map;
.line 437
:cond_b
iget-object v0, p0, Lorg/web3j/tx/Contract;->deployedAddresses:Ljava/util/Map;
invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 438
return-void
.end method
.method public setTransactionReceipt(Lorg/web3j/protocol/core/methods/response/TransactionReceipt;)V
.registers 2
.prologue
.line 92
iput-object p1, p0, Lorg/web3j/tx/Contract;->transactionReceipt:Lorg/web3j/protocol/core/methods/response/TransactionReceipt;
.line 93
return-void
.end method