The CryptoSwap Factory makes use of the create_forwarder_to function to deploy its contracts from the implementations.
Warning
Implementation contracts are upgradable. They can either be replaced, or additional implementation contracts can be added. Therefore, please always make sure to check the most recent ones.
It utilizes three different implementations:
pool_implementation, containing a contract that is used to deploy the pools.
token_implementation, containing a contract that is used to deploy LP tokens.
gauge_implementation, containing a blueprint contract that is used when deploying gauges for pools.
This function is only callable by the admin of the contract.
Function to set a new pool implementation contract.
Emits event: UpdatePoolImplementation
Input
Type
Description
_pool_implementation
address
New pool implementation
Source code
eventUpdatePoolImplementation:_old_pool_implementation:address_new_pool_implementation:addresspool_implementation:public(address)@externaldefset_pool_implementation(_pool_implementation:address):""" @notice Set pool implementation @dev Set to ZERO_ADDRESS to prevent deployment of new pools @param _pool_implementation Address of the new pool implementation """assertmsg.sender==self.admin# dev: admin onlylogUpdatePoolImplementation(self.pool_implementation,_pool_implementation)self.pool_implementation=_pool_implementation
This function is only callable by the admin of the contract.
Function to set a new token implementation contract.
Emits event: UpdateTokenImplementation
Input
Type
Description
_token_implementation
address
New token implementation
Source code
eventUpdateTokenImplementation:_old_token_implementation:address_new_token_implementation:addresstoken_implementation:public(address)@externaldefset_token_implementation(_token_implementation:address):""" @notice Set token implementation @dev Set to ZERO_ADDRESS to prevent deployment of new pools @param _token_implementation Address of the new token implementation """assertmsg.sender==self.admin# dev: admin onlylogUpdateTokenImplementation(self.token_implementation,_token_implementation)self.token_implementation=_token_implementation
This function is only callable by the admin of the contract.
Function to set a new gauge implementation contract.
Emits event: UpdateGaugeImplementation
Input
Type
Description
_gauge_implementation
address
New gauge implementation
Source code
eventUpdateGaugeImplementation:_old_gauge_implementation:address_new_gauge_implementation:addressgauge_implementation:public(address)@externaldefset_gauge_implementation(_gauge_implementation:address):""" @notice Set gauge implementation @dev Set to ZERO_ADDRESS to prevent deployment of new gauges @param _gauge_implementation Address of the new token implementation """assertmsg.sender==self.admin# dev: admin-only functionlogUpdateGaugeImplementation(self.gauge_implementation,_gauge_implementation)self.gauge_implementation=_gauge_implementation