Thank you for considering contributing to this project! Contributions are welcome and appreciated.
We are currently accepting contributions in these directions:
- Fixing existing bugs and compliance with TEPs.
- Improving documentation and tooling.
- Optimizing Tact source code.
If you want to add new functionality that hasn't been implemented before, it's better to open the issue first and discuss it with the maintainers.
This repo has different types of tests:
- Tests that were copied from reference TEP implementation.
- Extended tests for additional functionality and implementation details.
- End-to-end tests for compatibility with API providers.
We strongly advice against changing or editing the first type, since most-likely any new changes and code improvements shouldn't break them (only in case of the bug in the original jetton implementation).
You can run unit tests with yarn test.
To run end-to-end tests locally, you need:
- Deploy Jetton instance in testnet/mainnet. You can use
contract.deploy.tsscript for this. - Complete the
.envfile with deployed Jetton data, so verification script could use it to try to index your Jetton in the blockchain. - Run
yarn verify-deployment.
To run benchmarks use yarn bench. Note that benchmarks fail "early" on the first gas consumption failed assert.
To add new benchmark entry run yarn bench:add. This will acquire latest gas usage for all benchmark scenarios and add new entry to the result file.
If you want to update the latest entry instead of adding a new one, run yarn bench:update.
To add benchmark for a new type of operation (e.g. new receiver, chain of operations on the Jetton contract, etc.), take a look at the src/benchmarks/environment.ts. This file contains logic for getting the gas usage and asserting execution results. After this, you will need to add new assert statement to src/benchmarks/benchmark.ts.
Since the scope of this repository is relatively small, it's better to first discuss the changes, since they might be not planned or already in work.
Start by forking the repository to your GitHub account. This will allow you to make changes without affecting the original repository.
Clone your forked repository to your local machine:
git clone https://github.com/your-username/jetton.git
cd jettonInstall the required dependencies using Yarn:
yarn install
yarn deduplicateMake your changes to the codebase. Ensure that your changes align with the project's goals and standards.
Build contracts and run the test suite to ensure your changes do not break existing functionality.
If you are adding new features, consider adding tests for them as well.
If you are changing existing Tact code or adding new contracts functionality, it is mandatory to add benchmarks to your pull request.
Once your changes are ready, push them to your forked repository and create a pull request to the main repository. Provide a clear description of your changes and why they are necessary. Please link any new PR's with the issues they are closing. Please, allow editing your PR by maintainers, as they won't bother you and in case of any small issues present will edit your PR directly
- Follow the existing code style and structure.
- Write clear and concise commit messages.
- Ensure your changes are well-documented.
- If your changes include new features, update the relevant documentation files.
- Update benchmarks if you are modifying Tact source code.
If you encounter any issues or have suggestions for improvements, feel free to open an issue in the repository. Provide as much detail as possible to help us understand and address the problem.
By contributing to this project, you agree that your contributions will be licensed under the MIT License.