Skip to content

Commit

Permalink
Init ignition/modules/EventManager.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
s-damian committed Feb 9, 2025
1 parent d7833f2 commit 25900d7
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ npx hardhat node
```


### Make Scripts Executable

Ensure that the shell scripts are executable:

```bash
chmod +x sh/*.sh
```


### Compile and Deploy

Compile contract(s):
Expand All @@ -146,7 +155,7 @@ npx hardhat compile
Deploy contract(s) on local network:

```bash
npx hardhat run ./scripts/deploy.ts --network localhost
npm run deploy localhost
```

> In the terminal your EventManager Contract Address will be displayed.
Expand Down
2 changes: 1 addition & 1 deletion docs/Localnet-to-Testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ npx hardhat compile
Deploy contract(s) on Sepolia testnet network:

```bash
npx hardhat run ./scripts/deploy.ts --network sepolia
npm run deploy sepolia
```

> In the terminal your EventManager Contract Address will be displayed.
Expand Down
11 changes: 11 additions & 0 deletions ignition/modules/EventManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";

// npx hardhat ignition deploy ignition/modules/EventManager.ts --network localhost
const EventManagerModule = buildModule("EventManagerModule", (m) => {
// Déploiement du contrat EventManager.
const eventManager = m.contract("EventManager");

return { eventManager };
});

export default EventManagerModule;
17 changes: 0 additions & 17 deletions ignition/modules/Lock.ts

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"lint-sol:fix": "prettier --write --plugin=prettier-plugin-solidity 'contracts/**/*.sol'",
"lint-solhint": "solhint 'contracts/**/*.sol'",
"lint-solhint:fix": "solhint 'contracts/**/*.sol' --fix",
"lint-all": "npm run lint-sol:fix && npm run lint:fix"
"lint-all": "npm run lint-sol:fix && npm run lint:fix",
"deploy": "./sh/deploy.sh"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"hardhat": "^2.22.18",
"hardhat": "^2.22.16",
"prettier": "^3.3.2",
"prettier-plugin-solidity": "^1.4.0",
"solhint": "^5.0.3",
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions sh/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Vérifier si un argument est fourni.
if [ -z "$1" ]; then
echo "Error: Network must be specified as an argument."
echo "Usage: $0 <network>"
exit 1
fi

# Déployer sur le réseau spécifié.
npx hardhat ignition deploy ignition/modules/EventManager.ts --network $1

0 comments on commit 25900d7

Please sign in to comment.