#[public]
impl Distribution {
pub fn release_milestone_funds(&mut self, project_id: U256, milestone_id: U256) -> Result<(), Vec<u8>> {
if msg::sender() != self.admin.get() {
return Err("unauthorized: caller is not admin".into());
}
let key = Self::milestone_key(project_id, milestone_id);
let mut milestone = self.milestones.setter(key);
assert_eq!(milestone.status.get(), U256::from(1)); // Must be approved
milestone.status.set(U256::from(2)); // Paid
let beneficiary = self.projects.get(project_id).beneficiary.get();
let amount = milestone.amount.get();
// Cross-contract call to Treasury on Arbitrum Nitro
let treasury = ITreasury::new(self.treasury.get());
treasury.release_funds(Call::new(), beneficiary, amount)?;
Ok(())
}
}Donation Transparency, Solved.
Truvial is a decentralized, milestone-based charity treasury management platform. Donors lock funds securely, while beneficiaries unlock capital by completing real-world tasks.
Stylus Escrow Vault
Donor capital is locked directly in the Stylus Treasury contract. Beneficiary payouts are enforced via cryptographic EVM permissions.
Milestone-Bound Releases
Charities unlock tranche funding only upon proving completed real-world work. The Distribution contract autonomously releases tokens.
10x Lower Gas & Nitro Speed
Compiled to native WASM on Arbitrum Nitro, every audit check and transfer executes with sub-second finality and near-zero gas costs.
Designed for Trust. Built on Arbitrum Stylus.
Cross-Contract Interoperability
Clean logical separation: Treasury holds ERC-20 tokens while Distribution enforces RBAC access policies via `sol_interface!`.
MetaMask & EVM Wallets
Connect seamlessly with standard EVM wallets (MetaMask, Rabby, Rainbow). Arbitrum Sepolia testnet ready.
Role-Based Dashboard
Switch profiles instantly between Donors (view metrics & donate) and Charity Admins (whitelist addresses & release milestone funds).