Submitted by bardamu
https://github.com/code-423n4/2022-07-swivel/blob/fbf94f87994d91dce75c605a1822ec6d6d7e9e74/Marketplace/Compounding.sol#L55-L56
https://github.com/code-423n4/2022-07-swivel/blob/fbf94f87994d91dce75c605a1822ec6d6d7e9e74/Marketplace/MarketPlace.sol#L64-L73
Yearn integration is broken, making it impossible to create a MarketPlace associated with a Yearn vault.
Compounding.sol attempts to resolve the underlying token implemented by supported protocols:
https://github.com/code-423n4/2022-07-swivel/blob/fbf94f87994d91dce75c605a1822ec6d6d7e9e74/Marketplace/Compounding.sol#L50-L64
As can be seen in the excerpt above, the contract will attempt to access IYearnVault(c).underlying(); when integrating with a Yearn vault. Problem is this property is not present in Yearn vaults. Therefore this operation will always revert.
In particular, this would not allow to create a MarketPlace associated with a Yearn vault even though the protocol is stated as supported.
https://github.com/code-423n4/2022-07-swivel/blob/fbf94f87994d91dce75c605a1822ec6d6d7e9e74/Marketplace/MarketPlace.sol#L64-L73
Correct underlying token address in Yearn vaults is stored in the token property.
https://github.com/yearn/yearn-vaults/blob/beff27908bb2ae017ed73b773181b9b93f7435ad/contracts/Vault.vy#L74
VIM
Access the underlying token of a Yearn vault through the token property instead of the non-existent underlying which will cause a revert and the inability to create marketplaces associated with the protocol.
JTraversa (Swivel) disagreed with severity and commented:
bghughes (judge) decreaased severity to Medium and commented:
robrobbins (Swivel) commented:
robrobbins (Swivel) resolved:
