@ballkidz/defifa 0.0.38 → 0.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ballkidz/defifa",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "25.9.0"
@@ -31,10 +31,10 @@
31
31
  "remappings.txt"
32
32
  ],
33
33
  "dependencies": {
34
- "@bananapus/721-hook-v6": "^0.0.52",
34
+ "@bananapus/721-hook-v6": "^0.0.54",
35
35
  "@bananapus/address-registry-v6": "^0.0.26",
36
- "@bananapus/core-v6": "^0.0.55",
37
- "@bananapus/permission-ids-v6": "^0.0.25",
36
+ "@bananapus/core-v6": "^0.0.59",
37
+ "@bananapus/permission-ids-v6": "^0.0.26",
38
38
  "@openzeppelin/contracts": "5.6.1",
39
39
  "@prb/math": "4.1.1",
40
40
  "scripty.sol": "2.1.1"
@@ -348,8 +348,22 @@ contract DefifaDeployer is IDefifaDeployer, IDefifaGamePhaseReporter, IDefifaGam
348
348
  // Use the ruleset's baseCurrency — this matches the currency under which payout limits were stored
349
349
  // at launch time, regardless of whether the token is native ETH or an ERC-20.
350
350
  // Wrapped in try-catch so the final ruleset is always queued even if payout fails.
351
+ // Credit `DEFIFA_PROJECT_ID` as the referrer so the protocol fee volume from every game's commitment
352
+ // payout attributes back to the Defifa project itself — Defifa is the project that facilitated the
353
+ // fee-paying activity, regardless of which `gameId` triggered it.
354
+ //
355
+ // The referrer reference is encoded as `(referralChainId << 48) | referralProjectId` per `JBMultiTerminal`'s
356
+ // `currentReferralProjectId` packing. Defifa lives on Ethereum mainnet, so we hard-code `referralChainId = 1`
357
+ // here: this ensures the protocol fee volume credit accrues to Defifa on mainnet regardless of which chain
358
+ // the game runs on. (Auto-resolving to `block.chainid` would scatter credit across L2s where Defifa has no
359
+ // canonical project ID, so we pin mainnet explicitly.)
351
360
  try terminal.sendPayoutsOf({
352
- projectId: gameId, token: token, amount: feeAmount, currency: metadata.baseCurrency, minTokensPaidOut: 0
361
+ projectId: gameId,
362
+ token: token,
363
+ amount: feeAmount,
364
+ currency: metadata.baseCurrency,
365
+ minTokensPaidOut: 0,
366
+ referralProjectId: (uint256(1) << 48) | DEFIFA_PROJECT_ID
353
367
  }) {}
354
368
  catch (bytes memory reason) {
355
369
  // Payout failed — fee stays in pot. Reset to 0 so currentGamePotOf
@@ -5,17 +5,17 @@ import {ITypeface, Font} from "lib/typeface/contracts/interfaces/ITypeface.sol";
5
5
 
6
6
  /// @notice Helpers for loading on-chain Capsules typeface font sources used in Defifa SVG rendering.
7
7
  library DefifaFontImporter {
8
- /// @notice Gets the Base64 encoded Capsules-500.otf typeface.
8
+ /// @notice Gets the Base64 encoded Capsules-700.otf typeface.
9
9
  /// @param typeface The typeface contract to query.
10
10
  /// @return The Base64 encoded font file.
11
- function getSkinnyFontSource(ITypeface typeface) internal view returns (bytes memory) {
12
- return typeface.sourceOf(Font({weight: 500, style: "normal"})); // Capsules font source
11
+ function getBeefyFontSource(ITypeface typeface) internal view returns (bytes memory) {
12
+ return typeface.sourceOf(Font({weight: 700, style: "normal"})); // Capsules font source
13
13
  }
14
14
 
15
- /// @notice Gets the Base64 encoded Capsules-700.otf typeface.
15
+ /// @notice Gets the Base64 encoded Capsules-500.otf typeface.
16
16
  /// @param typeface The typeface contract to query.
17
17
  /// @return The Base64 encoded font file.
18
- function getBeefyFontSource(ITypeface typeface) internal view returns (bytes memory) {
19
- return typeface.sourceOf(Font({weight: 700, style: "normal"})); // Capsules font source
18
+ function getSkinnyFontSource(ITypeface typeface) internal view returns (bytes memory) {
19
+ return typeface.sourceOf(Font({weight: 500, style: "normal"})); // Capsules font source
20
20
  }
21
21
  }