0

Here I've added code snippet which is I'm learning right now.

The following terms/ entities/ variable are not understandable why exactly it means and why it is used. - Founder, Advisor, Bonus1/2/3, Airdrop, Reserve, Presale.

uint256 private constant decimalFactor = 10**uint256(18);
enum AllocationType { PRESALE, ADVISOR, FOUNDER, AIRDROP, RESERVE, BONUS1, BONUS2, BONUS3 }

uint256 public constant INITIAL_SUPPLY = 10000000 * decimalFactor;
uint256 public AVAILABLE_TOTAL_SUPPLY = 10000000 * decimalFactor;
uint256 public AVAILABLE_PRESALE_SUPPLY = 30000 * decimalFactor;
uint256 public AVAILABLE_FOUNDER_SUPPLY = 50000 * decimalFactor;
uint256 public AVAILABLE_AIRDROP_SUPPLY = 10000 * decimalFactor;
uint256 public AVAILABLE_ADVISOR_SUPPLY = 20000 * decimalFactor;
uint256 public AVAILABLE_RESERVE_SUPPLY = 2375435 * decimalFactor;
uint256 public AVAILABLE_BONUS1_SUPPLY = 78546 * decimalFactor;
uint256 public AVAILABLE_BONUS2_SUPPLY = 47586 * decimalFactor;
uint256 public AVAILABLE_BONUS3_SUPPLY = 8469840 * decimalFactor;

1 Answer 1

0

It is a type of enum, which is a customisable type that is used when there are limited options for a property. In the example you mentioned from PolyMath, it means that the variable AllocationType represents the type of monetary transaction, which could be due to an airdrop event (AIRDROP), an investment during presale (PRESALE), a special dividend payout for founding members (FOUNDER), various types of bonus (BONUS1, BONUS2, BONUS3), etc.

If a transaction is related to advisors, then AllocationType.ADVISOR will be used somewhere in the smart contract to store this information.

You could read more about enum in the official Solidity docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.