xiaoyong931011
2023-08-10 18b681e553980b20bc9b5b3a113167f33b83a7b3
src/main/java/cc/mrbird/febs/dapp/contract/andao/Abi.java
@@ -1,6 +1,7 @@
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;
@@ -10,7 +11,6 @@
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Uint256;
@@ -38,7 +38,7 @@
 */
@SuppressWarnings("rawtypes")
public class Abi extends Contract {
    private static final String BINARY = "6080604052600180546001600160a01b03199081167355d398326f99059ff775485246999027b319795517909155600380548216731562e481cef00b14693e43465444b726739e0cba17905560048054909116733614b30913f284e8868d7f6814bbcb62e3f8412717905534801561007657600080fd5b50600154600280546001600160a01b03199081166001600160a01b0390931692909217905560008054909116331790556108eb806100b56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806310786a021461003b57806347be04b914610050575b600080fd5b61004e610049366004610736565b610063565b005b61004e61005e3660046106c3565b6103a7565b600254604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e9060440160206040518083038186803b1580156100ad57600080fd5b505afa1580156100c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e5919061071d565b9050838110156101355760405162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b60448201526064015b60405180910390fd5b6002546040516323b872dd60e01b8152336004820152306024820152604481018690526000916001600160a01b0316906323b872dd90606401602060405180830381600087803b15801561018857600080fd5b505af115801561019c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c091906106fb565b9050806101df5760405162461bcd60e51b815260040161012c90610807565b60006101f760646101f188600a6105c7565b9061064f565b60025460035460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb90604401602060405180830381600087803b15801561024957600080fd5b505af115801561025d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028191906106fb565b61029d5760405162461bcd60e51b815260040161012c90610807565b60006102af60646101f18960466105c7565b6002546004805460405163a9059cbb60e01b81526001600160a01b03918216928101929092526024820184905292935091169063a9059cbb90604401602060405180830381600087803b15801561030557600080fd5b505af1158015610319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033d91906106fb565b6103595760405162461bcd60e51b815260040161012c90610807565b336001600160a01b03167f4ea43b897a5f947a4940ce8fc2485d2854dcf256c52754394f1804723a091a2188888860405161039693929190610830565b60405180910390a250505050505050565b6000546001600160a01b031633146104185760405162461bcd60e51b815260206004820152602e60248201527f4f6e6c792074686520636f6e74726163742063726561746f722063616e20636160448201526d1b1b081d1a1a5cc81b595d1a1bd960921b606482015260840161012c565b6002546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561045c57600080fd5b505afa158015610470573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610494919061071d565b9050818110156104dd5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640161012c565b60025460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b15801561052b57600080fd5b505af115801561053f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056391906106fb565b61057f5760405162461bcd60e51b815260040161012c90610807565b826001600160a01b03167f6fb24f3ad0678f9d138e80b17293be051d87911eb34e9e60f0d1b9c3805e885a836040516105ba91815260200190565b60405180910390a2505050565b6000826105d657506000610649565b60006105e28385610888565b9050826105ef8583610866565b146106465760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161012c565b90505b92915050565b600061064683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836106ad5760405162461bcd60e51b815260040161012c91906107b2565b5060006106ba8486610866565b95945050505050565b600080604083850312156106d657600080fd5b82356001600160a01b03811681146106ed57600080fd5b946020939093013593505050565b60006020828403121561070d57600080fd5b8151801515811461064657600080fd5b60006020828403121561072f57600080fd5b5051919050565b60008060006040848603121561074b57600080fd5b83359250602084013567ffffffffffffffff8082111561076a57600080fd5b818601915086601f83011261077e57600080fd5b81358181111561078d57600080fd5b87602082850101111561079f57600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156107df578581018301518582016040015282016107c3565b818111156107f1576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008261088357634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156108b057634e487b7160e01b600052601160045260246000fd5b50029056fea2646970667358221220694ed63a5283d88a2b5d348c1fcde9747ff91126df19a57ff8395fcdff4d712164736f6c63430008070033";
    private static final String BINARY = "6080604052600180546001600160a01b03199081167355d398326f99059ff775485246999027b319795517909155600380548216731562e481cef00b14693e43465444b726739e0cba17905560048054909116733614b30913f284e8868d7f6814bbcb62e3f8412717905534801561007657600080fd5b50600154600280546001600160a01b03199081166001600160a01b039093169290921790556000805490911673ce74955cf5289e803ee518902076ef42bb09b7a8179055610969806100c96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806310786a021461003b57806347be04b914610050575b600080fd5b61004e61004936600461065e565b610063565b005b61004e61005e3660046105f0565b61037b565b600254604051636eb1769f60e11b81526000916001600160a01b03169063dd62ed3e9061009690339030906004016106e9565b60206040518083038186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e69190610646565b9050838110156101115760405162461bcd60e51b81526004016101089061080a565b60405180910390fd5b6002546040516323b872dd60e01b81526000916001600160a01b0316906323b872dd9061014690339030908a90600401610703565b602060405180830381600087803b15801561016057600080fd5b505af1158015610174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101989190610626565b9050806101b75760405162461bcd60e51b815260040161010890610793565b60006101cf60646101c988600a61052e565b9061057c565b60025460035460405163a9059cbb60e01b81529293506001600160a01b039182169263a9059cbb926102079216908590600401610727565b602060405180830381600087803b15801561022157600080fd5b505af1158015610235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102599190610626565b6102755760405162461bcd60e51b815260040161010890610793565b600061028760646101c989604661052e565b6002546004805460405163a9059cbb60e01b81529394506001600160a01b039283169363a9059cbb936102bf93921691869101610727565b602060405180830381600087803b1580156102d957600080fd5b505af11580156102ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103119190610626565b61032d5760405162461bcd60e51b815260040161010890610793565b336001600160a01b03167f4ea43b897a5f947a4940ce8fc2485d2854dcf256c52754394f1804723a091a2188888860405161036a939291906108b2565b60405180910390a250505050505050565b6000546001600160a01b031633146103a55760405162461bcd60e51b8152600401610108906107bc565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a08231906103d69030906004016106d5565b60206040518083038186803b1580156103ee57600080fd5b505afa158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610646565b9050818110156104485760405162461bcd60e51b81526004016101089061083a565b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061047a9086908690600401610727565b602060405180830381600087803b15801561049457600080fd5b505af11580156104a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190610626565b6104e85760405162461bcd60e51b815260040161010890610793565b826001600160a01b03167f6fb24f3ad0678f9d138e80b17293be051d87911eb34e9e60f0d1b9c3805e885a8360405161052191906108a9565b60405180910390a2505050565b60008261053d57506000610576565b60006105498385610908565b90508261055685836108e8565b146105735760405162461bcd60e51b815260040161010890610868565b90505b92915050565b600061057383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836105da5760405162461bcd60e51b81526004016101089190610740565b5060006105e784866108e8565b95945050505050565b60008060408385031215610602578182fd5b82356001600160a01b0381168114610618578283fd5b946020939093013593505050565b600060208284031215610637578081fd5b81518015158114610573578182fd5b600060208284031215610657578081fd5b5051919050565b600080600060408486031215610672578081fd5b83359250602084013567ffffffffffffffff80821115610690578283fd5b818601915086601f8301126106a3578283fd5b8135818111156106b1578384fd5b8760208285010111156106c2578384fd5b6020830194508093505050509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000602080835283518082850152825b8181101561076c57858101830151858201604001528201610750565b8181111561077d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b6020808252602e908201527f4f6e6c792074686520636f6e74726163742063726561746f722063616e20636160408201526d1b1b081d1a1a5cc81b595d1a1bd960921b606082015260800190565b602080825260169082015275496e73756666696369656e7420616c6c6f77616e636560501b604082015260600190565b602080825260149082015273496e73756666696369656e742062616c616e636560601b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b90815260200190565b60008482526040602083015282604083015282846060840137818301606090810191909152601f909201601f1916010192915050565b60008261090357634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561092e57634e487b7160e01b81526011600452602481fd5b50029056fea2646970667358221220ecd7e60e42f1745e67b46beb65c088b9349c0afad94854f654de6496a9cca73364736f6c63430008000033";
    public static final String FUNC_RECEIVEANDAO = "receiveANDAO";
@@ -70,15 +70,6 @@
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }
    public RemoteFunctionCall<TransactionReceipt> receiveANDAO(BigInteger amount, String regFlow) {
        final Function function = new Function(
                FUNC_RECEIVEANDAO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(amount),
                        new org.web3j.abi.datatypes.Utf8String(regFlow)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }
    public List<ReceivedEventResponse> getReceivedEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(RECEIVED_EVENT, transactionReceipt);
        ArrayList<ReceivedEventResponse> responses = new ArrayList<ReceivedEventResponse>(valueList.size());
@@ -94,16 +85,16 @@
    }
    public Flowable<ReceivedEventResponse> receivedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, ReceivedEventResponse>() {
        return web3j.ethLogFlowable(filter).map(new Function<Log, ReceivedEventResponse>() {
            @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.log = log;
                typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();
                typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
                typedResponse.regFlow = (String) eventValues.getNonIndexedValues().get(1).getValue();
@@ -116,15 +107,6 @@
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(RECEIVED_EVENT));
        return receivedEventFlowable(filter);
    }
    public RemoteFunctionCall<TransactionReceipt> withdrawANDAO(String recipient, BigInteger amount) {
        final Function function = new Function(
                FUNC_WITHDRAWANDAO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, recipient),
                        new org.web3j.abi.datatypes.generated.Uint256(amount)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }
    public List<WithdrawnEventResponse> getWithdrawnEvents(TransactionReceipt transactionReceipt) {
@@ -141,16 +123,16 @@
    }
    public Flowable<WithdrawnEventResponse> withdrawnEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, WithdrawnEventResponse>() {
        return web3j.ethLogFlowable(filter).map(new Function<Log, WithdrawnEventResponse>() {
            @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.log = log;
                typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue();
                typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
                return typedResponse;
@@ -164,6 +146,24 @@
        return withdrawnEventFlowable(filter);
    }
    public RemoteFunctionCall<TransactionReceipt> receiveANDAO(BigInteger amount, String regFlow) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_RECEIVEANDAO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(amount),
                        new org.web3j.abi.datatypes.Utf8String(regFlow)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }
    public RemoteFunctionCall<TransactionReceipt> withdrawANDAO(String recipient, BigInteger amount) {
        final org.web3j.abi.datatypes.Function function = new org.web3j.abi.datatypes.Function(
                FUNC_WITHDRAWANDAO,
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, recipient),
                        new org.web3j.abi.datatypes.generated.Uint256(amount)),
                Collections.<TypeReference<?>>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);