This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
309 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
import {Script, stdJson} from "forge-std/Script.sol"; | ||
|
||
import {DeployUtils} from "script/DeployUtils.sol"; | ||
|
||
import {LlamaAccountMulticallExtension} from "src/account-multicall/LlamaAccountMulticallExtension.sol"; | ||
import {LlamaAccountMulticallGuard} from "src/account-multicall/LlamaAccountMulticallGuard.sol"; | ||
import {LlamaAccountMulticallStorage} from "src/account-multicall/LlamaAccountMulticallStorage.sol"; | ||
|
||
contract DeployLlamaAccountMulticall is Script { | ||
using stdJson for string; | ||
|
||
struct TargetSelectorAuthorizationInputs { | ||
// Attributes need to be in alphabetical order so JSON decodes properly. | ||
string comment; | ||
bytes selector; | ||
address target; | ||
} | ||
|
||
// Account multicall contracts. | ||
LlamaAccountMulticallStorage accountMulticallStorage; | ||
LlamaAccountMulticallExtension accountMulticallExtension; | ||
LlamaAccountMulticallGuard accountMulticallGuard; | ||
|
||
function run(string memory configFile) public { | ||
string memory jsonInput = DeployUtils.readScriptInput(configFile); | ||
|
||
address llamaExecutor = jsonInput.readAddress(".llamaExecutor"); | ||
LlamaAccountMulticallStorage.TargetSelectorAuthorization[] memory data = readTargetSelectorAuthorizations(jsonInput); | ||
|
||
DeployUtils.print(string.concat("Deploying Llama rewards claimer contracts to chain:", vm.toString(block.chainid))); | ||
|
||
vm.broadcast(); | ||
accountMulticallStorage = new LlamaAccountMulticallStorage(llamaExecutor, data); | ||
DeployUtils.print(string.concat(" LlamaAccountMulticallStorage: ", vm.toString(address(accountMulticallStorage)))); | ||
|
||
vm.broadcast(); | ||
accountMulticallExtension = new LlamaAccountMulticallExtension(accountMulticallStorage); | ||
DeployUtils.print( | ||
string.concat(" LlamaAccountMulticallExtension: ", vm.toString(address(accountMulticallExtension))) | ||
); | ||
|
||
vm.broadcast(); | ||
accountMulticallGuard = new LlamaAccountMulticallGuard(accountMulticallExtension); | ||
DeployUtils.print(string.concat(" LlamaAccountMulticallGuard: ", vm.toString(address(accountMulticallGuard)))); | ||
} | ||
|
||
function readTargetSelectorAuthorizations(string memory jsonInput) | ||
internal | ||
pure | ||
returns (LlamaAccountMulticallStorage.TargetSelectorAuthorization[] memory) | ||
{ | ||
bytes memory data = jsonInput.parseRaw(".initialTargetSelectorAuthorizations"); | ||
|
||
TargetSelectorAuthorizationInputs[] memory rawConfigs = abi.decode(data, (TargetSelectorAuthorizationInputs[])); | ||
|
||
LlamaAccountMulticallStorage.TargetSelectorAuthorization[] memory configs = | ||
new LlamaAccountMulticallStorage.TargetSelectorAuthorization[](rawConfigs.length); | ||
|
||
for (uint256 i = 0; i < rawConfigs.length; i++) { | ||
configs[i].target = rawConfigs[i].target; | ||
configs[i].selector = bytes4(rawConfigs[i].selector); | ||
configs[i].isAuthorized = true; | ||
} | ||
|
||
return configs; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
script/input/1/mockRewardsClaimerConfig.json → ...t/input/1/mockAccountMulticallConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../input/11155111/rewardsClaimerConfig.json → ...nput/11155111/accountMulticallConfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.