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 {
116116
117117 if ( ! address ) {
118118 await interaction . editReply ( {
119- content : "Please provide an address to remove " ,
119+ content : "Please provide an address to add " ,
120120 } ) ;
121121 return `Failed` ;
122122 }
Original file line number Diff line number Diff line change @@ -172,11 +172,29 @@ export class Ethereum {
172172 } ;
173173
174174 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 } `,
177191 process . env . WITHDRAWER_ADDRESS as `0x${string } `,
178192 ] ) ;
179193
180- return txHash ;
194+ const receipt = await this . publicClient . waitForTransactionReceipt ( {
195+ hash : txHash ,
196+ } ) ;
197+
198+ return receipt ;
181199 } ;
182200}
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ resource "aws_ecs_task_definition" "sparta_discord_bot" {
157157 name = " MINTER_PRIVATE_KEY"
158158 value = var.minter_private_key
159159 },
160+ {
161+ name = " WITHDRAWER_PRIVATE_KEY"
162+ value = var.withdrawer_private_key
163+ },
160164 {
161165 name = " WITHDRAWER_ADDRESS"
162166 value = var.withdrawer_address
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ variable "minter_private_key" {
5858 sensitive = true
5959}
6060
61+ variable "withdrawer_private_key" {
62+ description = " Ethereum wallet private key for withdrawing funds"
63+ type = string
64+ sensitive = true
65+ }
66+
6167variable "withdrawer_address" {
6268 description = " Ethereum wallet address for withdrawing funds"
6369 type = string
You can’t perform that action at this time.
0 commit comments