Factory

The Factory is used to deploy any PrincipalToken and Curve pools permissionlessly.

Factory.sol code can be found on GitHub.

Methods

deployPT

function deployPT(address _ibt, uint256 _duration) external returns (address pt)

Deploys the PrincipalToken contract implementation.

See also PrincipalToken.

deployCurvePool

function deployCurvePool(
        address _pt
        CurvePoolParams calldata curvePoolParams
) external returns (address curvePoolAddr)

Deploy a curve pool for the specific _pt instance with the specified curvePoolParams

CurvePoolParams

The curve pool parameters as defined in the curve pool documentation is a struct that hold the curve pool parameters.

deployAll

function deployAll(
        address _ibt,
        uint256 _duration,
        CurvePoolParams calldata curvePoolParams
    ) external returns (address pt, address curvePoolAddr, address lpv)

Deploy a Principal Token, a curve pool and a LP Vault associated with the PT and the deployed curve pool in a single transaction.

View Methods

getRegistry

function getRegistry() external view returns (address)

Returns the address of Registry contract.

getCurveAddressProvider

function getCurveAddressProvider() external view returns (address)

Returns the address of the Curve address provider.

getCurveFactory

function getCurveFactory() external view returns (address)

Returns the address of the Curve Factory.

getInitialPrice

function getInitialPrice(address curvePool) external view returns (uint256)

Return the initial_price parameter of the curvePool.

getCurveFactoryAddress

function getCurveFactoryAddress() public view returns (address)

Returns the address of the associated Curve Factory.

Last updated