Themis ⚖

An oracle enabling Purchasing Power Parity on Ethereum to allow for a more equitable and dynamic pricing of products allowing you to send and receive payments normalized to the geolocation of the users.

Oracle Details

Response Schema

{
    0: string: ccIsoAlpha2
    1: string: ccIsoAlpha3
    2: uint256: exchangeRate
    3: uint256: ppp
    4: uint256: pppConversionFactor
}

Response Example

{
    'ccIsoAlpha2': 'IN',
    'ccIsoAlpha3': 'IND',
    'exchangeRate': 74929300,
    'ppp': 185530,
    'pppConversionFactor': 247606743957303,
}

Response Details

ℹ All baselines are in USD.

  • countryCodeIsoAlpha2 : This is the ISO Alpha 2 Standard Country Code. You can find the available country codes below.

  • countryCodeIsoAlpha3 : This is the ISO Alpha 3 Standard Country Code. You can find the available country codes below.

  • exchangeRate : Exchange rate of the currency vs USD. ℹ️ The original value is multiplied by (10^6) and returned by the contract. This is done to allow storing decimals on Ethereum.

  • ppp : This is the Purchasing Power Pairity. ℹ️ The original value is multiplied by (10^4) and returned by the contract.

  • pppConversionFactor : The exchangeRate and ppp property are used to compute the pppConversionFactor. ℹ️ The original value is multiplied by (10^15) and returned by the contract.

Integration Guide

Intergration Example Contract 👉 ThemisIntegration.sol

Latest Deployment Address 👉 0x494D59F11c6da8A49aB5E3DC4a4A6dcdb6b68f6b

UI Example 👉 themis.anudit.dev

Solidity Interface

interface IThemis {

    function getConversionFactor(uint256 _index) view external returns (uint256);
    function getParityData(uint256 _index)
        view external
        returns (
            string memory ccIsoAlpha2, string memory ccIsoAlpha3, uint256 exchangeRate, uint256 ppp, uint256 pppConversionFactor
        );
}

ABI

 [
	{
		"inputs": [
			{
				"internalType": "address",
				"name": "_syncerAddress",
				"type": "address"
			}
		],
		"stateMutability": "nonpayable",
		"type": "constructor"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "_index",
				"type": "uint256"
			},
			{
				"internalType": "string",
				"name": "_ccIsoAlpha2",
				"type": "string"
			},
			{
				"internalType": "string",
				"name": "_ccIsoAlpha3",
				"type": "string"
			},
			{
				"internalType": "uint256",
				"name": "_exchangeRate",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "_ppp",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "_pppConversionFactor",
				"type": "uint256"
			}
		],
		"name": "updateParityData",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "address",
				"name": "_newSyncer",
				"type": "address"
			}
		],
		"name": "updateSyncer",
		"outputs": [],
		"stateMutability": "nonpayable",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "_index",
				"type": "uint256"
			}
		],
		"name": "getConversionFactor",
		"outputs": [
			{
				"internalType": "uint256",
				"name": "pppConversionFactor",
				"type": "uint256"
			}
		],
		"stateMutability": "view",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "_index",
				"type": "uint256"
			}
		],
		"name": "getParityData",
		"outputs": [
			{
				"internalType": "string",
				"name": "ccIsoAlpha2",
				"type": "string"
			},
			{
				"internalType": "string",
				"name": "ccIsoAlpha3",
				"type": "string"
			},
			{
				"internalType": "uint256",
				"name": "exchangeRate",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "ppp",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "pppConversionFactor",
				"type": "uint256"
			}
		],
		"stateMutability": "view",
		"type": "function"
	},
	{
		"inputs": [],
		"name": "owner",
		"outputs": [
			{
				"internalType": "address",
				"name": "",
				"type": "address"
			}
		],
		"stateMutability": "view",
		"type": "function"
	},
	{
		"inputs": [
			{
				"internalType": "uint256",
				"name": "",
				"type": "uint256"
			}
		],
		"name": "parityData",
		"outputs": [
			{
				"internalType": "string",
				"name": "ccIsoAlpha2",
				"type": "string"
			},
			{
				"internalType": "string",
				"name": "ccIsoAlpha3",
				"type": "string"
			},
			{
				"internalType": "uint256",
				"name": "exchangeRate",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "ppp",
				"type": "uint256"
			},
			{
				"internalType": "uint256",
				"name": "pppConversionFactor",
				"type": "uint256"
			}
		],
		"stateMutability": "view",
		"type": "function"
	},
	{
		"inputs": [],
		"name": "syncer",
		"outputs": [
			{
				"internalType": "address",
				"name": "",
				"type": "address"
			}
		],
		"stateMutability": "view",
		"type": "function"
	}
]

Themis has support for over 193 countries, more can be found on the documentation at GitHub.

Demo 👉 https://www.youtube.com/watch?v=16D3iYV1j_4

Website 👉 https://themis.anudit.dev

Github 👉 https://github.com/anudit/themis

🥇 Themis was a Winner at ETHIndia 2020 - DappJedi