Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
134 lines (100 sloc) 2.51 KB

Factory API

initializeFactory

{% code-tabs %} {% code-tabs-item title="Smart Contract" %}

initializeFactory(template: address):

{% endcode-tabs-item %}

{% code-tabs-item title="Web3" %}

factoryContract.methods.initializeFactory(template: String).send()

{% endcode-tabs-item %} {% endcode-tabs %}

Parameter Description
template Ethereum address of exchange template

****createExchange

{% code-tabs %} {% code-tabs-item title="Smart Contract" %}

createExchange(token: address): address

{% endcode-tabs-item %}

{% code-tabs-item title="Web3" %}

factoryContract.methods.initializeFactory(token: String).send()

{% endcode-tabs-item %} {% endcode-tabs %}

Parameter Type Description
token address Ethereum address of an ERC20 token
Returns
address Ethereum address of a Uniswap exchange

getExchange

{% code-tabs %} {% code-tabs-item title="Smart Contract" %}

@constant
getExchange(token: address): address

{% endcode-tabs-item %}

{% code-tabs-item title="Web3" %}

factoryContract.methods.getExchange(token: String).call()

{% endcode-tabs-item %} {% endcode-tabs %}

Parameter Type Description
token address Ethereum address of an ERC20 token
Returns
address Ethereum address of a Uniswap exchange

****

getToken

{% code-tabs %} {% code-tabs-item title="Smart Contract" %}

@constant
getToken(exchange: address): address

{% endcode-tabs-item %}

{% code-tabs-item title="Web3" %}

factoryContract.methods.getToken(exchange: String).call()

{% endcode-tabs-item %} {% endcode-tabs %}

Parameter Type Description
exchange address Ethereum address of a Uniswap exchange
Returns
address Ethereum address of an ERC20 token

****

getTokenWithId

{% code-tabs %} {% code-tabs-item title="Smart Contract" %}

@constant
getTokenWithId(token_id: uint256): address

{% endcode-tabs-item %}

{% code-tabs-item title="Web3" %}

factoryContract.methods.getToken(exchange: Integer).call()

{% endcode-tabs-item %} {% endcode-tabs %}

Parameter Type Description
token_id uint256 Uniswap ID for an ERC20 token
Returns
address Ethereum address of an ERC20 token

****