# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xft.finance/idn/use-cases/payroll.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
