Skip to content

Commit

Permalink
Fix missing solvers param when deploying LivepeerVerifier. Fix possib…
Browse files Browse the repository at this point in the history
…le divide by zero in setInflation
  • Loading branch information
yondonfu committed Dec 13, 2017
1 parent 386affc commit d3edf0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion contracts/token/Minter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ contract Minter is Manager, IMinter {
* @dev Set inflation based upon the current bonding rate
*/
function setInflation() internal {
uint256 currentBondingRate = (bondingManager().getTotalBonded() * PERC_DIVISOR) / livepeerToken().totalSupply();
uint256 currentBondingRate = 0;
uint256 totalSupply = livepeerToken().totalSupply();

if (totalSupply > 0) {
currentBondingRate = (bondingManager().getTotalBonded() * PERC_DIVISOR) / totalSupply;
}

if (currentBondingRate < targetBondingRate) {
// Bonding rate is below the target - increase inflation
Expand Down
2 changes: 1 addition & 1 deletion migrations/3_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function(deployer, network) {
if (network === "development" || network === "testrpc" || network === "parityDev" || network === "gethDev") {
await deployAndRegister(deployer, controller, IdentityVerifier, "Verifier", controller.address)
} else if (network === "lpTestNet") {
await deployAndRegister(deployer, controller, LivepeerVerifier, "Verifier", controller.address, config.verifier.verificationCodeHash)
await deployAndRegister(deployer, controller, LivepeerVerifier, "Verifier", controller.address, config.verifier.solvers, config.verifier.verificationCodeHash)
} else {
await deployAndRegister(deployer, controller, OraclizeVerifier, "Verifier", controller.address, config.verifier.verificationCodeHash, config.verifier.gasPrice, config.verifier.gasLimit)
}
Expand Down

0 comments on commit d3edf0c

Please sign in to comment.