Submitted by franfran20, also found by 0xLasadie, BenRai, BenRai, EPSec, and franfran20
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingManager.sol#L204
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingManager.sol#L121
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingManager.sol#L149
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_VestingManager.sol#L161
When interacting with the MarketPlace contract and vesting listings, the MarketPlace contract calls the VestingManager contract (using the address gotten from the MarketplaceSetting contract) which calls the StepVesting contract itself to transfer vestings from one address to another.
The VestingManager contract contains the setMarketplace function which is in place in case the MarketPlace contract needs to be changed and redeployed instead of an upgrade (upgrades to the MarketPlace contract occur through the proxy admin, so this function is to change the proxy entirely). When a new MarketPlace contract is set, all previous listings in the marketplace remain stuck, unlistable or inaccessible by the user who listed them, leading to loss of vested assets, simply because the VestingManager is no longer connected to that instance of the marketplace.
Lets take a user who has a total amount of 1000 Token F vested. The user decides to list 200 of these tokens on the marketplace. After this period that the listing is active, the VestingManager contract updates the MarketPlace contract(not an upgrade, a complete change of the proxy).
The function that changes the marketplace address in the VestingManager
The issue lies in the fact that the VestingManager no longer points to the previous marketplace were the listing was made. So those listings that existed in the former marketplace can no longer be unlisted or purchased by another user. Simply because the functions listVesting and unlistVesting in the MarketPlace contract rely on calling the VestingManager contract, which no longer recognizes the old marketplace, only the new one.
There is a freeze function that should supposedly stop all actions on the marketplace to give enough time for users to unlist their listed vestings but when the marketplace is frozen, unlisting and purchasing listings are also frozen. See below:
So when the old marketplace with users listings tries to call the VestingManager contract, it reverts simply because the marketplace recognized in the Vesting manager is not the same as the Old marketplace that contained all previous listings.
This leads to the vestings that were in the previous MarketPlace becoming inaccessible, unlistable or unpurchaseable.
Major impact would be that all the vestings that were listed in the old marketplace would no longer be accessible because the vesting manager is pointing to a new marketplace contract, leading to loss of vestings listed before the change happened due to them being inaccessible via unlisting or purchasing.
Provide a way to allow after a change in the marketplace contract, the user to be able to remove their vested listings and transfer it back to their address from the previous marketplace.
TechticalRAM (SecondSwap) acknowledged
