Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow Hardhat to deploy smart contracts #259

Closed
pathornteng opened this issue Jun 23, 2022 · 3 comments
Closed

Allow Hardhat to deploy smart contracts #259

pathornteng opened this issue Jun 23, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request limechain P2
Milestone

Comments

@pathornteng
Copy link

Problem

Currently, users will get Internal error when using Hardhat to deploy a smart contract. The transaction contains INVALID_SOLIDITY_ADDRESS error as shown in https://hashscan.io/#/testnet/transaction/0.0.46030734-1655918065-252797715?t=1655918078.085442000

Please feel free to use the following script to reproduce the problem
https://github.com/pathornteng/hedera-hardhat

Note: I can use Truffle to deploy a smart contract to Hedera network just fine.

Solution

Hardhat might be using different formats or values. Further investigation is required.

Alternatives

No response

@pathornteng pathornteng added the enhancement New feature or request label Jun 23, 2022
@Nana-EC
Copy link
Collaborator

Nana-EC commented Jul 5, 2022

Likely related to #193
Let's investigate why truffle works fine, does it just not check for a valid contract id?

@natanasow
Copy link
Collaborator

@pathornteng

As far as I can see, you are using a contract with console.logs in it.

That's not supported in Hedera, and the thrown error is INVALID_SOLIDITY_ADDRESS. Remove console.log lines and import statement from the head.

👇 Here is an example of a clean contract 👇

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

contract Greeter {
    string private greeting;

    constructor(string memory _greeting) {
        greeting = _greeting;
    }

    function greet() public view returns (string memory) {
        return greeting;
    }

    function setGreeting(string memory _greeting) public {
        greeting = _greeting;
    }
}

@pathornteng
Copy link
Author

@natanasow You are right. I removed the console.log and it works!

Thanks for the answer :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request limechain P2
Projects
Archived in project
Development

No branches or pull requests

3 participants