You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.7 KiB

2 years ago
# BTON jetton - wrapped TON
2 years ago
## Overview
2 years ago
There are two contracts here:
- Minter contract
- Jetton wallet contract that stores jettons for a user
2 years ago
## What does this repo contain?
* `contracts/*.fc` - Smart contracts for TON blockchain written in [FunC](https://ton.org/docs/#/func) language
* `test/*.spec.ts` - Test suite for the contracts in TypeScript running on [Mocha](https://mochajs.org/) test runner
2 years ago
* `build/_build.ts` - Build script to compile the FunC code to [Fift](https://ton-blockchain.github.io/docs/fiftbase.pdf) and [TVM](https://ton-blockchain.github.io/docs/tvm.pdf) opcodes
* `build/_deploy.ts` - Deploy script to deploy the compiled code to TON mainnet (or testnet)
* `build/_setup.ts` - Setup script to install build dependencies (used primarily for Glitch.com support)
2 years ago
* `build/cli.js` - CLI for interacting with the jettons
2 years ago
## Development instructions
2 years ago
2 years ago
* Write code
2 years ago
* FunC contracts are located in `contracts/*.fc`
2 years ago
* Standalone root contracts are located in `contracts/*.fc`
* Shared imports (when breaking code to multiple files) are in `contracts/imports/*.fc`
* Contract-specific imports that aren't shared are in `contracts/imports/mycontract/*.fc`
* Each contract may have optional but recommended auxiliary files:
* [TL-B](https://ton.org/docs/#/overviews/TL-B) file defining the encoding of its data and message ops in `contracts/mycontract.tld`
* TypeScript file that implements the encoding of its data and message ops in `contracts/mycontract.ts`
* Tests in TypeScript are located in `test/*.spec.ts`
2 years ago
* Build
* In the root repo dir, run in terminal `npm run build`
* Compilation errors will appear on screen
* Resulting build artifacts include:
* `mycontract.fif` - Fift file result of compilation (not very useful by itself)
2 years ago
* `mycontract.compiled.json` - the binary code cell of the compiled contract (for deployment). Saved in a hex format within a json file to support webapp imports
2 years ago
* Test
* In the root repo dir, run in terminal `npm run test`
* Don't forget to build (or rebuild) before running tests
* Tests are running inside Node.js by running TVM in web-assembly using `ton-contract-executor`
2 years ago
* Deploy
* Make sure all contracts are built and your setup is ready to deploy:
* Each contract to deploy should have a script `build/mycontract.deploy.ts` to return its init data cell
2 years ago
* The deployment wallet is configured in `.env` (created automatically if not exists), with contents:<br>
`DEPLOYER_MNEMONIC="mad nation chief flavor ..."` (24 secret words)
* To deploy to mainnet (production), run in terminal `npm run deploy`
* To deploy to testnet instead (where TON coins are free), run `npm run deploy:testnet`
* Follow the on-screen instructions of the deploy script
2 years ago
2 years ago
# License
MIT