Documentation Index
Fetch the complete documentation index at: https://docs.remlo.xyz/llms.txt
Use this file to discover all available pages before exploring further.
PayrollTreasury is the on-chain vault that holds employer payroll capital on Tempo. Funds enter via deposit, sit under per employer accounting, and exit via PayrollBatcher (or, for emergency recoveries, via sweepUnaccounted).
How funds enter
The dashboard’s on-chain deposit widget is the canonical path. The widget is atcomponents/treasury/OnChainDepositWidget.tsx. It signs an ERC-20 approve for the deposit amount, then calls PayrollTreasury.deposit(amount, memo) from the employer’s Privy embedded wallet.
The deposit memo carries identity. The first 8 bytes must equal bytes8(keccak256(employerAdminWallet)). The contract enforces this at deposit time and reverts with MemoEmployerMismatch if the prefix doesn’t match the msg.sender’s expected employer ID. Bytes 8-31 are reserved for future pay period and cost center metadata.
Per employer accounting
Every employer holds aEmployerAccount struct in storage:
PayrollBatcher calls transferToBatcher(employerId, total) (only callable by the configured Batcher address) which decrements the employer’s balance and transfers via SafeTIP20.
Idle balance can be routed through YieldRouter if the employer has yield enabled and the strategy passes the audit allow list (fix H-5).
Aggregate accounting (audit fix C-1)
totalAccountedPayToken tracks the sum of all employer balances. The owner-only sweepUnaccounted function transfers any tokens above this aggregate to a recovery address. Before the fix, a buggy front end or accidental token send to the contract was unrecoverable. After the fix, dust is sweepable without touching legitimate employer balances.
Events
Deposited(employerId indexed, amount, memo)on every successful deposit.Unlocked(employerId indexed, amount)when locked funds release back to free balance after a batch (audit fix M-5: previously this was silent; now there’s an audit trail).BatcherSet(oldBatcher, newBatcher)on owner onlysetBatcher.Swept(token, to, amount)onsweepUnaccounted.
Live deployment
Tempo Moderato (chainId42431):
0x20C000000000000000000000b9537d11c60E8b50. 6 decimals. All amounts in the Treasury and Batcher are atomic units (e.g., 1000000 is one dollar).