Skip to content

Commit 4568ce4

Browse files
committed
feat: support
1 parent b37a2f7 commit 4568ce4

File tree

4 files changed

+533
-0
lines changed

4 files changed

+533
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,5 @@ test/
268268
```
269269

270270
📌 For questions or support, please open an issue in the GitHub repository.
271+
272+
📖 Need help? Check out my [Support Guide](./SUPPORT.md)

README_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,4 @@ test/
292292

293293
📌 如有问题或需要支持,请在 GitHub 仓库中提交 issue。
294294

295+
📖 需要帮助?请查看我的 [支持指南](./SUPPORT_CN.md)

SUPPORT.md

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
# Support Documentation
2+
3+
[中文](./SUPPORT_CN.md)
4+
5+
## Table of Contents
6+
7+
- [Getting Help](#getting-help)
8+
- [Common Issues](#common-issues)
9+
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
10+
- [Troubleshooting](#troubleshooting)
11+
- [Reporting Bugs](#reporting-bugs)
12+
- [Feature Requests](#feature-requests)
13+
- [Contributing](#contributing)
14+
- [Contact Information](#contact-information)
15+
16+
## Getting Help
17+
18+
If you need help with GNad.Fun, here are the best ways to get support:
19+
20+
1. **Documentation**: Check the [README.md](./README.md) for comprehensive documentation
21+
2. **Issues**: Search existing issues on GitHub to see if your question has been answered
22+
3. **New Issue**: Create a new issue if you can't find an answer to your question
23+
4. **Discussions**: Use GitHub Discussions for general questions and community help
24+
25+
## Common Issues
26+
27+
### Contract Deployment Issues
28+
29+
**Issue**: Contracts fail to deploy or initialize
30+
31+
**Solutions**:
32+
- Ensure you have sufficient gas for deployment
33+
- Check that all required parameters are provided correctly
34+
- Verify that factory contracts are initialized before use
35+
- Ensure proper contract permissions and ownership
36+
37+
### Transaction Failures
38+
39+
**Issue**: Transactions revert with error messages
40+
41+
**Common Causes**:
42+
- Insufficient balance (WMon or tokens)
43+
- Slippage protection triggered
44+
- Deadline expired
45+
- Insufficient allowance for token spending
46+
- Contract is locked (for bonding curves)
47+
48+
**Solutions**:
49+
- Check your WMon balance before trading
50+
- Increase slippage tolerance if using protected functions
51+
- Use a future deadline (block.timestamp + X)
52+
- Approve tokens before selling operations
53+
- Wait until bonding curve unlocks or check lock status
54+
55+
### Fee Calculation Errors
56+
57+
**Issue**: Fee validation fails
58+
59+
**Solutions**:
60+
- Verify fee amount matches bonding curve configuration
61+
- Check fee denominator and numerator values
62+
- Ensure fee is calculated correctly: `fee >= (amount * denominator) / numerator`
63+
64+
### Permit/Approval Issues
65+
66+
**Issue**: Permit or approval fails
67+
68+
**Solutions**:
69+
- Verify signature parameters (v, r, s) are correct
70+
- Check deadline hasn't expired
71+
- Ensure domain separator matches contract
72+
- Verify nonce is correct
73+
74+
## Frequently Asked Questions (FAQ)
75+
76+
### General Questions
77+
78+
**Q: What is WMon?**
79+
A: WMon is the wrapped version of the native Monad token, providing ERC20 compatibility for trading operations.
80+
81+
**Q: How do bonding curves work?**
82+
A: Bonding curves use a constant product formula (k = x * y) to determine prices. As more tokens are bought, prices increase. Virtual reserves are used for initial price calculation.
83+
84+
**Q: What happens when a bonding curve locks?**
85+
A: When the locked token target is reached, the bonding curve locks and trading stops. The curve can then be listed on a DEX.
86+
87+
**Q: Can I create multiple tokens?**
88+
A: Yes, each call to `createBc` creates a new token and bonding curve pair.
89+
90+
**Q: How are fees calculated?**
91+
A: Fees are calculated based on the bonding curve's fee configuration (denominator/numerator). The fee is taken from the input amount for buys and output amount for sells.
92+
93+
### Trading Questions
94+
95+
**Q: What's the difference between `buy` and `protectBuy`?**
96+
A: `buy` executes immediately at current price. `protectBuy` includes slippage protection and reverts if price moves beyond `amountOutMin`.
97+
98+
**Q: Do I need to approve tokens before selling?**
99+
A: Yes, you need to either:
100+
- Approve tokens using `approve()` function, or
101+
- Use permit-based functions (`sellPermit`, `protectSellPermit`, etc.)
102+
103+
**Q: What is a deadline parameter?**
104+
A: Deadline ensures transaction freshness. It must be a future timestamp (block.timestamp + duration). Transactions with expired deadlines will revert.
105+
106+
**Q: Can I buy exact amounts of tokens?**
107+
A: Yes, use `exactOutBuy` to specify exactly how many tokens you want to receive.
108+
109+
**Q: Can I sell for exact amounts of WMon?**
110+
A: Yes, use `exactOutSell` to specify exactly how much WMon you want to receive.
111+
112+
### Technical Questions
113+
114+
**Q: What Solidity version is used?**
115+
A: Contracts are written in Solidity ^0.8.13
116+
117+
**Q: What testing framework is used?**
118+
A: Foundry is used for testing. See [test/README.md](./test/README.md) for testing information.
119+
120+
**Q: How do virtual reserves differ from real reserves?**
121+
A: Virtual reserves are used for initial price calculation and don't reflect actual balances. Real reserves track actual token balances in the bonding curve contract.
122+
123+
**Q: What happens during DEX listing?**
124+
A: When `listing()` is called, tokens and WMon are transferred to a Uniswap V2 compatible pair, liquidity is provided, and LP tokens are burned.
125+
126+
## Troubleshooting
127+
128+
### Test Failures
129+
130+
If tests are failing:
131+
132+
1. **Check Foundry version**: Ensure you're using a compatible Foundry version
133+
```bash
134+
forge --version
135+
```
136+
137+
2. **Update dependencies**: Pull latest dependencies
138+
```bash
139+
forge update
140+
```
141+
142+
3. **Clean build**: Clean and rebuild
143+
```bash
144+
forge clean
145+
forge build
146+
```
147+
148+
4. **Run specific test**: Isolate the failing test
149+
```bash
150+
forge test --match-test testName
151+
```
152+
153+
5. **Verbose output**: Get more information
154+
```bash
155+
forge test -vvv
156+
```
157+
158+
### Compilation Errors
159+
160+
If contracts won't compile:
161+
162+
1. **Check Solidity version**: Ensure version matches (^0.8.13)
163+
2. **Verify imports**: Check all import paths are correct
164+
3. **Install dependencies**: Ensure all dependencies are installed
165+
```bash
166+
forge install
167+
```
168+
4. **Check remappings**: Verify `remappings.txt` is correct
169+
170+
### Runtime Errors
171+
172+
If transactions fail at runtime:
173+
174+
1. **Read error messages**: Error messages are designed to be descriptive
175+
2. **Check event logs**: Events can provide additional context
176+
3. **Verify state**: Ensure contracts are in expected state
177+
4. **Check permissions**: Verify caller has required permissions
178+
5. **Gas estimation**: Ensure sufficient gas is provided
179+
180+
## Reporting Bugs
181+
182+
When reporting bugs, please include:
183+
184+
1. **Description**: Clear description of the issue
185+
2. **Steps to Reproduce**: Detailed steps to reproduce the bug
186+
3. **Expected Behavior**: What should happen
187+
4. **Actual Behavior**: What actually happens
188+
5. **Environment**:
189+
- Solidity version
190+
- Foundry version (if applicable)
191+
- Network (if applicable)
192+
6. **Error Messages**: Full error messages or logs
193+
7. **Code Samples**: Minimal code to reproduce (if applicable)
194+
8. **Screenshots**: If visual issues (if applicable)
195+
196+
### Bug Report Template
197+
198+
```markdown
199+
## Bug Description
200+
Brief description of the bug
201+
202+
## Steps to Reproduce
203+
1. Step one
204+
2. Step two
205+
3. Step three
206+
207+
## Expected Behavior
208+
What should happen
209+
210+
## Actual Behavior
211+
What actually happens
212+
213+
## Environment
214+
- Solidity Version:
215+
- Foundry Version:
216+
- Network:
217+
218+
## Error Messages
219+
Paste error messages here
220+
221+
## Additional Context
222+
Any additional context or information
223+
```
224+
225+
## Feature Requests
226+
227+
We welcome feature requests! When submitting:
228+
229+
1. **Clear Description**: Describe the feature clearly
230+
2. **Use Case**: Explain why this feature would be useful
231+
3. **Potential Implementation**: If you have ideas, share them
232+
4. **Alternatives**: Discuss any alternatives you've considered
233+
234+
## Contributing
235+
236+
Contributions are welcome! Please:
237+
238+
1. Fork the repository
239+
2. Create a feature branch
240+
3. Make your changes
241+
4. Add tests for new functionality
242+
5. Ensure all tests pass
243+
6. Submit a pull request
244+
245+
For more details, see contribution guidelines (if available).
246+
247+
## Contact Information
248+
249+
### 📬 Say hello
250+
251+
- [Whatsapp](https://wa.me/16286666724?text=Hello%20there)
252+
- [Telegram](https://t.me/angel001000010100)
253+
- [Discord](https://discordapp.com/users/1114372741672488990)
254+
- [Email](mailto:10xAngel.dev@gmail.com?subject=Hello%20Angel&body=Hi%20Angel%2C%20I%20found%20you%20on%20GitHub!)
255+
256+
## Additional Resources
257+
258+
- [README.md](./README.md) - Main documentation
259+
- [README_CN.md](./README_CN.md) - Chinese documentation
260+
- [test/README.md](./test/README.md) - Testing documentation
261+
- [GitHub Repository](https://github.com/angel10x/Gnad.fun-SmartContract) - Source code
262+
263+
---
264+
265+
**Note**: For security vulnerabilities, please use responsible disclosure and contact maintainers privately rather than opening a public issue.
266+

0 commit comments

Comments
 (0)