Creating Products

A Product mean a specific rulebook from which investors stake based on these rules.

The following call explains how to generate products based on startDate, endDate, APR, individualMinimumAmount, totalMaxAmount, lockedUntilFinalization

🚧

Only accessible by the Admin

This function is only available by the admin of the contract (the one deploying it for example), where products are created

/* Create Product */
let res = await stakingContract.createProduct({
  startDate : moment().add(1, 'minutes'),
  endDate : moment().add(10, 'minutes'),
  totalMaxAmount : 100,
  individualMinimumAmount : 10,
  APR : 5, // represents 5% yearly
  lockedUntilFinalization : false
});
/* Check if product was created */
let products = await stakingContract.getProducts();
console.log(products.length) // 1

πŸ“˜

lockedUntilFinalization

If lockedUntilFinalization == true means that investors who stake their tokens can only withdraw the principal + interest at the endDate, if equals false investors can withdraw at any time after the startDate