[E-Lang] ERTP-aware MintMaker
Tue, 13 Feb 2001 22:54:35 -0800
I thought of another possible attack, but it doesn't work. That would
be to make a purse with a floating-point amount. Then you could come
up with a tiny transfer amount such that floating point roundoff would
not reduce the size of the purse you were drawing from, but it would
increase the size of the purse you were adding to (which would have less
to start with). Then you could increase the money supply by repeatedly
calling transfer with this amount.
At first I thought maybe the MintMaker was supposed to allow floating
point amounts, and that was why all those "any"s are used instead of
"int"s for the amounts. E aborts though on the compare ":(any >= 0)"
with a floating point value. It calls the Java BigInteger compareTo
function and that doesn't do any int-float promotion as some languages do.
(Actually I am testing with the "(_ >= 0)" syntax used in 0.8.9.)
Likewise I think the ":(0..quantity)" guard would fail as well on Decr.
As long as the purse only allows ints then this attack won't work.