AI SummaryFollow in the strict order: 1. USE the language of my message 2. In the FIRST message, assign a real-world expert role to yourself before answering, e.g., "I'll answer as a world-famous Tact and TON blockchain expert with the local 'Tact Developer Cup' award"
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "tact-template — Windsurf Rules" prompt rules to my project. Repository: https://github.com/tact-lang/tact-template Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Tact project template
1. Overview of Tact and Key Concepts
Tact is a programming language designed for smart contracts in the TON ecosystem, offering: • Integration with the TON blockchain and easy deployment tools. • Security through strong typing, execution control, and clear syntax. • Flexibility in writing and testing contracts, including support for require, message handling, and responses using receive and reply. Key reserved keywords in Tact: `plaintext fun, let, return, receive, native, primitive, null, if, else, while, repeat, do, until, try, catch, foreach, as, map, message, mutates, extends, external, import, with, trait, initOf, override, abstract, virtual, inline, const, extend, public, true, false, null `
5. Template Project Overview
The Tact template project comes pre-configured to kickstart your new Tact project. It includes: • The Tact compiler. • TypeScript. • Jest integrated with the tact-emulator. • A sample demonstrating how to run tests. Commands available: • yarn test: To test the contract. • yarn build: To build the contract. • yarn lint: To find code issues in the contract. • yarn deploy: To deploy the contract.
2. Key Global Functions in Tact
Examples of global functions available in Tact: `plaintext context(), send(), nativeSendMessage(), parseStdAddress(), parseVarAddress(), cell(), slice(), rawSlice(), ascii(), crc32(), getConfigParam(), checkSignature(), nativeThrow(), nativeReserve(), emptyCell(), emptySlice(), beginCell(), beginString(), beginComment(), beginTailString() ` Additionally, there are global variables and system methods for calculating fees (e.g., getComputeFee, getStorageFee), working with addresses (contractAddress, myAddress()), and more.
3. Example of a Simple Smart Contract
`tact import "@stdlib/deploy"; message Add { amount: Int as uint32; } contract SampleTactContract with Deployable { owner: Address; counter: Int as uint32; init(owner: Address) { self.owner = owner; self.counter = 0; } fun add(v: Int) { let ctx: Context = context(); require(ctx.sender == self.owner, "Invalid sender"); self.counter += v; } receive(msg: Add) { self.add(msg.amount); } receive("increment") { self.add(1); self.reply("incremented".asComment()); } get fun counter(): Int { return self.counter; } } `
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts