Skip to content

Commit

Permalink
Merge branch 'develop' into add_distribute_event
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhe8x authored Nov 1, 2024
2 parents 5cf7977 + 1cf89b1 commit 307003e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
6 changes: 2 additions & 4 deletions contracts/RewardsBooster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,7 @@ contract RewardsBooster is Initializable, OwnableUpgradeable, IRewardsBooster, S
address(this),
_amount
);
// Allowance
IERC20(settings.getContractAddress(SQContracts.SQToken)).approve(msg.sender, _amount);
sqToken.safeTransfer(msg.sender, _amount);

emit QueryRewardsSpent(_deploymentId, _spender, _amount, _data);
}
Expand Down Expand Up @@ -1393,8 +1392,7 @@ contract RewardsBooster is Initializable, OwnableUpgradeable, IRewardsBooster, S
address(this),
_amount
);
// Allowance
IERC20(settings.getContractAddress(SQContracts.SQToken)).approve(msg.sender, _amount);
sqToken.safeTransfer(msg.sender, _amount);

emit QueryRewardsSpent(_deploymentId, _spender, _amount, _data);
}
Expand Down
14 changes: 0 additions & 14 deletions contracts/StateChannel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,6 @@ contract StateChannel is Initializable, OwnableUpgradeable, SQParameter {
amount,
abi.encode(channelId)
);
if (rewardsAmount > 0) {
IERC20(settings.getContractAddress(SQContracts.SQToken)).safeTransferFrom(
rbAddress,
address(this),
rewardsAmount
);
}

if (rewardsAmount < amount) {
// transfer the balance to contract
Expand Down Expand Up @@ -592,13 +585,6 @@ contract StateChannel is Initializable, OwnableUpgradeable, SQParameter {
spent - rewardsTotal,
abi.encode(channelId)
);
if (rewardsAmount > 0) {
IERC20(settings.getContractAddress(SQContracts.SQToken)).safeTransferFrom(
rbAddress,
address(this),
rewardsAmount
);
}
total += rewardsAmount;
}

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/contract-sdk",
"version": "1.4.1-0",
"version": "1.5.0",
"main": "index.js",
"license": "GPL3",
"scripts": {
Expand All @@ -23,6 +23,8 @@
"deploy": "ts-node --transpileOnly scripts/deploy.ts",
"upgrade": "ts-node --transpileOnly scripts/upgrade.ts",
"setup": "ts-node --transpileOnly scripts/startup.ts",
"scan-verify:testnet": "hardhat publishChild --deployment publish/testnet.json --network base-sepolia --networkpair testnet ",
"scan-verify:mainnet": "hardhat publishChild --deployment publish/mainnet.json --network base --networkpair mainnet ",
"verify": "ts-node --transpileOnly scripts/verify.ts",
"upgrade:verify": "ts-node --transpileOnly scripts/verifyUpgrade.ts",
"seed": "node -r ts-node/register/transpile-only -r dotenv/config scripts/seed.ts",
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": "0x6DA2eA5591d39d94Cc2Aae17e619d041D3315c6c",
"innerAddress": "0xF265b1B3526FE55138a86dc299e559e76960020f",
"address": "0x7F138D57A5e05b6FBF3bCAdDa9a1252354245464",
"bytecodeHash": "cf14fe59440af7049bdb6a7520836f02d6a4a3d643850d2260b31234ce211bce",
"lastUpdate": "Thu, 19 Sep 2024 05:25:48 GMT"
"bytecodeHash": "10ded472cbfa2afbcfd1ac3a8b44414e12339fdd8018fcfd4c47a5b338e08af9",
"lastUpdate": "Mon, 14 Oct 2024 21:42:35 GMT"
},
"StakingAllocation": {
"innerAddress": "0x5Fa0105aa31e05d2f639Fe79DB20700AEC2B859C",
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": "0x113F10C5fe8C66e7F51Df6A2Dfd1d26d283d7bC4",
"innerAddress": "0x438bD56449Cd044F65C607EbdbB9a4Ede0c936b7",
"address": "0x4f6A1045A56EeD1D2795b5f6F6713972B67C09C2",
"bytecodeHash": "cf14fe59440af7049bdb6a7520836f02d6a4a3d643850d2260b31234ce211bce",
"lastUpdate": "Wed, 11 Sep 2024 11:31:48 GMT"
"bytecodeHash": "10ded472cbfa2afbcfd1ac3a8b44414e12339fdd8018fcfd4c47a5b338e08af9",
"lastUpdate": "Tue, 08 Oct 2024 23:50:39 GMT"
},
"StakingAllocation": {
"innerAddress": "0xfbeB402CADFCDB28407E86f5F20Ee719f5F6F430",
Expand Down

0 comments on commit 307003e

Please sign in to comment.