1.0.1 • Published 12 months ago

@mrmiff/swisstronik v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Swisstronik Tesnet Techinal Task 1

link : Click!

Feel free donate to my EVM address

EVM :

0xc8562af3a9a63f43b03b85Eff5A8755A2377c137

Steps

1. Clone Repository

git clone https://github.com/Mnuralim/hardhat-deploy-contract.git
cd hardhat-deploy-contract

2. Install Dependency

npm install

3. Set .env File

create .env file in root project

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

npm run compile

6. Deploy Smart Contract

npm run deploy

7. Get Message

npm run get-message

8. Get Message

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

by : github : Mnuralim twitter : @MiffMr telegram : @MrMiff

//0xc8562af3a9a63f43b03b85Eff5A8755A2377c137//

1.0.1

12 months ago