# Sohopay

> Initiate payments on the SOHO Pay credit layer using EIP-712 signatures.

- Skill: `johnalbertini14-glitch/sohopay` (Agent Skill, multi-file: 10 files)
- Install (CLI): `npx skillmds@latest add johnalbertini14-glitch/sohopay`
- Raw SKILL.md: https://api.skillmd.com/api/skills/johnalbertini14-glitch/sohopay/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: johnalbertini14-glitch (https://skillmd.com/u/johnalbertini14-glitch)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/johnalbertini14-glitch/sohopay

---


# SOHO Pay - Credit Layer Payments

This skill allows the agent to initiate payments through the SOHO Pay `Creditor` smart contract using the `spendWithAuthorization` EIP-712 flow.

The agent signs the payment authorization off-chain using a pre-configured wallet, and then submits the transaction to the network on the user's behalf.

## Core Command

The primary way to use this skill is with a natural language command that maps to:

`pay <amount> to <merchant_address>`

- `<amount>`: The numerical amount to pay (e.g., `10`, `0.5`).
- `<merchant_address>`: The recipient EVM address (`0x...`). **Names are not supported** and no random addresses are ever generated by this skill.

## Workflow

When triggered, the skill's script performs the following actions:

1. **Parse Inputs**: Extracts the amount and merchant address from the user's request.
2. **Validate Merchant Address**: Confirms that the merchant is a valid EVM address; otherwise it aborts.
3. **Pre-Flight Checks**: Before signing, it runs a series of checks to ensure the transaction is likely to succeed:
    - Verifies the borrower is registered and active.
    - Checks if the borrower has a sufficient credit limit.
4. **Generate Authorization**: Creates an EIP-712 typed data message for the payment.
5. **Sign Off-Chain**: Uses the configured `PRIVATE_KEY` wallet (from environment variables) to sign the authorization message.
6. **Execute On-Chain**: Calls the `spendWithAuthorization` function on the `Creditor` contract, providing the signed message.
7. **Report Result**: Returns the transaction hash to the user upon confirmation.

## Configuration

- **Environment Variable (runtime)**: The private key for the signing wallet must be provided via the `PRIVATE_KEY` environment variable.
- **Skill Metadata**: The skill declares `PRIVATE_KEY` as a required, sensitive credential, intended **only for testnet signing**.
- **Network**: All transactions are performed on the **Base Sepolia** testnet. The script will abort if connected to mainnet or any non-Base-Sepolia chain.

## Defaults

The following values are hardcoded into the script for consistency:

- **Creditor Contract**: `0x669324C8c8011c3C0cA31faFBdD9C76219C06dB1`
- **Borrower Manager**: `0xFdcb4abf261944383dbac37cB8E9147E50E2a609`
- **Asset (USDC)**: `0x08B1797bB535C4cf86f93424137Cb3e004476624` (6 decimals)
- **Payment Plan ID**: `0`

## Security & Testnet Usage

- This skill requires a **TESTNET-ONLY** private key. Do **not** use a mainnet or real-funds wallet.
- It is designed **only for Base Sepolia**. The script enforces the Base Sepolia `chainId` and aborts on mainnet or any other network.
- The agent **cannot auto-invoke** this skill; it must be called manually by a user or higher-level workflow.
- The merchant must be provided as an explicit `merchant_address`. If the address is wrong, funds on the testnet may be irrecoverably sent to the wrong account.
- No random address generation is performed. The skill will refuse non-address merchant inputs.

## Example Usage

> `pay 10 to 0x1234567890abcdef1234567890abcdef12345678`

This command will trigger a payment of 10 USDC to the specified address on Base Sepolia, signed by the configured testnet wallet.

