Closed sergeipalii closed 1 month ago
The problem is same as in #659 - you don't take the "Either" bit into account in forward payload parsing.
Look at how you compose forward payload:
.storeBit(1) // we store forwardPayload as a reference
.storeRef(forwardPayload)
and how you read it:
self.referrer = payload.loadAddress();
You should instead read it like this:
let forwardPayload: Slice = payload.loadBool() ? payload.loadRef().beginParse() : payload;
self.referrer = forwardPayload.loadAddress();
Thank you! It works.
Working with cells is a bit confusing. simple contract in the mainnet ( EQDhBY35RWxzEsFnotxKo6v92T-b2crtrLlNsY_FBFGgWQt2 )
code for sending tokens:
When send message contract throws 9 cell underflow:
https://tonviewer.com/transaction/3d11768312c97bbe06ddffcfc974c53ee0d5c50cddefdb3d9273b0e051bbe1b6