> For the complete documentation index, see [llms.txt](https://docs.xft.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xft.finance/idn/use-cases/payroll.md).

# Payroll

COUNTERPARTIES\
Cardholder\
Merchant\
USD\
REEDUSD 0x86449a994fED1c90f5DdCB3cc5bd4fD236aE4B0f\
Rowe\
Visa\
XFTRoutingFactoryV6

SOFTWARE SEQUENCE / EXECUTION

1. Load Hardhat, network config, and RAILS definitions.
2. Set constants for TOKEN, mint amount, and transfer amount.
3. Get deployer signer and print address.
4. Deploy `XFTRoutingFactoryV6` with TOKEN address.
5. Wait for deployment and optionally verify on Etherscan.
6. Attach to REEDUSD token contract at TOKEN address.
7. Grant `MINTER_ROLE` to factory.
8. Grant `BURNER_ROLE` to factory if available.
9. For each enabled rail, predict deterministic wallet from ID.
10. Deploy wallet for each rail ID.
11. Mint REEDUSD to each deployed wallet.
12. For transfer rails, transfer from wallet A to wallet B.
13. Burn remaining balances from wallets.
14. Query and print all rail–ID–wallet mappings.
15. Exit on success or log error and exit on failure.

### American Express

```
COUNTERPARTIES
Cardholder
Merchant
USD
American Express Network

PREPAID DEBIT
1. Amex holds $10 prefunded account for Cardholder
2. Cardholder initiates $5 payment
3. Amex debits $5 from Cardholder account
4. Amex credits $5 to Merchant account
5. Merchant receives settled USD

PUSH/CREDIT TRANSFER
1. Alice sends a request to Bank A “Pay Bank B $5 for the benefit of Bob”
2. Bank A verifies Alice’s identity and adequacy of Alice’s funds
3. Bank A notifies Bank B of the payment
4. Bank B verifies Bob has an account
5. Bank B sends confirmation to Bank A
6. Both banks send confirmation to their respective customers
```

***

RESOURCES

```
// contracts/XFTRoutingFactory.sol:XFTRoutingFactory
// contracts/XFTRoutingFactoryV2.sol:XFTRoutingFactoryV2
// contracts/XFTRoutingFactoryV3.sol:XFTRoutingFactoryV3
// contracts/XFTRoutingFactoryV5.sol:XFTRoutingFactoryV5
// contracts/XFTRoutingFactoryV6.sol:XFTRoutingFactoryV6
```
