Proxy for deploying SecurityToken instances (STFactory.sol)

View Source: contracts/tokens/STFactory.solโ€‹

โ†— Extends: ISTFactory, Ownableโ€‹

STFactory

Structs

LogicContract

struct LogicContract {
string version,
address logicContract,
bytes initializationData,
bytes upgradeData
}

Contract Members

Constants & Variables

//public members
address public transferManagerFactory;
contract DataStoreFactory public dataStoreFactory;
contract IPolymathRegistry public polymathRegistry;
uint256 public latestUpgrade;
โ€‹
//internal members
mapping(address => uint256) internal tokenUpgrade;
mapping(uint256 => struct STFactory.LogicContract) internal logicContracts;

Events

event LogicContractSet(string _version, uint256 _upgrade, address _logicContract, bytes _initializationData, bytes _upgradeData);
event TokenUpgraded(address indexed _securityToken, uint256 indexed _version);
event DefaultTransferManagerUpdated(address indexed _oldTransferManagerFactory, address indexed _newTransferManagerFactory);
event DefaultDataStoreUpdated(address indexed _oldDataStoreFactory, address indexed _newDataStoreFactory);

Functions

function (address _polymathRegistry, address _transferManagerFactory, address _dataStoreFactory, string _version, address _logicContract, bytes _initializationData) public nonpayable

Arguments

Name

Type

Description

_polymathRegistry

address

โ€‹

_transferManagerFactory

address

โ€‹

_dataStoreFactory

address

โ€‹

_version

string

โ€‹

_logicContract

address

โ€‹

_initializationData

bytes

โ€‹

deployToken

โคพ overrides ISTFactory.deployTokenโ€‹

deploys the token and adds default modules like the GeneralTransferManager. Future versions of the proxy can attach different modules or pass different parameters.

function deployToken(string _name, string _symbol, uint8 _decimals, string _tokenDetails, address _issuer, bool _divisible, address _treasuryWallet) external nonpayable
returns(address)

Arguments

Name

Type

Description

_name

string

โ€‹

_symbol

string

โ€‹

_decimals

uint8

โ€‹

_tokenDetails

string

โ€‹

_issuer

address

โ€‹

_divisible

bool

โ€‹

_treasuryWallet

address

โ€‹

_deploy

function _deploy(string _name, string _symbol, uint8 _decimals, string _tokenDetails, bool _divisible) internal nonpayable
returns(address)

Arguments

Name

Type

Description

_name

string

โ€‹

_symbol

string

โ€‹

_decimals

uint8

โ€‹

_tokenDetails

string

โ€‹

_divisible

bool

โ€‹

setLogicContract

โคพ overrides ISTFactory.setLogicContractโ€‹

Used to set a new token logic contract

function setLogicContract(string _version, address _logicContract, bytes _initializationData, bytes _upgradeData) external nonpayable onlyOwner

Arguments

Name

Type

Description

_version

string

Version of upgraded module

_logicContract

address

Address of deployed module logic contract referenced from proxy

_initializationData

bytes

Initialization data that used to intialize value in the securityToken

_upgradeData

bytes

Data to be passed in call to upgradeToAndCall when a token upgrades its module

updateLogicContract

Used to update an existing token logic contract

function updateLogicContract(uint256 _upgrade, string _version, address _logicContract, bytes _initializationData, bytes _upgradeData) external nonpayable onlyOwner

Arguments

Name

Type

Description

_upgrade

uint256

logic contract to upgrade

_version

string

Version of upgraded module

_logicContract

address

Address of deployed module logic contract referenced from proxy

_initializationData

bytes

โ€‹

_upgradeData

bytes

Data to be passed in call to upgradeToAndCall when a token upgrades its module

_modifyLogicContract

function _modifyLogicContract(uint256 _upgrade, string _version, address _logicContract, bytes _initializationData, bytes _upgradeData) internal nonpayable

Arguments

Name

Type

Description

_upgrade

uint256

โ€‹

_version

string

โ€‹

_logicContract

address

โ€‹

_initializationData

bytes

โ€‹

_upgradeData

bytes

โ€‹

upgradeToken

โคพ overrides ISTFactory.upgradeTokenโ€‹

Used to upgrade a token

function upgradeToken(uint8 _maxModuleType) external nonpayable

Arguments

Name

Type

Description

_maxModuleType

uint8

maximum module type enumeration

updateDefaultTransferManager

โคพ overrides ISTFactory.updateDefaultTransferManagerโ€‹

Used to set a new default transfer manager

function updateDefaultTransferManager(address _transferManagerFactory) external nonpayable onlyOwner

Arguments

Name

Type

Description

_transferManagerFactory

address

Address of new default transfer manager factory

updateDefaultDataStore

โคพ overrides ISTFactory.updateDefaultDataStoreโ€‹

Used to set a new default data store

function updateDefaultDataStore(address _dataStoreFactory) external nonpayable onlyOwner

Arguments

Name

Type

Description

_dataStoreFactory

address

Address of new default data store factory