TON Dev Chat
8003d9b6ece5ab616955e5b3aaae6d0f8e32154d093009b3cfaf5dee32eb5807c5c0
). How to transform it to a usable address for transactions? for example like this EQB5qiXT6-Zqx4sBXduG_pYmXRurYqbn2dE1B2U2V9rNdJpW
?
pip3 install -U pytonlib
#define MAX(a, b) a >= b ? a : b
getNftItemsByOwnerAddress
that may work well for me. Anyway the idea behind this is to save locally the owners of every collection periodically right? There's no other way, starting from an address to get its nft?
async function getWallet(mnemonic) {
const keyPair = await mnemonicToKeyPair(mnemonic);
const wallet = ton.wallet.create({publicKey: keyPair.publicKey, wc: 0});
const address = await wallet.getAddress();
const data = address.toString(true, true, true, false);
console.log(data);
}
getWallet(myMnemonic);
const TonWeb = require('tonweb');
const {generateMnemonic, mnemonicToKeyPair} = require('tonweb-mnemonic');
const nacl = TonWeb.
utils.
nacl;
const {NftCollection, NftItem, NftMarketplace, NftSale} = TonWeb.
token.
nft;
const tonProvider = new TonWeb.
HttpProvider('https://toncenter.com/api/v2/jsonRPC', {apiKey:
....});
const ton = new TonWeb(tonProvider);
address.toString(true, true, true, false);
burn
but not to do weird extra-movements.
get_data
, defining a global function of unknown typefunc -V
FunC semantic version: v0.2.0
Build information: [ Commit: a9ba27382c7f25618323356b9f408281c6c27704, Date: 2022-05-25 23:27:36 +0300]
fift -V
Fift build information: [ Commit: a9ba27382c7f25618323356b9f408281c6c27704, Date: 2022-05-25 23:27:36 +0300]
connection refused
error when I run the lite client. Any idea what could be causing the issue?
wallet3-code.fc
there, but I’m not able to compile it to the same output as the fift file in the repo
toncli start wallet
cd wallet
toncli deploy -n testnet
the same way it was in docs.() recv_external (slice in_msg) impure {
var valid_until = in_msg~load_uint(32);
throw_if(35, valid_until <= now());
var dest_addr = in_msg~load_bits(256);
var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(dest_addr)
.store_coins(1)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.end_cell();
accept_message();
send_raw_message(msg, 3);
}
I think that's better than screenshots
load_msg_addr
Addr,
not addr,
(fift is a little crazy, yeah)
addr,
and Addr,
by the way?
256 u,
: write 256uint. Meanwhile full address serialization also include address format tag, workchain, 256bit part ans some additional fields. Addr,
consume from stack two elements: workchain and hash-part and handle this
compute_gas_fees
and other_fee
?addr_std$10 anycast:(## 1) {anycast = 0}```
toncli run_tests
procedure already defined
might come up even having only 2 procedures in test file.? Pretty confusing
[ 1][t 0][2022-08-03 17:54:16.452700431][Fift.cpp:67] top: abort
level 1: swap { <continuation 0x5592f7b91d00> } if HERE drop
level 2: [in @PROC:<{:] over @fail-ifdef HERE 2 { <continuation 0x5592f7c09180> } does null swap @doafter<{ 0 32 u,
level 3: <text interpreter continuation>
level 4: <continuation 0x5592f7bae2d0>
level 5: <text interpreter continuation>
[ 1][t 0][2022-08-03 17:54:16.452739603][fift-main.cpp:204] Error interpreting file `/tmp/tmpohjkaaen.fif`: contract_tests.fif:84: PROC:<{:procedure already defined
`
That's
very bizarre. I've looked at the contract_test.fif and at :84 it's just a definition of test_example function and no double defs in fif output
already defined procedure
during the runtime
s1 s3 XCHG
prior to that prelude
cell build_new_addr( int addr ){
cell new_addr = begin_cell()
.store_uint(1, 2)
.store_uint(5, 9)
.store_uint(addr, 5)
.end_cell();
return new_addr;
}
procedure already defined
Command '['path_to_func.exe', '-V']' returned non-zero exit status 3222601730'
(I am running console as admin). I found this command in the Toncli python script, it just tries to run func.exe
. So it sees func.exe but cannot run it. When I try to run func.exe manually, it gives error "couldn't start the program correctly", so apparently it's some system problem. My laptop has Windows 11. Somebody knows how to fix this?
~dump msg_value;
CMake Error at /opt/homebrew/Cellar/cmake/3.23.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.23.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/Cellar/cmake/3.23.3/share/cmake/Modules/FindOpenSSL.cmake:578 (find_package_handle_standard_args)
terminal/CMakeLists.txt:4 (find_package)
Referenced from: /usr/local/bin/fift
Reason: no suitable image found. Did find:
/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib: mach-o, but wrong architecture
counter.fif
: counter.fif:8: PROCINLINE:<{:-?
1 <= a, b <= 1048576
, so there aren't any tests in which a or b is out of range specified by you
invoke_method
undefined ). Then it says build successful. Then there is several lines of weird logs, ending with error: Error interpreting file C:\Users\andyr\AppData\Local\Temp\tmpkuarq9x3.fif
: contract_tests.fif:27: }END>c:main
procedure not definedgetters
or get-functions (like in this contest) and recv_internal
or recv_external
Please, note that you need to specify unique function_selector
By default, for recv_internal
it is 0 (and recv_external
is -1). But for getters it is unique.function selector
for your getter, you should run toncli build
and then open ./build/contract.fif
file and find there something like this 93344 DECLMETHOD gcd
93344
will be what are you looking for
method_id(0)
I already use function selector to reference the function. Now there is a new error, which indicates that there is no code of the function. Error: Error interpreting file C:\Users\andyr\AppData\Local\Temp\tmpdft_qdou.fif
: contract_tests.fif:27: }END>c:invoke_method: procedure declared but left undefinedthrow_if(100, exit_code != 0);
but how I can receive exit_code to figure out what happend?
#DEBUG#: stack(2 values) : 7 C{3AA53057A70DD9BA69D96D763CD5DE8EF2F65B88A879B04A02949D54AA4D75B9}
throw(10);
in begin of method) but it still 7...
invoke_method
is optimised out because result is not used
func
and fift
on my Ubuntu 20.04 machine. I downloaded the binaries for Ubuntu 18.04 and they don't run. They exit with no output, and exit code 132.Error 2
.
export CC=clang && export CXX=clang++