Currency Registry Contract
- BETA -
Smart Contract: specific to a Swarm Powered Fundraise for a specific SRC20
Created: review the SPF Deployment Sequence; then referenced in the Swarm Powered Fundraise contract
Purpose: Registers all currencies that will be accepted in a specific Swarm Powered Fundraise
Example: TBD
Feature Description
Read Functions
Function | Description |
| An array of CurrencyStats Objects. These objects have the following structure: |
| Returns an array of the accepted currencies in a Swarm Powered Fundraise |
| A mapping of accepted currency addresses to integers; To obtain the index of DAI in the contract use |
| Returns the value of the locked exchange rate of the currency in the first parameter |
| Returns if a specific currency is accepted in a Swarm Powered Fundraise; To check if the fundraise accepts DAI use |
| Returns the base currency in which a Swarm Powered Fundraise is denominated |
| Converts the amount given as the first parameter into USD. The second parameter is the address of the currency to be converted to USD. |
| Converts the amount given as the first parameter into the Base Currency. The second parameter is the address of the currency to be converted to Base Currency |
| Returns the exchange rate between the first and the 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 use |
| Returns true if the calling address is the contract owner |
| Returns the address of the contract owner |
Write Functions
Function | Description |
| Adds a currency to the list of currencies accepted in a Swarm Powered Fundraise. The first parameter is the token address and the second parameter is the address of the exchange proxy contract |
| Locks the exchange rates of currencies accepted in a Swarm Powered Fundraise to the Base Currency |
| Sets a base currency from the list of currencies accepted in a Swarm Powered Fundraise; the parameter is the address of the base currency to be set |
| Sets the currency address that will be used as the default USD dollar oracle address for a Swarm Powered Fundraise. Usually set to USDC; e.g. to set to USDC use |
| Contract owner can renounce ownership of this Currency Registry contract |
| Transfers ownership of this Currency Registry contract to another address |
Last updated