@@ -17,10 +17,46 @@ task("upgrade-spokepool", "Generate calldata to upgrade a SpokePool deployment")
17
17
}
18
18
19
19
// @dev Any spoke pool's interface can be used here since they all should have the same upgradeTo function signature.
20
- const abi = [ "function upgradeTo(address newImplementation) external" ] ;
20
+ const abi = [
21
+ {
22
+ inputs : [
23
+ {
24
+ internalType : "address" ,
25
+ name : "newImplementation" ,
26
+ type : "address" ,
27
+ } ,
28
+ { internalType : "bytes" , name : "data" , type : "bytes" } ,
29
+ ] ,
30
+ name : "upgradeToAndCall" ,
31
+ outputs : [ ] ,
32
+ stateMutability : "payable" ,
33
+ type : "function" ,
34
+ } ,
35
+ {
36
+ inputs : [ { internalType : "bytes[]" , name : "data" , type : "bytes[]" } ] ,
37
+ name : "multicall" ,
38
+ outputs : [ { internalType : "bytes[]" , name : "results" , type : "bytes[]" } ] ,
39
+ stateMutability : "nonpayable" ,
40
+ type : "function" ,
41
+ } ,
42
+ {
43
+ inputs : [ { internalType : "bool" , name : "pause" , type : "bool" } ] ,
44
+ name : "pauseDeposits" ,
45
+ outputs : [ ] ,
46
+ stateMutability : "nonpayable" ,
47
+ type : "function" ,
48
+ } ,
49
+ ] ;
21
50
const spokePool = new ethers . Contract ( implementation , abi ) ;
22
51
23
- const upgradeTo = spokePool . interface . encodeFunctionData ( "upgradeTo" , [ implementation ] ) ;
52
+ const data = spokePool . interface . encodeFunctionData ( "multicall" , [
53
+ [
54
+ spokePool . interface . encodeFunctionData ( "pauseDeposits" , [ true ] ) ,
55
+ spokePool . interface . encodeFunctionData ( "pauseDeposits" , [ false ] ) ,
56
+ ] ,
57
+ ] ) ;
58
+
59
+ const upgradeTo = spokePool . interface . encodeFunctionData ( "upgradeToAndCall" , [ implementation , data ] ) ;
24
60
console . log ( `upgradeTo bytes: ` , upgradeTo ) ;
25
61
26
62
console . log (
0 commit comments