From 11968f3edb865a501fa2aeec260bf17a7ced3fbb Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 25 Jul 2023 16:14:38 +0800 Subject: [PATCH] Remove maxGeneralCategoryId & earlyLockedWithdrawFee from Accounts; Use Registrar Fee lookup for Charity Easrly Withdraw Fee in Accounts; Change one missed meta>>metadata; --- .../upgradeInitializers/DiamondInit.sol | 5 ---- .../facets/AccountsCreateEndowment.sol | 2 +- .../facets/AccountsQueryEndowments.sol | 4 +-- .../core/accounts/facets/AccountsUpdate.sol | 9 +------ .../accounts/interfaces/IAccountsUpdate.sol | 7 +---- contracts/core/accounts/message.sol | 1 - contracts/core/accounts/storage.sol | 1 - contracts/multisigs/CharityApplications.sol | 2 +- tasks/helpers/updateRegistrar.ts | 9 +++---- tasks/manage/accounts/updateConfig.ts | 25 +---------------- tasks/manage/queryEndowments.ts | 2 +- tasks/manage/registrar/setNetworkInfo.ts | 7 +++-- tasks/manage/registrar/setStratParams.ts | 5 +++- tasks/upgrade/upgradeRegistrar.ts | 5 ++-- test/core/accounts/AccountsCreateEndowment.ts | 2 -- test/core/accounts/AccountsDeployContract.ts | 2 -- .../AccountsDepositWithdrawEndowments.ts | 2 -- test/core/accounts/AccountsDonationMatch.ts | 2 -- test/core/accounts/AccountsQueryEndowments.ts | 2 -- test/core/accounts/AccountsUpdate.ts | 27 +++++-------------- ...countsUpdateEndowmentSettingsController.ts | 2 -- .../core/accounts/AccountsUpdateEndowments.ts | 2 -- .../AccountsUpdateStatusEndowments.ts | 2 -- test/core/router/Router.ts | 18 ++++++------- test/utils/helpers/accounts/defaults.ts | 2 -- 25 files changed, 39 insertions(+), 108 deletions(-) diff --git a/contracts/core/accounts/diamond/upgradeInitializers/DiamondInit.sol b/contracts/core/accounts/diamond/upgradeInitializers/DiamondInit.sol index 2770ed47e..ec150ae7e 100644 --- a/contracts/core/accounts/diamond/upgradeInitializers/DiamondInit.sol +++ b/contracts/core/accounts/diamond/upgradeInitializers/DiamondInit.sol @@ -41,11 +41,6 @@ contract DiamondInit { state.config.registrarContract = registrar; state.config.networkName = "Polygon"; state.config.nextAccountId = 1; - state.config.maxGeneralCategoryId = 1; - state.config.earlyLockedWithdrawFee = LibAccounts.FeeSetting({ - payoutAddress: address(0), - bps: 1000 // 10% fee placeholder. Can always change later if needed - }); // add your own state variables // EIP-2535 specifies that the `diamondCut` function takes two optional diff --git a/contracts/core/accounts/facets/AccountsCreateEndowment.sol b/contracts/core/accounts/facets/AccountsCreateEndowment.sol index 7931911fd..a2ef5bf70 100644 --- a/contracts/core/accounts/facets/AccountsCreateEndowment.sol +++ b/contracts/core/accounts/facets/AccountsCreateEndowment.sol @@ -35,8 +35,8 @@ contract AccountsCreateEndowment is address registrarAddress = state.config.registrarContract; RegistrarStorage.Config memory registrar_config = IRegistrar(registrarAddress).queryConfig(); + LibAccounts.FeeSetting memory earlyLockedWithdrawFee = IRegistrar(registrarAddress).getFeeSettingsByFeeType(LibAccounts.FeeTypes.EarlyLockedWithdrawCharity); - LibAccounts.FeeSetting memory earlyLockedWithdrawFee = state.config.earlyLockedWithdrawFee; if (LibAccounts.EndowmentType.Charity == details.endowType) { require(msg.sender == registrar_config.charityApplications, "Unauthorized"); } else { diff --git a/contracts/core/accounts/facets/AccountsQueryEndowments.sol b/contracts/core/accounts/facets/AccountsQueryEndowments.sol index 2438549f3..50bd77d15 100644 --- a/contracts/core/accounts/facets/AccountsQueryEndowments.sol +++ b/contracts/core/accounts/facets/AccountsQueryEndowments.sol @@ -61,9 +61,7 @@ contract AccountsQueryEndowments is IAccountsQueryEndowments { version: state.config.version, networkName: state.config.networkName, registrarContract: state.config.registrarContract, - nextAccountId: state.config.nextAccountId, - maxGeneralCategoryId: state.config.maxGeneralCategoryId, - earlyLockedWithdrawFee: state.config.earlyLockedWithdrawFee + nextAccountId: state.config.nextAccountId }); } diff --git a/contracts/core/accounts/facets/AccountsUpdate.sol b/contracts/core/accounts/facets/AccountsUpdate.sol index 81170142a..30e8f9fc8 100644 --- a/contracts/core/accounts/facets/AccountsUpdate.sol +++ b/contracts/core/accounts/facets/AccountsUpdate.sol @@ -34,21 +34,14 @@ contract AccountsUpdate is ReentrancyGuardFacet, IAccountsEvents, IAccountsUpdat * @notice This function updates the config of the contract * @dev This function updates the config of the contract * @param newRegistrar The new registrar contract - * @param maxGeneralCategoryId The max general category id */ - function updateConfig( - address newRegistrar, - uint256 maxGeneralCategoryId, - LibAccounts.FeeSetting memory earlyLockedWithdrawFee - ) public nonReentrant { + function updateConfig(address newRegistrar) public nonReentrant { AccountStorage.State storage state = LibAccounts.diamondStorage(); require(msg.sender == state.config.owner, "Unauthorized"); require(Validator.addressChecker(newRegistrar), "invalid registrar address"); state.config.registrarContract = newRegistrar; - state.config.maxGeneralCategoryId = maxGeneralCategoryId; - state.config.earlyLockedWithdrawFee = earlyLockedWithdrawFee; emit ConfigUpdated(); } diff --git a/contracts/core/accounts/interfaces/IAccountsUpdate.sol b/contracts/core/accounts/interfaces/IAccountsUpdate.sol index d6de133bd..065ff6f36 100644 --- a/contracts/core/accounts/interfaces/IAccountsUpdate.sol +++ b/contracts/core/accounts/interfaces/IAccountsUpdate.sol @@ -20,11 +20,6 @@ interface IAccountsUpdate { * @notice This function updates the config of the contract * @dev This function updates the config of the contract * @param newRegistrar The new registrar contract - * @param maxGeneralCategoryId The max general category id */ - function updateConfig( - address newRegistrar, - uint256 maxGeneralCategoryId, - LibAccounts.FeeSetting memory earlyLockedWithdrawFee - ) external; + function updateConfig(address newRegistrar) external; } diff --git a/contracts/core/accounts/message.sol b/contracts/core/accounts/message.sol index 754c8a316..18538cc12 100644 --- a/contracts/core/accounts/message.sol +++ b/contracts/core/accounts/message.sol @@ -89,7 +89,6 @@ library AccountMessages { string networkName; address registrarContract; uint256 nextAccountId; - uint256 maxGeneralCategoryId; } struct StateResponse { diff --git a/contracts/core/accounts/storage.sol b/contracts/core/accounts/storage.sol index 4212ab11c..a12f6f527 100644 --- a/contracts/core/accounts/storage.sol +++ b/contracts/core/accounts/storage.sol @@ -11,7 +11,6 @@ library AccountStorage { string networkName; address registrarContract; uint32 nextAccountId; - uint256 maxGeneralCategoryId; bool reentrancyGuardLocked; } diff --git a/contracts/multisigs/CharityApplications.sol b/contracts/multisigs/CharityApplications.sol index 194f6839d..3619d0161 100644 --- a/contracts/multisigs/CharityApplications.sol +++ b/contracts/multisigs/CharityApplications.sol @@ -135,7 +135,7 @@ contract CharityApplications is MultiSigGeneric, StorageApplications, ICharityAp proposals[proposalCount] = ApplicationsStorage.ApplicationProposal({ proposer: msg.sender, application: _application, - meta: _metadata, + metadata: _metadata, expiry: expiry, executed: false }); diff --git a/tasks/helpers/updateRegistrar.ts b/tasks/helpers/updateRegistrar.ts index d4ae58e66..a9cf99621 100644 --- a/tasks/helpers/updateRegistrar.ts +++ b/tasks/helpers/updateRegistrar.ts @@ -22,14 +22,13 @@ export async function updateRegistrarNetworkConnections( ) { logger.divider(); - let networkName + let networkName; try { - - // If we're updating info on this chain for another chain, arg info MUST specify chain id + // If we're updating info on this chain for another chain, arg info MUST specify chain id if (Number(networkInfo.chainId) > 0) { networkName = getNetworkNameFromChainId(Number(networkInfo.chainId)); - } - else { // we're updating this chains own network info and can safely lookup chain id + } else { + // we're updating this chains own network info and can safely lookup chain id const chainId = await getChainId(hre); networkName = getNetworkNameFromChainId(chainId); } diff --git a/tasks/manage/accounts/updateConfig.ts b/tasks/manage/accounts/updateConfig.ts index 7c7908f5b..931166e16 100644 --- a/tasks/manage/accounts/updateConfig.ts +++ b/tasks/manage/accounts/updateConfig.ts @@ -7,25 +7,11 @@ import { import {confirmAction, getAddresses, getSigners, logger} from "utils"; type TaskArgs = { - earlyLockedWithdrawFeeBps?: number; - earlyLockedWithdrawFeePayoutAddress?: string; - maxGeneralCategoryId?: number; registrarContract?: string; yes: boolean; }; task("manage:accounts:updateConfig", "Will update Accounts Diamond config") - .addOptionalParam( - "earlyLockedWithdrawFeeBps", - "Early locked withdraw fee BPS.", - undefined, - types.int - ) - .addOptionalParam( - "earlyLockedWithdrawFeePayoutAddress", - "Early locked withdraw fee payout address." - ) - .addOptionalParam("maxGeneralCategoryId", "The max general category id.", undefined, types.int) .addOptionalParam( "registrarContract", "Registrar contract address. Will do a local lookup from contract-address.json if none is provided." @@ -44,9 +30,7 @@ task("manage:accounts:updateConfig", "Will update Accounts Diamond config") addresses.accounts.diamond, apTeamMultisigOwners[0] ); - const {registrarContract, earlyLockedWithdrawFee, maxGeneralCategoryId, owner} = - await accountsQueryEndowments.queryConfig(); - const curConfig = {registrarContract, earlyLockedWithdrawFee, maxGeneralCategoryId}; + const {registrarContract, owner} = await accountsQueryEndowments.queryConfig(); logger.out(curConfig); logger.out("Config data to update:"); @@ -64,13 +48,6 @@ task("manage:accounts:updateConfig", "Will update Accounts Diamond config") ); const data = accountsUpdate.interface.encodeFunctionData("updateConfig", [ newConfig.registrarContract || curConfig.registrarContract, - newConfig.maxGeneralCategoryId || curConfig.maxGeneralCategoryId, - { - bps: newConfig.earlyLockedWithdrawFeeBps || curConfig.earlyLockedWithdrawFee.bps, - payoutAddress: - newConfig.earlyLockedWithdrawFeePayoutAddress || - curConfig.earlyLockedWithdrawFee.payoutAddress, - }, ]); const apTeamMultiSig = APTeamMultiSig__factory.connect( owner, // ensure connection to current owning APTeamMultiSig contract diff --git a/tasks/manage/queryEndowments.ts b/tasks/manage/queryEndowments.ts index d140ceb66..03d12cd24 100644 --- a/tasks/manage/queryEndowments.ts +++ b/tasks/manage/queryEndowments.ts @@ -22,7 +22,7 @@ task("manage:queryEndowments", "Will create a new endowment") apTeam1 ); - logger.out(await queryEndowmentFacet.queryEndowmentDetails(taskArgs.id)) + logger.out(await queryEndowmentFacet.queryEndowmentDetails(taskArgs.id)); } catch (error) { logger.out(error, logger.Level.Error); } diff --git a/tasks/manage/registrar/setNetworkInfo.ts b/tasks/manage/registrar/setNetworkInfo.ts index da8831f0d..8da92862f 100644 --- a/tasks/manage/registrar/setNetworkInfo.ts +++ b/tasks/manage/registrar/setNetworkInfo.ts @@ -25,8 +25,11 @@ task("manage:registrar:setNetworkInfo", "Set network info for a specified networ logger.out("Connecting to registrar on specified network..."); const networkId = getChainIdFromNetworkName(taskArguments.networkName); - const thisNetworkAddresses = await getAddresses(hre) - const thatNetworkAddresses = getAddressesByNetworkId(networkId, DEFAULT_CONTRACT_ADDRESS_FILE_PATH); + const thisNetworkAddresses = await getAddresses(hre); + const thatNetworkAddresses = getAddressesByNetworkId( + networkId, + DEFAULT_CONTRACT_ADDRESS_FILE_PATH + ); const newNetworkInfo: Partial = { chainId: networkId, router: thatNetworkAddresses.router.proxy, diff --git a/tasks/manage/registrar/setStratParams.ts b/tasks/manage/registrar/setStratParams.ts index b58408dbc..c27cc0387 100644 --- a/tasks/manage/registrar/setStratParams.ts +++ b/tasks/manage/registrar/setStratParams.ts @@ -28,7 +28,10 @@ task("manage:registrar:setStratParams") logger.out("Connecting to registrar on specified network..."); const addresses = await getAddresses(hre); const {apTeamMultisigOwners} = await getSigners(hre); - const registrar = Registrar__factory.connect(addresses.registrar.proxy, apTeamMultisigOwners[0]); + const registrar = Registrar__factory.connect( + addresses.registrar.proxy, + apTeamMultisigOwners[0] + ); logger.pad(50, "Connected to Registrar at: ", registrar.address); logger.divider(); diff --git a/tasks/upgrade/upgradeRegistrar.ts b/tasks/upgrade/upgradeRegistrar.ts index 764236469..002306013 100644 --- a/tasks/upgrade/upgradeRegistrar.ts +++ b/tasks/upgrade/upgradeRegistrar.ts @@ -15,7 +15,8 @@ task("upgrade:registrar", "Will upgrade the Registrar (use only on the primary c .addFlag("yes", "Automatic yes to prompt.") .setAction(async (taskArgs: {skipVerify: boolean; yes: boolean}, hre) => { try { - const isConfirmed = taskArgs.yes || (await confirmAction("Upgrading Registrar implementation...")); + const isConfirmed = + taskArgs.yes || (await confirmAction("Upgrading Registrar implementation...")); if (!isConfirmed) { return logger.out("Confirmation denied.", logger.Level.Warn); } @@ -42,7 +43,7 @@ task("upgrade:registrar", "Will upgrade the Registrar (use only on the primary c await updateAddresses( { registrar: { - implementation: registrar.address + implementation: registrar.address, }, }, hre diff --git a/test/core/accounts/AccountsCreateEndowment.ts b/test/core/accounts/AccountsCreateEndowment.ts index c842bab53..36206e632 100644 --- a/test/core/accounts/AccountsCreateEndowment.ts +++ b/test/core/accounts/AccountsCreateEndowment.ts @@ -152,8 +152,6 @@ describe("AccountsCreateEndowment", function () { networkName: "Polygon", registrarContract: registrarFake.address, nextAccountId: expectedNextAccountId, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); diff --git a/test/core/accounts/AccountsDeployContract.ts b/test/core/accounts/AccountsDeployContract.ts index 788ae7cf0..31fa55153 100644 --- a/test/core/accounts/AccountsDeployContract.ts +++ b/test/core/accounts/AccountsDeployContract.ts @@ -72,8 +72,6 @@ describe("AccountsDeployContract", function () { networkName: "Polygon", registrarContract: registrarFake.address, nextAccountId: 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); diff --git a/test/core/accounts/AccountsDepositWithdrawEndowments.ts b/test/core/accounts/AccountsDepositWithdrawEndowments.ts index 0c34f4aa9..dd920b9b9 100644 --- a/test/core/accounts/AccountsDepositWithdrawEndowments.ts +++ b/test/core/accounts/AccountsDepositWithdrawEndowments.ts @@ -130,8 +130,6 @@ describe("AccountsDepositWithdrawEndowments", function () { networkName: "Polygon", registrarContract: registrarFake.address, nextAccountId: 3, // 2 endows already added - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 5, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); }); diff --git a/test/core/accounts/AccountsDonationMatch.ts b/test/core/accounts/AccountsDonationMatch.ts index dc92cacf8..3c3b5138b 100644 --- a/test/core/accounts/AccountsDonationMatch.ts +++ b/test/core/accounts/AccountsDonationMatch.ts @@ -92,8 +92,6 @@ describe("AccountsDonationMatch", function () { networkName: "Polygon", registrarContract: registrarFake.address, nextAccountId: endowId + 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); }); diff --git a/test/core/accounts/AccountsQueryEndowments.ts b/test/core/accounts/AccountsQueryEndowments.ts index 02cbb5ae3..ecfc9a5b3 100644 --- a/test/core/accounts/AccountsQueryEndowments.ts +++ b/test/core/accounts/AccountsQueryEndowments.ts @@ -215,8 +215,6 @@ describe("AccountsQueryEndowments", function () { const configResponse = await facet.queryConfig(); // Assert the expected config - expect(configResponse.earlyLockedWithdrawFee).to.equalFee(config.earlyLockedWithdrawFee); - expect(configResponse.maxGeneralCategoryId).to.equal(config.maxGeneralCategoryId); expect(configResponse.nextAccountId).to.equal(config.nextAccountId); expect(configResponse.owner).to.equal(config.owner); expect(configResponse.registrarContract).to.equal(config.registrarContract); diff --git a/test/core/accounts/AccountsUpdate.ts b/test/core/accounts/AccountsUpdate.ts index b3458d274..f062a07d9 100644 --- a/test/core/accounts/AccountsUpdate.ts +++ b/test/core/accounts/AccountsUpdate.ts @@ -17,8 +17,6 @@ describe("AccountsUpdate", function () { let state: TestFacetProxyContract; let newRegistrar: string; - let maxGeneralCategoryId: number; - let earlyLockedWithdrawFee: LibAccounts.FeeSettingStruct; before(async function () { const signers = await getSigners(hre); @@ -27,11 +25,6 @@ describe("AccountsUpdate", function () { user = signers.deployer; newRegistrar = signers.airdropOwner.address; - maxGeneralCategoryId = 2; - earlyLockedWithdrawFee = { - bps: 2000, - payoutAddress: owner.address, - }; }); beforeEach(async function () { @@ -45,8 +38,6 @@ describe("AccountsUpdate", function () { networkName: "Polygon", registrarContract: ethers.constants.AddressZero, nextAccountId: 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); @@ -81,29 +72,25 @@ describe("AccountsUpdate", function () { describe("updateConfig", () => { it("should update the config when called by the owner", async () => { - expect( - await facet.updateConfig(newRegistrar, maxGeneralCategoryId, earlyLockedWithdrawFee) - ).to.emit(facet, "ConfigUpdated"); + expect(await facet.updateConfig(newRegistrar)).to.emit(facet, "ConfigUpdated"); const config = await state.getConfig(); expect(config.registrarContract).to.equal(newRegistrar); - expect(config.maxGeneralCategoryId).to.equal(maxGeneralCategoryId); - expect(config.earlyLockedWithdrawFee).to.equalFee(earlyLockedWithdrawFee); }); it("should revert when called by a non-owner address", async () => { - await expect( - facet.connect(user).updateConfig(newRegistrar, maxGeneralCategoryId, earlyLockedWithdrawFee) - ).to.be.revertedWith("Unauthorized"); + await expect(facet.connect(user).updateConfig(newRegistrar)).to.be.revertedWith( + "Unauthorized" + ); }); it("should revert when the registrar address is invalid", async () => { const invalidAddress = ethers.constants.AddressZero; - await expect( - facet.updateConfig(invalidAddress, maxGeneralCategoryId, earlyLockedWithdrawFee) - ).to.be.revertedWith("invalid registrar address"); + await expect(facet.updateConfig(invalidAddress)).to.be.revertedWith( + "invalid registrar address" + ); }); }); }); diff --git a/test/core/accounts/AccountsUpdateEndowmentSettingsController.ts b/test/core/accounts/AccountsUpdateEndowmentSettingsController.ts index bcd993298..dbe9a7421 100644 --- a/test/core/accounts/AccountsUpdateEndowmentSettingsController.ts +++ b/test/core/accounts/AccountsUpdateEndowmentSettingsController.ts @@ -63,8 +63,6 @@ describe("AccountsUpdateEndowmentSettingsController", function () { networkName: "", registrarContract: ethers.constants.AddressZero, nextAccountId: 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); diff --git a/test/core/accounts/AccountsUpdateEndowments.ts b/test/core/accounts/AccountsUpdateEndowments.ts index a4f9ee26d..785fa8efb 100644 --- a/test/core/accounts/AccountsUpdateEndowments.ts +++ b/test/core/accounts/AccountsUpdateEndowments.ts @@ -677,8 +677,6 @@ describe("AccountsUpdateEndowments", function () { version: "1", registrarContract: registrarFake.address, nextAccountId: 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); return registrarFake; diff --git a/test/core/accounts/AccountsUpdateStatusEndowments.ts b/test/core/accounts/AccountsUpdateStatusEndowments.ts index 92cc11edc..8e3f1b83b 100644 --- a/test/core/accounts/AccountsUpdateStatusEndowments.ts +++ b/test/core/accounts/AccountsUpdateStatusEndowments.ts @@ -89,8 +89,6 @@ describe("AccountsUpdateStatusEndowments", function () { networkName: "Polygon", registrarContract: registrarFake.address, nextAccountId: accountId + 1, - maxGeneralCategoryId: 1, - earlyLockedWithdrawFee: {bps: 1000, payoutAddress: ethers.constants.AddressZero}, reentrancyGuardLocked: false, }); diff --git a/test/core/router/Router.ts b/test/core/router/Router.ts index 9e82f6988..fdb54f111 100644 --- a/test/core/router/Router.ts +++ b/test/core/router/Router.ts @@ -257,7 +257,7 @@ describe("Router", function () { beforeEach(async function () { router = await deployRouterAsProxy(gateway.address, gasService.address, registrar); await token.mint(gateway.address, 333); - await token.approveFor(gateway.address, router.address, 333) + await token.approveFor(gateway.address, router.address, 333); let collectorBal = await token.balanceOf(collector.address); if (collectorBal.gt(0)) { await token.connect(collector).transfer(deadAddr, collectorBal); @@ -436,7 +436,7 @@ describe("Router", function () { beforeEach(async function () { router = await deployRouterAsProxy(gateway.address, undefined, registrar); // set gas service to undef so that the sendTokens call fails await token.mint(gateway.address, 333); - await token.approveFor(gateway.address, router.address, 333) + await token.approveFor(gateway.address, router.address, 333); let collectorBal = await token.balanceOf(collector.address); if (collectorBal.gt(0)) { await token.connect(collector).transfer(deadAddr, collectorBal); @@ -652,7 +652,7 @@ describe("Router", function () { it("correctly calls depost", async function () { await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); actionData.selector = liquidVault.interface.getSighash("deposit"); let packedData = await packActionData(actionData); await expect( @@ -670,7 +670,7 @@ describe("Router", function () { it("correctly calls redeem via execute", async function () { // Do a deposit first to update the symbol mapping await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); actionData.selector = liquidVault.interface.getSighash("deposit"); let packedData = await packActionData(actionData); await router.executeWithToken( @@ -699,7 +699,7 @@ describe("Router", function () { it("correctly calls redeemAll via execute", async function () { // Do a deposit first to update the symbol mapping await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); actionData.selector = liquidVault.interface.getSighash("deposit"); let packedData = await packActionData(actionData); await router.executeWithToken( @@ -716,7 +716,7 @@ describe("Router", function () { actionData.token = token.address; packedData = await packActionData(actionData); await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); await expect( router.execute( ethers.utils.formatBytes32String("true"), @@ -797,7 +797,7 @@ describe("Router", function () { it("deposits the specified amounts to the specified vaults", async function () { await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); let packedData = packActionData(actionData); await router.executeWithToken( ethers.utils.formatBytes32String("true"), @@ -864,7 +864,7 @@ describe("Router", function () { beforeEach(async function () { router = await deployRouterAsProxy(gateway.address, gasService.address, registrar); await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); actionData.selector = liquidVault.interface.getSighash("deposit"); let packedData = packActionData(actionData); await router.executeWithToken( @@ -1015,7 +1015,7 @@ describe("Router", function () { beforeEach(async function () { router = await deployRouterAsProxy(gateway.address, gasService.address, registrar); await token.mint(gateway.address, LOCKAMT + LIQAMT); - await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT) + await token.approveFor(gateway.address, router.address, LOCKAMT + LIQAMT); actionData.selector = liquidVault.interface.getSighash("deposit"); let packedData = packActionData(actionData); await router.executeWithToken( diff --git a/test/utils/helpers/accounts/defaults.ts b/test/utils/helpers/accounts/defaults.ts index 34db9aef2..73151f6c4 100644 --- a/test/utils/helpers/accounts/defaults.ts +++ b/test/utils/helpers/accounts/defaults.ts @@ -91,9 +91,7 @@ export const DEFAULT_ACCOUNTS_CONFIG: AccountStorage.ConfigStruct = { version: "", registrarContract: ethers.constants.AddressZero, nextAccountId: 0, - maxGeneralCategoryId: 0, reentrancyGuardLocked: false, - earlyLockedWithdrawFee: DEFAULT_FEE_STRUCT, }; export const DEFAULT_NETWORK_INFO: IAccountsStrategy.NetworkInfoStruct = {