dOrgTech / OpenRaise

Bonding Curves For DAOs
MIT License
76 stars 26 forks source link

Guidance needed: BancorFormula requirement & initial token minting #61

Open BenSchZA opened 4 years ago

BenSchZA commented 4 years ago

Hi team :) I need some guidance with the tests.

In the calculatePurchaseReturn method of the BancorFormula contract there is the following requirement set:

require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT);

In setting up the migrations for the project I'm working on, the total supply of the bonded token is initially zero, which causes the call to priceToBuy etc. to fail.

I know this isn't the case in the tests for BC-DAO, as they mostly pass, but I can't figure out exactly where the testing ecosystem setup mints the initial tokens for the bonded token to avoid the above issue. I see the following line for the payment token though, in the BondingCurve.behaviour.js file:

const paymentTokenInitialBalance = new BN(web3.utils.toWei('60000', 'ether'));

    await paymentToken.methods
      .mint(tokenMinter, paymentTokenInitialBalance.toString())
      .send({from: tokenMinter});

In production deployment, would one just mint a probably insignificant number of tokens to the creator or perform some sort of hatch phase, and if so would that need to be done manually by minting or are there plans to have a contract method for this?