diff --git a/src/actions/abis/minipoolManager.ts b/src/actions/abis/minipoolManager.ts index 6d8ec1c..5101995 100644 --- a/src/actions/abis/minipoolManager.ts +++ b/src/actions/abis/minipoolManager.ts @@ -10,120 +10,49 @@ export const abi = [ stateMutability: "nonpayable", type: "constructor", }, + { inputs: [], name: "CancellationTooEarly", type: "error" }, + { inputs: [], name: "ContractNotFound", type: "error" }, + { inputs: [], name: "ContractPaused", type: "error" }, + { inputs: [], name: "DelegationFeeOutOfBounds", type: "error" }, + { inputs: [], name: "DurationOutOfBounds", type: "error" }, + { inputs: [], name: "InsufficientAVAXForMinipoolCreation", type: "error" }, + { inputs: [], name: "InsufficientGGPCollateralization", type: "error" }, + { inputs: [], name: "InvalidAVAXAssignmentRequest", type: "error" }, + { inputs: [], name: "InvalidAmount", type: "error" }, + { inputs: [], name: "InvalidEndTime", type: "error" }, + { inputs: [], name: "InvalidMultisigAddress", type: "error" }, + { inputs: [], name: "InvalidNodeID", type: "error" }, + { inputs: [], name: "InvalidOrOutdatedContract", type: "error" }, + { inputs: [], name: "InvalidStartTime", type: "error" }, + { inputs: [], name: "InvalidStateTransition", type: "error" }, + { inputs: [], name: "MinipoolDurationExceeded", type: "error" }, + { inputs: [], name: "MinipoolNotFound", type: "error" }, + { inputs: [], name: "MustBeGuardian", type: "error" }, + { inputs: [], name: "MustBeGuardianOrValidContract", type: "error" }, + { inputs: [], name: "MustBeMultisig", type: "error" }, + { inputs: [], name: "NegativeCycleDuration", type: "error" }, + { inputs: [], name: "OnlyOwner", type: "error" }, + { inputs: [], name: "OnlyRole", type: "error" }, + { inputs: [], name: "WithdrawAmountTooLarge", type: "error" }, + { inputs: [], name: "WithdrawForDelegationDisabled", type: "error" }, { - inputs: [], - name: "CancellationTooEarly", - type: "error", - }, - { - inputs: [], - name: "ContractNotFound", - type: "error", - }, - { - inputs: [], - name: "ContractPaused", - type: "error", - }, - { - inputs: [], - name: "DelegationFeeOutOfBounds", - type: "error", - }, - { - inputs: [], - name: "DurationOutOfBounds", - type: "error", - }, - { - inputs: [], - name: "InsufficientAVAXForMinipoolCreation", - type: "error", - }, - { - inputs: [], - name: "InsufficientGGPCollateralization", - type: "error", - }, - { - inputs: [], - name: "InvalidAVAXAssignmentRequest", - type: "error", - }, - { - inputs: [], - name: "InvalidAmount", - type: "error", - }, - { - inputs: [], - name: "InvalidEndTime", - type: "error", - }, - { - inputs: [], - name: "InvalidMultisigAddress", - type: "error", - }, - { - inputs: [], - name: "InvalidNodeID", - type: "error", - }, - { - inputs: [], - name: "InvalidOrOutdatedContract", - type: "error", - }, - { - inputs: [], - name: "InvalidStartTime", - type: "error", - }, - { - inputs: [], - name: "InvalidStateTransition", - type: "error", - }, - { - inputs: [], - name: "MinipoolDurationExceeded", - type: "error", - }, - { - inputs: [], - name: "MinipoolNotFound", - type: "error", - }, - { - inputs: [], - name: "MustBeGuardian", - type: "error", - }, - { - inputs: [], - name: "MustBeGuardianOrValidContract", - type: "error", - }, - { - inputs: [], - name: "MustBeMultisig", - type: "error", - }, - { - inputs: [], - name: "NegativeCycleDuration", - type: "error", - }, - { - inputs: [], - name: "OnlyOwner", - type: "error", - }, - { - inputs: [], - name: "WithdrawAmountTooLarge", - type: "error", + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "nodeID", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "blsPubkeyAndSig", + type: "bytes", + }, + ], + name: "BLSKeysAdded", + type: "event", }, { anonymous: false, @@ -137,9 +66,29 @@ export const abi = [ { indexed: false, internalType: "uint256", - name: "ggp", + name: "amount", type: "uint256", }, + { + indexed: false, + internalType: "uint256", + name: "rewardsAmount", + type: "uint256", + }, + ], + name: "DepositFromDelegation", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "nodeID", + type: "address", + }, + { indexed: false, internalType: "uint256", name: "ggp", type: "uint256" }, ], name: "GGPSlashed", type: "event", @@ -164,51 +113,42 @@ export const abi = [ type: "event", }, { + anonymous: false, inputs: [ { - internalType: "uint256", - name: "avaxRewardAmt", - type: "uint256", + indexed: true, + internalType: "address", + name: "nodeID", + type: "address", }, - ], - name: "calculateGGPSlashAmt", - outputs: [ { + indexed: false, internalType: "uint256", - name: "", + name: "amount", type: "uint256", }, ], - stateMutability: "view", - type: "function", + name: "WithdrawForDelegation", + type: "event", }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, + { internalType: "uint256", name: "avaxRewardAmt", type: "uint256" }, ], + name: "calculateGGPSlashAmt", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "canClaimAndInitiateStaking", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], + outputs: [{ internalType: "bool", name: "", type: "bool" }], stateMutability: "view", type: "function", }, { - inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - ], + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "cancelMinipool", outputs: [], stateMutability: "nonpayable", @@ -216,16 +156,8 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "bytes32", - name: "errorCode", - type: "bytes32", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "bytes32", name: "errorCode", type: "bytes32" }, ], name: "cancelMinipoolByMultisig", outputs: [], @@ -233,13 +165,7 @@ export const abi = [ type: "function", }, { - inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - ], + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "claimAndInitiateStaking", outputs: [], stateMutability: "nonpayable", @@ -247,26 +173,15 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint256", - name: "delegationFee", - type: "uint256", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "delegationFee", type: "uint256" }, { internalType: "uint256", name: "avaxAssignmentRequest", type: "uint256", }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, ], name: "createMinipool", outputs: [], @@ -275,99 +190,63 @@ export const abi = [ }, { inputs: [ + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "delegationFee", type: "uint256" }, { internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint256", - name: "avaxAmt", + name: "avaxAssignmentRequest", type: "uint256", }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, ], - name: "getExpectedAVAXRewardsAmt", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, + name: "createMinipoolOnBehalfOf", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { internalType: "uint256", name: "rewards", type: "uint256" }, + { internalType: "address", name: "nodeID", type: "address" }, ], - stateMutability: "view", + name: "depositFromDelegation", + outputs: [], + stateMutability: "payable", type: "function", }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "avaxAmt", type: "uint256" }, ], + name: "getExpectedAVAXRewardsAmt", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "getIndexOf", - outputs: [ - { - internalType: "int256", - name: "", - type: "int256", - }, - ], + outputs: [{ internalType: "int256", name: "", type: "int256" }], stateMutability: "view", type: "function", }, { - inputs: [ - { - internalType: "int256", - name: "index", - type: "int256", - }, - ], + inputs: [{ internalType: "int256", name: "index", type: "int256" }], name: "getMinipool", outputs: [ { components: [ - { - internalType: "int256", - name: "index", - type: "int256", - }, - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "status", - type: "uint256", - }, - { - internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint256", - name: "delegationFee", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "multisigAddr", - type: "address", - }, - { - internalType: "uint256", - name: "avaxNodeOpAmt", - type: "uint256", - }, + { internalType: "int256", name: "index", type: "int256" }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "status", type: "uint256" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "delegationFee", type: "uint256" }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "multisigAddr", type: "address" }, + { internalType: "uint256", name: "avaxNodeOpAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpInitialAmt", @@ -378,46 +257,23 @@ export const abi = [ name: "avaxLiquidStakerAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "txID", - type: "bytes32", - }, - { - internalType: "uint256", - name: "creationTime", - type: "uint256", - }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, + { internalType: "bytes32", name: "txID", type: "bytes32" }, + { internalType: "uint256", name: "creationTime", type: "uint256" }, { internalType: "uint256", name: "initialStartTime", type: "uint256", }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, + { internalType: "uint256", name: "startTime", type: "uint256" }, + { internalType: "uint256", name: "endTime", type: "uint256" }, { internalType: "uint256", name: "avaxTotalRewardAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "errorCode", - type: "bytes32", - }, - { - internalType: "uint256", - name: "ggpSlashAmt", - type: "uint256", - }, + { internalType: "bytes32", name: "errorCode", type: "bytes32" }, + { internalType: "uint256", name: "ggpSlashAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpRewardAmt", @@ -438,57 +294,19 @@ export const abi = [ type: "function", }, { - inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - ], + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "getMinipoolByNodeID", outputs: [ { components: [ - { - internalType: "int256", - name: "index", - type: "int256", - }, - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "status", - type: "uint256", - }, - { - internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint256", - name: "delegationFee", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "multisigAddr", - type: "address", - }, - { - internalType: "uint256", - name: "avaxNodeOpAmt", - type: "uint256", - }, + { internalType: "int256", name: "index", type: "int256" }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "status", type: "uint256" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "delegationFee", type: "uint256" }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "multisigAddr", type: "address" }, + { internalType: "uint256", name: "avaxNodeOpAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpInitialAmt", @@ -499,46 +317,23 @@ export const abi = [ name: "avaxLiquidStakerAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "txID", - type: "bytes32", - }, - { - internalType: "uint256", - name: "creationTime", - type: "uint256", - }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, + { internalType: "bytes32", name: "txID", type: "bytes32" }, + { internalType: "uint256", name: "creationTime", type: "uint256" }, { internalType: "uint256", name: "initialStartTime", type: "uint256", }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, + { internalType: "uint256", name: "startTime", type: "uint256" }, + { internalType: "uint256", name: "endTime", type: "uint256" }, { internalType: "uint256", name: "avaxTotalRewardAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "errorCode", - type: "bytes32", - }, - { - internalType: "uint256", - name: "ggpSlashAmt", - type: "uint256", - }, + { internalType: "bytes32", name: "errorCode", type: "bytes32" }, + { internalType: "uint256", name: "ggpSlashAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpRewardAmt", @@ -561,78 +356,28 @@ export const abi = [ { inputs: [], name: "getMinipoolCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], stateMutability: "view", type: "function", }, { inputs: [ - { - internalType: "enum MinipoolStatus", - name: "status", - type: "uint8", - }, - { - internalType: "uint256", - name: "offset", - type: "uint256", - }, - { - internalType: "uint256", - name: "limit", - type: "uint256", - }, + { internalType: "enum MinipoolStatus", name: "status", type: "uint8" }, + { internalType: "uint256", name: "offset", type: "uint256" }, + { internalType: "uint256", name: "limit", type: "uint256" }, ], name: "getMinipools", outputs: [ { components: [ - { - internalType: "int256", - name: "index", - type: "int256", - }, - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "status", - type: "uint256", - }, - { - internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint256", - name: "delegationFee", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "multisigAddr", - type: "address", - }, - { - internalType: "uint256", - name: "avaxNodeOpAmt", - type: "uint256", - }, + { internalType: "int256", name: "index", type: "int256" }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "status", type: "uint256" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + { internalType: "uint256", name: "delegationFee", type: "uint256" }, + { internalType: "address", name: "owner", type: "address" }, + { internalType: "address", name: "multisigAddr", type: "address" }, + { internalType: "uint256", name: "avaxNodeOpAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpInitialAmt", @@ -643,46 +388,23 @@ export const abi = [ name: "avaxLiquidStakerAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "txID", - type: "bytes32", - }, - { - internalType: "uint256", - name: "creationTime", - type: "uint256", - }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, + { internalType: "bytes32", name: "txID", type: "bytes32" }, + { internalType: "uint256", name: "creationTime", type: "uint256" }, { internalType: "uint256", name: "initialStartTime", type: "uint256", }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, + { internalType: "uint256", name: "startTime", type: "uint256" }, + { internalType: "uint256", name: "endTime", type: "uint256" }, { internalType: "uint256", name: "avaxTotalRewardAmt", type: "uint256", }, - { - internalType: "bytes32", - name: "errorCode", - type: "bytes32", - }, - { - internalType: "uint256", - name: "ggpSlashAmt", - type: "uint256", - }, + { internalType: "bytes32", name: "errorCode", type: "bytes32" }, + { internalType: "uint256", name: "ggpSlashAmt", type: "uint256" }, { internalType: "uint256", name: "avaxNodeOpRewardAmt", @@ -705,26 +427,14 @@ export const abi = [ { inputs: [], name: "getTotalAVAXLiquidStakerAmt", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], stateMutability: "view", type: "function", }, { inputs: [], name: "minStakingDuration", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], stateMutability: "view", type: "function", }, @@ -737,21 +447,9 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "avaxTotalRewardAmt", - type: "uint256", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "endTime", type: "uint256" }, + { internalType: "uint256", name: "avaxTotalRewardAmt", type: "uint256" }, ], name: "recordStakingEnd", outputs: [], @@ -760,21 +458,9 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "endTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "avaxTotalRewardAmt", - type: "uint256", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "endTime", type: "uint256" }, + { internalType: "uint256", name: "avaxTotalRewardAmt", type: "uint256" }, ], name: "recordStakingEndThenMaybeCycle", outputs: [], @@ -783,16 +469,8 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "bytes32", - name: "errorCode", - type: "bytes32", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "bytes32", name: "errorCode", type: "bytes32" }, ], name: "recordStakingError", outputs: [], @@ -801,51 +479,64 @@ export const abi = [ }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "bytes32", - name: "txID", - type: "bytes32", - }, - { - internalType: "uint256", - name: "startTime", - type: "uint256", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "bytes32", name: "txID", type: "bytes32" }, + { internalType: "uint256", name: "startTime", type: "uint256" }, ], name: "recordStakingStart", outputs: [], stateMutability: "nonpayable", type: "function", }, + { + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], + name: "requireValidMinipool", + outputs: [{ internalType: "int256", name: "", type: "int256" }], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, + ], + name: "setBLSKeys", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [], name: "version", - outputs: [ - { - internalType: "uint8", - name: "", - type: "uint8", - }, - ], + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], stateMutability: "view", type: "function", }, { inputs: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, + { internalType: "uint256", name: "amount", type: "uint256" }, + { internalType: "address", name: "nodeID", type: "address" }, ], + name: "withdrawForDelegation", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [{ internalType: "address", name: "nodeID", type: "address" }], name: "withdrawMinipoolFunds", outputs: [], stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "uint256", name: "duration", type: "uint256" }, + ], + name: "withdrawRewardsAndRelaunchMinipool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, ]; diff --git a/src/actions/abis/minipoolStreamliner.ts b/src/actions/abis/minipoolStreamliner.ts index 43b62ce..9106169 100644 --- a/src/actions/abis/minipoolStreamliner.ts +++ b/src/actions/abis/minipoolStreamliner.ts @@ -6,80 +6,22 @@ export const abi = [ name: "storageAddress", type: "address", }, - { - internalType: "address", - name: "WAVAX", - type: "address", - }, - { - internalType: "address", - name: "USDC", - type: "address", - }, - { - internalType: "address", - name: "TJRouter", - type: "address", - }, - { - internalType: "address", - name: "Oonodz", - type: "address", - }, + { internalType: "address", name: "WAVAX", type: "address" }, + { internalType: "address", name: "TJRouter", type: "address" }, ], stateMutability: "nonpayable", type: "constructor", }, - { - inputs: [], - name: "ContractNotFound", - type: "error", - }, - { - inputs: [], - name: "ContractPaused", - type: "error", - }, - { - inputs: [], - name: "IncorrectNodeIDFormat", - type: "error", - }, - { - inputs: [], - name: "IncorrectNodeIDLength", - type: "error", - }, - { - inputs: [], - name: "InvalidOrOutdatedContract", - type: "error", - }, - { - inputs: [], - name: "MismatchedFunds", - type: "error", - }, - { - inputs: [], - name: "MustBeGuardian", - type: "error", - }, - { - inputs: [], - name: "MustBeGuardianOrValidContract", - type: "error", - }, - { - inputs: [], - name: "MustBeMultisig", - type: "error", - }, - { - inputs: [], - name: "SwapFailed", - type: "error", - }, + { inputs: [], name: "ContractNotFound", type: "error" }, + { inputs: [], name: "ContractPaused", type: "error" }, + { inputs: [], name: "InvalidOrOutdatedContract", type: "error" }, + { inputs: [], name: "MismatchedFunds", type: "error" }, + { inputs: [], name: "MustBeGuardian", type: "error" }, + { inputs: [], name: "MustBeGuardianOrValidContract", type: "error" }, + { inputs: [], name: "MustBeMultisig", type: "error" }, + { inputs: [], name: "NotApprovedHardwareProvider", type: "error" }, + { inputs: [], name: "OnlyOwner", type: "error" }, + { inputs: [], name: "SwapFailed", type: "error" }, { anonymous: false, inputs: [ @@ -97,12 +39,12 @@ export const abi = [ }, { indexed: false, - internalType: "bool", - name: "isUsingOonodz", - type: "bool", + internalType: "address", + name: "hardwareProviderContract", + type: "address", }, ], - name: "NewStreamlinedMinipoolMade", + name: "MinipoolRelaunched", type: "event", }, { @@ -111,48 +53,38 @@ export const abi = [ { indexed: false, internalType: "address", - name: "reciever", + name: "nodeID", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "owner", type: "address", }, { indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", + internalType: "address", + name: "hardwareProviderContract", + type: "address", }, ], - name: "USDCRefunded", + name: "NewStreamlinedMinipoolMade", type: "event", }, { inputs: [ { components: [ - { - internalType: "address", - name: "nodeID", - type: "address", - }, - { - internalType: "uint256", - name: "duration", - type: "uint256", - }, - { - internalType: "uint16", - name: "countryOfResidence", - type: "uint16", - }, + { internalType: "address", name: "nodeID", type: "address" }, + { internalType: "bytes", name: "blsPubkeyAndSig", type: "bytes" }, + { internalType: "uint256", name: "duration", type: "uint256" }, { internalType: "uint256", name: "avaxForMinipool", type: "uint256", }, - { - internalType: "uint256", - name: "avaxForGGP", - type: "uint256", - }, + { internalType: "uint256", name: "avaxForGGP", type: "uint256" }, { internalType: "uint256", name: "minGGPAmountOut", @@ -164,19 +96,14 @@ export const abi = [ type: "uint256", }, { - internalType: "uint256", - name: "minUSDCAmountOut", - type: "uint256", - }, - { - internalType: "bool", - name: "bestRate", - type: "bool", + internalType: "address", + name: "hardwareProviderContract", + type: "address", }, { - internalType: "bool", - name: "withdrawalRightWaiver", - type: "bool", + internalType: "bytes", + name: "hardwareProviderInformation", + type: "bytes", }, ], internalType: "struct MinipoolStreamliner.StreamlinedMinipool", @@ -184,11 +111,20 @@ export const abi = [ type: "tuple", }, ], - name: "createStreamlinedMinipool", + name: "createOrRelaunchStreamlinedMinipool", outputs: [], stateMutability: "payable", type: "function", }, + { + inputs: [ + { internalType: "address", name: "contractAddress", type: "address" }, + ], + name: "isApprovedHardwareProvider", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "receiveWithdrawalAVAX", @@ -197,15 +133,22 @@ export const abi = [ type: "function", }, { - inputs: [], - name: "version", + inputs: [ + { internalType: "address", name: "user", type: "address" }, + { internalType: "uint256", name: "avaxForGGP", type: "uint256" }, + { internalType: "uint256", name: "minGGPAmountOut", type: "uint256" }, + ], + name: "swapAndStakeGGPOnBehalfOf", outputs: [ - { - internalType: "uint8", - name: "", - type: "uint8", - }, + { internalType: "uint256", name: "ggpPurchased", type: "uint256" }, ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [{ internalType: "uint8", name: "", type: "uint8" }], stateMutability: "view", type: "function", }, diff --git a/src/actions/constants.ts b/src/actions/constants.ts index bee544f..296188f 100644 --- a/src/actions/constants.ts +++ b/src/actions/constants.ts @@ -48,8 +48,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"; @@ -65,9 +64,7 @@ export const TOKENGGP_ADDRESS = "0x69260B9483F9871ca57f81A90D91E2F96c2Cd11d"; export const TOKENGG_AVAX_ADDRESS = "0xA25EaF2906FA1a3a13EdAc9B9657108Af7B703e3"; export const WAVAX_ADDRESS = "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"; -export const MINIPOOL_STREAMLINER = - "0x0A75a480Af4ADC81b20b1664A1Da2bd7caEFA430"; -export const GGP_VAULT_ADDRESS = "0xdF34022e8a280fc79499cA560439Bb6f9797EbD8"; +export const MINIPOOL_STREAMLINER = "0x8C05D78066431C3b11bBFB6f3546fD3F1396115C"; export const CLAIM_NODE_OP_INTERFACE = new utils.Interface(ClaimNodeOpAbi); export const CLAIM_PROTOCOL_DAO_INTERFACE = new utils.Interface( diff --git a/src/actions/minipool.ts b/src/actions/minipool.ts index 5f798f7..45bfe59 100644 --- a/src/actions/minipool.ts +++ b/src/actions/minipool.ts @@ -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"); } diff --git a/src/actions/templates.ts b/src/actions/templates.ts index 20f67f6..3cf112f 100644 --- a/src/actions/templates.ts +++ b/src/actions/templates.ts @@ -1,5 +1,5 @@ import { TransactionEvent } from "@tenderly/actions"; -import { formatDistance } from "date-fns"; +// import { formatDistance } from "date-fns"; import { APIEmbedField, ActionRowBuilder, @@ -74,20 +74,20 @@ const balloonField = (nodeId: string): APIEmbedField => { }; }; -const tripDurationField = (duration: string): APIEmbedField => { - const now = new Date(); - return { - name: "📅 trip duration", - value: `${formatDistance( - now, - new Date(now.getTime() + parseInt(duration) * 1000), - { - addSuffix: false, - } - )}`, - inline: true, - }; -}; +// const tripDurationField = (duration: string): APIEmbedField => { +// const now = new Date(); +// return { +// name: "📅 trip duration", +// value: `${formatDistance( +// now, +// new Date(now.getTime() + parseInt(duration) * 1000), +// { +// addSuffix: false, +// } +// )}`, +// inline: true, +// }; +// }; const endTimeField = (endTime: string): APIEmbedField => { return { @@ -307,7 +307,7 @@ export const MINIPOOL_PRELAUNCH_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), minipoolStatusField("prelaunch") ) @@ -342,7 +342,7 @@ export const MINIPOOL_STREAMLINE_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), minipoolStatusField("prelaunch") ) .setColor(0x7ddbd5) @@ -375,7 +375,7 @@ export const MINIPOOL_LAUNCH_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), minipoolStatusField("launched") ) @@ -409,7 +409,7 @@ export const MINIPOOL_STAKING_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), endTimeField(endTime), minipoolStatusField("staking") ) @@ -444,7 +444,7 @@ export const MINIPOOL_WITHDRAWABLE_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), minipoolStatusField("withdrawable") ) @@ -478,7 +478,7 @@ export const MINIPOOL_FINISHED_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), endTimeField(endTime), minipoolStatusField("finished") ) @@ -513,7 +513,7 @@ export const MINIPOOL_CANCELED_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), endTimeField(endTime), minipoolStatusField("canceled") ) @@ -548,7 +548,7 @@ export const MINIPOOL_ERROR_TEMPLATE = ( .addFields( pilotField(owner), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), endTimeField(endTime), minipoolStatusField("error") ) @@ -564,7 +564,8 @@ export const MINIPOOL_RESTAKE_TEMPLATE = ( nodeId: string, owner: string, duration: string, - endTime: string + endTime: string, + isOneClick: boolean = false ) => { return { components: [ @@ -578,12 +579,14 @@ 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), balloonField(nodeId), - tripDurationField(duration), + // tripDurationField(duration), minipoolStatusField("finished -> prelaunch -> launched") ) .setColor(0x7ddbd5) @@ -624,7 +627,7 @@ export const GGP_STAKING_STAKE_TEMPLATE = ( ggpAmountField(amount, { name: "stake amount", }), - ggpDifferenceField(amount, totalStake, false, { + ggpAmountField(totalStake, { name: "total stake", }) ) @@ -665,7 +668,7 @@ export const GGP_STAKING_WITHDRAW_TEMPLATE = ( ggpAmountField(amount, { name: "un-stake amount", }), - ggpDifferenceField(amount, totalStake, true, { + ggpAmountField(totalStake, { name: "total stake", }) ) diff --git a/src/actions/types.ts b/src/actions/types.ts index 48a265b..5fbcc18 100644 --- a/src/actions/types.ts +++ b/src/actions/types.ts @@ -96,6 +96,7 @@ export enum MinipoolStatus { CANCELED = "5", FINISHED = "6", STREAMLINE_PRELAUNCH = "10", + STREAMLINE_RELAUNCH = "12", RESTAKE = "11", } diff --git a/tenderly.yaml b/tenderly.yaml index 3ecfc66..7dbcf94 100644 --- a/tenderly.yaml +++ b/tenderly.yaml @@ -13,7 +13,7 @@ actions: filters: - eventEmitted: contract: - address: 0xb84fA022c7fE1CE3a1F94C49f2F13236C3d1Ed08 + address: 0x17395Ad76b236FABeaC3634b78fF8F6970222199 name: MinipoolStatusChanged status: success network: 43114