To interact with the supertoken Factory contract on a particular chain, You first connect to the target chain
>>> from superfluid_finance.supertoken_factory import SupertokenFatory
>>> from superfluid_finance import accounts_provider as a
>>> account = a.get_account("<ENV_VARIABLE_NAME>")
or
>>>account = a.load_account("<local account name>")
>>> factory = SupertokenFatory("kovan", "infura")
Now you have a factory object connected to a factory contract on the active chain
Interactig with the factory contract is as easy as calling methods of the factory object
There are only two view functions
>>> factory.get_host()
It returns the host address
>>> factory.get_supertoken_logic()
Get the current super token logic used by the factory
Write functions change the state of the blockchain hence, require you to sign the transaction with an acount
>>> factory.initialize(account)
@dev Initialize the contract
>>> factory.create_ERC20Wraper_decimals(
underlying_token,
underlyingDecimals,
upgradability,
name,
symbol,
account
)
- Creates new super token wrapper for the underlying ERC20 token
- @param underlyingToken Underlying ERC20 token
- @param underlyingDecimals Underlying token decimals
- @param upgradability Upgradability mode
- @param name Super token name
- @param symbol Super token symbol
>>> factory.create_ERC20Wraper(
underlying_token,
upgradability,
name,
symbol,
account
)
- Create new super token wrapper for the underlying ERC20 token with extra token info
- underlyingToken Underlying ERC20 token
- upgradability Upgradability mode
- name Super token name
- symbol Super token symbol
- NOTE:
-
- It assumes token provides the .decimals() function
>>> factory.initialize_custom_supertoken(
customSuperTokenProxy,
account
)