Skip to content

Commit

Permalink
Adds read method on fee recipent/treasury value.
Browse files Browse the repository at this point in the history
ckartik committed Jan 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 94313d4 commit 13d9f1c
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/BidderRegistry.sol
Original file line number Diff line number Diff line change
@@ -112,6 +112,13 @@ contract BidderRegistry is IBidderRegistry, Ownable, ReentrancyGuard {
return providerAmount[provider];
}

/**
* @dev Get the amount assigned to the fee recipient (treasury).
*/
function getFeeRecipientAmount() external onlyOwner view returns (uint256) {
return feeRecipientAmount;
}

/**
* @dev Internal function for bidder registration and staking.
*/
2 changes: 2 additions & 0 deletions test/BidderRegistryTest.sol
Original file line number Diff line number Diff line change
@@ -140,6 +140,7 @@ contract BidderRegistryTest is Test {

assertEq(providerAmount, 900000000000000000);
assertEq(feeRecipientAmount, 100000000000000000);
assertEq(bidderRegistry.getFeeRecipientAmount(), 100000000000000000);
assertEq(bidderRegistry.bidderPrepaidBalances(bidder), 1 ether);
}

@@ -198,6 +199,7 @@ contract BidderRegistryTest is Test {
uint256 balanceAfter = feeRecipient.balance;
assertEq(balanceAfter - balanceBefore, 100000000000000000);
assertEq(bidderRegistry.feeRecipientAmount(), 0);
assertEq(bidderRegistry.getFeeRecipientAmount(), 0);
}

function testFail_withdrawFeeRecipientAmount() public {

0 comments on commit 13d9f1c

Please sign in to comment.