File tree Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ The project is configured in `hardhat.config.ts` to use the Silent Data Rollup n
3333}
3434```
3535
36- ## Smart Contract
36+ ## Smart Contracts
3737
3838The example includes a simple ` PrivateToken.sol ` contract that implements a privacy-focused ERC20 token with the following features:
3939
4040- Implements the ERC20 standard interface
4141- Only allows token holders to view their own balance through the ` balanceOf ` method
4242
43- ## Deployment
43+ These is also a very basic contract example called ` SimpleContract ` .
44+
45+ ## Deployment - PrivateToken
4446
4547The project uses Hardhat Ignition for deployments. The deployment module is configured in ` ignition/modules/PrivateToken.ts ` .
4648
@@ -52,14 +54,31 @@ npm run deploy
5254
5355This will:
5456
55- 1 . Compile the contract
57+ 1 . Compile the PrivateToken contract
58+ 2 . Deploy it to the Silent Data [ Rollup] network
59+
60+ ## Deployment - SimpleContract
61+
62+ The project uses Hardhat Ignition for deployments. The deployment module is configured in ` ignition/modules/SimpleContract.ts ` .
63+
64+ To deploy the contract:
65+
66+ ``` bash
67+ npm run deploy:simple-contract
68+ ```
69+
70+ This will:
71+
72+ 1 . Compile the SimpleContract contract
56732 . Deploy it to the Silent Data [ Rollup] network
5774
5875## Development
5976
6077### Available Scripts
6178
79+ - ` npm run compile ` - Compile all contracts
6280- ` npm run deploy ` - Deploy the PrivateToken contract using Hardhat Ignition
81+ - ` npm run deploy:simple-contract ` - Deploy the SimpleContract contract using Hardhat Ignition
6382
6483### Project Dependencies
6584
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+ pragma solidity ^ 0.8.20 ;
3+
4+ contract SimpleContract {
5+ uint256 public constant MY_CONSTANT = 42 ;
6+
7+ function getConstant () public pure returns (uint256 ) {
8+ return MY_CONSTANT;
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'
2+
3+ const SimpleContract = buildModule ( 'SimpleContract' , ( m ) => {
4+ const simpleContract = m . contract ( 'SimpleContract' )
5+
6+ return { simpleContract }
7+ } )
8+
9+ export default SimpleContract
Original file line number Diff line number Diff line change 11{
22 "name" : " example-hardhat-plugin" ,
33 "scripts" : {
4- "deploy" : " npx hardhat compile && npx hardhat ignition deploy ignition/modules/PrivateToken.ts"
4+ "compile" : " npx hardhat compile" ,
5+ "deploy" : " npx hardhat compile && npx hardhat ignition deploy ignition/modules/PrivateToken.ts" ,
6+ "deploy:simple-contract" : " npx hardhat compile && npx hardhat ignition deploy ignition/modules/SimpleContract.ts"
57 },
68 "devDependencies" : {
79 "@appliedblockchain/silentdatarollup-hardhat-plugin" : " file:../../packages/hardhat-plugin" ,
You can’t perform that action at this time.
0 commit comments