Skip to content

Commit

Permalink
feat: initiated the project
Browse files Browse the repository at this point in the history
  • Loading branch information
madhousegroup committed Jul 25, 2024
1 parent d988f74 commit 9cdd45f
Show file tree
Hide file tree
Showing 12 changed files with 7,468 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337
18 changes: 18 additions & 0 deletions contracts/Hello_swtr.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;

contract Swisstronik {
string private message;

constructor(string memory _message) payable {
message = _message;
}

function setMessage(string memory _message) public {
message = _message;
}

function getMessage() public view returns(string memory) {
return message;
}
}
12 changes: 12 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

module.exports = {
solidity: "0.8.19",
networks: {
swisstronik: {
url: "https://json-rpc.testnet.swisstronik.com/",
accounts: [`0x${process.env.PRIVATE_KEY}`],
},
},
};
15 changes: 15 additions & 0 deletions ignition/modules/Lock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");

const JAN_1ST_2030 = 1893456000;
const ONE_GWEI = 1_000_000_000n;

module.exports = buildModule("LockModule", (m) => {
const unlockTime = m.getParameter("unlockTime", JAN_1ST_2030);
const lockedAmount = m.getParameter("lockedAmount", ONE_GWEI);

const lock = m.contract("Lock", [unlockTime], {
value: lockedAmount,
});

return { lock };
});
32 changes: 32 additions & 0 deletions loader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
tput civis

# Clear Line
CL="\e[2K"
# Spinner Character
SPINNER="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"

function spinner() {
task=$1
msg=$2
while :; do
jobs %1 > /dev/null 2>&1
[ $? = 0 ] || {
printf "${CL}${task} Done\n"
break
}
for (( i=0; i<${#SPINNER}; i++ )); do
sleep 0.05
printf "${CL}${SPINNER:$i:1} ${task} ${msg}\r"
done
done
}

msg="${2-InProgress}"
task="${3-$1}"
$1 & spinner "$task" "$msg"

tput cnorm

# usage => ./loader.sh "<TIMER_TO_SLEEP>" "<PROGRESS>" "<TASK_NAME>"
# e.g => ./loader.sh "sleep 5" "..." "Installing Dependencies"
Loading

0 comments on commit 9cdd45f

Please sign in to comment.