itsnickbarry / hardhat-dependency-compiler Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Compile Solidity sources directly from NPM dependencies
License: MIT License
๐ฆ Compile Solidity sources directly from NPM dependencies
License: MIT License
I want the artifact of https://github.com/ZeframLou/create3-factory/blob/18cfad8d118b25a5092cdfed6bea9c932ca5b6eb/src/CREATE3Factory.sol to use in my hardhat scripts.
I tried
yarn add -D https://github.com/ZeframLou/create3-factory/#18cfad8d118b25a5092cdfed6bea9c932ca5b6eb
which added "create3-factory": "https://github.com/ZeframLou/create3-factory#18cfad8d118b25a5092cdfed6bea9c932ca5b6eb"
into dependencies in package.json, and the create3-factory
directory was created with all the repository files under node_modules
directory.
Then I added the path for dependencyCompiler
:
dependencyCompiler: {
paths: [
"create3-factory/src/CREATE3Factory.sol",
],
}
When I try to compile this error appears:
Error HH411: The library create3-factory, imported from contracts/hardhat-dependency-compiler/create3-factory/src/CREATE3Factory.sol, is not installed. Try installing it using npm.
What can be done?
Steps to reproduce:
Some hint how to reset this in the error msg would save some time.
To get rid of this error: There is empty directory hardhat-dependency-compiler
in the contracts folder. And just have to delete that.
hardhat.config.ts(17,7): error TS2322: Type '{ defaultNetwork: string; networks: any; solidity: string; dependencyCompiler: { paths: string[]; }; }' is not assignable to type 'HardhatUserConfig'.
Object literal may only specify known properties, and 'dependencyCompiler' does not exist in type 'HardhatUserConfig'.
hi there, i am working with a contract that depends on @uniswap/v3-periphery
, which in turn depends on @openzeppelin/[email protected]
which has a pragma solidity declaration of >=6, <8.
However my project uses 0.8.9 and the @openzeppelin/[email protected]
which uses a different structure, and fails when the dependency compiler path is used. I have installed the node_module in the sub directory, at project-root/node_modules/@uniswap/v3-periphery/node_modules/@openzeppelin/contracts
, using the resolutions
key as defined by yarn
, and that seemed to work (i can see the folder) but dependency compiler does not seem to see the resolutions folder or that there is a node_modules in the uniswap periphery folder.
All this to ask, does it make sense to utilize sub / localized dependencies when compiling dependencies?
I'm getting this error when passing a .sol file,
dependencyCompiler: { paths: [ '@zircon/periphery/contracts/Token.sol', '@zircon/periphery/contracts/WETH.sol', // '@zircon/energy/contracts/*', '@zircon/energy/contracts/interfaces/IZirconEnergyRevenue.sol', '@zircon/energy/contracts/interfaces/IZirconEnergyFactory.sol', '@zircon/energy/contracts/ZirconEnergyFactory.sol', ], },
the error is invoked only in the last contract
When trying to run slither it seems that the plugin breaks something with the compilation.
I opened an issue on slither as well as not sure whether the issue with the plugin or slither.
It's is not clear to most users how to set a particular solidity version for an imported dependency.
Description here: https://discord.com/channels/750408878008827925/754295965044703285/976983614321463296
When I try to test only one test file with hardhat test test/something.sol
it passes 0 tests skipped all of them.
And when I try to test all test files with hardhat test
some tests run without their before(() => { ... })
block and variables inited in that blocks are with undefined values.
It will be useful to possible use hardhat args for the test command.
This works fine on my local machine, but fails when I run my tests on GitHub actions:
yarn run v1.17.3
$ hardhat typechain
An unexpected error occurred:
{ Error: ENOTEMPTY: directory not empty, rmdir '/github/workspace/contracts/hardhat-dependency-compiler'
at Object.rmdirSync (fs.js:684:3)
at OverriddenTaskDefinition._action (/github/workspace/node_modules/hardhat-dependency-compiler/index.js:48:10)
at Environment._runTaskDefinition (/github/workspace/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:35)
at Environment.run (/github/workspace/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:25)
at SimpleTaskDefinition.config_1.task.setAction [as action] (/github/workspace/node_modules/@typechain/hardhat/src/index.ts:58:9)
at Environment._runTaskDefinition (/github/workspace/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:35)
at Environment.run (/github/workspace/node_modules/hardhat/src/internal/core/runtime-environment.ts:130:25)
at main (/github/workspace/node_modules/hardhat/src/internal/cli/cli.ts:188:15)
errno: -39,
syscall: 'rmdir',
code: 'ENOTEMPTY',
path: '/github/workspace/contracts/hardhat-dependency-compiler' }
error Command failed with exit code 1.
See discussion in #14.
Trying to use verification on okc network, configured in hardhat.config.ts
npx hardhat verify --network oktcTestnet --contract contracts/HMToken.sol:HMToken --constructor-args scripts/arguments.js 0x854EC65E9e5e973C458FC2c92F6E0CbD403f5b95
But got :
Error in plugin hardhat-dependency-compiler: resolved path must be inside of sources directory
This is my folder architecture
And I'm launching the command from the core folder
Any idea what could cause this issue? I tried without the args not working either. I don't understand the error message as my file are there
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.