Skip to main content

FactoryBase

Git Source Inherits: Ownable, IFactory Author: @oscarsernarosero @mpetersoCode55 @cirsteve creates the pools in an automated and permissioned fashion

State Variables

VERSION

string public constant VERSION = "v0.2.0";

MAX_PROTOCOL_FEE

uint16 public constant MAX_PROTOCOL_FEE = 20;

yTokenAllowList

address yTokenAllowList;

deployerAllowList

address deployerAllowList;

protocolFeeCollector

address public protocolFeeCollector;

proposedProtocolFeeCollector

address public proposedProtocolFeeCollector;

protocolFee

uint16 public protocolFee;

Functions

onlyAllowedDeployers

modifier onlyAllowedDeployers();

onlyAllowedYTokens

modifier onlyAllowedYTokens(address _yToken);

onlyProposedProtocolFeeCollector

modifier onlyProposedProtocolFeeCollector();

setYTokenAllowList

sets the y token allow list
function setYTokenAllowList(address _address) external onlyOwner;
Parameters
NameTypeDescription
_addressaddressof the allow list contract

getYTokenAllowList

gets the y token allow list
function getYTokenAllowList() external view returns (address);
Returns
NameTypeDescription
<none>address_address of the current allow list contract

setDeployerAllowList

Only the owner can set the deployer allow list sets the deployer allow list
function setDeployerAllowList(address _address) external onlyOwner;
Parameters
NameTypeDescription
_addressaddressof the allow list contract

getDeployerAllowList

gets the deployer allow list
function getDeployerAllowList() external view returns (address);
Returns
NameTypeDescription
<none>address_address of the current allow list contract

setProtocolFee

Only the owner can set the protocol fee This is the function to update the protocol fees per trade.
function setProtocolFee(uint16 _protocolFee) public onlyOwner;
Parameters
NameTypeDescription
_protocolFeeuint16percentage of the transaction that will get collected as fees (in percentage basis points: 10000 -> 100.00%; 500 -> 5.00%; 1 -> 0.01%)

proposeProtocolFeeCollector

that only the current fee collector address can call this function function to propose a new protocol fee collector
function proposeProtocolFeeCollector(address _protocolFeeCollector) external onlyOwner;
Parameters
NameTypeDescription
_protocolFeeCollectoraddressthe new fee collector

confirmProtocolFeeCollector

that only the already proposed fee collector can call this function function to confirm a new protocol fee collector
function confirmProtocolFeeCollector() external onlyProposedProtocolFeeCollector;