Whenever a new offer is created, after calling createOffer, a call to tillIn is made, which handles the transfer of tokens to the CapitalPool. It should support ERC20 token and native token transfers, however, it can only handle ERC20/Wrapped token transfers.
The function createOffer in PreMarkets.sol is used by a Maker in order to create an offer to buy/sell points. With the creation of the offer, they must also provide collateral in order to back the points from the offer. Their tokens get transferred from the msg.sender to the CapitalPool using the function tillIn.
An issue arises within the implementation of tillIn, as it's intended for it to support ERC20 token and native token, however, the only thing that supports Native tokens is that the function is currently payable. Although it can receive native tokens, it can't transfer them to the CapitalPool.
This can be tested by pasting the simple test from below into Premarkets.t.sol
To further prove my point, you can replace the else statement in the tillIn function with the following:
Make sure to import the console in TokenManager using: import "forge-std/console2.sol";
After which you can, delete the vm.expectRevert line from the test and run it. The test will pass successfully again, but this time the Native Ether was actually sent to the CapitalPool
createOffer's functionality is broken for native token transfers.
Manual Review
Consider refactoring the way tillIn handles token transfers, by including a case where the native tokens are actually transferred to the CapitalPool.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.