Skip to content

Commit

Permalink
renamed eips -> contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriymyronovych committed Mar 7, 2019
1 parent 84f67d9 commit 1fd4ec8
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 71 deletions.
2 changes: 1 addition & 1 deletion console/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description 'web3j command line tools'
dependencies {
compile project(':codegen'),
project(':infura'),
project(':eips')
project(':contracts')
runtime "org.slf4j:slf4j-nop:$slf4jVersion" // prevent logging of the library to the console
testCompile project(path: ':crypto', configuration: 'testArtifacts'),
project(path: ':core', configuration: 'testArtifacts')
Expand Down
2 changes: 1 addition & 1 deletion eips/build.gradle → contracts/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

description 'web3j support for Ethereum Improvement Proposals (EIP's)'
description 'web3j support for Ethereum Improvement Proposals (EIP\'s)'

dependencies {
compile project(':core')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ targetFileIn=(
"src/main/resources/eip721/solidity/ERC721Metadata")

targetPackageOut=(
"org.web3j.eips.eip20.generated"
"org.web3j.eips.eip165.generated"
"org.web3j.eips.eip721.generated"
"org.web3j.eips.eip721.generated"
"org.web3j.eips.eip721.generated")
"org.web3j.contracts.eip20.generated"
"org.web3j.contracts.eip165.generated"
"org.web3j.contracts.eip721.generated"
"org.web3j.contracts.eip721.generated"
"org.web3j.contracts.eip721.generated")

mkdir -p ../build/

Expand All @@ -26,17 +26,17 @@ for i in ${!targetFileIn[@]}; do
fileName=$(basename $solcFileIn)

cd ../$dirName
eipsRootDir="../../../../../"
contractsRootDir="../../../../../"

echo "Compiling Solidity file ${fileName}.sol:"
solc --abi --optimize --overwrite ${fileName}.sol -o ${eipsRootDir}/build/
solc --abi --optimize --overwrite ${fileName}.sol -o ${contractsRootDir}/build/
echo "Complete"

echo "Generating web3j bindings"
web3j solidity generate \
-a ${eipsRootDir}build/${fileName}.abi \
-a ${contractsRootDir}build/${fileName}.abi \
-p ${packageOut} \
-o ${eipsRootDir}/src/main/java/ > /dev/null
-o ${contractsRootDir}/src/main/java/ > /dev/null
echo "Complete"

cd -
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.web3j.eips.eip165.generated;
package org.web3j.contracts.eip165.generated;

import java.math.BigInteger;
import java.util.Arrays;
Expand All @@ -15,9 +15,12 @@

/**
* <p>Auto generated code.
* <p>See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
* <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.0-SNAPSHOT.
* <p>Generated with web3j version 4.1.1.
*/
public class ERC165 extends Contract {
private static final String BINARY = "Bin file was not provided";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.web3j.eips.eip20.generated;
package org.web3j.contracts.eip20.generated;

import java.io.IOException;
import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -20,24 +20,20 @@
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.EthSendTransaction;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.protocol.http.HttpService;
import org.web3j.tx.Contract;
import org.web3j.tx.ReadonlyTransactionManager;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;
import org.web3j.tx.gas.DefaultGasProvider;
import rx.Observable;
import rx.functions.Func1;

/**
* <p>Auto generated code.
* <p>Abstract contract for the full ERC 20 Token standard
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* <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.0-SNAPSHOT.
* <p>Generated with web3j version 4.1.1.
*/
public class ERC20 extends Contract {
private static final String BINARY = "Bin file was not provided";
Expand Down Expand Up @@ -171,10 +167,10 @@ public List<TransferEventResponse> getTransferEvents(TransactionReceipt transact
return responses;
}

public Observable<TransferEventResponse> transferEventObservable(EthFilter filter) {
return web3j.ethLogObservable(filter).map(new Func1<Log, TransferEventResponse>() {
public Flowable<TransferEventResponse> transferEventFlowable(EthFilter filter) {
return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, TransferEventResponse>() {
@Override
public TransferEventResponse call(Log log) {
public TransferEventResponse apply(Log log) {
Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log);
TransferEventResponse typedResponse = new TransferEventResponse();
typedResponse.log = log;
Expand All @@ -186,10 +182,10 @@ public TransferEventResponse call(Log log) {
});
}

public Observable<TransferEventResponse> transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT));
return transferEventObservable(filter);
return transferEventFlowable(filter);
}

public List<ApprovalEventResponse> getApprovalEvents(TransactionReceipt transactionReceipt) {
Expand All @@ -206,10 +202,10 @@ public List<ApprovalEventResponse> getApprovalEvents(TransactionReceipt transact
return responses;
}

public Observable<ApprovalEventResponse> approvalEventObservable(EthFilter filter) {
return web3j.ethLogObservable(filter).map(new Func1<Log, ApprovalEventResponse>() {
public Flowable<ApprovalEventResponse> approvalEventFlowable(EthFilter filter) {
return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, ApprovalEventResponse>() {
@Override
public ApprovalEventResponse call(Log log) {
public ApprovalEventResponse apply(Log log) {
Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVAL_EVENT, log);
ApprovalEventResponse typedResponse = new ApprovalEventResponse();
typedResponse.log = log;
Expand All @@ -221,10 +217,10 @@ public ApprovalEventResponse call(Log log) {
});
}

public Observable<ApprovalEventResponse> approvalEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
public Flowable<ApprovalEventResponse> approvalEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT));
return approvalEventObservable(filter);
return approvalEventFlowable(filter);
}

@Deprecated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.web3j.eips.eip721.generated;
package org.web3j.contracts.eip721.generated;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -23,16 +24,15 @@
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;
import rx.Observable;
import rx.functions.Func1;

/**
* <p>Auto generated code.
* <p>ERC-721 Non-Fungible Token Standard
* See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
* the ERC-165 identifier for this interface is 0x80ac58cd.
* <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.0-SNAPSHOT.
* <p>Generated with web3j version 4.1.1.
*/
public class ERC721 extends Contract {
private static final String BINARY = "Bin file was not provided";
Expand Down Expand Up @@ -175,10 +175,10 @@ public List<TransferEventResponse> getTransferEvents(TransactionReceipt transact
return responses;
}

public Observable<TransferEventResponse> transferEventObservable(EthFilter filter) {
return web3j.ethLogObservable(filter).map(new Func1<Log, TransferEventResponse>() {
public Flowable<TransferEventResponse> transferEventFlowable(EthFilter filter) {
return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, TransferEventResponse>() {
@Override
public TransferEventResponse call(Log log) {
public TransferEventResponse apply(Log log) {
Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log);
TransferEventResponse typedResponse = new TransferEventResponse();
typedResponse.log = log;
Expand All @@ -190,10 +190,10 @@ public TransferEventResponse call(Log log) {
});
}

public Observable<TransferEventResponse> transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT));
return transferEventObservable(filter);
return transferEventFlowable(filter);
}

public List<ApprovalEventResponse> getApprovalEvents(TransactionReceipt transactionReceipt) {
Expand All @@ -210,10 +210,10 @@ public List<ApprovalEventResponse> getApprovalEvents(TransactionReceipt transact
return responses;
}

public Observable<ApprovalEventResponse> approvalEventObservable(EthFilter filter) {
return web3j.ethLogObservable(filter).map(new Func1<Log, ApprovalEventResponse>() {
public Flowable<ApprovalEventResponse> approvalEventFlowable(EthFilter filter) {
return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, ApprovalEventResponse>() {
@Override
public ApprovalEventResponse call(Log log) {
public ApprovalEventResponse apply(Log log) {
Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVAL_EVENT, log);
ApprovalEventResponse typedResponse = new ApprovalEventResponse();
typedResponse.log = log;
Expand All @@ -225,10 +225,10 @@ public ApprovalEventResponse call(Log log) {
});
}

public Observable<ApprovalEventResponse> approvalEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
public Flowable<ApprovalEventResponse> approvalEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT));
return approvalEventObservable(filter);
return approvalEventFlowable(filter);
}

public List<ApprovalForAllEventResponse> getApprovalForAllEvents(TransactionReceipt transactionReceipt) {
Expand All @@ -245,10 +245,10 @@ public List<ApprovalForAllEventResponse> getApprovalForAllEvents(TransactionRece
return responses;
}

public Observable<ApprovalForAllEventResponse> approvalForAllEventObservable(EthFilter filter) {
return web3j.ethLogObservable(filter).map(new Func1<Log, ApprovalForAllEventResponse>() {
public Flowable<ApprovalForAllEventResponse> approvalForAllEventFlowable(EthFilter filter) {
return web3j.ethLogFlowable(filter).map(new io.reactivex.functions.Function<Log, ApprovalForAllEventResponse>() {
@Override
public ApprovalForAllEventResponse call(Log log) {
public ApprovalForAllEventResponse apply(Log log) {
Contract.EventValuesWithLog eventValues = extractEventParametersWithLog(APPROVALFORALL_EVENT, log);
ApprovalForAllEventResponse typedResponse = new ApprovalForAllEventResponse();
typedResponse.log = log;
Expand All @@ -260,10 +260,10 @@ public ApprovalForAllEventResponse call(Log log) {
});
}

public Observable<ApprovalForAllEventResponse> approvalForAllEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
public Flowable<ApprovalForAllEventResponse> approvalForAllEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(APPROVALFORALL_EVENT));
return approvalForAllEventObservable(filter);
return approvalForAllEventFlowable(filter);
}

@Deprecated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.web3j.eips.eip721.generated;
package org.web3j.contracts.eip721.generated;

import java.math.BigInteger;
import java.util.Arrays;
Expand All @@ -15,11 +15,12 @@

/**
* <p>Auto generated code.
* <p>ERC-721 Non-Fungible Token Standard, optional enumeration extension
* See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
* Note: the ERC-165 identifier for this interface is 0x780e9d63.
* <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.0-SNAPSHOT.
* <p>Generated with web3j version 4.1.1.
*/
public class ERC721Enumerable extends Contract {
private static final String BINARY = "Bin file was not provided";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.web3j.eips.eip721.generated;
package org.web3j.contracts.eip721.generated;

import java.math.BigInteger;
import java.util.Arrays;
Expand All @@ -15,11 +15,12 @@

/**
* <p>Auto generated code.
* <p>@title ERC-721 Non-Fungible Token Standard
* See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
* Note: the ERC-165 identifier for this interface is 0x5b5e139f.
* <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.0-SNAPSHOT.
* <p>Generated with web3j version 4.1.1.
*/
public class ERC721Metadata extends Contract {
private static final String BINARY = "Bin file was not provided";
Expand Down
2 changes: 1 addition & 1 deletion docs/source/eips.rst → docs/source/contracts.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EIPs supported by web3j
Contracts supported by web3j
=======================

EIP20
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Contents:
management_apis.rst
infura.rst
ens.rst
eips.rst
contracts.rst
trouble.rst
projects.rst
companies.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The below modules only depend on the core module.
* geth - Geth specific JSON-RPC module
* parity - Parity specific JSON-RPC module
* infura - Infura specific HTTP header support
* eips - Support for specific EIP's (Ethereum Improvement Proposals)
* contracts - Support for specific EIP's (Ethereum Improvement Proposals)

For most use cases (interacting with the network and smart contracts) the *core* module should be
all you need. The dependencies of the core module are very granular and only likely to be of use
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ include 'parity'
include 'rlp'
include 'tuples'
include 'utils'
include 'eips'
include 'contracts'
include 'pantheon'

0 comments on commit 1fd4ec8

Please sign in to comment.