Venturing into The LAO: Comparing MolochDAO and vmLAO Solidity Designs

Ross Campbell
Coinmonks
Published in
5 min readSep 4, 2019

--

👹 + 👾 = ❤️

The LAO, a recently announced project powered by OpenLaw to fund new Ethereum ventures with model legal forms and structures, borrows greatly from the Moloch DAO smart contract framework in order to achieve the following key objectives in managing funds:

  • Simplicity in Solidity for Security;
  • Escrowed Proposals;
  • Graceful Exits;

In this way, the Moloch design helps limit the zones for member contention and likewise enables a simple template for private ordering around digital fund grants. Extending this format to venture is not a heavy technical lift, and the Moloch v2 contract upgrades also present a promising and complementary design for automating aspects of online funding.

Seeking to iterate slightly over a well-tested base, our vmLAO design merges on-chain membership and funding proposals through the original Moloch DAO voting track, with a few tailored economic changes that accommodate ERC20 token swaps and accounting logic for The LAO member dividends and investment records.

We look forward to collaborating with other projects building venture designs around Moloch and similar online guild frameworks as we iterate.

The following highlights our initial approach for a streamlined vmLAO design forked from Moloch: Please reach out with comments, questions, suggestions!

Multi-Token Support

IERC20 public contributionToken; 
IERC20 private tributeToken;

The vmLAO tracks two token types:

(i) “contribution token,” the base token which members contribute in order to receive voting shares and economic interests over the guild bank (and, which ventures request funding *in*), such as DAI or wETH, and

(ii) tribute token,” the token which is escrowed into the vmLAO smart contract during membership and/or funding proposals (if request for voting shares, this will likely match contribution token type).

Similar to the original Moloch design, in the event that a vmLAO proposal fails, deposited tribute token amounts will be automatically returned to the vmLAO applicant.

Dissimilar to Moloch, contribution token amounts are not required as a proposal deposit by The LAO members. With identified participants and membership agreements, The LAO will initially explore how legal liabilities can help optimize participation and reduce spam on the proposal process (though deposit mechanisms are not discounted for future implementation!).

Accounting for Economic Weight

uint256 public totalContributed = 0; 
uint256 public totalDividends = 0;
uint256 public totalWithdrawals = 0;

The vmLAO design tracks three values to internally account for the *fair share* over the guild bank total that any member can claim as dividends or withdraw entirely through a ragequitting exit: (i) “total contributed,” (ii) “total dividends”, (iii) “total withdrawals.”

When a proposal is processed, contributions in the base token are tracked as a sum total (matching whatever amount vmLAO deposits to the guild bank):

if (proposal.tributeToken == contributionToken) { 
totalContributed = totalContributed.add(proposal.tributeAmount);
}

Minor additions to the Moloch member struct also account for individual token contributions and dividend withdrawals from the guild bank total, allowing the vmLAO to calculate individual economic shares on a running basis:

struct Member {     
address delegateKey;
uint256 shares;
bool exists;
uint256 tributeAmount;
uint256 highestIndexYesVote;
uint256 lastTotalDividends;
}

Adding Venture Administration

modifier onlySummoner {
require(msg.sender == summoner);
_;
}

vmLAO also has an additional modifier, ‘onlySummoner,’ that allows the summoner address set by the smart contract constructor certain limited administrative privileges over the guild bank: (i) withdrawing investment assets, and (ii) declaring dividends due to contributing members:

admin withdraw assets:

function adminWithdrawAsset(IERC20 assetToken, address receiver, uint256 amount) onlySummoner public returns (bool) {     require(assetToken != contributionToken); 
return guildBank.adminWithdrawAsset(assetToken, receiver, amount);
}

admin declare dividends:

updateTotalDividends(uint256 newDividendAmount) onlySummoner public { totalDividends = totalDividends.add(newDividendAmount); 
}

Note: Summoner admins are not permitted to unilaterally withdraw amounts in the base contribution token held in the guild bank; instead, they must request such funds like any other (for, e.g., DeFi savings strategies), through the regular vmLAO proposal process. In addition to the ‘guild kick’ mechanism to remove non-compliant members in Moloch v2 venture design, we are studying the benefit of adding similar member voting mechanisms to remove/assign admin privileges over LAO functions that might require administrative attention for legal or other precautionary reasons.

Adding Funds Disbursement

While the original Moloch code calls for tribute applicants to raqequit/exit the guild and burn voting shares in order to claim funding per their voting weight, vmLAO eliminates this followup mechanism for pure funding requests and delineates between voting and economics. To this end, the proposal function contains an additional field, “funds requested,” which directs a disbursement of such amount in the base contribution token to an applicant after an approval is processed (such amount also tallied into total sum of withdrawals from guild bank):

require(
guildBank.withdrawFunds(proposal.applicant, proposal.fundsRequested), "Moloch::processProposal - withdrawal of tokens from guildBank failed"
);

Finally, let’s take a look through how this additional economic scripting on Moloch comes into important play for vmLAO raqequitting and dividend claiming functions for each of The LAO members:

member raqequit:

function ragequit() public onlyMember {     
Member storage member = members[msg.sender];
require(canRagequit(member.highestIndexYesVote), "Moloch::ragequit - cant ragequit until highest index proposal member voted YES on is processed"); uint256 withdrawalAmount = (member.tributeAmount / totalContributed) * (totalContributed + totalDividends - totalWithdrawals); // burn shares and other pertinent membership records totalShares = totalShares.sub(member.shares);
member.shares = 0;
member.tributeAmount = 0;

totalWithdrawals = totalWithdrawals.add(withdrawalAmount); // update total guild bank withdrawal tally to reflect raqequit amount
// instruct guild bank to transfer withdrawal amount to ragequitter
require(
guildBank.withdraw(msg.sender, withdrawalAmount), "Moloch::ragequit - withdrawal of tokens from guildBank failed" );

emit Ragequit(msg.sender);
}

As the calculations above might suggest, this design aims to allow the vmLAO to gauge how much a member has contributed to its base token amount that funds ventures and administration of The LAO, attributing their fair economic ‘share’ over guild bank funds that can be withdrawn on their exit.

Note: unlike Moloch, this initial raqequitting extension does not allow a member to withdraw for lesser amounts than their total contribution (adjusted for allocations that pass vote), though we are contemplating benefit of a more piecemeal design.

member claim dividends:

function claimDividend() public onlyMember { 
Member storage member = members[msg.sender];
// claim fair share of declared member dividend amount uint256 dividendAmount = (member.tributeAmount / totalContributed) * (totalDividends — member.lastTotalDividends); // instruct guild bank to transfer fair share to member
require(
guildBank.withdrawDividend(msg.sender, dividendAmount), “Moloch::claimDividend — withdrawal of tokens from guildBank failed” );
member.lastTotalDividends = member.lastTotalDividends.add(dividendAmount); totalWithdrawals = totalWithdrawals.add(dividendAmount);
}

As described above, The LAO members can call the vmLAO smart contract to withdraw their share of declared dividends garnered through approved investments of guild bank funds.

Conclusion

The LAO and vmLAO Solidity design extends the original Moloch design for grant-making in the Ethereum space to profit-driven venture funding, with economic extensions that retains core Moloch benefits of simplicity over voting and member management while modestly accommodating for-profit business concerns in regulated environments.

Get Best Software Deals Directly In Your Inbox

--

--