Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@ngeth/hardhat
Advanced tools
`@ngeth/hardhat` is a collection of hardhat task that comes with : - Contract type generation for ethers - Script runner when local node boots up for better E2E tests - Local Block Explorer app - Local API endpoint to emulate common cloud services (o
@ngeth/hardhat
is a collection of hardhat task that comes with :
Note: @ngeth/hardhat
is built for Typescript project.
Nx support: @ngeth/hardhat
is built with nx and provides schematics and builders for a better nx integration.
npm install @ngeth/hardhat
Update an existing project
ng generate @ngeth/hardhat:ng-add
Note: Prefer the command above over ng add @ngeth/hardhat
which might be very slow.
Create a dedicated library
ng generate @ngeth/hardhat:library contracts
outputType
: "angular" | "typescript"
(default: "typescript")Setup a hardhat project following official documentation.
Update hardhat.config.ts
import '@nomiclabs/hardhat-ethers';
import '@ngeth/hardhat'; // <-- load @ngeth/hardhat
export default {
solidity: '0.8.11',
paths: {
sources: './contracts',
tests: './tests',
artifacts: './artifacts',
},
// Config for @ngeth/hardhat
ngeth: {
outputPath: './src',
runs: ['scripts/deploy.ts'],
explorer: {
api: 3000,
app: 3001
},
},
};
The field runs
let you run scripts before ngeth:serve
. This is very handy to create an initial state for your local app development. Let's see how to deploy a contract and save its address in the outputPath
directory:
scripts/deploy.ts
import * as hre from 'hardhat';
import { deploy, saveAddresses } from '@ngeth/hardhat';
async function main() {
// Deploy contract from the artifacts by their names & constructor arguments
const addresses = await deploy(hre, {
BaseERC721: [],
BaseERC20: ['SYB', 'Name'],
});
// Save the addresses of the contracts in the outputPath directory
await saveAddresses(hre, addresses);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
The addresses output will be a json file with the addresses by chain. This format is useful to manage addresses for contract from different chains.
addresses.json
{
"hardhat": {
"BaseERC721": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
"BaseERC20": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
}
}
outputPath
hardhat.config.ts
, to put generated contracts classesstring
runs
@ngeth:serve
after node has started. If array of string, parallel is false
string[] | { scripts: string[], parallel: boolean }
[]
explorer
false | { api: number, app: number }
{ api: 3000, app: 3001 }
withImports
boolean
false
@ngeth/hardhat
comes with 3 custom hardhat tasks.
If you use Nx or Angular, the schematics will create builders inside your workspace that wrap these tasks:
hardhat ngeth:build
(@ngeth/hardhat:build
):hardhat ngeth:serve
(@ngeth/hardhat:serve
):runs
.hardhat ngeth:test
(@ngeth/hardhat:test
):If you want to test with mocha, use the regular hardhat test
task.
This is an issue with metamask and hardhat https://hardhat.org/metamask-issue.html
This is an issue with metamask not beeing able to reset the nonce to 0 when you restart the node Go to Metamask > Setting > Advanced > Reset Account
FAQs
`@ngeth/hardhat` is a collection of hardhat task that comes with : - Contract type generation for ethers - Script runner when local node boots up for better E2E tests - Local Block Explorer app - Local API endpoint to emulate common cloud services (o
We found that @ngeth/hardhat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.