bosonprotocol / boson-protocol-contracts

Boson Protocol V2 (latest)
https://bosonprotocol.io/
GNU General Public License v3.0
32 stars 8 forks source link

Remove redundant check on createTwinInternal #596

Closed anajuliabit closed 1 year ago

anajuliabit commented 1 year ago

The code block at https://github.com/bosonprotocol/boson-protocol-contracts/blob/100b9b05599f12a77b93f9e7986c207df93e4ab9/contracts/protocol/bases/TwinBase.sol#L79-L93 is redundant and should be removed.

The check for overlapping twins is already performed on lines https://github.com/bosonprotocol/boson-protocol-contracts/blob/100b9b05599f12a77b93f9e7986c207df93e4ab9/contracts/protocol/bases/TwinBase.sol#L100-L106, so it is not necessary to perform it on lines 79-93.

The lookup twinIdsByTokenAddressAndBySeller should be deprecated, as it is only used for this code block.

mischat commented 1 year ago

@anajuliabit, in your description above, you say that the lines

Lines 79 to 93 in 100b9b0

could be removed, as the check happens on (the same) lines :

Lines 79 to 93 in 100b9b0.

Could you please link to where the check is already happenings for me, as it will make it easier for me to review the resultant PR, thanks?

anajuliabit commented 1 year ago

@mischat sorry, description updated

mischat commented 1 year ago

thanks, this will make it easier for me to review! 👍