diff --git a/packages/protocol/contracts/governance/Election.sol b/packages/protocol/contracts/governance/Election.sol index 0da0cdb44f7..ce80cbda845 100644 --- a/packages/protocol/contracts/governance/Election.sol +++ b/packages/protocol/contracts/governance/Election.sol @@ -1052,6 +1052,6 @@ contract Election is } } require(info.remainingValue == 0, "Failure to decrement all votes."); - return value.sub(info.remainingValue); + return value; } } diff --git a/packages/protocol/contracts/governance/ReleaseGold.sol b/packages/protocol/contracts/governance/ReleaseGold.sol index 8d8b5bafb82..909b8501677 100644 --- a/packages/protocol/contracts/governance/ReleaseGold.sol +++ b/packages/protocol/contracts/governance/ReleaseGold.sol @@ -426,15 +426,16 @@ contract ReleaseGold is UsingRegistry, ReentrancyGuard, IReleaseGold, Initializa /** * @notice Calculates remaining locked gold balance in the release schedule instance. * The returned amount also includes pending withdrawals to maintain consistent releases. + * Return 0 if address of caller is not an account. * @return The remaining locked gold of the release schedule instance. * @dev The returned amount may vary over time due to locked gold rewards. */ function getRemainingLockedBalance() public view returns (uint256) { - uint256 pendingWithdrawalSum = 0; if (getAccounts().isAccount(address(this))) { - pendingWithdrawalSum = getLockedGold().getTotalPendingWithdrawals(address(this)); + uint256 pendingWithdrawalSum = getLockedGold().getTotalPendingWithdrawals(address(this)); + return getLockedGold().getAccountTotalLockedGold(address(this)).add(pendingWithdrawalSum); } - return getLockedGold().getAccountTotalLockedGold(address(this)).add(pendingWithdrawalSum); + return 0; } /**