Skip to content

Commit b3034fb

Browse files
committed
more nits
1 parent 5fae7e0 commit b3034fb

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

tooling/sparta/src/admins/manageValidators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tooling/sparta/src/utils/ethereum.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

tooling/sparta/terraform/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

tooling/sparta/terraform/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
6167
variable "withdrawer_address" {
6268
description = "Ethereum wallet address for withdrawing funds"
6369
type = string

0 commit comments

Comments
 (0)