@ballkidz/defifa 0.0.39 → 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 +2 -2
- package/src/DefifaDeployer.sol +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ballkidz/defifa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "25.9.0"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@bananapus/721-hook-v6": "^0.0.54",
|
|
35
35
|
"@bananapus/address-registry-v6": "^0.0.26",
|
|
36
|
-
"@bananapus/core-v6": "^0.0.
|
|
36
|
+
"@bananapus/core-v6": "^0.0.59",
|
|
37
37
|
"@bananapus/permission-ids-v6": "^0.0.26",
|
|
38
38
|
"@openzeppelin/contracts": "5.6.1",
|
|
39
39
|
"@prb/math": "4.1.1",
|
package/src/DefifaDeployer.sol
CHANGED
|
@@ -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,
|
|
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
|