Skip to content

chore: community standard updates #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bug Report
description: Submit bug report.
title: 'Bug: '
labels: ['bug']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: To reproduce
description: Steps to reproduce the behavior
placeholder: |
1. Send message 0x000 '...'
2. Contract exit with 1 '....'
3. See error
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual result
description: What actually happened?
placeholder: Not OK
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected result
description: What did you expect to happen?
placeholder: OK
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Documentation report
description: Something wrong with documentation.
title: 'Docs: '
labels: ['documentation']
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this report!
- type: input
id: url
attributes:
label: Document url
description: Please fill this input with url to page with error
placeholder: README.md
validations:
required: false
- type: textarea
id: wrong
attributes:
label: What is wrong
description: What confused you?
validations:
required: true
- type: textarea
id: fix
attributes:
label: Possible solution
description: If it's possible please specify how do you see good way to fix it
validations:
required: false
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature request
description: Suggest an idea for this project.
title: 'Add '
labels: ['enhancement']
body:
- type: markdown
attributes:
value: |
Thank for your attention to project!
- type: textarea
id: related
attributes:
label: Is your feature request related to a problem
description: Please describe
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**Summary of changes**:

Please include short summary of changes

Close # (issue)
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Continuous Integration

on:
pull_request:
branches: ['master']
merge_group:
types: [checks_requested]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: NPM Install
run: npm install
- name: Build contracts
run: npm run build
- name: Run tests
run: npm test
44 changes: 21 additions & 23 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
name: Commit Lint

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
merge_group:
types: [ checks_requested ]
pull_request:
branches: ['master']
merge_group:
types: [checks_requested]

jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install commitlint
run: npm install
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install commitlint
run: npm install

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate merge queue
if: github.event_name == 'merge_group'
run: npx commitlint --last --verbose
- name: Validate merge queue
if: github.event_name == 'merge_group'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
28 changes: 0 additions & 28 deletions .github/workflows/contracts.yml

This file was deleted.

138 changes: 58 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,71 @@
# TON Jetton contract on Tact

ℹ️ Jetton implementation for The Open Network written in Tact language. Metadata is fully decentralized, it means that full token metadata is stored on-chain.
[![Build status](https://img.shields.io/github/actions/workflow/status/supadupadao/jetton/ci.yml?label=CI)](https://github.com/supadupadao/jetton/actions/workflows/ci.yml)
[![GitHub License](https://img.shields.io/github/license/supadupadao/jetton)](https://github.com/supadupadao/jetton/blob/master/LICENSE)
[![TON](https://img.shields.io/badge/blockchain-TON-0098EA)](https://ton.org)
[![Tact](https://img.shields.io/badge/lang-Tact-000000)](https://github.com/tact-lang/tact)
[![Work in progress](https://img.shields.io/badge/WORK%20IN%20PROGRESS-DO%20NOT%20USE%20IN%20PRODUCTION-ff0000)](https://github.com/supadupadao/jetton/issues)

ℹ️ Implementation of Jetton standard for The Open Network written in Tact language

⚠️ <b>Warning!</b> This contract is not 100% tested and I would not recommend using it in production yet.

❤️ I'll be very grateful for any kind of contribution: code, docs, issues, bug reports, github stars or whatever

<!-- # Deploy TODO -->
# Features overview

# Development
This project implements TON Jetton standard with following TEPs:

- [TEP-64](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md) - Token Data Standard
- [TEP-74](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md) - Fungible tokens (Jettons) standard
- [TEP-89](https://github.com/ton-blockchain/TEPs/blob/master/text/0089-jetton-wallet-discovery.md) - Discoverable Jettons Wallets

This is default Tact blueprint project with default commands:
TEPs logic isolated in corresponding Tact Traits in `contracts/teps` directory.

- `npm run build` - build project and compile contracts
- `npm test` - run contracts tests
- `npx blueprint run` - execute script from `/scripts` directory
## On-Chain metadata

Smart contract code allows to store fully decentralized it means that full token metadata is stored on-chain. Also contract ABI has handlers for flexible managing metadata parameters

# Docs

## Project structure

- `contracts` - source code of all the smart contracts
- - `jetton` - entrypoints of jetton contracts with dependencies (traits) specified
- - - `master.tact` - jetton master contract entrypoint
- - - `wallet.tact` - jetton wallet contract entrypoint
- - `teps` - traits with [TEPs](https://github.com/ton-blockchain/TEPs/) realization
- - - `messages` - API messages for TEP traits
- - - - `discoverable` - messages related to the tep89 "discoverable" trait
- - - - `jettonStandard` - messages related to the tep74 jettons standard
- - - `tep64.tact` - trait implementation of [TEP 64](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md)
- - - `tep74.tact` - trait implementation of [TEP 74](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md)
- - - `tep89.tact` - trait implementation of [TEP 89](https://github.com/ton-blockchain/TEPs/blob/master/text/0089-jetton-wallet-discovery.md)
- - `consts.tact` - project constants
- - `errors.tact` - custom project error codes (exit codes)
- - `messages.tact` - contracts API messages

## Exit codes

[Standard Tact exit codes](https://docs.tact-lang.org/book/exit-codes)

<table>
<tr>
<th>Code</th>
<th>Description</th>
</tr>
<tr><td colspan=2>Tact lang exit codes</td></tr>
<tr>
<td>132</td>
<td>
Invalid owner of contract.</br><i>Occurs when sender wallet is not owner of receiver contract when it is required.</i>
</td>
</tr>
<tr><td colspan=2>Custom exit codes</td></tr>
<tr>
<td>6901</td>
<td>No enough TON on contract balance.</td>
</tr>
<tr>
<td>6902</td>
<td>No enough TON in message</td>
</tr>
<tr>
<td>6903</td>
<td>
Jetton already initialized.<br/><i>Occurs when you send <code>0x133701</code> message to jetton that has been already initialized.</i>
</td>
</tr>
<tr>
<td>6904</td>
<td>
Max supply exceeded.</br><i>Occurs when you try mint more tokens than max_supply parameter allow.</i>
</td>
</tr>
<tr>
<td>6905</td>
<td>
Invalid transfer amount.</br><i>Occurs when you try to send, burn or mint 0 tokens.</i>
</td>
</tr>
<tr>
<td>6906</td>
<td>
Minting already disabled.</br><i>Occurs when you attempt to enable minting after it has been permanently disabled.</i>
</td>
</tr>
<tr>
<td>6907</td>
<td>
Minting is disabled.</br><i>Occurs when you try to mint tokens while the minting functionality is disabled.</i>
</td>
</tr>
</table>
[Read our docs in Gitbook](https://docs.supadupa.space/jetton)

# Development

## Prerequisites

To work with project locally you will need [Node.js](https://nodejs.org/en) version 22+. Clone this repo and run the following command to install dependencies

```
npm i
```

## How to build contract

The following command will compile contract source code. TVM byte code files will be stored in `build/` directory.

```
npm run build
```

## All allowed commands

- `npm run build` - build project and compile contracts
- `npm test` - run contracts tests
- `npx blueprint run` - execute script from `/scripts` directory

# How can i contribute?

We are very appreciate if you want to contribute. Please read out [contributing guideline](docs/CONTRIBUTING.md) document.

If something was unclear in this document please [open issue](https://github.com/supadupadao/jetton/issues) and we will help you.

# How can i process it?

If you want to build application that uses this jetton, read our [development guideline](docs/DEVELOPMENT.md). It describes interaction ways with this jetton.

If something was unclear in this document please [open issue](https://github.com/supadupadao/jetton/issues) and we will help you.

# License

[MIT](https://opensource.org/license/mit)
Loading
Loading