Safety Considerations
Not getting REKT 101
Searchers must ensure the following security measures are in place to safeguard their contract interactions:
1. Restrict Unauthorized Access:
Ensure that only trusted contracts, such as the designated Atlas contract, can execute sensitive functions. Unauthorized access checks help prevent exploitation from untrusted or malicious actors attempting to interact with critical contract features.
if (msg.sender != _atlas) revert InvalidEntry();
2. Verify Caller Identity:
Always confirm the caller’s origin to restrict sensitive actions to authorized accounts only. By implementing identity checks, searchers protect their contracts from external interference by unauthorized sources.
if (solverOpFrom != _owner) revert InvalidCaller()
3. Implement Solver call to be private
Ensure that the function performing the backrun is not accessible externally. Implement whitelisting to limit access, as demonstrated in our example.
Regardless of whether the searcher uses a direct or proxy implementation, explicit access and security checks must be applied.
Verify that the solverOpFrom
address supplied as the first argument in atlasSolverCall
is properly permissioned.
Please see the next two sections for examples of these checks.
Last updated