From 66ae3a07e2e411a810dfd1cae85ebe46ac26b052 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 16:23:29 -0400 Subject: [PATCH 1/4] Remove unused variable --- src/models/AzoriusTxBuilder.ts | 3 --- src/models/TxBuilderFactory.ts | 1 - 2 files changed, 4 deletions(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index cc919d50b4..2d89f37044 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -25,7 +25,6 @@ import { generateContractByteCodeLinear, generateSalt } from './helpers/utils'; export class AzoriusTxBuilder extends BaseTxBuilder { private readonly safeContract: GnosisSafeL2; - private readonly predictedSafeAddress: string; private encodedSetupTokenData: string | undefined; private encodedSetupERC20WrapperData: string | undefined; @@ -54,7 +53,6 @@ export class AzoriusTxBuilder extends BaseTxBuilder { azoriusContracts: AzoriusContracts, daoData: AzoriusERC20DAO | AzoriusERC721DAO, safeContract: GnosisSafeL2, - predictedSafeAddress: string, parentAddress?: string, parentTokenAddress?: string, ) { @@ -68,7 +66,6 @@ export class AzoriusTxBuilder extends BaseTxBuilder { ); this.safeContract = safeContract; - this.predictedSafeAddress = predictedSafeAddress; this.tokenNonce = getRandomBytes(); this.claimNonce = getRandomBytes(); diff --git a/src/models/TxBuilderFactory.ts b/src/models/TxBuilderFactory.ts index 392452bb2d..c452b0a902 100644 --- a/src/models/TxBuilderFactory.ts +++ b/src/models/TxBuilderFactory.ts @@ -130,7 +130,6 @@ export class TxBuilderFactory extends BaseTxBuilder { this.azoriusContracts!, this.daoData as AzoriusERC20DAO, this.safeContract!, - this.predictedSafeAddress!, this.parentAddress, this.parentTokenAddress, ); From 2df103fd3ceae4e4a1207c3007822454e38b1cd2 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 16:39:24 -0400 Subject: [PATCH 2/4] Add missing abi parameter on "setUp" encoding for ERC20Claim --- src/models/AzoriusTxBuilder.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index 2d89f37044..a6c860dd38 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -346,8 +346,9 @@ export class AzoriusTxBuilder extends BaseTxBuilder { private setEncodedSetupTokenClaimData() { const azoriusGovernanceDaoData = this.daoData as AzoriusERC20DAO; const encodedInitTokenData = defaultAbiCoder.encode( - ['address', 'address', 'address', 'uint256'], + ['uint32', 'address', 'address', 'address', 'uint256'], [ + 0, // deadlineBlock. do we capture this in the UI? this.safeContract.address, this.parentTokenAddress, this.predictedTokenAddress, From e0b112665510ff184e21790d6382f14327e4a328 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 16:40:12 -0400 Subject: [PATCH 3/4] Clean up ABI encoding for a couple of contract calls, but I bet they do work currently, the code is just misleading --- src/models/FreezeGuardTxBuilder.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/models/FreezeGuardTxBuilder.ts b/src/models/FreezeGuardTxBuilder.ts index 666c531c86..a2ef2b21be 100644 --- a/src/models/FreezeGuardTxBuilder.ts +++ b/src/models/FreezeGuardTxBuilder.ts @@ -217,7 +217,7 @@ export class FreezeGuardTxBuilder extends BaseTxBuilder { 'setUp', [ ethers.utils.defaultAbiCoder.encode( - ['uint256', 'uint256', 'address', 'address', 'address'], + ['uint32', 'uint32', 'address', 'address', 'address'], [ subDaoData.timelockPeriod, // Timelock Period subDaoData.executionPeriod, // Execution Period @@ -231,19 +231,14 @@ export class FreezeGuardTxBuilder extends BaseTxBuilder { } private setFreezeGuardCallDataAzorius() { - const subDaoData = this.daoData as SubDAO; - this.freezeGuardCallData = AzoriusFreezeGuard__factory.createInterface().encodeFunctionData( 'setUp', [ ethers.utils.defaultAbiCoder.encode( - ['address', 'address', 'address', 'address', 'uint256'], + ['address', 'address'], [ this.parentAddress, // Owner -- Parent DAO this.freezeVotingAddress, // Freeze Voting - this.strategyAddress, // Base Strategy - this.azoriusAddress, // Azorius - subDaoData.executionPeriod, // Execution Period ], ), ], From 667bb65e9a8a23f97399188f3b50d17222dc8570 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 26 Apr 2024 21:50:45 -0400 Subject: [PATCH 4/4] Clean up a comment on a magic number --- src/models/AzoriusTxBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index a6c860dd38..64a1b39868 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -348,7 +348,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { const encodedInitTokenData = defaultAbiCoder.encode( ['uint32', 'address', 'address', 'address', 'uint256'], [ - 0, // deadlineBlock. do we capture this in the UI? + 0, // deadlineBlock. We don't capture this in the UI. 0 means no deadline to claim. this.safeContract.address, this.parentTokenAddress, this.predictedTokenAddress,