DeFi Saver
Search…
Bot Auth
This contract handles authority of who can call strategy executions on StrategyExecutor. The contract is registered in the DFSRegistry and isApproved function of the Bot Auth is called before each strategy execution.
In the current implementation, only DeFi Saver approved bots have access to calling strategy execution. While there are plans to allow other participants to run bots in the future, this is currently not allowed.
Besides checking the caller, BotAuth also has the subId as an input, allowing it to make decisions on who can execute based on the subscription or strategy.
Below is the interface of the contract:
1
contract BotAuth {
2
3
/// @notice Checks if the caller is approved for the specific subscription
4
/// @dev First param is subId but it's not used in this implementation
5
/// @dev Currently auth callers are approved for all strategies
6
/// @param _caller Address of the caller
7
function isApproved(uint256, address _caller) public view returns (bool) {
8
return approvedCallers[_caller];
9
}
10
11
/// @notice Adds a new bot address which will be able to call executeStrategy()
12
/// @param _caller Bot address
13
function addCaller(address _caller) public onlyOwner;
14
15
/// @notice Removes a bot address so it can't call executeStrategy()
16
/// @param _caller Bot address
17
function removeCaller(address _caller) public onlyOwner;
18
}
Copied!
Last modified 1d ago
Copy link