From 3699a44b039757c6f10d52d9d89a523ae9b64ba5 Mon Sep 17 00:00:00 2001 From: neooo <104398287+nz-neooo@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:03:37 +1200 Subject: [PATCH] Avoid allocate when amount is 0 (#418) --- contracts/StakingAllocation.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/StakingAllocation.sol b/contracts/StakingAllocation.sol index c37b7859..e0b914c0 100644 --- a/contracts/StakingAllocation.sol +++ b/contracts/StakingAllocation.sol @@ -127,7 +127,9 @@ contract StakingAllocation is IStakingAllocation, Initializable, OwnableUpgradea require(msg.sender == settings.getContractAddress(SQContracts.ProjectRegistry), 'SAL06'); uint256 amount = allocatedTokens[_runner][_deployment]; - _removeAllocation(_deployment, _runner, amount); + if (amount > 0) { + _removeAllocation(_deployment, _runner, amount); + } } function _removeAllocation(bytes32 _deployment, address _runner, uint256 _amount) private {