-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
|
||
### TON to jetton | ||
|
||
TON to jetton swap introduces `ProxyTonTransfer` cause all interaction is done with pTON contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's explain a little bit more about pTON
and provide a link to the related page in stonfi docs for further reading
refundAddress: Address; // Address where refund will be sent if swap fails | ||
excessesAddress: Address; // Address where TON excesses will be sent | ||
deadline: Int as uint64; // Timestamp of execution deadline for this tx | ||
additionalData: SwapAdditionalData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a comment like defined below
for this line
|
||
</Callout> | ||
Some variables like `offerAmount` are hardcoded for demonstration purposes. Don't forget to change them in real case scenarios. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a few links for common TON stuff in the beginning of the article, like what are messages in general, how to work with jettons etc
const RouterJettonWallet: Address = address("kQAtX3x2s-wMtYTz8CfmAyloHAB73vONzJM5S2idqXl-_5xK"); // Router Jetton Wallet Address | ||
|
||
message SwapJettonJetton { | ||
myJettonWalletAddress: Address; // calculated offchain for ease of example, in real world scenarios should be calculated onchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the should be
part seems wrong to me, especially in the context of this specific line. let's move this warning comment to the line below (see next comment)
contract JettonToJetton { | ||
receive() {} | ||
receive(msg: SwapJettonJetton) { | ||
let myJettonWalletAddress: Address = msg.myJettonWalletAddress; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move that comment here, and rephrase it so that it's clear that this specific example just takes whatever address it receives in message instead of some reliable way (either on-chain calculation or saving on initialization)
|
||
</Callout> | ||
Some variables like `offerAmount` are hardcoded for demonstration purposes. Don't forget to change them in real case scenarios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should explain what offerAmount
is and how it should be changed in real case scenarios
. none of the below examples explain that. you can probably just add a link to the related stonfi doca page and tell readers to look there for other variables explanations too
} | ||
|
||
message SampleProvideLP { | ||
myJettonWalletAddress: Address; // calculated offchain for ease of example, in real world scenarios should be calculated onchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as for the swaps
} | ||
``` | ||
|
||
## Liquidity provision |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add a section on withdrawing provided liquidity
@Gusarich should i do this in this version of docs or move to the newest one? |
@a-bahdanau newest one is preferred, since there is a better test suite available |
Closed all comments through tact-lang/tact#956 |
This PR was adjusted for the new docs and moved to tact-lang/tact#956 |
Closes #149
P.S.: Why do you do the issue reference in a separate message? :)