https://github.com/adryan089/hardhat-deploy-contract
https://github.com/adryan089/hardhat-deploy-contract
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adryan089/hardhat-deploy-contract
- Owner: adryan089
- Created: 2024-07-23T23:14:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-24T00:45:17.000Z (11 months ago)
- Last Synced: 2025-01-24T13:22:46.150Z (4 months ago)
- Language: TypeScript
- Size: 132 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swisstronik Tesnet Techinal Task 1
link : [Click!](https://www.swisstronik.com/testnet2/dashboard)
Feel free donate to my EVM address
EVM :
```bash
0x9902C3A98Df4b240ad5496cC26F89bAb8058f4aE
```## Steps
### 1. Clone Repository
```bash
git clone https://github.com/Mnuralim/hardhat-deploy-contract.git
``````
cd hardhat-deploy-contract
```### 2. Install Dependency
```bash
npm install
```### 3. Set .env File
create .env file in root project
```bash
PRIVATE_KEY="your private key"
```### 4. Create Smart Contract
- Open contract folder
- Create Hello_swtr.sol file
- Copy this code and paste there```
/// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;//This contract is only intended for testing purposes
contract Swisstronik {
string private message;/**
* @dev Constructor is used to set the initial message for the contract
* @param _message the message to associate with the message variable.
*/
constructor(string memory _message) payable{
message = _message;
}/**
* @dev setMessage() updates the stored message in the contract
* @param _message the new message to replace the existing one
*/
function setMessage(string memory _message) public {
message = _message;
}/**
* @dev getMessage() retrieves the currently stored message in the contract
* @return The message associated with the contract
*/
function getMessage() public view returns(string memory){
return message;
}
}
```### 5. Compile Smart Contract
```bash
npm run compile
```### 6. Deploy Smart Contract
```bash
npm run deploy
```### 7. Get Message
```bash
npm run get-message
```### 8. Get Message
```bash
npm run set-message
```### 9. Finsihed
- Open the deployed-adddress.ts (location in utils folder)
- Copy the address and paste the address in testnet dashboard
- push this project to your github and paste your repository link in testnet dashboard