Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Last active May 15, 2024 16:38
Show Gist options
  • Save vlzhr/76f1718134cc79614f9eb29b1c7cc69b to your computer and use it in GitHub Desktop.
Save vlzhr/76f1718134cc79614f9eb29b1c7cc69b to your computer and use it in GitHub Desktop.
Transfer USDT on Tact
import "@stdlib/deploy";
message(0xf8a7ea5) TokenTransfer {
query_id: Int as uint64;
amount: Int as coins;
sender: Address;
destination: Address?;
response_destination: Address?;
forward_ton_amount: Int as coins;
forward_payload: Slice as remaining;
}
contract Test2 with Deployable {
const MinTonForStorage: Int = ton("0.01"); // enough for 1 KB of storage for 2.5 years
deployer: Address;
init() {
self.deployer = sender();
}
receive() {
dump("funds received");
}
receive("send") {
send(SendParameters{
to: address("EQD_kMQkK-A9-CQu3CdOnQUDZ2_8bY8Zrh1PvtE3hZpxvdRH"), // USDT contract
bounce: false,
value: 0,
mode: SendRemainingBalance + SendIgnoreErrors,
body: TokenTransfer{
query_id: 1,
amount: ton("0.00001"), // USDT amount to send
sender: self.deployer, // send USDT here
destination: self.deployer, // send USDT here
response_destination: self.deployer, // send USDT here
forward_ton_amount: ton("0.01"),
forward_payload: emptySlice()
}.toCell()
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment