d
d
docs
Search…
ElasticMath.sol

Math of ElasticDAO

Provides functions for performing ElasticDAO specific math.

Functions

capitalDelta

Calculates the value of capitalDelta, the amount of ETH backing each governance token.
1
function capitalDelta(uint256 totalEthValue, uint256 totalSupplyOfTokens)
2
internal
3
pure
4
returns (uint256)
5
{...}
Copied!

parameters

1
@param totalEthValue amount of ETH in the DAO contract
2
@param totalSupplyOfTokens number of tokens in existance
Copied!

deltaE

Calculates the value of deltaE, the amount of ETH required to mint deltaLambda.
1
function deltaE(
2
uint256 deltaLambda,
3
uint256 capitalDeltaValue,
4
uint256 k,
5
uint256 elasticity,
6
uint256 lambda,
7
uint256 m
8
) internal pure returns (uint256) {...}
Copied!

parameters

1
@param deltaLambda = lambdaDash - lambda
2
@param capitalDeltaValue the ETH/token ratio; see capitalDelta(uint256, uint256)
3
@param k constant token multiplier - it increases the number of tokens that each member of the DAO has with respect to their lambda
4
@param elasticity the percentage by which capitalDelta (cost of entering the DAO) should increase on every join
5
@param lambda outstanding shares
6
@param m - lambda modifier - it's value increases every time someone joins the DAO
Copied!

lambdaFromT

Calculates the lambda value given t, k, & m.
1
function lambdaFromT(
2
uint256 tokens,
3
uint256 k,
4
uint256 m
5
) internal pure returns (uint256) {...}
Copied!

parameters

1
@param tokens t value; number of tokens for which lambda should be calculated
2
@param k constant token multiplier - it increases the number of tokens that each member of the DAO has with respect to their lambda
3
@param m - lambda modifier - it's value increases every time someone joins the DAO
Copied!

mDash

Calculates the future share modifier given the future value of lambda (lambdaDash), the current value of lambda, and the current share modifier.
1
function mDash(
2
3
uint256 lambda,
4
uint256 m
5
) internal pure returns (uint256) {...}
Copied!

parameters

1
@param m current share modifier
2
@param lambda current outstanding shares
3
Copied!

revamp

Calculates the value of revamp (revamp = 1 + elasticity).
1
function revamp(uint256 elasticity) internal pure returns (uint256) {...}
Copied!

parameters

1
@param elasticity the percentage by which capitalDelta should increase
Copied!

t

Calculates the number of tokens represented by lambda given k & m.
1
function t(
2
uint256 lambda,
3
uint256 k,
4
uint256 m
5
) internal pure returns (uint256) {...}
Copied!

parameters

1
@param lambda shares
2
@param k a constant, initially set by the DAO
3
@param m share modifier
Copied!

wmul

Multiplies two float values, required since solidity does not handle floating-point values.
1
function wmul(uint256 a, uint256 b) internal pure returns (uint256) {...}
Copied!

wdiv

Divides two float values, required since solidity does not handle floating-point values.
1
function wdiv(uint256 a, uint256 b) internal pure returns (uint256) {...}
Copied!