> For the complete documentation index, see [llms.txt](https://docs.tradeflows.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tradeflows.io/tradeflows/smart-contracts.md).

# Smart Contracts

Testing environment on StarkNet Goerli

The protocol is based on three infrastructure Smart Contracts that are used to power the entire infrastructure:

* **DAO**: Custom ERC20 contract that represents the ownership of the DAO. This contract is also the treasury to which all Trade Init / Minting fees go to.
* **txAsset**: Custom ERC721 contract that stores the terms of the asset as a minted NFT. This contract also contains the functionality that allows the buyer to agree to the asset and the NFT is also the receiver of the programmed payment stream.
* **txEscrow**: Custom ERC1155 contract that wraps around the ownership of an escrow account.
* **txDharma**: Custom ERC20 contract that is non-transferable and mintable. Community members that are in an active trade are able to mint these tokens to their counterpart's wallets or burn them when attributing a negative score.

Additionally, we have a set of ERC20 wrapper contracts that enable all custom streaming and escrow functionality:

* **txFlow**: Custom ERC20 contract that wraps around the target token, eg. USDC, and contains the streaming and self-custody functionality. This contract is also extended to attribute a balance to any ERC721 contract.

We have deployed a set of contracts to the StarkNet Goerli testnet in order to test all of the functionality in this document. More on this below.

## Goerli Testnet

During this alpha phase, we are deploying a set of test contracts to the Goerli Starknet testnet. The production contract will be deployed at a later date on to mainnet.

⚠️ WARNING! ⚠️ All of the contract addresses below will change as we iterate rapidly during these initial phases. Please keep a look out for changes in these addresses.

### Infrastructure Alpha on Goerli Testnet

<table><thead><tr><th width="150" align="center">Contract</th><th width="604.4285714285713" align="center">Address</th></tr></thead><tbody><tr><td align="center">DAO</td><td align="center"><a href="https://goerli.voyager.online/contract/0x0351172e2bb614d3354c8c5aba22d777f6faeba2b66744f7116e96b79358dac0">0x0351172e2bb614d3354c8c5aba22d777f6faeba2b66744f7116e96b79358dac0</a></td></tr><tr><td align="center">txTrade</td><td align="center"><a href="https://goerli.voyager.online/contract/0x04f7ce277a2d81fb20466f07017037e1a9762c308cc86a95f9534c61f3412714">0x04f7ce277a2d81fb20466f07017037e1a9762c308cc86a95f9534c61f3412714</a></td></tr><tr><td align="center">txDharma</td><td align="center"><a href="https://goerli.voyager.online/contract/0x07d00d72858504a84a1a09a06e60800811c2b8d720474ca420f2fa7bc1b1104a">0x07d00d72858504a84a1a09a06e60800811c2b8d720474ca420f2fa7bc1b1104a</a></td></tr></tbody></table>

### Flows Alpha on Goerli Testnet

<table><thead><tr><th width="150" align="center">Contract</th><th width="611.4285714285713" align="center">Address</th></tr></thead><tbody><tr><td align="center">ERC20 Test</td><td align="center"><a href="https://goerli.voyager.online/contract/0x039bded9481f5fc7d46185c44655206362a647bb046dd97efcd2524a10bf7ab2">0x039bded9481f5fc7d46185c44655206362a647bb046dd97efcd2524a10bf7ab2</a></td></tr><tr><td align="center">ERC20 Test xFlow</td><td align="center"><a href="https://goerli.voyager.online/contract/0x002a63a6069e8209ad6bcab1d11d75cead44003aaaccbfad069954e32e533f35">0x002a63a6069e8209ad6bcab1d11d75cead44003aaaccbfad069954e32e533f35</a></td></tr></tbody></table>
