This page helps you to instantly start developing with TIP-3 and deploy your own token here and now. Read next guides, if you want to go deeper.
Source code
You can inspect the source code of TIP-3 token implementation by link.
How to deploy your own token
You need to have an installed Smart Contract Development Environment. If you haven't already, follow this tutorial.
Initialize your token project
npxlockliftinit--pathmy-first-token> [INFO] New Locklift project initialized in .> [INFO] Installing required dependencies...> [INFO] > added 181 packages, and audited 182 packages in 13s> 23 packages are looking for funding> run `npmfund`for details> found 0 vulnerabilities> [INFO] LockLift initialized in my-first-token happy hacking!
Install dependencies
Add TIP-3 implementation repository as a devDependencies in corresponding section of package.json file
Specify installed contracts to external contracts section of locklift config, by providing path to contracts artifacts (.abi.json files, .tvc files etc., most commonly placed in a build folder of smart contracts projects) and contract names array.
Let's move to deploy action. Firstly, we make a new deploy script in scripts directory for TokenRoot contract.
01-deploy-token-root.ts
import { Address, getRandomNonce, toNano, zeroAddress } from"locklift"import BigNumber from"bignumber.js"asyncfunctionmain() {constsigner= (awaitlocklift.keystore.getSigner("0"))!// Address of initial token supply recipient (write your own)constinitialSupplyTo=newAddress("0:7542...")// Address of token owner (write your own)constrootOwner=newAddress("0:7542...")// Name of the token constname="First Venom Token"// Symbol of the tokenconstsymbol="FVT"// How many token will be issued instantly after deploy constinitialSupply=0// The number of decimals the token uses constdecimals=18// If `true`, disables token mintingconstdisableMint=false// If `true`, disables token burning by root constdisableBurnByRoot=false// If `true`, pauses token burning constpauseBurn=false/* Returns compilation artifacts based on the .sol file name or name from value config.externalContracts[pathToLib]. */constTokenWallet=locklift.factory.getContractArtifacts("TokenWallet")/* Deploy the TIP-3 Token Root contract. @params deployWalletValue: Along with the deployment of the root token, the wallet will be automatically deployed to the owner. This is the amount of EVERs that will be sent to the wallet. */const { contract: tokenRoot } =awaitlocklift.factory.deployContract({ contract:"TokenRoot", publicKey:signer.publicKey, initParams: { deployer_: zeroAddress,// this field should be zero address if deploying with public key (see source code) randomNonce_:getRandomNonce(), rootOwner_: rootOwner, name_: name, symbol_: symbol, decimals_: decimals, walletCode_:TokenWallet.code, }, constructorParams: { initialSupplyTo: initialSupplyTo, initialSupply:newBigNumber(initialSupply).shiftedBy(decimals).toFixed(), deployWalletValue:toNano(1), mintDisabled: disableMint, burnByRootDisabled: disableBurnByRoot, burnPaused: pauseBurn, remainingGasTo: zeroAddress, }, value:toNano(5), })console.log(`${name}: ${tokenRoot.address}`)}main().then(() =>process.exit(0)).catch(e => {console.log(e)process.exit(1) })
Finally, we can deploy a new token to local network. For this, make sure local node is running, if not follow the next command