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.
Lev
b7ce982abc
|
2 years ago | |
---|---|---|
.github/workflows | 2 years ago | |
build | 2 years ago | |
contracts | 2 years ago | |
test | 2 years ago | |
.gitignore | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 2 years ago | |
package-lock.json | 2 years ago | |
package.json | 2 years ago | |
tsconfig.json | 3 years ago |
README.md
BTON jetton - wrapped TON
Overview
There are two contracts here:
- Minter contract
- Jetton wallet contract that stores jettons for a user
What does this repo contain?
contracts/*.fc
- Smart contracts for TON blockchain written in FunC languagetest/*.spec.ts
- Test suite for the contracts in TypeScript running on Mocha test runnerbuild/_build.ts
- Build script to compile the FunC code to Fift and TVM opcodesbuild/_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)build/cli.js
- CLI for interacting with the jettons
Development instructions
-
Write code
- FunC contracts are located in
contracts/*.fc
- 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
- Standalone root contracts are located in
- Each contract may have optional but recommended auxiliary files:
- 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
- TL-B file defining the encoding of its data and message ops in
- Tests in TypeScript are located in
test/*.spec.ts
- FunC contracts are located in
-
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)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
- In the root repo dir, run in terminal
-
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
- In the root repo dir, run in terminal
-
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 - The deployment wallet is configured in
.env
(created automatically if not exists), with contents:
DEPLOYER_MNEMONIC="mad nation chief flavor ..."
(24 secret words)
- Each contract to deploy should have a script
- 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
- To deploy to testnet instead (where TON coins are free), run
- Make sure all contracts are built and your setup is ready to deploy:
License
MIT