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 transfer 2 years ago
.github/workflows Update node.js.yml 2 years ago
build transfer 2 years ago
contracts transfer 2 years ago
test Fixed content, removed old tests 2 years ago
.gitignore Add support for glitch 3 years ago
LICENSE initial 3 years ago
README.md Update readme 2 years ago
package-lock.json Wrote deployment and stuff 2 years ago
package.json Wrote deployment and stuff 2 years ago
tsconfig.json Support func 0.2.0 (consts, pragma version, includes) (#4) 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 language
  • test/*.spec.ts - Test suite for the contracts in TypeScript running on Mocha test runner
  • build/_build.ts - Build script to compile the FunC code to Fift and TVM 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)
  • 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
    • 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
    • Tests in TypeScript are located in test/*.spec.ts
  • 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
  • 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
  • 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)
    • 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

License

MIT