Decentralized Creator Support Platform - Powered by Stylus
Gyfted is a revolutionary Web3 platform that enables creators to receive cryptocurrency tips from their supporters through a unified, gas-efficient smart contract system. Built on Arbitrum using the Stylus SDK, Gyfted provides a seamless tipping experience for content creators, developers, artists, and anyone building in the digital space.
- π Free Registration - No contract deployment costs
- π€ Rich Profiles - Name, bio, avatar, and custom links
- π° Direct Tips - Receive ETH directly from supporters
- π Analytics Dashboard - Track tips, supporter count, and earnings
- π Self-Custody - Withdraw your tips anytime to your wallet
- π Discoverability - Get found by new supporters
- π― Easy Tipping - Send ETH with personalized messages
- π Creator Discovery - Browse and discover new creators
- π¬ Message Support - Send encouragement with your tips
- β‘ Low Gas Fees - Efficient Stylus smart contracts
- π Web3 Native - Connect any Ethereum-compatible wallet
- π Factory Pattern - One contract serves all creators
- πΌ Revenue Model - Optional platform fees (2.5% default)
- π οΈ Upgradeable - Modular architecture for improvements
- π Analytics - Platform-wide statistics and insights
Gyfted uses a factory contract pattern where a single smart contract manages multiple creators:
Gyfted Factory Contract
βββ Creator Registry (profiles, balances)
βββ Tip Processing (with optional platform fees)
βββ Withdrawal System (creator-specific balances)
βββ Discovery System (public creator listings)
Key Components:
- Factory Contract: Main contract managing all creators
- Creator Profiles: On-chain metadata (name, bio, avatar)
- Tip Balances: Individual creator balances
- Event System: Real-time tip notifications
- Fee Management: Optional platform sustainability model
- Rust (latest stable)
- Cargo Stylus
- Node.js v18+ (for frontend)
- An Arbitrum testnet wallet with ETH
-
Clone the repository
git clone https://github.com/Nanle-code/Stylus cd Stylus -
Install Stylus toolchain
cargo install cargo-stylus
-
Build the contract
# Optional: type-check with Stylus tooling cargo stylus check # Build optimized WASM for Stylus cargo build --release --target wasm32-unknown-unknown
-
Export ABI The ABI is generated from the
#[public]interfaces inStylus/src/lib.rs. We provide a no-opmainunder theexport-abifeature so this compiles cleanly.cargo stylus export-abi # Outputs an ABI JSON you can use in your frontend (e.g., in ./target/abi) -
Deploy to Arbitrum Sepolia
cargo stylus deploy \ --private-key="your-private-key" \ --endpoint="https://sepolia-rollup.arbitrum.io/rpc"
-
Post-deploy
- Save the deployed address output by the deploy command
- Verify events by sending a small test tip
- Use the ABI JSON with ethers/web3 to integrate on the frontend
Register as a creator:
// Call this function to join Gyfted
register_creator(
name: "Alice Developer",
bio: "Full-stack developer building Web3 tools",
avatar_url: "https://example.com/alice.jpg"
)Update your profile:
update_profile(
name: "Alice | Rust Developer",
bio: "Building the future with Rust and Web3",
avatar_url: "https://newurl.com/alice.jpg"
)Withdraw your tips:
withdraw_my_tips() // Sends all accumulated tips to your walletSend a tip:
tip_creator(
creator: "0x742d35Cc6Bf5432532532B4C9c47",
message: "Love your tutorials! Keep it up! π"
) // Send ETH with the transaction// Get creator profile
get_creator_profile(creator_address)
// Check creator's tip balance
get_creator_balance(creator_address)
// Browse all creators
get_registered_creators()
// Check platform fee
get_platform_fee() // Returns basis points (250 = 2.5%)import { ethers } from 'ethers';
import GiftedABI from './contracts/Gyfted.json';
// Connect to contract
const provider = new ethers.providers.Web3Provider(window.ethereum);
const contract = new ethers.Contract(contractAddress, GiftedABI, provider);
// Send a tip
async function tipCreator(creatorAddress, message, amount) {
const signer = provider.getSigner();
const contractWithSigner = contract.connect(signer);
const tx = await contractWithSigner.tip_creator(
creatorAddress,
message,
{ value: ethers.utils.parseEther(amount) }
);
return await tx.wait();
}
// Listen for tip events
contract.on("TipSent", (supporter, creator, amount, message) => {
console.log(`${supporter} tipped ${creator}: ${message}`);
});import { useState, useEffect } from 'react';
function CreatorProfile({ creatorAddress }) {
const [profile, setProfile] = useState(null);
const [tipAmount, setTipAmount] = useState('0.001');
const [message, setMessage] = useState('');
useEffect(() => {
loadCreatorProfile();
}, [creatorAddress]);
const loadCreatorProfile = async () => {
const profileData = await contract.get_creator_profile(creatorAddress);
setProfile(profileData);
};
const sendTip = async () => {
try {
await tipCreator(creatorAddress, message, tipAmount);
alert('Tip sent successfully!');
setMessage('');
} catch (error) {
alert('Error sending tip: ' + error.message);
}
};
return (
<div className="creator-card">
<img src={profile?.avatar_url} alt={profile?.name} />
<h3>{profile?.name}</h3>
<p>{profile?.bio}</p>
<div className="tip-form">
<input
type="number"
value={tipAmount}
onChange={(e) => setTipAmount(e.target.value)}
step="0.001"
min="0.001"
placeholder="Amount in ETH"
/>
<textarea
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder="Send a message of support..."
/>
<button onClick={sendTip}>Send Tip β</button>
</div>
</div>
);
}
## π Smart Contract Details
### Storage Layout
```rust
pub struct CoffeeFactory {
// Creator balances: creator_address => tip_balance
mapping(address => uint256) creator_balances;
// Creator profiles: creator_address => profile_data
mapping(address => CreatorProfile) creator_profiles;
// All registered creators for discovery
address[] registered_creators;
// Platform configuration
address factory_owner;
uint256 platform_fee_basis_points; // 250 = 2.5%
address fee_recipient; // recipient of platform fees
uint256 platform_fees_accrued; // accumulated fees (wei)
}// Emitted when someone sends a tip
event TipSent(
address indexed supporter,
address indexed creator,
uint256 amount,
string message
);
// Emitted when a creator registers
event CreatorRegistered(
address indexed creator,
string name
);
// Emitted when tips are withdrawn
event TipsWithdrawn(
address indexed creator,
uint256 amount,
uint256 platform_fee
);
// Emitted when platform fee bps is updated
event PlatformFeeUpdated(
uint256 oldFeeBps,
uint256 newFeeBps
);
// Emitted when fee recipient is updated
event FeeRecipientUpdated(
address oldRecipient,
address newRecipient
);
// Emitted on each tip to record fee collected
event PlatformFeeAccrued(
address indexed supporter,
address indexed creator,
uint256 feeAmount
);Owner-only functions and config. The owner is set to the deployer in constructor.
// View current platform fee bps
get_platform_fee() -> uint256
// Update platform fee bps (capped at 500 = 5%)
set_platform_fee_basis_points(new_bps: uint256)
// View/set fee recipient address
get_fee_recipient() -> address
set_fee_recipient(new_recipient: address)
// View and withdraw accrued platform fees
get_platform_fees_accrued() -> uint256
withdraw_platform_fees()Example (ethers.js):
import { ethers } from 'ethers'
const provider = new ethers.JsonRpcProvider('https://sepolia-rollup.arbitrum.io/rpc')
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)
const contract = new ethers.Contract(address, abi, wallet)
// Read fee config
const feeBps = await contract.get_platform_fee()
const feeRecipient = await contract.get_fee_recipient()
// Update fee to 3%
await (await contract.set_platform_fee_basis_points(300)).wait()
// Set new fee recipient
await (await contract.set_fee_recipient('0xYourTreasury')).wait()
// Withdraw accrued fees
await (await contract.withdraw_platform_fees()).wait()- The library exposes public interfaces via
#[public] impl CoffeeFactoryinStylus/src/lib.rs. Stylus/src/main.rscontains a no-opmainfor normal builds and ABI export builds. This avoids missing-symbol issues while lettingcargo stylus export-abiwork.- Recommended workflow:
- Local checks:
cargo stylus check - Build:
cargo build --release --target wasm32-unknown-unknown - Export ABI:
cargo stylus export-abi - Deploy:
cargo stylus deploy --endpoint <RPC> --private-key <KEY>
- Local checks:
If youβre using a frontend, place the generated ABI JSON where your app expects it (e.g., frontend/src/contracts/CoffeeFactory.json) and keep the deployed address in your environment config.
| Function | Gas Cost | USD (20 gwei) |
|---|---|---|
| Register Creator | ~80,000 | ~$2.40 |
| Send Tip | ~50,000 | ~$1.50 |
| Withdraw Tips | ~45,000 | ~$1.35 |
| Update Profile | ~35,000 | ~$1.05 |
- β Creators can only withdraw their own tips
- β Only factory owner can withdraw platform fees
- β Profile updates restricted to profile owner
- β Input validation on all functions
- β Reentrancy protection on withdrawals
- β Integer overflow protection (Rust native)
- β Platform fee caps (max 10%)
- β Minimum tip amounts to prevent spam
- π Audit Required: This contract needs professional audit before mainnet
- π§ͺ Test Thoroughly: Extensive testing on testnets required
- π Monitor Events: Set up monitoring for unusual activity
- π Multisig: Consider multisig for factory owner operations
- Factory contract architecture
- Creator registration system
- Basic tipping functionality
- Profile management
- Subscription tipping (monthly/recurring)
- Tip goals and milestones
- Creator verification system
- Advanced analytics dashboard
- Mobile app (React Native)
- Social features (creator following)
- Integration APIs for external platforms
- Multi-token support (USDC, DAI, etc.)
- Creator NFT rewards
- Governance token (GYFT)
- DAO treasury management
- Cross-chain support
We welcome contributions from developers, designers, and Web3 enthusiasts!
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Install dependencies:
npm install && cargo build - Run tests:
cargo test && npm test - Submit PR: Make sure tests pass and code is documented
- Smart Contract: Rust/Stylus development
- Frontend: React/TypeScript/Web3 integration
- Design: UI/UX improvements
- Documentation: Tutorials, guides, API docs
- Testing: Security audits, integration tests
# Format Rust code
cargo fmt
# Lint Rust code
cargo clippy
# Format TypeScript/JavaScript
npm run format
# Lint frontend code
npm run lintThis project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: docs.gyfted.com
- Discord: discord.gg/gyfted
- Twitter: @gyfted_app
- Email: hello@gyfted.com
- GitHub Issues: Report bugs
- Live App: app.gyfted.com
- Arbitrum Contract:
0x...(Coming soon) - Block Explorer: arbiscan.io
- Stylus Docs: docs.arbitrum.io/stylus
Gyfted is experimental software. Use at your own risk. Always do your own research and never invest more than you can afford to lose. This software has not been audited and should not be used with significant funds without proper security review.
Built with β€οΈ by the Web3 community
Empowering creators in the decentralized future