-
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
Showing
14 changed files
with
7,505 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,13 @@ | ||
# Sample Hardhat Project | ||
|
||
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract. | ||
|
||
Try running some of the following tasks: | ||
|
||
```shell | ||
npx hardhat help | ||
npx hardhat test | ||
REPORT_GAS=true npx hardhat test | ||
npx hardhat node | ||
npx hardhat ignition deploy ./ignition/modules/Lock.js | ||
``` |
Empty file.
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 @@ | ||
0xC1e1888E1C3e0cD6229a1f40E40b5a8E101C5C3f |
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,16 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.20; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract TestToken is ERC20 { | ||
constructor()ERC20("chrome2","chr"){} | ||
|
||
function mint100tokens() public { | ||
_mint(msg.sender, 100*10**18); | ||
} | ||
|
||
function burn100tokens() public{ | ||
_burn(msg.sender, 100*10**18); | ||
} | ||
} |
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.20", | ||
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.