Skip to content

Commit

Permalink
fix: new mp address, streamline relaunch support
Browse files Browse the repository at this point in the history
  • Loading branch information
Namaskar-1F64F committed Apr 8, 2024
1 parent d7fb6d5 commit 1688fcc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/actions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export const CLAIM_NODE_OP_ADDRESS =
"0xb42CfaD450B46FDc9cAC5FBF14Bc2e6091AfC35c";
export const CLAIM_PROTOCOL_DAO_ADDRESS =
"0x4169CF88c7Ed811E6f6e61917c5b915BeA49476c";
export const MINIPOOL_MANAGER_ADDRESS =
"0xb84fA022c7fE1CE3a1F94C49f2F13236C3d1Ed08";
export const MINIPOOL_MANAGER_ADDRESS = "0x17395Ad76b236FABeaC3634b78fF8F6970222199";
export const MULTISIG_MANAGER_ADDRESS =
"0x7fff419c562Dd8b3cf16C335a01CDb37ea1B6a3B";
export const OCYTICUS_ADDRESS = "0x9189d18F453b1Ec1F02E40A8e3711334f9eA210B";
Expand Down
17 changes: 17 additions & 0 deletions src/actions/minipool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ const getMessageFromStatusChangedEvent = async (
duration.toString()
);

case MinipoolStatus.STREAMLINE_RELAUNCH:
return MINIPOOL_RESTAKE_TEMPLATE(
transactionEvent,
nodeID,
owner,
duration.toString(),
startTime.add(duration).toString(),
true
);

default:
throw new Error("unknown status");
}
Expand All @@ -154,6 +164,13 @@ export const minipoolStatusChange = async (context: Context, event: Event) => {
"NewStreamlinedMinipoolMade"
)?.length > 0;
if (hasNewStreamlinedMinipoolMadeEvent) {
if(transactionEvent.logs.length > 5) {
message = await getMessageFromStatusChangedEvent(
statusChangedEvents[0],
transactionEvent,
MinipoolStatus.STREAMLINE_RELAUNCH
);
}
message = await getMessageFromStatusChangedEvent(
statusChangedEvents[0],
transactionEvent,
Expand Down
7 changes: 5 additions & 2 deletions src/actions/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ export const MINIPOOL_RESTAKE_TEMPLATE = (
nodeId: string,
owner: string,
duration: string,
endTime: string
endTime: string,
isOneClick: boolean = false
) => {
return {
components: [
Expand All @@ -569,7 +570,9 @@ export const MINIPOOL_RESTAKE_TEMPLATE = (
new EmbedBuilder()
.setTitle("♻️ Another Adventure Begins")
.setDescription(
"The minipool has completed it's flight and is going out for another. Enjoy the ride!\n[πŸ“„ the life of a minipool](https://docs.gogopool.com/design/how-minipools-work/the-life-of-a-minipool) [πŸ“„ minipool statuses](https://docs.gogopool.com/design/how-minipools-work/minipooldesign)"
`The ${
isOneClick ? "streamlined " : ""
}minipool has completed it's flight and is going out for another. Enjoy the ride!\n[πŸ“„ the life of a minipool](https://docs.gogopool.com/design/how-minipools-work/the-life-of-a-minipool) [πŸ“„ minipool statuses](https://docs.gogopool.com/design/how-minipools-work/minipooldesign)`
)
.addFields(
pilotField(owner),
Expand Down
1 change: 1 addition & 0 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export enum MinipoolStatus {
CANCELED = "5",
FINISHED = "6",
STREAMLINE_PRELAUNCH = "10",
STREAMLINE_RELAUNCH = "12",
RESTAKE = "11",
}

Expand Down
2 changes: 1 addition & 1 deletion tenderly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ actions:
filters:
- eventEmitted:
contract:
address: 0xb84fA022c7fE1CE3a1F94C49f2F13236C3d1Ed08
address: 0x17395Ad76b236FABeaC3634b78fF8F6970222199
name: MinipoolStatusChanged
status: success
network: 43114
Expand Down

0 comments on commit 1688fcc

Please sign in to comment.