{"_id":"@dedge_security/hardhat2-deployment-notifier","_rev":"3-08dc3af29f6f93dd94bcc8be4464fc3c","name":"@dedge_security/hardhat2-deployment-notifier","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@dedge_security/hardhat2-deployment-notifier","version":"0.1.0","keywords":["hardhat","hardhat-plugin","deployment","notifier","ethereum","smart-contracts"],"author":{"name":"dedge-security"},"license":"MIT","_id":"@dedge_security/hardhat2-deployment-notifier@0.1.0","maintainers":[{"name":"ds_ruben","email":"rjimenez@dedgesecurity.com"},{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"}],"homepage":"https://dedgesecurity.com/","dist":{"shasum":"94a04660669fd1ea13ff7162585c828bddd66976","tarball":"https://registry.npmjs.org/@dedge_security/hardhat2-deployment-notifier/-/hardhat2-deployment-notifier-0.1.0.tgz","fileCount":4,"integrity":"sha512-ZlbQK23e1Wro3QLBfSj1kH9qfocl/nnLfbRqLOr+S+jEJ3t5+f8e7iU/k9fJZu5LGf/br0wkXwvzd6emmP5vDA==","signatures":[{"sig":"MEUCIQDJXhc/cSv+bchEqn1kmO5aergbYNujwdEATsr6LiT+eAIgB4JF5IzYwQALs4XXxBafBelmHHdQ8ZaMzyfQAbj7tSI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10320},"main":"dist/index.js","engines":{"node":">=20.0.0"},"gitHead":"fa9b8fa282ecc31e4c3c7927fbda0f99070ef12c","scripts":{"test":"cd example && npm run test:ci","build":"node build.js","clean":"rm -rf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.2","description":"Hardhat plugin to notify endpoints on contract deployment","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.19.12"},"peerDependencies":{"hardhat":"^2.28.4"},"_npmOperationalInternal":{"tmp":"tmp/hardhat2-deployment-notifier_0.1.0_1772635482108_0.8540239001480168","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dedge_security/hardhat2-deployment-notifier","version":"0.1.1","keywords":["hardhat","hardhat-plugin","deployment","notifier","ethereum","smart-contracts"],"author":{"name":"dedge-security"},"license":"MIT","_id":"@dedge_security/hardhat2-deployment-notifier@0.1.1","maintainers":[{"name":"ds_ruben","email":"rjimenez@dedgesecurity.com"},{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"}],"homepage":"https://dedgesecurity.com/","dist":{"shasum":"4c249dc689af603794597cc551b423614add970b","tarball":"https://registry.npmjs.org/@dedge_security/hardhat2-deployment-notifier/-/hardhat2-deployment-notifier-0.1.1.tgz","fileCount":4,"integrity":"sha512-AhhOQc7JOFI/hzTXWAzl8u9oNHOf0d6lIZVQOtVzAkPMVToLDQLXpq1ho76Xhq4aVaY2vo7D1Ux0Ei8Rhr7hxw==","signatures":[{"sig":"MEYCIQDKw0st1ndbP5dp4bmmQSbNRV+BjjOBq2Y8xJJ8V7duvgIhAK2Xv/k2B6SGWSGCfz4CB/d1O6fBbpxd+n7lewBBAY3s","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10431},"main":"dist/index.js","engines":{"node":">=20.0.0"},"gitHead":"35addaad542708541af9e9c951e8b0cda9b7904f","scripts":{"test":"cd example && npm run test:ci","build":"node build.js","clean":"rm -rf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.2","description":"Hardhat plugin to notify endpoints on contract deployment","directories":{},"_nodeVersion":"20.20.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.19.12"},"peerDependencies":{"hardhat":"^2.28.4"},"_npmOperationalInternal":{"tmp":"tmp/hardhat2-deployment-notifier_0.1.1_1773140800014_0.727879763699435","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dedge_security/hardhat2-deployment-notifier","version":"0.2.0","description":"Hardhat plugin to notify endpoints on contract deployment","main":"dist/index.js","keywords":["hardhat","hardhat-plugin","deployment","notifier","ethereum","smart-contracts"],"author":{"name":"dedge-security"},"license":"MIT","homepage":"https://dedgesecurity.com/","publishConfig":{"access":"public"},"repository":{"type":"git","url":""},"engines":{"node":">=20.0.0"},"scripts":{"build":"node build.js","prepublishOnly":"npm run build","test":"cd example && npm run test:ci","clean":"rm -rf dist"},"peerDependencies":{"hardhat":"^2.28.4"},"devDependencies":{"esbuild":"^0.19.12"},"_id":"@dedge_security/hardhat2-deployment-notifier@0.2.0","gitHead":"4fb94250ea483c7d0a54c94095f48faf8e705b59","_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-JyYIShV51i0VWcWx+tFiVGQDhVSAygmlxqNJcxwmkdpJQX4vDvjUprgh1Sy/yqvzmTTGXO6cHVw5/vD3Vu1wng==","shasum":"8e6fbcfe5eabc2f03ee17efa7bce602d1acf6e62","tarball":"https://registry.npmjs.org/@dedge_security/hardhat2-deployment-notifier/-/hardhat2-deployment-notifier-0.2.0.tgz","fileCount":4,"unpackedSize":12074,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCwi0XUCRaGVTGnTOi9dOZuQCyL0l/c6A5yYNGys4wG7AIhAPNCLdnJ5R+FljcNxami7ntJLNjk+lYem0O1sDGUVQal"}]},"_npmUser":{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"},"directories":{},"maintainers":[{"name":"ds_ruben","email":"rjimenez@dedgesecurity.com"},{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hardhat2-deployment-notifier_0.2.0_1773155066882_0.010547699880565364"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-04T14:44:42.035Z","modified":"2026-03-10T15:04:27.207Z","0.1.0":"2026-03-04T14:44:42.261Z","0.1.1":"2026-03-10T11:06:40.135Z","0.2.0":"2026-03-10T15:04:27.041Z"},"author":{"name":"dedge-security"},"license":"MIT","homepage":"https://dedgesecurity.com/","keywords":["hardhat","hardhat-plugin","deployment","notifier","ethereum","smart-contracts"],"repository":{"type":"git","url":""},"description":"Hardhat plugin to notify endpoints on contract deployment","maintainers":[{"name":"ds_ruben","email":"rjimenez@dedgesecurity.com"},{"name":"ds-rabadie","email":"rabadie@dedgesecurity.com"}],"readme":"# @dedge_security/hardhat2-deployment-notifier\n\nA Hardhat plugin that automatically sends deployment information to a configurable endpoint whenever a smart contract is deployed.\n\n## Requirements\n\n- Node.js 20+\n- Hardhat 2.x\n\n## Features\n\n- Automatically captures deployment information\n- Sends data to configurable HTTP endpoint\n- Includes git commit ID, contract address, ABI, constructor arguments, file path, and contract name\n- Configurable timeout and error handling\n- Works with any EVM network supported by Hardhat\n\n## Installation\n\n```bash\nnpm install --save-dev @dedge_security/hardhat2-deployment-notifier\n```\n\n## Configuration\n\nAdd the following to your `hardhat.config.js`:\n\n```javascript\nmodule.exports = {\n  // ... other config\n  deploymentNotifier: {\n    endpoint: \"http://localhost:3000/api/deployments\", // Required: endpoint URL\n    timeout: 10000, // Optional: request timeout in ms (default: 10000)\n    failOnError: false, // Optional: throw error if notification fails (default: false)\n  },\n};\n```\n\n## Usage\n\n### Method 1: Using the Custom Deploy Task\n\nThe plugin provides a custom `deploy` task:\n\n```bash\n# Deploy without constructor arguments\nnpx hardhat deploy --contract MyContract --network localhost\n\n# Deploy with constructor arguments\nnpx hardhat deploy --contract MyContract arg1 arg2 arg3 --network localhost\n```\n\n### Method 2: Using in Deployment Scripts\n\nYou can also use the plugin's functionality directly in your deployment scripts:\n\n```javascript\nconst hre = require(\"hardhat\");\n\nasync function main() {\n  const MyContract = await ethers.getContractFactory(\"MyContract\");\n  const contract = await MyContract.deploy(arg1, arg2);\n  await contract.waitForDeployment();\n  const address = await contract.getAddress();\n\n  // Get deployment information\n  const filePath = hre.deploymentNotifier.getContractFilePath(\"MyContract\");\n  const abi = hre.deploymentNotifier.getContractABI(\"MyContract\");\n  const bytecode = hre.deploymentNotifier.getContractBytecode(\"MyContract\");\n\n  // Send notification\n  await hre.deploymentNotifier.notifyDeployment({\n    address,\n    contractName: \"MyContract\",\n    constructorArgs: [arg1, arg2],\n    abi,\n    bytecode,\n    filePath,\n    transactionHash: hre.deploymentNotifier.getDeploymentTransactionHash(contract),\n    deployerAddress: hre.deploymentNotifier.getDeployerAddress(contract),\n  });\n}\n```\n\n## Data Sent to Endpoint\n\nThe plugin sends a POST request with the following JSON payload\n\n```json\n{\n  \"gitCommitId\": \"abc123...\",\n  \"gitRepositoryUrl\": \"https://github.com/org/repo.git\",\n  \"contractName\": \"MyContract\",\n  \"contractAddress\": \"0x...\",\n  \"filePath\": \"contracts/MyContract.sol\",\n  \"network\": \"localhost\",\n  \"chainId\": \"31337\",\n  \"timestamp\": \"2024-01-01T00:00:00.000Z\",\n  \"transactionHash\": \"0x...\",\n  \"deployerAddress\": \"0x...\",\n  \"constructorArguments\": [...],\n  \"abi\": [...],\n  \"bytecode\": \"0x6080604052...\"\n}\n```\n\n## API Reference\n\n### `hre.deploymentNotifier.notifyDeployment(deploymentData)`\n\nSends deployment notification to the configured endpoint.\n\n**Parameters:**\n- `deploymentData` (object):\n  - `address` (string): Contract address\n  - `contractName` (string): Contract name\n  - `constructorArgs` (array): Constructor arguments\n  - `abi` (array): Contract ABI\n  - `bytecode` (string): Deployment bytecode (hex)\n  - `filePath` (string): Source file path\n  - `transactionHash` (string, optional): Deployment transaction hash\n  - `deployerAddress` (string, optional): Address that deployed the contract\n\n**Returns:** Promise that resolves when notification is sent\n\n### `hre.deploymentNotifier.getGitCommitId()`\n\nGets the current git commit ID.\n\n**Returns:** string | null\n\n### `hre.deploymentNotifier.getContractFilePath(contractName)`\n\nGets the source file path for a contract.\n\n**Parameters:**\n- `contractName` (string): Name of the contract\n\n**Returns:** string | null\n\n### `hre.deploymentNotifier.getContractABI(contractName)`\n\nGets the ABI for a contract.\n\n**Parameters:**\n- `contractName` (string): Name of the contract\n\n**Returns:** array | null\n\n### `hre.deploymentNotifier.getContractBytecode(contractName)`\n\nGets the deployment bytecode for a contract.\n\n**Parameters:**\n- `contractName` (string): Name of the contract\n\n**Returns:** string (hex string with \"0x\" prefix)\n\n### `hre.deploymentNotifier.getDeploymentTransactionHash(contract)`\n\nGets the deployment transaction hash from a deployed contract instance (returned by `ContractFactory.deploy()`).\n\n**Parameters:**\n- `contract` (object): Deployed contract instance\n\n**Returns:** string | null\n\n### `hre.deploymentNotifier.getDeployerAddress(contract)`\n\nGets the deployer address from a deployed contract instance (returned by `ContractFactory.deploy()`).\n\n**Parameters:**\n- `contract` (object): Deployed contract instance\n\n**Returns:** string | null\n\n## Error Handling\n\nBy default, if the notification fails, the plugin will log a warning but not fail the deployment. To make deployments fail if notification fails, set `failOnError: true` in the configuration.\n\n## Example\n\nSee the `example/` directory for a complete working example with a mock server.\n\n\n## Build and Test\n\n```bash\nnpm run clean\nnpm run build\nnpm run test\n```\n\n## Publishing to npm\n\nTrigger a github release with tag `hardhat2-vX.X.X`\n\n### Version Management\n\n1. Update the version in `package.json` following [semantic versioning](https://semver.org/):\n   - Patch version (1.0.0 → 1.0.1): Bug fixes\n   - Minor version (1.0.0 → 1.1.0): New features, backward compatible\n   - Major version (1.0.0 → 2.0.0): Breaking changes\n\n## License\n\nMIT\n\n","readmeFilename":"README.md"}