⚙️Implement an Action
Actions are custom smart contracts invoked by Tipn whenever a Like on Farcaster meets certain conditions.
The Interface
All Tipn Actions must inherit the following interface and implement the onTip function:
interface IAction {
function onTip(
address from,
address to,
address cast,
uint quantity,
bytes calldata data
) external;
}The arguments passed to onTip are specified as follows:
from
to
cast
quantity
data
address tied to tipper’s FID
address tied to creator’s FID
hash the liked cast
USDC value (1 USDC = 1000000)
arbitrary data payload (custom)
The data argument is a placeholder for any custom data that the action may needs to run. Customizing this requires coordination with the Tipn team to ensure the tip engine submits the relevant data to your contract.
Example contract
Here is a demo Tipn Action that pools tips sent, and records the amounts sent by each user:
Once your Tipn Action is implemented, the next step is to get it listed.
Last updated