PCVEquityMinter and BalancerLBPSwapper - desynchronisation race
There is nothing that prevents other actors from calling `BalancerLBPSwapper.swap()` `afterTime` but right before `PCVEquityMinter.mint()` would as long as the `minAmount` required for the call to pass is deposited to `BalancerLBPSwapper`.\\nBoth the `PCVEquityMinter.mint()` and `BalancerLBPSwapper.swap()` are timed (via the `afterTime` modifier) and are ideally in sync. In an ideal world the incentive to call `mint()` would be enough to ensure that both contracts are always in sync, however, a malicious actor might interfere by calling `.swap()` directly, providing the `minAmount` required for the call to pass. This will have two effects:\\ninstead of taking the newly minted FEI from `PCVEquityMinter`, existing FEI from the malicious user will be used with the pool. (instead of inflating the token the malicious actor basically pays for it)\\nthe `Timed` modifiers of both contracts will be out of sync with `BalancerLBPSwapper.swap()` being reset (and failing until it becomes available again) and `PCVEquityMinter.mint()` still being available. Furthermore, keeper-scripts (or actors that want to get the incentive) might continue to attempt to `mint()` while the call will ultimately fail in `.swap()` due to the resynchronization of `timed` (unless they simulate the calls first).\\nNote: There are not a lot of incentives to actually exploit this other than preventing protocol inflation (mint) and potentially griefing users. A malicious user will lose out on the incentivized call and has to ensure that the `minAmount` required for `.swap()` to work is available. It is, however, in the best interest of security to defuse the unpredictable racy character of the contract interaction.\\n```\\nfunction \\_afterMint() internal override {\\n    IPCVSwapper(target).swap();\\n}\\n```\\n\\n```\\nfunction swap() external override afterTime whenNotPaused {\\n    (\\n        uint256 spentReserves,\\n        uint256 receivedReserves, \\n        uint256 lastChangeBlock\\n    ) = getReserves();\\n\\n    // Ensures no actor can change the pool contents earlier in the block\\n    require(lastChangeBlock < block.number, "BalancerLBPSwapper: pool changed this block");\\n```\\n
If `BalancerLBPSwapper.swap()` is only to be called within the flows of action from a `PCVEquityMinter.mint()` it is suggested to authenticate the call and only let `PCVEquityMinter` call `.swap()`
```\\nfunction \\_afterMint() internal override {\\n    IPCVSwapper(target).swap();\\n}\\n```\\n