FloorDAO / floor-v2

Floor aims to create a fully onchain governance mechanism for sweeping and deploying NFTs to profitable NFT-Fi strategies as well as seeding liquidity for its own NFT-Fi products.
https://floor.xyz
2 stars 0 forks source link

Manual Sweeper Burns ETH #33

Closed aleph-v closed 1 year ago

aleph-v commented 1 year ago

The manual sweeper is called by the treasury contract with an amount of eth which is set by the sweep execution trigger. The manual sweeper function contains no way to retrieve this eth and so if it is called the ETH is burned.

tomwade commented 1 year ago

The Manual Sweeper shouldn't receive ETH as part of the process as it should just allow a tx code to be passed in. This sweeper would assume that the sweeping would be done externally and this would just provide reference to the external sweep. For example, if we were to sweep OTC, then we may just link to the tx.

My understanding was that by excluding the receive function from the contract, it would revert if ETH was attempted to be sent. I will create a test suite to check this and will also make this more explicitly clear in the description of the contract.

tomwade commented 1 year ago

My understanding was incorrect and confirmed through test suite, as you'd said, that ETH could be sent. I've added this check to prevent it and written tests around the logic.

tomwade commented 1 year ago

A PR for this issue has been added here: https://github.com/FloorDAO/floor-v2/pull/37