Skip to content

Commit

Permalink
refactor(protocol): fix solidity lint issues (#13185)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Feb 18, 2023
1 parent 5ef2c0f commit 667a5d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ contract TaikoL1 is
}

function getBlockFee() public view returns (uint256) {
(, uint fee, uint deposit) = LibProposing.getBlockFee(
(, uint256 fee, uint256 deposit) = LibProposing.getBlockFee(
state,
getConfig()
);
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ library LibProposing {
TaikoData.State storage state,
uint256 commitConfirmations,
TaikoData.BlockMetadata memory meta
) private {
) private view {
if (commitConfirmations == 0) {
return;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/protocol/contracts/L1/libs/LibVerifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ library LibVerifying {
uint256 tRelBp,
TkoToken tkoToken
) private {
uint refund = (target.deposit * (10000 - tRelBp)) / 10000;
uint256 refund = (target.deposit * (10000 - tRelBp)) / 10000;
if (refund > 0 && tkoToken.balanceOf(target.proposer) > 0) {
// Do not refund proposer with 0 TKO balance.
tkoToken.mint(target.proposer, refund);
Expand All @@ -166,18 +166,18 @@ library LibVerifying {
uint256 reward,
TkoToken tkoToken
) private {
uint start;
uint count = fc.provers.length;
uint256 start;
uint256 count = fc.provers.length;

if (config.enableOracleProver) {
start = 1;
count -= 1;
}

uint sum = (1 << count) - 1;
uint weight = 1 << (count - 1);
uint256 sum = (1 << count) - 1;
uint256 weight = 1 << (count - 1);
for (uint i = 0; i < count; ++i) {
uint proverReward = (reward * weight) / sum;
uint256 proverReward = (reward * weight) / sum;
if (proverReward == 0) {
break;
}
Expand Down

0 comments on commit 667a5d9

Please sign in to comment.