diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..2dba3ee --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,27 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '21 6 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/Metadata.JSON b/Metadata.JSON new file mode 100644 index 0000000..a4988d5 --- /dev/null +++ b/Metadata.JSON @@ -0,0 +1,7 @@ +{ +"name": "NH Token", +"symbol": "NH", +"decimals": 9, +"image": "https:// /logo.png +"description": "NH Token is a compliant, secure Defi asset on Ton." +} diff --git a/Metadata/info.json b/Metadata/info.json new file mode 100644 index 0000000..e94b241 --- /dev/null +++ b/Metadata/info.json @@ -0,0 +1,16 @@ +{ + "name": "NH Token", + "symbol": "NH", + "type": "ERC20", + "decimals": 18, + "chainId": 137, + "address": "0xf930cf4150f7cb1108b30df610f07188fd794398", + "logoURI": "https://nishant939.github.io/nh-token/metadata/logo.png", + "description": "NH Token is a Polygon-based utility token designed for e-commerce payments in Switzerland, with full AML compliance and anti-whale protections.", + "website": "https://nh-token.io", + "explorer": "https://polygonscan.com/token/0xf930cf4150f7cb1108b30df610f07188fd794398", + "socials": { + "twitter": "https://twitter.com/nh_token", + "telegram": "https://t.me/nh_token" + } +} diff --git a/NH Tonkeeper token sources (1).zip b/NH Tonkeeper token sources (1).zip new file mode 100644 index 0000000..c078d0a Binary files /dev/null and b/NH Tonkeeper token sources (1).zip differ diff --git a/logo.jpg b/logo.jpg new file mode 100644 index 0000000..cea7653 Binary files /dev/null and b/logo.jpg differ diff --git a/n_i_s_h_a_n_n_s.fc b/n_i_s_h_a_n_n_s.fc new file mode 100644 index 0000000..b829b11 --- /dev/null +++ b/n_i_s_h_a_n_n_s.fc @@ -0,0 +1,71 @@ +#include "imports/stdlib.fc"; + +const op::increase = "op::increase"c; ;; create an opcode from string using the "c" prefix, this results in 0x7e8764ef opcode in this case + +;; storage variables + +;; id is required to be able to create different instances of counters +;; since addresses in TON depend on the initial state of the contract +global int ctx_id; +global int ctx_counter; + +;; load_data populates storage variables using stored data +() load_data() impure { + var ds = get_data().begin_parse(); + + ctx_id = ds~load_uint(32); + ctx_counter = ds~load_uint(32); + + ds.end_parse(); +} + +;; save_data stores storage variables as a cell into persistent storage +() save_data() impure { + set_data( + begin_cell() + .store_uint(ctx_id, 32) + .store_uint(ctx_counter, 32) + .end_cell() + ); +} + +;; recv_internal is the main function of the contract and is called when it receives a message from other contracts +() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { + if (in_msg_body.slice_empty?()) { ;; ignore all empty messages + return (); + } + + slice cs = in_msg_full.begin_parse(); + int flags = cs~load_uint(4); + if (flags & 1) { ;; ignore all bounced messages + return (); + } + + load_data(); ;; here we populate the storage variables + + int op = in_msg_body~load_uint(32); ;; by convention, the first 32 bits of incoming message is the op + int query_id = in_msg_body~load_uint(64); ;; also by convention, the next 64 bits contain the "query id", although this is not always the case + + if (op == op::increase) { + int increase_by = in_msg_body~load_uint(32); + ctx_counter += increase_by; + save_data(); + return (); + } + + throw(0xffff); ;; if the message contains an op that is not known to this contract, we throw +} + +;; get methods are a means to conveniently read contract data using, for example, HTTP APIs +;; they are marked with method_id +;; note that unlike in many other smart contract VMs, get methods cannot be called by other contracts + +int get_counter() method_id { + load_data(); + return ctx_counter; +} + +int get_id() method_id { + load_data(); + return ctx_id; +} diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..6a1f2ff --- /dev/null +++ b/netlify.toml @@ -0,0 +1,7 @@ +[build] + publish = "dist" # folder that contains final HTML/CSS/JS + command = "npm run build" # your build command (use "" if no build) + +[dev] + command = "npm run dev" +