-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: precision issue #493
fix: precision issue #493
Conversation
@@ -29,8 +29,8 @@ contract DeployTestnet is Script { | |||
address protocolFeeRecipient = address( | |||
0xfA0B0f5d298d28EFE4d35641724141ef19C05684 // Placeholder for now, L1 preconf.eth address | |||
); | |||
uint16 feePercent = 2; | |||
uint16 providerPenaltyPercent = 5; | |||
uint256 feePercent = 2 * 1e16; // 2% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number 1e16
repeats, consider creating a constant.
@@ -194,7 +194,7 @@ contract BidderRegistryTest is Test { | |||
|
|||
bidderRegistry.openBid(commitmentDigest, 1 ether, bidder, blockNumber); | |||
|
|||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider), 100); | |||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider), 1e18); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be the 1e18
replaced with PERCENT
constant?
@@ -269,7 +269,7 @@ contract BidderRegistryTest is Test { | |||
vm.expectRevert(bytes("")); | |||
bytes32 commitmentDigest = keccak256("1234"); | |||
bidderRegistry.openBid(commitmentDigest, 1 ether, bidder, blockNumber); | |||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider),100); | |||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider),1e18); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above.
@@ -287,7 +287,7 @@ contract BidderRegistryTest is Test { | |||
vm.prank(address(this)); | |||
bytes32 commitmentDigest = keccak256("1234"); | |||
bidderRegistry.openBid(commitmentDigest, 3 ether, bidder, blockNumber); | |||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider),100); | |||
bidderRegistry.retrieveFunds(nextWindow, commitmentDigest, payable(provider),1e18); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is here and also in several other places below.
7bc1f95
to
1dc0fed
Compare
1dc0fed
to
e7e2440
Compare
Describe your changes
Fixing precision issue
Issue ticket number and link
Fixes #492
Checklist before requesting a review