From 2b42f5f51146c51cb68d486fd8bad5ea44161ccb Mon Sep 17 00:00:00 2001 From: echo Date: Fri, 29 Nov 2024 17:22:37 +0800 Subject: [PATCH 1/2] skip 0 value deposit --- src/deposit/Deposit.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/deposit/Deposit.sol b/src/deposit/Deposit.sol index 1a5146c..b14c962 100644 --- a/src/deposit/Deposit.sol +++ b/src/deposit/Deposit.sol @@ -122,7 +122,9 @@ contract Deposit is uint256[] memory ids = new uint256[](len); for (uint256 i = 0; i < len; i++) { PalletInfo memory info = deposits[i]; - require(info.value > 0, "!value"); + if (info.value == 0) { + continue; + } uint64 months = (info.expiredAt - info.startAt) / uint64(MONTH); require(months <= 36 && months >= 1, "!months"); require(info.startAt <= block.timestamp, "!startAt"); From 8719ecbad3f6bec3f24aa1db8a77131d2b769ec3 Mon Sep 17 00:00:00 2001 From: echo Date: Fri, 29 Nov 2024 17:24:13 +0800 Subject: [PATCH 2/2] migrate script --- script/Migrate.s.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/Migrate.s.sol b/script/Migrate.s.sol index 3354ede..9a6d4eb 100644 --- a/script/Migrate.s.sol +++ b/script/Migrate.s.sol @@ -7,14 +7,15 @@ import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; import {Core} from "openzeppelin-foundry-upgrades/internal/Core.sol"; import {CollatorStakingHub} from "../src/collator/CollatorStakingHub.sol"; +import {Deposit} from "../src/deposit/Deposit.sol"; contract MigrateScript is Script { - address proxy = 0xa4fFAC7A5Da311D724eD47393848f694Baee7930; + address proxy = 0x46275d29113f065c2aac262f34C7a3d8a8B7377D; function run() public { vm.startBroadcast(); - address logic = address(new CollatorStakingHub()); + address logic = address(new Deposit()); Core.upgradeProxyTo(proxy, logic, ""); require(logic == Upgrades.getImplementationAddress(proxy)); safeconsole.log("logic: ", logic);