flashbots / flashbots/flashtestations
Make `_cachedIsAllowedPolicy` `public` instead of `internal` so it can be re-used by third-party verifiers
- Dominant language
- Solidity
- Stars
- 4
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
# Purpose
In the event that a third party contract wants to piggyback off the policy verification logic that already exists in a policy, making `_cachedIsAllowedPolicy` public will mean the third party contract won't need to re-implement this code. This better follows DRY.
# Context
Unichain wanted to re-use the block builder TEE verification logic for its [flashblocks number contract, a contract that implements `block.number`, but for flashblocks](https://github.com/Uniswap/flashblocks_number_contract/pull/6). Because `_cachedIsAllowedPolicy` was `internal` we had to needlessly re-implement that function in the flashblock number contract.
# Security Considerations
This was originally made `internal` simply to keep the contract's API as simple as possible, not out of a concern for security. So it is fine to make it publicly callable by any actors on the blockchain.
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the repository for `_cachedIsAllowedPolicy` and inspect its declaration and existing callers. Confirm that changing its visibility enables third-party verifiers to reuse the policy verification logic without reimplementing it, while preserving the stated security behavior. Done means the function is publicly callable and the relevant verification behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100