File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export default {
116
116
117
117
if ( ! address ) {
118
118
await interaction . editReply ( {
119
- content : "Please provide an address to remove " ,
119
+ content : "Please provide an address to add " ,
120
120
} ) ;
121
121
return `Failed` ;
122
122
}
Original file line number Diff line number Diff line change @@ -172,11 +172,29 @@ export class Ethereum {
172
172
} ;
173
173
174
174
removeValidator = async ( address : string ) : Promise < TransactionReceipt > => {
175
- const txHash = await this . rollup . write . initiateWithdraw ( [
176
- address ,
175
+ const withdrawerWalletClient = createWalletClient ( {
176
+ account : privateKeyToAccount (
177
+ process . env . WITHDRAWER_PRIVATE_KEY as `0x${string } `
178
+ ) ,
179
+ chain : ethereumChain ,
180
+ transport : http ( process . env . ETHEREUM_HOST as string ) ,
181
+ } ) ;
182
+
183
+ const rollupWithdrawerScoped = getContract ( {
184
+ address : this . rollup . address as `0x${string } `,
185
+ abi : RollupAbi ,
186
+ client : withdrawerWalletClient ,
187
+ } ) ;
188
+
189
+ const txHash = await rollupWithdrawerScoped . write . initiateWithdraw ( [
190
+ address as `0x${string } `,
177
191
process . env . WITHDRAWER_ADDRESS as `0x${string } `,
178
192
] ) ;
179
193
180
- return txHash ;
194
+ const receipt = await this . publicClient . waitForTransactionReceipt ( {
195
+ hash : txHash ,
196
+ } ) ;
197
+
198
+ return receipt ;
181
199
} ;
182
200
}
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ resource "aws_ecs_task_definition" "sparta_discord_bot" {
157
157
name = " MINTER_PRIVATE_KEY"
158
158
value = var.minter_private_key
159
159
},
160
+ {
161
+ name = " WITHDRAWER_PRIVATE_KEY"
162
+ value = var.withdrawer_private_key
163
+ },
160
164
{
161
165
name = " WITHDRAWER_ADDRESS"
162
166
value = var.withdrawer_address
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ variable "minter_private_key" {
58
58
sensitive = true
59
59
}
60
60
61
+ variable "withdrawer_private_key" {
62
+ description = " Ethereum wallet private key for withdrawing funds"
63
+ type = string
64
+ sensitive = true
65
+ }
66
+
61
67
variable "withdrawer_address" {
62
68
description = " Ethereum wallet address for withdrawing funds"
63
69
type = string
You can’t perform that action at this time.
0 commit comments