-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ignition deployment and group currency tasks (#12)
* use ignition deployment and group currency tasks * add minting task * fix linter * add missing field in package.json * remove unused .gitmodules * replace contract with deployed
- Loading branch information
1 parent
1a6f520
commit 1976977
Showing
43 changed files
with
1,266 additions
and
5,872 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 |
---|---|---|
@@ -1,3 +1,14 @@ | ||
NIL_RPC_ENDPOINT="http://127.0.0.1:8529/" | ||
PRIVATE_KEY="" | ||
WALLET_ADDR="" | ||
# Configuration for interacting with the =nil; cluster | ||
|
||
# Specify the RPC endpoint of your cluster | ||
# For example, if your cluster's RPC endpoint is at "http://127.0.0.1:8529", set it as below | ||
NIL_RPC_ENDPOINT: "http://127.0.0.1:8529" | ||
|
||
# Specify the private key used for signing transactions | ||
# This should be a hexadecimal string corresponding to your account's private key | ||
PRIVATE_KEY: "" | ||
|
||
# Specify the wallet address associated with your private key | ||
# Wallets can be created using the =nil; CLI | ||
# This address will be used for transactions on the =nil; network | ||
WALLET_ADDR: "0x" |
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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 1 | ||
commit-message: | ||
prefix: "deps" | ||
labels: | ||
- "dependencies" | ||
allow: | ||
- dependency-name: "@nilfoundation/hardhat-plugin" |
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,29 @@ | ||
name: Format | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Format | ||
run: npm run format |
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,29 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Lint | ||
run: npm run lint |
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"style": { | ||
"useTemplate": { | ||
"level": "off" | ||
} | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 80 | ||
}, | ||
"files": { | ||
"ignore": [ | ||
"node_modules", | ||
"artifacts", | ||
"cache", | ||
"typechain-types", | ||
"ignition/deployments" | ||
] | ||
} | ||
} |
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,34 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
import "@nilfoundation/smart-contracts/contracts/NilCurrencyBase.sol"; | ||
|
||
contract Currency is NilCurrencyBase { | ||
|
||
constructor(string memory _currencyName) payable { | ||
// Revert if the currency name is an empty string | ||
require(bytes(_currencyName).length > 0, "Currency name must not be empty"); | ||
|
||
tokenName = _currencyName; | ||
} | ||
receive() external payable {} | ||
|
||
/** | ||
* @dev Sends currency to a specified address | ||
* This is a workaround until we are able to send external messages to smart contracts | ||
* For production, consider implementing access control, such as Ownable from OpenZeppelin | ||
*/ | ||
function sendCurrencyPublic(address to, uint256 currencyId, uint256 amount) public { | ||
sendCurrencyInternal(to, currencyId, amount); | ||
} | ||
|
||
/** | ||
* @dev Mints new currency | ||
* This is a workaround until we are able to send external messages to smart contracts | ||
* For production, consider implementing access control, such as Ownable from OpenZeppelin | ||
*/ | ||
function mintCurrencyPublic(uint256 amount) public { | ||
mintCurrencyInternal(amount); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.