Factory for deploying upgradable modules (UpgradableModuleFactory.sol)
View Source: contracts/modules/UpgradableModuleFactory.sol
↗ Extends: ModuleFactory ↘ Derived Contracts: BlacklistTransferManagerFactory, CappedSTOFactory, CountTransferManagerFactory, DummySTOFactory, ERC20DividendCheckpointFactory, EtherDividendCheckpointFactory, GeneralPermissionManagerFactory, GeneralTransferManagerFactory, LockUpTransferManagerFactory, ManualApprovalTransferManagerFactory, PercentageTransferManagerFactory, PLCRVotingCheckpointFactory, PreSaleSTOFactory, USDTieredSTOFactory, VestingEscrowWalletFactory, VolumeRestrictionTMFactory, WeightedVoteCheckpointFactory
UpgradableModuleFactory
Structs
LogicContract
struct LogicContract {
string version,
address logicContract,
bytes upgradeData
}
Contract Members
Constants & Variables
mapping(uint256 => struct UpgradableModuleFactory.LogicContract) public logicContracts;
mapping(address => mapping(address => uint256)) public modules;
mapping(address => address) public moduleToSecurityToken;
uint256 public latestUpgrade;
Events
event LogicContractSet(string _version, uint256 _upgrade, address _logicContract, bytes _upgradeData);
event ModuleUpgraded(address indexed _module, address indexed _securityToken, uint256 indexed _version);
Functions
Constructor
function (string _version, uint256 _setupCost, address _logicContract, address _polymathRegistry, bool _isCostInPoly) public nonpayable ModuleFactory
Arguments
Name
Type
Description
_version
string
_setupCost
uint256
Setup cost of the module
_logicContract
address
Contract address that contains the logic related to description
_polymathRegistry
address
Address of the Polymath registry
_isCostInPoly
bool
true = cost in Poly, false = USD
setLogicContract
Used to upgrade the module factory
function setLogicContract(string _version, address _logicContract, 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
_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 _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
_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 _upgradeData) internal nonpayable
Arguments
Name
Type
Description
_upgrade
uint256
_version
string
_logicContract
address
_upgradeData
bytes
upgrade
Used by a security token to upgrade a given module
function upgrade(address _module) external nonpayable
Arguments
Name
Type
Description
_module
address
Address of (proxy) module to be upgraded
_initializeModule
⤾ overrides ModuleFactory._initializeModule
Used to initialize the module
function _initializeModule(address _module, bytes _data) internal nonpayable
Arguments
Name
Type
Description
_module
address
Address of module
_data
bytes
Data used for the intialization of the module factory variables
version
⤾ overrides ModuleFactory.version
Get the version related to the module factory
function version() external view
returns(string)
Arguments
Name
Type
Description
Last updated
Was this helpful?