Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated code cannot deploy EIP-1559 compliant contract #77

Open
ocarlsen opened this issue Sep 22, 2021 · 0 comments
Open

Generated code cannot deploy EIP-1559 compliant contract #77

ocarlsen opened this issue Sep 22, 2021 · 0 comments

Comments

@ocarlsen
Copy link

ocarlsen commented Sep 22, 2021

After using the plugin to generate Java wrapper from DocumentRegistry.sol file, I try to deploy contract like this:

        public static void main(final String[] args) throws Exception {
            final String url = "https://rpc.goerli.mudit.blog/";
            final Web3j web3 = Web3j.build(new HttpService(url));

            final Credentials creds = Credentials.create("private-key");

            final String fromAddress = creds.getAddress();
            System.out.println("fromAddress = " + fromAddress);

            // Error processing transaction request: only replay-protected (EIP-155) transactions allowed over RPC
            final DocumentRegistry registryContract = DocumentRegistry.deploy(web3, creds, new org.web3j.tx.gas.DefaultGasProvider()).send();

            final String contractAddress = registryContract.getContractAddress();
            System.out.println("contractAddress = " + contractAddress);
        }

However, I get this exception:

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Error processing transaction request: only replay-protected (EIP-155) transactions allowed over RPC
	at org.web3j.tx.Contract.deploy(Contract.java:460)
	at org.web3j.tx.Contract.lambda$deployRemoteCall$7(Contract.java:608)
	at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:42)
	at io.kauri.tutorials.java_ethereum.DeployContract$DocumentRegistryContract.main(DeployContract.java:25)
Caused by: java.lang.RuntimeException: Error processing transaction request: only replay-protected (EIP-155) transactions allowed over RPC
	at org.web3j.tx.TransactionManager.processResponse(TransactionManager.java:176)
	at org.web3j.tx.TransactionManager.executeTransaction(TransactionManager.java:81)
	at org.web3j.tx.ManagedTransaction.send(ManagedTransaction.java:128)
	at org.web3j.tx.Contract.executeTransaction(Contract.java:367)
	at org.web3j.tx.Contract.create(Contract.java:422)
	at org.web3j.tx.Contract.deploy(Contract.java:456)

Plugin configuration is below.

            <plugin>
                <groupId>org.web3j</groupId>
                <artifactId>web3j-maven-plugin</artifactId>
                <version>4.8.2</version>
                <executions>
                    <execution>
                        <id>generate-sources-web3j</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-sources</goal>
                        </goals>
                        <configuration>
                            <packageName>me.gjeanmart.tutorials.javaethereum.contracts.generated</packageName>
                            <sourceDestination>${basedir}/target/generated-sources/contracts</sourceDestination>
                            <soliditySourceFiles>
                                <directory>${basedir}/src/main/resources</directory>
                                <includes>
                                    <include>**/*.sol</include>
                                </includes>
                            </soliditySourceFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Source DocumentRegistry.sol is attached: DocumentRegistry.sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant