/*
 * Copyright ConsenSys AG.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package org.hyperledger.besu.tests.web3j.generated;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;

import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
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.
 *
 * <p><strong>Do not modify!</strong>
 *
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the <a
 * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.0.1.
 */
@SuppressWarnings("rawtypes")
public class SimpleStorage extends Contract {
  private static final String BINARY =
      "608060405234801561001057600080fd5b5060d08061001f6000396000f3fe60806040526004361060485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166360fe47b18114604d5780636d4ce63c146075575b600080fd5b348015605857600080fd5b50607360048036036020811015606d57600080fd5b50356099565b005b348015608057600080fd5b506087609e565b60408051918252519081900360200190f35b600055565b6000549056fea165627a7a72305820cb1d0935d14b589300b12fcd0ab849a7e9019c81da24d6daa4f6b2f003d1b0180029";

  public static final String FUNC_SET = "set";

  public static final String FUNC_GET = "get";

  @Deprecated
  protected SimpleStorage(
      final String contractAddress,
      final Web3j web3j,
      final Credentials credentials,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
  }

  protected SimpleStorage(
      final String contractAddress,
      final Web3j web3j,
      final Credentials credentials,
      final ContractGasProvider contractGasProvider) {
    super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
  }

  @Deprecated
  protected SimpleStorage(
      final String contractAddress,
      final Web3j web3j,
      final TransactionManager transactionManager,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
  }

  protected SimpleStorage(
      final String contractAddress,
      final Web3j web3j,
      final TransactionManager transactionManager,
      final ContractGasProvider contractGasProvider) {
    super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
  }

  public RemoteCall<TransactionReceipt> set(final BigInteger value) {
    final Function function =
        new Function(
            FUNC_SET,
            Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(value)),
            Collections.<TypeReference<?>>emptyList());
    return executeRemoteCallTransaction(function);
  }

  public RemoteCall<BigInteger> get() {
    final Function function =
        new Function(
            FUNC_GET,
            Arrays.<Type>asList(),
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
    return executeRemoteCallSingleValueReturn(function, BigInteger.class);
  }

  @Deprecated
  public static SimpleStorage load(
      final String contractAddress,
      final Web3j web3j,
      final Credentials credentials,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    return new SimpleStorage(contractAddress, web3j, credentials, gasPrice, gasLimit);
  }

  @Deprecated
  public static SimpleStorage load(
      final String contractAddress,
      final Web3j web3j,
      final TransactionManager transactionManager,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    return new SimpleStorage(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
  }

  public static SimpleStorage load(
      final String contractAddress,
      final Web3j web3j,
      final Credentials credentials,
      final ContractGasProvider contractGasProvider) {
    return new SimpleStorage(contractAddress, web3j, credentials, contractGasProvider);
  }

  public static SimpleStorage load(
      final String contractAddress,
      final Web3j web3j,
      final TransactionManager transactionManager,
      final ContractGasProvider contractGasProvider) {
    return new SimpleStorage(contractAddress, web3j, transactionManager, contractGasProvider);
  }

  public static RemoteCall<SimpleStorage> deploy(
      final Web3j web3j,
      final Credentials credentials,
      final ContractGasProvider contractGasProvider) {
    return deployRemoteCall(
        SimpleStorage.class, web3j, credentials, contractGasProvider, BINARY, "");
  }

  @Deprecated
  public static RemoteCall<SimpleStorage> deploy(
      final Web3j web3j,
      final Credentials credentials,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    return deployRemoteCall(
        SimpleStorage.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
  }

  public static RemoteCall<SimpleStorage> deploy(
      final Web3j web3j,
      final TransactionManager transactionManager,
      final ContractGasProvider contractGasProvider) {
    return deployRemoteCall(
        SimpleStorage.class, web3j, transactionManager, contractGasProvider, BINARY, "");
  }

  @Deprecated
  public static RemoteCall<SimpleStorage> deploy(
      final Web3j web3j,
      final TransactionManager transactionManager,
      final BigInteger gasPrice,
      final BigInteger gasLimit) {
    return deployRemoteCall(
        SimpleStorage.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
  }
}
