This jetton allows you to set one address to blacklist and add or remove multiple addresses to whitelist. If address is in blacklist and in whitelist in same time, you can send to this address.
contracts
- source code of all the smart contracts of the project and their dependencies.wrappers
- wrapper classes (implementingContract
from ton-core) for the contracts, including any [de]serialization primitives and compilation functions.tests
- tests for the contracts.scripts
- scripts used by the project, mainly the deployment scripts.
npx blueprint build
or yarn blueprint build
npx blueprint test
or yarn blueprint test
npx blueprint run
or yarn blueprint run
npx blueprint create ContractName
or yarn blueprint create ContractName
-
npm i
-
Need to fix
@ton/blueprint
typescript library- Go to node_modules/@ton/blueprint/dist/network/NetworkProvider.d.ts
- Or just click to NetworkProvider in scripts/bwController.ts on 46 line of code
- api(): TonClient4 | TonClient; + api(): TonClient4 & TonClient;
-
To build all contracts at once write in terminal
npx blueprint build --all
-
You need mnemonic phrase of your wallet to interact with contract. Write in terminal to create .env
touch .env
-
replace WALLET_MNEMONIC variable with your 24 words of seed phrase
-
Be sure that on this wallet there is enough money for deploying and other actions with smart contract
-
There are two ways to add metadata. OnChain means that data will be at blockchain, OffChain means that data will be on external server. If you want use OffChain, you can Upload your metadata.json file to github or another internet place. File to upload locate in path data/jetton-metadata.json. When you upload get link with raw data only. Or if you want use OnChain method, you can use only local file at data/jetton-metadata.json, customize it inside file or do it late in menu.
{ "name": "BW Jetton", "description": "Sample BW of Jetton", "symbol": "BWJ", "decimals": 9, "image": "https://avatars.githubusercontent.com/u/104382459?s=80&v=4" }
-
To deploy Jetton Minter write
npx blueprint run deployJettonMinterDiscoverable
- Then select
mainnet
ortestnet
- Then select
Mnemonic
Or for shortcut write
npx blueprint run deployJettonMinterDiscoverable --testnet --mnemonic --tonviewer
- Press enter to select admin as address of your wallet
- Choose
OnChain (local json file)
orOffChain (external url link)
- If
OnChain (local json file)
selected- Get attention to current data, if you want choose, write
n
and hit enter - Then you can change admin data or metadata, like
Admin
,Name
,Description
,Symbol
,Decimals
,Image
or justQuit
from this menu. Just select and write what you need. Data is replaced in current metadata file. - Then if everythin Ok write
y
- Get attention to current data, if you want choose, write
- If
OffChain (external url link)
selected- Paste jetton-metadata.json raw link from github or your another place and hit enter
- If you want to edit Admin or Url, write
n
and then chooseAdmin
orUrl
options and write what you want - Then if everything is ok, write
y
- After that there maybe several options.
Success!
You are see your minter address and link in scan. Copy address and go to the next step.Contract is already deployed
It means that contract at your wallet with that code of jetton minter and metadata link is already deployed. If your want create new, just change the link of your metadata.json to metadata-1.json (or add another character) and paste it the next time. It is the quick way to fix that. Later I will add on chain data to play with it more better.Fetch failed
,error with orbs.network
and etc. Please turn off vpn, check your internet connection and try again. It is problem with network.
- Then select
-
Open scripts/bwController.ts (bw is black and white), scroll to the almost of the ending of file and to the
499 line
of code replace address of minterAddress constant for new deployed contract of the previous step. Double check this step. If you miss this step. There will be notification that data in contract don't match with provided data. -
Next step is minting tokens. Write in terminal command below or if you already have options skip this step.
npx blueprint run bwController
- Then select
mainnet
ortestnet
- Then select
Mnemonic
Or for shortcut write
npx blueprint run bwController --testnet --mnemonic --tonviewer
- If you are admin of the contract you will see admin + user actions, if not, only user actions.
- By arrows choose
Mint
and hit enter - Hit enter to select your address as destination of minting tokens. You can paste any address
- Write by numbers how much your want to mint. Any number multiple for
1e9
, eg. You write 123. Then you get 123 000 000 000 jettons to your wallet. - Write
yes
and hit enter orno
for redo prev step. - After successfully minted, check your address.
- Then select
-
To
Transfer
write in terminal:npx blueprint run bwController --testnet --mnemonic --tonviewer
- Select
Transfer
- Paste here addres to transfer and hit enter
- Write amount in numbers. If your write
777
tokens, you will transfer777
tokens to your address - Write
yes
and hit enter orno
for redo prev step. - Success!
- Select
-
To
Set address to blacklist
write command below or skip this step if you have already menu options.npx blueprint run bwController --testnet --mnemonic --tonviewer
- Select
Set blacklist address
- Paste address for blacklist and hit enter. You can set only one blacklist address in one time. If you want replace with new blacklist address just re-choose it and retry all commands again.
- Write
y
and hit enter to set address orn
for re-paste it. - Success!
- Select
-
To
Add address to whitelist
write command below or skip this step if you have already menu options.npx blueprint run bwController --testnet --mnemonic --tonviewer
- Select
Add address to whitelist
- Paste address to add to whitelist and hit enter
- Write
y
and hit enter to set address orn
for re-paste it. - Success!
- Select
-
To
Remove address from whitelist
write command below or skip this step if you have already menu options.npx blueprint run bwController --testnet --mnemonic --tonviewer
- Select
Remove address from whitelist
- Paste exact address to remove matched address from whitelist and hit enter
- Write
y
and hit enter to set address orn
for re-paste it. - Success!
- Select
-
To
Witdhraw TON from Jetton Minter
write command below or skip this step if you have already menu options.npx blueprint run bwController --testnet --mnemonic --tonviewer
- Select
Witdhraw TON from Jetton Minter
- Wait some time. Script fetch balance of Jetton Minter...
- Write exact amount of TON you want to withdraw in float mode. Eg. 1.115. Then JettonMinter will send to you 1.115000000 TON. It automatically converts to TON format underhood.
- If you write greater or negative or zero amount you will appropriate warning and another try to write correct amount
- Write
yes
and hit enter to set address orno
for re-write it. - Success!
- Select
-
Also you have Info actions. Choose what you like and get specific data you want.
Get blacklist address
Get whitelist address(es)
Jetton Info
-
Always you can select
Quit
option to go out from this menu.
- ✅ Works properly on wallet v4
- ⛔️ Works unstable on wallet v5, need update of blueprint, I commited update, below there is instructions how to hardcode update yourself in blueprint module.
- Everytime Jetton Minter increase self TON balance on every transaction. That's why there is for admin withdraw function.
- To do work for wallet v5 need:
- Go to node_modules/@ton/blueprint/dist/network/send/MnemonicProvider.js and at 28 line of code add
v5r1: ton_1.WalletContractV5R1,
const wallets = { v1r1: ton_1.WalletContractV1R1, v1r2: ton_1.WalletContractV1R2, v1r3: ton_1.WalletContractV1R3, v2r1: ton_1.WalletContractV2R1, v2r2: ton_1.WalletContractV2R2, v3r1: ton_1.WalletContractV3R1, v3r2: ton_1.WalletContractV3R2, v4: ton_1.WalletContractV4, + v5r1: ton_1.WalletContractV5R1, };
- Then when you will paste mnemonic phrase second line of code will be
WALLET_VERSION=v5r1
- Go to node_modules/@ton/blueprint/dist/network/send/MnemonicProvider.js and at 28 line of code add
- Write tlb schemes for new functions
- Finish tests and complete whole run of tests to green
- ✅ Add opportunity to choose offchain or onchain metadata
- ✅ Fix onchain metadata function in wrapper
⚠️ (Not Stable yet) Add wallet v5 support- Add for withdraw function in Jetton Minter to not spend TON for withdraw for rent and gas.