-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d988f74
commit 9cdd45f
Showing
12 changed files
with
7,468 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`], | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Oops, something went wrong.