Trying to create a simple wallet smart contract by myself to learn FunC, but my transactions keep failing with exit code 34... What am I doing wrong?
I'm fixing it for like a hour already but no success

Aug 3, 2022, 6:44 AM
Aug 3, 2022, 6:44 AM
I guess dest_addr is malformed
Aug 3, 2022, 6:50 AM
1) that's how I'm loading it in smart contract
2) that's how am I passing it to external message
getting dest_addr from cmd
() 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
Aug 3, 2022, 6:53 AM
Store coins is in nano ton?
Aug 3, 2022, 6:53 AM
Yeah, both snippets are not correct :
1) you should read address from slice via load_msg_addr
2) store address to builder via Addr, not addr, (fift is a little crazy, yeah)
Aug 3, 2022, 6:56 AM
Thanks! It works now.

What's the difference between addr, and Addr, by the way?
Aug 3, 2022, 7:02 AM
addr, is alias for 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
Aug 3, 2022, 7:06 AM
so why it's always addr, in docs?
Aug 3, 2022, 7:07 AM

© 2024 Draquery.com All rights reserved.