Skip to content
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 accQueryRewardsPerBooster when it is zero #412

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contracts/RewardsBooster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,13 @@ contract RewardsBooster is Initializable, OwnableUpgradeable, IRewardsBooster, S

emit QueryRewardsRefunded(_deploymentId, _spender, _amount, _data);
}

function refreshAccRewardsPerBooster(bytes32 _deploymentId, address _account) external {
DeploymentPool storage deployment = deploymentPools[_deploymentId];
BoosterQueryReward memory boosterQueryRewards = deployment.boosterQueryRewards[_account];
if (deployment.accQueryRewardsPerBooster == 0) {
deployment.accQueryRewardsPerBooster = boosterQueryRewards
.accQueryRewardsPerBoosterSnapshot;
}
}
}
18 changes: 18 additions & 0 deletions publish/ABI/RewardsBooster.json
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,24 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_deploymentId",
"type": "bytes32"
},
{
"internalType": "address",
"name": "_account",
"type": "address"
}
],
"name": "refreshAccRewardsPerBooster",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
6 changes: 3 additions & 3 deletions publish/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@
"lastUpdate": "Tue, 21 May 2024 22:09:56 GMT"
},
"RewardsBooster": {
"innerAddress": "0x2958EBcfAd30a1E7A965a185B29A2885E0a33583",
"innerAddress": "0xF2553F861e70821D4Ee4aC4aD6Eb345c177f0F35",
"address": "0x7F138D57A5e05b6FBF3bCAdDa9a1252354245464",
"bytecodeHash": "96934570da9e4be1704b1b77df95dac61def599e53102bdc4129926e1556b6ad",
"lastUpdate": "Wed, 29 May 2024 01:55:49 GMT"
"bytecodeHash": "2cb2b1b307ff5aee1791c0b0f872b1b3df8cb713b90d441e400bcf1b351e8b29",
"lastUpdate": "Wed, 29 May 2024 23:28:58 GMT"
},
"StakingAllocation": {
"innerAddress": "0xFD80c162B2b3D958EB16588582A93C6731b57874",
Expand Down
6 changes: 3 additions & 3 deletions publish/testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@
"lastUpdate": "Tue, 21 May 2024 22:04:33 GMT"
},
"RewardsBooster": {
"innerAddress": "0x50dCFa4D100EB8E35a40857B7B7F0E64BE319b82",
"innerAddress": "0xc4336cb8Fb14953daBA35b1e13f2Df84b48e72C4",
"address": "0x4f6A1045A56EeD1D2795b5f6F6713972B67C09C2",
"bytecodeHash": "96934570da9e4be1704b1b77df95dac61def599e53102bdc4129926e1556b6ad",
"lastUpdate": "Wed, 29 May 2024 00:59:17 GMT"
"bytecodeHash": "2cb2b1b307ff5aee1791c0b0f872b1b3df8cb713b90d441e400bcf1b351e8b29",
"lastUpdate": "Wed, 29 May 2024 23:27:54 GMT"
},
"StakingAllocation": {
"innerAddress": "0x6d987b33a149e44098A9096C57e74068882Ef6D6",
Expand Down
Loading