package cc.mrbird.febs.dapp.contract.andao; import io.reactivex.Flowable; import io.reactivex.functions.Function; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.web3j.abi.EventEncoder; import org.web3j.abi.TypeReference; import org.web3j.abi.datatypes.Address; import org.web3j.abi.datatypes.Event; import org.web3j.abi.datatypes.Type; import org.web3j.abi.datatypes.Utf8String; import org.web3j.abi.datatypes.generated.Uint256; import org.web3j.crypto.Credentials; import org.web3j.protocol.Web3j; import org.web3j.protocol.core.DefaultBlockParameter; import org.web3j.protocol.core.RemoteCall; import org.web3j.protocol.core.RemoteFunctionCall; import org.web3j.protocol.core.methods.request.EthFilter; import org.web3j.protocol.core.methods.response.BaseEventResponse; import org.web3j.protocol.core.methods.response.Log; import org.web3j.protocol.core.methods.response.TransactionReceipt; import org.web3j.tx.Contract; import org.web3j.tx.TransactionManager; import org.web3j.tx.gas.ContractGasProvider; /** *

Auto generated code. *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the * codegen module to update. * *

Generated with web3j version 4.5.5. */ @SuppressWarnings("rawtypes") public class Abi extends Contract { private static final String BINARY = "6080604052600180546001600160a01b03199081167355d398326f99059ff775485246999027b319795517909155600380548216731562e481cef00b14693e43465444b726739e0cba17905560048054909116733614b30913f284e8868d7f6814bbcb62e3f8412717905534801561007657600080fd5b50600154600280546001600160a01b03199081166001600160a01b039093169290921790556000805490911673ce74955cf5289e803ee518902076ef42bb09b7a8179055610969806100c96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806310786a021461003b57806347be04b914610050575b600080fd5b61004e61004936600461065e565b610063565b005b61004e61005e3660046105f0565b61037b565b600254604051636eb1769f60e11b81526000916001600160a01b03169063dd62ed3e9061009690339030906004016106e9565b60206040518083038186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e69190610646565b9050838110156101115760405162461bcd60e51b81526004016101089061080a565b60405180910390fd5b6002546040516323b872dd60e01b81526000916001600160a01b0316906323b872dd9061014690339030908a90600401610703565b602060405180830381600087803b15801561016057600080fd5b505af1158015610174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101989190610626565b9050806101b75760405162461bcd60e51b815260040161010890610793565b60006101cf60646101c988600a61052e565b9061057c565b60025460035460405163a9059cbb60e01b81529293506001600160a01b039182169263a9059cbb926102079216908590600401610727565b602060405180830381600087803b15801561022157600080fd5b505af1158015610235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102599190610626565b6102755760405162461bcd60e51b815260040161010890610793565b600061028760646101c989604661052e565b6002546004805460405163a9059cbb60e01b81529394506001600160a01b039283169363a9059cbb936102bf93921691869101610727565b602060405180830381600087803b1580156102d957600080fd5b505af11580156102ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103119190610626565b61032d5760405162461bcd60e51b815260040161010890610793565b336001600160a01b03167f4ea43b897a5f947a4940ce8fc2485d2854dcf256c52754394f1804723a091a2188888860405161036a939291906108b2565b60405180910390a250505050505050565b6000546001600160a01b031633146103a55760405162461bcd60e51b8152600401610108906107bc565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a08231906103d69030906004016106d5565b60206040518083038186803b1580156103ee57600080fd5b505afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610646565b9050818110156104485760405162461bcd60e51b81526004016101089061083a565b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061047a9086908690600401610727565b602060405180830381600087803b15801561049457600080fd5b505af11580156104a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190610626565b6104e85760405162461bcd60e51b815260040161010890610793565b826001600160a01b03167f6fb24f3ad0678f9d138e80b17293be051d87911eb34e9e60f0d1b9c3805e885a8360405161052191906108a9565b60405180910390a2505050565b60008261053d57506000610576565b60006105498385610908565b90508261055685836108e8565b146105735760405162461bcd60e51b815260040161010890610868565b90505b92915050565b600061057383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836105da5760405162461bcd60e51b81526004016101089190610740565b5060006105e784866108e8565b95945050505050565b60008060408385031215610602578182fd5b82356001600160a01b0381168114610618578283fd5b946020939093013593505050565b600060208284031215610637578081fd5b81518015158114610573578182fd5b600060208284031215610657578081fd5b5051919050565b600080600060408486031215610672578081fd5b83359250602084013567ffffffffffffffff80821115610690578283fd5b818601915086601f8301126106a3578283fd5b8135818111156106b1578384fd5b8760208285010111156106c2578384fd5b6020830194508093505050509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000602080835283518082850152825b8181101561076c57858101830151858201604001528201610750565b8181111561077d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b6020808252602e908201527f4f6e6c792074686520636f6e74726163742063726561746f722063616e20636160408201526d1b1b081d1a1a5cc81b595d1a1bd960921b606082015260800190565b602080825260169082015275496e73756666696369656e7420616c6c6f77616e636560501b604082015260600190565b602080825260149082015273496e73756666696369656e742062616c616e636560601b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b90815260200190565b60008482526040602083015282604083015282846060840137818301606090810191909152601f909201601f1916010192915050565b60008261090357634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561092e57634e487b7160e01b81526011600452602481fd5b50029056fea2646970667358221220ecd7e60e42f1745e67b46beb65c088b9349c0afad94854f654de6496a9cca73364736f6c63430008000033"; public static final String FUNC_RECEIVEANDAO = "receiveANDAO"; public static final String FUNC_WITHDRAWANDAO = "withdrawANDAO"; public static final Event RECEIVED_EVENT = new Event("received", Arrays.>asList(new TypeReference

(true) {}, new TypeReference() {}, new TypeReference() {})); ; public static final Event WITHDRAWN_EVENT = new Event("withdrawn", Arrays.>asList(new TypeReference
(true) {}, new TypeReference() {})); ; @Deprecated protected Abi(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); } protected Abi(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, credentials, contractGasProvider); } @Deprecated protected Abi(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); } protected Abi(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); } public List getReceivedEvents(TransactionReceipt transactionReceipt) { List valueList = extractEventParametersWithLog(RECEIVED_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { ReceivedEventResponse typedResponse = new ReceivedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.regFlow = (String) eventValues.getNonIndexedValues().get(1).getValue(); responses.add(typedResponse); } return responses; } public Flowable receivedEventFlowable(EthFilter filter) { return web3j.ethLogFlowable(filter).map(new Function() { @Override public ReceivedEventResponse apply(Log log) { Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(RECEIVED_EVENT, log); ReceivedEventResponse typedResponse = new ReceivedEventResponse(); typedResponse.log = log; if(eventValues==null){ // 为空则直接返回空对象 return typedResponse; } typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); typedResponse.regFlow = (String) eventValues.getNonIndexedValues().get(1).getValue(); return typedResponse; } }); } public Flowable receivedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(RECEIVED_EVENT)); return receivedEventFlowable(filter); } public List getWithdrawnEvents(TransactionReceipt transactionReceipt) { List valueList = extractEventParametersWithLog(WITHDRAWN_EVENT, transactionReceipt); ArrayList responses = new ArrayList(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { WithdrawnEventResponse typedResponse = new WithdrawnEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; } public Flowable withdrawnEventFlowable(EthFilter filter) { return web3j.ethLogFlowable(filter).map(new Function() { @Override public WithdrawnEventResponse apply(Log log) { Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(WITHDRAWN_EVENT, log); WithdrawnEventResponse typedResponse = new WithdrawnEventResponse(); typedResponse.log = log; if(eventValues==null){ // 为空则直接返回空对象 return typedResponse; } typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue(); typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } }); } public Flowable withdrawnEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(WITHDRAWN_EVENT)); return withdrawnEventFlowable(filter); } public RemoteFunctionCall receiveANDAO(BigInteger amount, String regFlow) { final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function( FUNC_RECEIVEANDAO, Arrays.asList(new org.web3j.abi.datatypes.generated.Uint256(amount), new org.web3j.abi.datatypes.Utf8String(regFlow)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } public RemoteFunctionCall withdrawANDAO(String recipient, BigInteger amount) { final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function( FUNC_WITHDRAWANDAO, Arrays.asList(new org.web3j.abi.datatypes.Address(160, recipient), new org.web3j.abi.datatypes.generated.Uint256(amount)), Collections.>emptyList()); return executeRemoteCallTransaction(function); } @Deprecated public static Abi load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { return new Abi(contractAddress, web3j, credentials, gasPrice, gasLimit); } @Deprecated public static Abi load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { return new Abi(contractAddress, web3j, transactionManager, gasPrice, gasLimit); } public static Abi load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { return new Abi(contractAddress, web3j, credentials, contractGasProvider); } public static Abi load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { return new Abi(contractAddress, web3j, transactionManager, contractGasProvider); } public static RemoteCall deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { return deployRemoteCall(Abi.class, web3j, credentials, contractGasProvider, BINARY, ""); } public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) { return deployRemoteCall(Abi.class, web3j, transactionManager, contractGasProvider, BINARY, ""); } @Deprecated public static RemoteCall deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) { return deployRemoteCall(Abi.class, web3j, credentials, gasPrice, gasLimit, BINARY, ""); } @Deprecated public static RemoteCall deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { return deployRemoteCall(Abi.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, ""); } public static class ReceivedEventResponse extends BaseEventResponse { public String from; public BigInteger amount; public String regFlow; } public static class WithdrawnEventResponse extends BaseEventResponse { public String to; public BigInteger amount; } }