17

in many token contracts the amount parameter is called wad

I was not able to make sense what this means or where it comes from. Does someone have a clue?

3 Answers 3

11

As i know it was introduced by Dapp tool-suite (part of dapphub project) as a concept representing a number with 18 decimals. So i presume the contract developed using Dapp libraries or tools use the same names.

2
  • thank you. I have not marked your answer as accepted because it does not clarify the meaning of the acronym (I assume it is an acronym) wad Commented Sep 27, 2017 at 13:40
  • It is not an acronym . Google defines it as bundle of paper, banknotes, or documents. "a thick wad of index cards" Commented Sep 27, 2017 at 16:35
21

A wad is a decimal number with 18 digits of precision that is being represented as an integer.

A ray is a decimal number with 27 digits of precision that is being represented as an integer.

Under the hood, they both are uint (i.e. uint256).

Introduced by DS-Math library. With DS-Math you can safely add, subtract, multiply, and divide uint numbers without fear of integer overflow. You can also find the minimum and maximum of two numbers.

This naming convention helps a programmer avoid mistakes while performing arithmetic operations on these values.

Hope this helps!

0

Everything Badr and Raman said, plus I don't think it's an actual acronym, but I like to make it as one. Pick whichever you like:

  • Wei As Decimal
  • Wei Adjusted Decimal

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.