Description
The token model is serialized in the join function and then again in mintShares. It would be cheaper to calculate lambdaDash and mDash in Token.mintShares. This avoids duplicate calls to Ecosystem.deserialize and to Token.serialize.
// mdash
uint256 lambdaDash = SafeMath.add(token.maxLambdaPurchase, token.lambda);
uint256 mDash = ElasticMath.mDash(lambdaDash, token.lambda, token.m);
// serialize the token
Ecosystem.Instance memory ecosystem = _getEcosystem();
Token tokenStorage = Token(ecosystem.tokenModelAddress);
token.m = mDash;
tokenStorage.serialize(token);
// tokencontract mint shares
bool success = tokenContract.mintShares(msg.sender, token.maxLambdaPurchase);
require(success, 'ElasticDAO: Mint Shares Failed during Join');
Definition of Done
Description
The token model is serialized in the join function and then again in mintShares. It would be cheaper to calculate lambdaDash and mDash in Token.mintShares. This avoids duplicate calls to Ecosystem.deserialize and to Token.serialize.
Definition of Done