Skip to content

Commit d3edf0c

Browse files
committed
Fix missing solvers param when deploying LivepeerVerifier. Fix possible divide by zero in setInflation
1 parent 386affc commit d3edf0c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

contracts/token/Minter.sol

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ contract Minter is Manager, IMinter {
126126
* @dev Set inflation based upon the current bonding rate
127127
*/
128128
function setInflation() internal {
129-
uint256 currentBondingRate = (bondingManager().getTotalBonded() * PERC_DIVISOR) / livepeerToken().totalSupply();
129+
uint256 currentBondingRate = 0;
130+
uint256 totalSupply = livepeerToken().totalSupply();
131+
132+
if (totalSupply > 0) {
133+
currentBondingRate = (bondingManager().getTotalBonded() * PERC_DIVISOR) / totalSupply;
134+
}
130135

131136
if (currentBondingRate < targetBondingRate) {
132137
// Bonding rate is below the target - increase inflation

migrations/3_deploy_contracts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = function(deployer, network) {
6161
if (network === "development" || network === "testrpc" || network === "parityDev" || network === "gethDev") {
6262
await deployAndRegister(deployer, controller, IdentityVerifier, "Verifier", controller.address)
6363
} else if (network === "lpTestNet") {
64-
await deployAndRegister(deployer, controller, LivepeerVerifier, "Verifier", controller.address, config.verifier.verificationCodeHash)
64+
await deployAndRegister(deployer, controller, LivepeerVerifier, "Verifier", controller.address, config.verifier.solvers, config.verifier.verificationCodeHash)
6565
} else {
6666
await deployAndRegister(deployer, controller, OraclizeVerifier, "Verifier", controller.address, config.verifier.verificationCodeHash, config.verifier.gasPrice, config.verifier.gasLimit)
6767
}

0 commit comments

Comments
 (0)