The TriCrypto-NG Factory allows the permissionless deployment of two-coin volatile asset pools, as well as gauges. The liquidity pool and LP token share the same contract.
Additionally, the Factory contract is the direct admin and fee receiver of all pools. In turn, the Factory is controlled by the CurveDAO.
Contract Source & Deployment
Source code for this contract is available on Github. A list of all deployed contracts can be found here.
The Tricrypto-NG Factory makes use of blueprint contracts 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 four different implementations:
pool_implementations, containing multiple blueprint contracts that are used to deploy the pools.
gauge_implementation, containing a blueprint contract that is used when deploying gauges for pools.
views_implementation, containing a view methods contract relevant for integrators and users looking to interact with the AMMs.
math_implementation, containing math functions used in the AMM.
This function is only callable by the admin of the contract.
Function to set a _pool_implementation for _implementation_index.
Emits event: UpdatePoolImplementation
Input
Type
Description
_pool_implementation
address
New pool implementation
_implementation_index
uint256
Index
Source code
eventUpdatePoolImplementation:_implemention_id:uint256_old_pool_implementation:address_new_pool_implementation:addresspool_implementations:public(HashMap[uint256,address])@externaldefset_pool_implementation(_pool_implementation:address,_implementation_index:uint256):""" @notice Set pool implementation @dev Set to empty(address) to prevent deployment of new pools @param _pool_implementation Address of the new pool implementation @param _implementation_index Index of the pool implementation """assertmsg.sender==self.admin,"dev: admin only"logUpdatePoolImplementation(_implementation_index,self.pool_implementations[_implementation_index],_pool_implementation)self.pool_implementations[_implementation_index]=_pool_implementation
This function is only callable by the admin of the contract.
Function to set a new _gauge_implementation.
Emits event: UpdateGaugeImplementation
Input
Type
Description
_gauge_implementation
address
Gauge blueprint contract
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 empty(address) to prevent deployment of new gauges @param _gauge_implementation Address of the new token implementation """assertmsg.sender==self.admin,"dev: admin only"logUpdateGaugeImplementation(self.gauge_implementation,_gauge_implementation)self.gauge_implementation=_gauge_implementation
This function is only callable by the admin of the contract.
Function to set a new _views_implementation.
Emits event: UpdateViewsImplementation
Input
Type
Description
_views_implementation
address
Views blueprint contract
Source code
eventUpdateViewsImplementation:_old_views_implementation:address_new_views_implementation:addressviews_implementation:public(address)@externaldefset_views_implementation(_views_implementation:address):""" @notice Set views contract implementation @param _views_implementation Address of the new views contract """assertmsg.sender==self.admin,"dev: admin only"logUpdateViewsImplementation(self.views_implementation,_views_implementation)self.views_implementation=_views_implementation
This function is only callable by the admin of the contract.
Function to set a new _math_implementation.
Emits event: UpdateMathImplementation
Input
Type
Description
_math_implementation
address
Math blueprint contract
Source code
eventUpdateMathImplementation:_old_math_implementation:address_new_math_implementation:addressmath_implementation:public(address)@externaldefset_math_implementation(_math_implementation:address):""" @notice Set math implementation @param _math_implementation Address of the new math contract """assertmsg.sender==self.admin,"dev: admin only"logUpdateMathImplementation(self.math_implementation,_math_implementation)self.math_implementation=_math_implementation
This function is only callable by the admin of the contract.
Function to set a new fee_receiver address.
Emits event: UpdateFeeReceiver
Input
Type
Description
_fee_receiver
address
new fee receiver address
Source code
eventUpdateFeeReceiver:_old_fee_receiver:address_new_fee_receiver:addressadmin:public(address)fee_receiver:public(address)@externaldefset_fee_receiver(_fee_receiver:address):""" @notice Set fee receiver @param _fee_receiver Address that fees are sent to """assertmsg.sender==self.admin,"dev: admin only"logUpdateFeeReceiver(self.fee_receiver,_fee_receiver)self.fee_receiver=_fee_receiver