From 1eb9e3349b33762d470d336775f84228ffdcd049 Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Wed, 2 Feb 2022 18:26:09 -0500 Subject: [PATCH] misc: Slight reorganization. --- contracts/core/FollowNFT.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/core/FollowNFT.sol b/contracts/core/FollowNFT.sol index 9bb2e52..dfe331a 100644 --- a/contracts/core/FollowNFT.sol +++ b/contracts/core/FollowNFT.sol @@ -231,8 +231,6 @@ contract FollowNFT is LensNFTBase, IFollowNFT { } if (to != address(0)) { - uint256 toSnapshotCount = _snapshotCount[to]; - // if from == address(0) ==> initial delegation (add amount to supply) if (from == address(0)) { // It is expected behavior that the `previousDelSupply` underflows upon the first delegation, returning the expected value of zero @@ -246,6 +244,7 @@ contract FollowNFT is LensNFTBase, IFollowNFT { } // It is expected behavior that `previous` underflows upon the first delegation to an address, returning the expected value of zero + uint256 toSnapshotCount = _snapshotCount[to]; uint128 previous = _snapshots[to][toSnapshotCount - 1].value; uint128 newValue = uint128(previous + amount); _writeSnapshot(to, newValue, toSnapshotCount);