EquityFinancingModule

Git Source

Inherits: MezzUpgradeableModule, IEquityFinancingModule

Author: Daniel Yamagata

A module that manages the equity financing of a company. Priced rounds are indexed at one

The initial version of Mezzanine only enables a Treasury to have the equity financing module as a child. Future versions may support departments having their own equity financing modules. Additionally, other forms of equity financing will be added via upgrades

State Variables

EquityFinancingModuleStorageLocation

bytes32 private constant EquityFinancingModuleStorageLocation =
    0xd961ff105dce6f539fbf0ae0958698eac72f58f46f1375706a8de3e60e2e2f00;

Functions

_getEquityFinancingModuleStorage

function _getEquityFinancingModuleStorage() internal pure returns (EquityFinancingModuleStorage storage $);

constructor

constructor(address _mezzHub, address _mezzMigrator) MezzUpgradeableModule(_mezzHub, _mezzMigrator);

init

Initializes the state of the module. This initialization is bespoke to each module

function init(address initTeam, bytes memory) external virtual override(Module, IModule) initializer;

Parameters

NameTypeDescription

initTeam

address

The team that controls the module

<none>

bytes

__EquityFinancingModule_init

function __EquityFinancingModule_init(address initTeam) internal virtual onlyInitializing;

currentRoundIndex

If there are no priced rounds, returns 0. Otherwise, returns the current round's index

'initTeam' must be a department or treasury

function currentRoundIndex() public view returns (uint256);

openPricedRound

Opens a Priced Round for the treasury of 'team' and returns the address of the new priced round

Only callable by the 'team' or its ancestor(s)

function openPricedRound(DataTypes.PricedRoundInitArgs memory initArgs, address shares)
    external
    virtual
    onlyTeamOrAncestor
    pausable
    returns (address);

Parameters

NameTypeDescription

initArgs

DataTypes.PricedRoundInitArgs

The arguments to initialize the priced round with. Validated within the priced round, itself

shares

address

The shares to be distributed in the priced round

getPricedRounds

Cache

function getPricedRounds() public view virtual returns (address[] memory);

getPricedRoundByIndex

If the priced round with 'roundIndex' does not exist, returns address(0). Otherwise, returns the address of the priced round with 'roundIndex'

function getPricedRoundByIndex(uint256 roundIndex) public view virtual returns (address);

coreId

Returns the coreId of the implementation as a bytes32

The core ID is the keccak256 hash of the contract name followed by a version under the following syntax: "mezzanine.coreId.ContractName.vX" For example, the core ID of the 2nd version of the Treasury would be the following: keccak256(abi.encodePacked("mezzanine.coreId.Treasury.v2"))

function coreId() public pure virtual override(Credentialed, ICredentialed) returns (bytes32);

version

Returns the version of the implementation as a uint256

function version() public pure virtual override(Credentialed, ICredentialed) returns (uint256);

_updateStateForCanceledRound

Deletes a canceled priced round from the '_pricedRoundByIndex' mapping and decrements the '_nextPricedRoundIndex'

function _updateStateForCanceledRound(uint256 currentRoundIndexCache) internal;

_incrementCurrentRoundIndex

Increments the '_currentRoundIndex' and returns the new value

function _incrementCurrentRoundIndex() internal returns (uint256);

_decrementCurrentRoundIndex

Decrements the '_currentRoundIndex' and returns the new value

function _decrementCurrentRoundIndex() internal returns (uint256);

_isTeamDepartment

Returns true if 'teamCache' supports the Department Interface, false otherwise

function _isTeamDepartment(address teamCache) internal view returns (bool);

_isTeamTreasury

Returns true if 'teamCache' supports the Treasury Interface, false otherwise

function _isTeamTreasury(address teamCache) internal view returns (bool);

supportsInterface

ERC165 support

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(MezzUpgradeableModule, IERC165)
    returns (bool);

Structs

EquityFinancingModuleStorage

struct EquityFinancingModuleStorage {
    uint256 _currentRoundIndex;
    mapping(uint256 => address) _pricedRoundByIndex;
}

Last updated