> For the complete documentation index, see [llms.txt](https://docs.socialhood.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.socialhood.app/contracts/tipjar.md).

# TipJar

A deliberately tiny contract: it forwards tips and emits an event so they can be indexed. That's all it does — which is the point.

```solidity
function tip(address to) external payable;
function tipToken(address token, address to, uint256 amount) external;

event Tip(address indexed from, address indexed to, uint256 amount);
event TipToken(address indexed from, address indexed to, address indexed token, uint256 amount);
```

## Properties

* **100% pass-through** — the full amount reaches the recipient in the same transaction. The contract holds nothing, ever.
* **No fee. No admin. No owner.** There is nothing to configure and nobody who can configure it.
* `tipToken` performs a direct `transferFrom(sender → recipient)`, handling non-standard ERC-20s (tokens that don't return a bool) and rejecting calls to non-contract addresses.
* The app attaches the post id as extra calldata so tips can be attributed to posts — the contract ignores it; attribution is validated off-chain against the post author's wallet before any number is displayed.

v2 (current) added ERC-20 support. v1 remains onchain and indexed for historical tips.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.socialhood.app/contracts/tipjar.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
