TON Dev Chat
* Starting on December 13 at 12PM UTC, the price of random numbers will increase by 1 every 3 hours until it reaches 99, at which point they will be removed from sale.does this mean after december 13, we can not buy any number for 9 ton?
load*
operation reads next n
-bits from the bit-string and removes them. So you need to consecutively apply these operations based on the TL-B schema of your binary data.
() execute (cell) impure asm "c5 POPCTR";
TON
was registered as 607 at https://github.com/satoshilabs/slips/blob/master/slip-0044.md. Is it the same coin?
Address.toString(true,true,false)
wallet.address.to_string(True, True, True)
/get
command to the bot, it asks for your address, and then sends you 2 TON on the testnet.
.store_slice("Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"a)
;)
sudo apt install build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev
export CC=clang
export CXX=clang++
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -j$(nproc)
brew install ton
and use it in toncli.
toncli start nft_collection
/local/
tho, since I think I deploy successfully tho?
alexg@Aleksejs-MacBook-Air tsc-3-solution % docker run --rm -it \
-v ~/Dev/tsc-3-solution:/code \
-v ~/Dev/toncli/:/root/.config \
toncli-local update_libs
INFO:
🥰 First time run - i'll create config folder 4you and save some stuff there
INFO:
🤖 Check all executables are installed...
ERROR: [Errno 13] Permission denied: '/code/func'
WARNING:
🤖 Can't find executable for func, please specify it, e.g.: /usr/bin/func
Path:
/usr/local/bin/func
INFO: [' Commit: e37edfb6ab699dc7b430b458ac78c87acf4920f0', ' Date: 2022-10-03 22:36:45 +0300]']
ERROR: [Errno 13] Permission denied: '/code/fift'
WARNING:
🤖 Can't find executable for fift, please specify it, e.g.: /usr/bin/fift
Path:
/usr/local/bin/fift
INFO: [' Commit: e37edfb6ab699dc7b430b458ac78c87acf4920f0', ' Date: 2022-10-03 22:36:45 +0300]\nThis is toncli-local version of Fift']
WARNING:
🤖 Can't find executable for lite-client, please specify it, e.g.: /usr/bin/lite-client
Path:
/usr/local/bin/lite-client
INFO: [' Commit: e37edfb6ab699dc7b430b458ac78c87acf4920f0', ' Date: 2022-10-03 22:36:45 +0300]']
INFO:
🥰 Feel free to change it if needed: /root/.config/toncli/config.ini
INFO: Succesfully copied fift-libs func-libs test-libs
alexg@Aleksejs-MacBook-Air test_for_build % docker run --rm -it \
-v ~/Dev/test_for_build:/code \
toncli-local build
INFO:
🥌 Build [] successfully, check out ./build
./fift -V && ./func -V && ./lite-client -V
from that directory (you don't need sudo here, btw)
chmod +x
for func and lite-client as well.
M:\TON\ton-win64-binaries>pip install bitstring
Requirement already satisfied: bitstring in c:\users\win10_game_os\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (4.0.1)
b5ee9c72
- it's BOC prefix[ 1][t 0][2022-12-19 06:43:52.3848540][Fift.cpp:67] top: <text interpreter continuation>
[ 1][t 0][2022-12-19 06:43:52.3849547][fift-main.cpp:204] Error interpreting file `.\counter.fif`: counter.fif:1: PROGRAM{:-?
sudo apt install openssl libssl-dev
chmod +x fift
problem with libcrypto (2 screen)
cat /etc/*release
?
cell in_msg_cell
, slice in_msg
? 🤔
send_raw_msg
function
recv_internal (int balance, int msg_value, cell in_msg_full, slice in_msg_body)
recv_internal
function is always same?
int balance
why?
var ds = get_data().begin_parse();
toncli
, I get this output:PS C:\Users\Maxim\Desktop\ton> toncli
INFO: 🥰 First time run - i'll create config folder 4you and save some stuff there
INFO: 🤖 Check all executables are installed...
INFO: Adding path to executable func success!
ERROR: Command '['C:\\Users\\Maxim\\Desktop\\ton\\fift.exe', '-V']' returned non-zero exit status 3221225501.
WARNING: 🤖 Can't find executable for fift, please specify it, e.g.: /usr/bin/fift
Path
tried to do by this instruction have such conclusions:PS C:\Users\Maxim> func -V
FunC semantic version: v0.2.0
Build information: [ Commit: 8537dd60e6341474967f8e9d04a7b7f6a060ec36, Date: 2022-06-13 20:02:32 +0300]
PS C:\Users\Maxim> lite-client -V
lite-client build information: [ Commit: 8537dd60e6341474967f8e9d04a7b7f6a060ec36, Date: 2022-06-13 20:02:32 +0300]
PS C:\Users\Maxim> fift -V
PS C:\Users\Maxim>
What could be the problem?
operation
? i want to know which function of the contract is executed by the operation shown in tonscan.
slice sting = “string”;
cell begin_cell().store_slice(string).end_cell();
slice string = “.txt”;
begin_cell().store_uint(_item_index, _item_index_len).store_slice(string).end_cell();
“index.txt”
will not equal the cell with index
number and ”.txt”
slice.
func
or fift
. Please help me. And I'm using Ubuntu 22.04func: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
torskiy@DESKTOP-PCD7KCG:~$ docker build . -t toncli-local
[+] Building 0.0s (1/2)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3536167109/Dockerfile: no such file or directory
torskiy@DESKTOP-PCD7KCG:~$ docker run --rm -it toncli-local
ERROR: Command '['/usr/local/bin/fift', '-V']' died with <Signals.SIGILL: 4>.
ERROR: Command '['/usr/local/bin/fift', '-V']' died with <Signals.SIGILL: 4>.
ERROR: 😳 Executable path is not working correct, output:
WARNING: 🤖 Can't find executable for fift, please specify it, e.g.: /usr/bin/fift
Path:
sudo apt install libatomic1 libssl-dev
?
apt install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev
git submodule update --init
ldd fift
--depth=1
to fetch only the last commits, then it will be faster
cell dictval = 0
? because just cell dictval;
gave an error
int value = 123;slice to int:
slice slice_from_int = begin_cell().store_uint(value, 256).end_cell().begin_parse();
slice value = {{{dict get or something else}}}
int int_from_slice = value~load_uint(256)
slice to_string(int n) {
builder b = begin_cell();
tuple chars = null();
do {
int r = n~divmod(10);
chars = cons(r + "0"u, chars);
} until (n == 0);
do {
int char = chars~list_next();
b~store_uint(char, 8);
} until (null?(chars));
return b.end_cell().begin_parse();
}
Slice
class with all the useful Cell parsing methods. It also has a pretty good test coverage. But it's not up to date, regarding the latest vanilla TonWeb version. I'm planning to update it soon.
tonlib
(a C++ library that implements TON stuff). It will execute the contract using your message and will calculate the fees without actually delivering it to the validator. If you are not on the web, it could be all done locally. There are actually solutions to execute contracts locally from JS, maybe you can use that.
contract.fc:4:8: error: undefined function
`get_data
, defining a global function of unknown typelvalue expression constructor is 9
fatal: cannot compile lvalue expression with unknown constructor
filed
that is 'Addresses'? Would like to see which smartContractAddresses or Wallet are contributing more in daily Txs.
dump("ok");
, in other not, all the difference) work in different ways. When i have dump("ok")
everything is ok, but when i remove it i get not a tuple of valid size
error, how is this possible?PS C:\Users\yuria\learning\TON\lesson5,6> toncli build
ERROR: 🤟 It is not project root [C:\Users\yuria\learning\TON\lesson5,6] - I can't build project without project
project.yaml
file
contract:
func:
- func/code.func
tests:
- tests/contract_tests.fc
func/code.func
to func/code.fc
() process(slice msg) impure {
if(~ msg.is_null()){
~dump(msg);
cell storage = msg~load_ref();
process(msg~load_ref().begin_parse());
processNode(msg, storage);
}
}
processNode
call, i've set it to impure
Fift build information: [ Commit: ba8f700e26620707f8ff14e46cc9a040a1b3f97c, Date: 2022-11-22 16:30:53 +0300]
"
Error interpreting standard preamble file `Fift.fif`: cannot locate file `Fift.fif`
Check that correct include path is set by -I or by FIFTPATH environment variable, or disable standard preamble by -n.
"VCVTUSI2SD
, It's used by rocksdb and is an AVX512
instruction. TON monorepo builds with -march=native
and all capabilities of the host builder are used, which makes the binaries less portable. (AVX512
is not widely available capability, only on special Core-X, Xeon series + Icelake series)int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool
src:MsgAddressInt dest:MsgAddressInt
value:CurrencyCollection ihr_fee:Grams fwd_fee:Grams
created_lt:uint64 created_at:uint32 = CommonMsgInfo;
method, is there any more description for how to use this method in `tonWeb
?idx
for?crc32
usage?cacheBits
?flags
for?
TL-B schema of the data
, yeh, I know what is the input I send in.Cell[]
from on-chain data.
toncli run_tests
INFO: 🌈 Start tests
/Users/ololo/Library/Application Support/toncli/test-libs/bad_messages_generator.func:19:16: error: undefined function `generate_internal_address`, defining a global function of unknown type
slice ssrc = generate_internal_address()
TVMExecutionResultFail
exit code 7 in TVMExecuteConfig?
enum class Excno : int {
none = 0,
alt = 1,
stk_und = 2,
stk_ov = 3,
int_ov = 4,
range_chk = 5,
inv_opcode = 6,
type_chk = 7,
cell_ov = 8,
cell_und = 9,
dict_err = 10,
unknown = 11,
fatal = 12,
out_of_gas = 13,
virt_err = 14,
total
};
export const JettonDefaultWallet_errors: { [key: string]: string } = {
'2': `Stack undeflow`,
'3': `Stack overflow`,
'4': `Integer overflow`,
'5': `Integer out of expected range`,
'6': `Invalid opcode`,
'7': `Type check error`,
'8': `Cell overflow`,
'9': `Cell underflow`,
'10': `Dictionary error`,
'13': `Out of gas error`,
'32': `Method ID not found`,
'34': `Action is invalid or not supported`,
'37': `Not enough TON`,
'38': `Not enough extra-currencies`,
'128': `Null reference exception`,
'129': `Invalid serialization prefix`,
'130': `Invalid incoming message`,
'131': `Constraints error`,
'132': `Access denied`,
'133': `Contract stopped`,
'134': `Invalid argument`,
'4429': `Invalid sender`,
'13650': `Invalid bounced message`,
'16059': `Invalid value`,
'62972': `Invalid balance`,
}
tuple one() {
(tuple) two() {
Argument of type 'import(".../hello-world/node_modules/ton/dist/boc/Cell").Cell' is not assignable to parameter of type 'import(".../hello-world/node_modules/ton-contract-executor/node_modules/ton/dist/boc/Cell").Cell'.
Types of property 'bits' are incompatible.
Type 'import(".../hello-world/node_modules/ton/dist/boc/BitString").BitString' is not assignable to type 'import(".../hello-world/node_modules/ton-contract-executor/node_modules/ton/dist/boc/BitString").BitString'.
Property '#private' in type 'BitString' refers to a different member that cannot be accessed from within type 'BitString'.
contract = await SmartContract.fromCell(
initCodeCell, initDataCell);
a
and b
in same order they have written into your slice cs
. For example:int a = cs~load_uint(32);
int b = cs~load_uint(64);
You can find out some thoughts in this lessons.
84478511
into ip address like 1.1.1.1
async function send_gramms(addr, amount) {
try {
const PubK=Uint8Array.from(config.PublicKey);
const SecK=Uint8Array.from(config.SecretKey);
const tonweb = new TonWeb(new TonWeb.HttpProvider('https://toncenter.com/api/v2/jsonRPC', {apiKey: '***'}));
let wallet = tonweb.wallet.create({publicKey: PubK});
const address = await wallet.getAddress();
console.log("Your address: "+address.toString(true,true));
var balance = await tonweb.getBalance(address);
console.log("Balance: "+balance);
const seqno = await wallet.methods.seqno().call();
console.log(seqno);
const transfer = wallet.methods.transfer({
secretKey: SecK,
toAddress: addr,
amount: TonWeb.utils.toNano(amount), // ton amount
seqno: seqno,
payload: '\xF0\x9F\x98\x81 ItchDesu Faucet', // Message
sendMode: 3,
});
//const transferFee = await transfer.estimateFee();
//console.log(transferFee);
const transferSended = await transfer.send(); // send transfer query to blockchain
//console.log(transferSended);
if(transferSended && transferSended['@type']=='ok'){
console.log('TON sent');
return true;
}else{
return false;
}
} catch(e) {
console.log('Error',e);
return e;
}
}``
seqno: (seqno || 0),