unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.11.1

41 Views Asked by At

I'm running some tests on a withdraw and burn function for a token I am releasing but receive the error above

this is the section of my code

    describe("Tax and Burning", function () {
        beforeEach(async function () {
            await Token.launch();
            await Token.transfer(user1.address, ethers.parseUnits("10000", 18)); // To ensure there's enough balance
        });

        it("allows the owner to withdraw accumulated tax", async function () {
            const initialContractBalance = await Token.balanceOf(Token.address);
            const taxAmount = await Token.balanceOf(Token.address);
            await Token.withdrawTax(owner.address, taxAmount);
            const finalContractBalance = await Token.balanceOf(Token.address);
            expect(finalContractBalance).to.equal(initialContractBalance.sub(taxAmount));
        });

        it("allows the owner to burn tokens", async function () {
            const initialTotalSupply = await Token.totalSupply();
            const burnAmount = await Token.balanceOf(Token.address);
            await Token.burnTax(burnAmount);
            const finalTotalSupply = await Token.totalSupply();
            expect(finalTotalSupply).to.equal(initialTotalSupply.sub(burnAmount));
        });
    });
});

This is the error response i get TypeError: unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.11.1)

I am looking to test out the withdraw and burn function where the contract collects tokens from tax. I am using hardhat.

0

There are 0 best solutions below