@bananapus/core-v6 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/foundry.toml CHANGED
@@ -2,7 +2,7 @@
2
2
  solc = '0.8.28'
3
3
  bytecode_hash = "none"
4
4
  evm_version = 'cancun'
5
- optimizer_runs = 150
5
+ optimizer_runs = 200
6
6
  libs = ["node_modules", "lib"]
7
7
  fs_permissions = [{ access = "read-write", path = "./"}]
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/core-v6",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -676,7 +676,7 @@ contract JBMultiTerminal is JBPermissioned, ERC2771Context, IJBMultiTerminal {
676
676
  returns (uint256 beneficiaryTokenCount)
677
677
  {
678
678
  // Get a reference to the beneficiary's balance before the payment.
679
- uint256 beneficiaryBalanceBefore = TOKENS.totalBalanceOf({holder: beneficiary, projectId: projectId});
679
+ uint256 beneficiaryBalanceBefore = _totalBalanceOf({holder: beneficiary, projectId: projectId});
680
680
 
681
681
  // Accept the funds.
682
682
  uint256 acceptedAmount =
@@ -694,7 +694,7 @@ contract JBMultiTerminal is JBPermissioned, ERC2771Context, IJBMultiTerminal {
694
694
  });
695
695
 
696
696
  // Get a reference to the beneficiary's balance after the payment.
697
- uint256 beneficiaryBalanceAfter = TOKENS.totalBalanceOf({holder: beneficiary, projectId: projectId});
697
+ uint256 beneficiaryBalanceAfter = _totalBalanceOf({holder: beneficiary, projectId: projectId});
698
698
 
699
699
  // Set the beneficiary token count.
700
700
  if (beneficiaryBalanceAfter > beneficiaryBalanceBefore) {
@@ -2324,6 +2324,14 @@ contract JBMultiTerminal is JBPermissioned, ERC2771Context, IJBMultiTerminal {
2324
2324
  JBTokenAmount({token: token, decimals: context.decimals, currency: context.currency, value: value});
2325
2325
  }
2326
2326
 
2327
+ /// @notice Returns a holder's total token balance for a project.
2328
+ /// @param holder The holder to get a balance for.
2329
+ /// @param projectId The ID of the project to get a balance for.
2330
+ /// @return balance The holder's total project token balance.
2331
+ function _totalBalanceOf(address holder, uint256 projectId) internal view returns (uint256 balance) {
2332
+ return TOKENS.totalBalanceOf({holder: holder, projectId: projectId});
2333
+ }
2334
+
2327
2335
  //*********************************************************************//
2328
2336
  // -------------------------- private helpers ------------------------ //
2329
2337
  //*********************************************************************//