> For the complete documentation index, see [llms.txt](https://docs.swarmnetwork.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swarmnetwork.org/swarm-protocol/spf/uniswap-proxy-contract.md).

# Uniswap Proxy Contract

* **Smart Contract:** globally across all Swarm Powered Fundraises
* **Created:** pre-exists / created only once  and then referenced in each Swarm Powered Fundraise contract
* **Purpose:** Proxy Contract that makes ongoing calls to the different Uniswap exchanges to obtain the prices of accepted currencies used in Swarm Powered Fundraises
* **Example:** TBD

## Feature Description

### Read Functions

| Function                                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `getRate(address, address, uint256, uint256)` returns `(uint256, uint256)` | Returns the exchange rate between first and second address. The first parameter is the token address of the currency to be exchanged from, the second parameter is the address of the currency to be exchanged to, the third parameter is the value in Wei to be exchanged and the fourth parameter is the decimal places; e.g. to get the rate of 1 ETH in DAI `getRate(“0x0000000000000000000000000000000000000000”,”0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667”,1000000000000000000,0)` |
| `isOwner()` returns `(bool)`                                               | Returns true if the caller is the current contract owner address of this contract                                                                                                                                                                                                                                                                                                                                                                                                          |
| `owner()` returns `(address)`                                              | Returns the address of the owner of this contract                                                                                                                                                                                                                                                                                                                                                                                                                                          |

### Write Functions

| Function                                | Description                                                                                                                                                                                                                                                                                                                                                |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `addOrUpdateExchange(address, address)` | Adds an exchange pair between two currencies to the proxy. The first parameter is the token address and the second parameter is the Uniswap exchange address; e.g. to set up DAI stable coin the following should be called `addOrUpdateExchange("0x6B175474E89094C44Da98b954EedeAC495271d0F&#x201D;,&#x201D;0x6B175474E89094C44Da98b954EedeAC495271d0F")` |
| `renounceOwnership()`                   | Contract owner can renounce ownership of this contract.                                                                                                                                                                                                                                                                                                    |
| `transferOwnership()`                   | An owner can transfer their role to a new address or to a multisig wallet                                                                                                                                                                                                                                                                                  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.swarmnetwork.org/swarm-protocol/spf/uniswap-proxy-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
