-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TEP: Wrapped TON standard and implementation #102
base: master
Are you sure you want to change the base?
Conversation
Hello guys, could you please review this one? |
LGTM |
Hello colleagues! At ston.fi we offer to update WTON standard to actually transfers TON between wallets when transferring WTON. This approach avoid custom minting calls and works without the need of custom code in any protocol to support it. ConceptsUnlike current WTON implementations, we propose to not rely on wrapping/unwrapping logic. In this standard, minting WTON doesn’t touch central jetton contract, minting occurs when the user sends TON to a his WTON wallet. SpecificationThe following opcodes describes only the non-standard core logic needed in the implementation.
Pros:
Cons:
|
I want to emphasize some aspects of @dariotarantini proposal:
It is important to stress that we should be quite cautious about fee-managing to make these wTON fully Jetton compatible. I propose to ensure that amount of TON sent with each inter-wallet transfer to be equal to amount of TON which would be sent in the case it is standard jetton + amount of jettons in message. Anyway, wTON-wallet of the receiver should not trust amount of jetton in incoming internal transfer, instead it should calculate amount that was really sent (TON amount minus all forward amounts/fees). Another important point is way to unwrap. Dario propose to make auto-unwrap option on jetton wallet, while there is also an option that wallet will peek in payload and if there something very special (that will not intersects with standard transfer) it will understand that it should not send TON as jettons to the other wTON wallet, but unwrap it directly to destination. I used 23bit long prime number as that special payload (since it is expected that for any usual purpose there will be 32bit long op) |
This assume that, if you are interacting with another contract, the receiver contract will forward the payload in the next transaction. Some may not; that's why I proposed an alternative on user-side, similar to |
Not forcing my option, just emphasize that my implementation differs from your suggestion. Also in my implementation reading of |
Hey @dariotarantini @EmelyanenkoK, thank you very much for this suggestion! Thank you very much! |
Correct me if I'm wrong, but in your proposal the receiver has no way to refuse an auto-unwrap payment, right? |
@markokhman @dariotarantini That way, I believe we get benefits from both approaches and no downsides. Indeed ability sender to forcefully unwrap wTONs does not make system more unpredictable: sender always have privilege to shot his leg (and for instance send TON directly instead of through wTON system). But this combined scheme allows both sender auto-unwrap tokens and receiver auto-unwrap token if wanted. |
@EmelyanenkoK I understand, sure We'll first make sure every interested party took their time to view and comment, the will do further code polishing on our end if needed. Thank you very much! |
@dariotarantini @EmelyanenkoK |
@NickNekilov I believe it would be great to have some tests that are actually demonstrating core usecases and maybe also those DEX, if that's the case |
I guess next step is explicit listing of additional functionality such as
Get consensus from interested parties and then reference implementation. |
Publishing this as a draft. The work is in process and will be lot's of updates in upcoming days.
Please leave your comments.