require((from == token1 && to == token2) || (from == token2 && to == token1), "Invalid tokens");

Screen Shot 2022-05-27 at 12.02.13.png

Ethernaut

Ethernaut Hacks Level 23: Dex Two