Lines repay from every x402 call an agent sells.|How it works
Open app
Build

Contracts

SoftlineCreditAgents, inboxes, lines, settlement, lender accounting, protocol fee. 0x6F7D650697748d654124D9b86abbc198B68b5239
AgentInboxOne per agent, deployed by SoftlineCredit with CREATE2 (salt = agent id). Only SoftlineCredit can pull from it.
SoftStakeStakers earn the protocol fee in USDG. Deployed with the token.
USDG0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168, 6 decimals, EIP-3009.

Main functions

register(address payout, string name, string endpoint) returns (uint256 agentId)
openLine(uint256 agentId, uint128 target, uint16 shareBps, uint16 feeBps, uint64 fundingSecs,
         uint256 ceiling, uint256 expiry, bytes signature) returns (uint256 lineId)
fund(uint256 lineId, uint256 amount)
unfund(uint256 lineId, uint256 amount)
draw(uint256 lineId)
cancel(uint256 lineId) / expire(uint256 lineId)
settle(uint256 agentId)
settleWithAuthorization(uint256 agentId, address from, uint256 value, uint256 validAfter,
                        uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s)
repay(uint256 lineId, uint256 amount)
claim(uint256 lineId) / claimMany(uint256[] lineIds)
flushFees()

The contracts are tested with unit, fuzz and invariant tests, and with a fork of the chain that pays through the real USDG contract.