Skip to content
Business logic Audit finding Beginner

Enabling transfer restrictions permanently blocks minting and burning

The whitelist restriction contract blocks transfers involving the zero address, which is used by ERC20 for minting and burning. When transfer restrictions are enabled, minting and burning become impossible, permanently disabling those functions.

rajaroy43 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

51502 sc low enabling transfer restrictions permanently blocks minting and burning

Submitted on Aug 3rd 2025 at 12:55:14 UTC by @rajaroy43 for Attackathon | Plume Network

Description

Brief/Intro

The WhitelistRestrictions.sol contract incorrectly implements its transfer validation logic by failing to account for the ERC20 standard's use of the zero address (address(0)) for minting and burning operations. When transfer restrictions are enabled, this flaw makes it impossible to mint new tokens or burn existing ones. In a production environment, this would permanently disable critical protocol functionalities, break the token's economic model, and halt any operations that depend on changing the total supply, such as token sales, rewards distribution, or deflationary mechanisms.

Vulnerability Details

The vulnerability exists within the isTransferAllowed function of the WhitelistRestrictions.sol contract. When transfer restrictions are active (transfersAllowed == false), the function requires both the from and to addresses to be on the whitelist for a transfer to be approved.

The logic is as follows:

{% code title="WhitelistRestrictions.sol (relevant snippet)" %}

Solidity
function isTransferAllowed(address from, address to, uint256 /*amount*/ ) external view override returns (bool) {
    WhitelistStorage storage ws = _getWhitelistStorage();

    // If transfers are unrestricted, allow all transfers
    if (ws.transfersAllowed) {
        return true;
    }

    // Otherwise, only allow if both the sender and receiver are whitelisted
    return ws.isWhitelisted[from] && ws.isWhitelisted[to];
}

{% endcode %}

https://github.com/plumenetwork/contracts/blob/main/arc/src/restrictions/WhitelistRestrictions.sol#L110

However, the ERC20 standard defines special cases for the zero address:

  • Minting: a transfer from address(0).
  • Burning: a transfer to address(0).

The WhitelistRestrictions contract correctly prevents address(0) from being added to the whitelist, meaning ws.isWhitelisted[address(0)] will always be false.

When an associated token contract (like ArcToken) attempts to _mint or _burn, its _update hook calls this isTransferAllowed function.

  • For a mint, isTransferAllowed(address(0), ...) is called → evaluates to false.
  • For a burn, isTransferAllowed(..., address(0)) is called → evaluates to false.

Consequently, the token's _update function reverts the transaction, effectively blocking all minting and burning as long as the whitelist restriction is active.

Impact Details

Permanent Functional Denial of Service: The mint() and burn() functions become completely and permanently unusable whenever the whitelist feature is activated. There is no way to perform these actions without disabling the restrictions entirely, defeating the purpose of the module.

References

Proof of Concept

{% stepper %} {% step %}

Enable transfer restrictions

Admin enables transfer restrictions:

Solidity
vm.prank(admin);
vulnerableRestrictions.setTransfersAllowed(false);

{% endstep %}

{% step %}

Expect revert on mint

We expect the mint call to revert because from is address(0):

Solidity
vm.expectRevert("TransferRestricted()");

{% endstep %}

{% step %}

Attempt to mint

Attempt to mint, which triggers the flawed isTransferAllowed check:

Solidity
token.mint(userA, 100 ether);

{% endstep %} {% endstepper %}

The original report as published on Immunefi, by rajaroy43. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

The target is ArcToken.sol in the Plume Network Attackathon repository. The token's _update hook calls isTransferAllowed in WhitelistRestrictions.sol, which checks a transfersAllowed flag. In restricted mode, only addresses on a whitelist should be able to move tokens.

The report is filed as a low severity smart contract finding with the impact "Permanent freezing of funds". The flaw is not in the token itself but in how the restriction module treats the zero address, which ERC20 uses as the counterparty for minting and burning.

Setup

The report does not describe a deployment, toolchain or test harness beyond the cheatcodes used in the proof of concept (vm.prank, vm.expectRevert). The relevant actors are:

  • An admin, who can call setTransfersAllowed on the restrictions contract.
  • A user, userA, who receives minted tokens in the proof of concept.
  • The token contract, ArcToken, whose _update hook consults the restrictions contract on every balance change.

The precondition for the bug is simply that transfer restrictions are enabled, that is, transfersAllowed == false in the whitelist storage.

Finding it

The researcher looked at isTransferAllowed in WhitelistRestrictions.sol and noticed that when restrictions are active it requires both the sender and the receiver to be whitelisted:

Solidity
function isTransferAllowed(address from, address to, uint256 /*amount*/ ) external view override returns (bool) {
    WhitelistStorage storage ws = _getWhitelistStorage();

    // If transfers are unrestricted, allow all transfers
    if (ws.transfersAllowed) {
        return true;
    }

    // Otherwise, only allow if both the sender and receiver are whitelisted
    return ws.isWhitelisted[from] && ws.isWhitelisted[to];
}

That logic is correct for ordinary transfers between two holders, but ERC20 defines two special cases where one side of the transfer is the zero address: a mint is a transfer from address(0), and a burn is a transfer to address(0). The restrictions contract also prevents address(0) from ever being added to the whitelist, so ws.isWhitelisted[address(0)] is always false. The conjunction therefore always fails for mints and burns while restrictions are on.

Exploitation

The proof of concept is a three-step test showing that a mint reverts once restrictions are enabled.

Step 1: Enable transfer restrictions

The admin turns restrictions on:

Solidity
vm.prank(admin);
vulnerableRestrictions.setTransfersAllowed(false);

From this point every balance change goes through the whitelist check.

Step 2: Expect revert on mint

The test declares that the mint call must fail with a specific error:

Solidity
vm.expectRevert("TransferRestricted()");

It encodes the researcher's expectation that the failure surfaces from the restriction check rather than from some unrelated condition.

Step 3: Attempt to mint

The mint itself:

Solidity
token.mint(userA, 100 ether);

Minting calls _mint, which routes through the token's _update hook. The hook calls isTransferAllowed(address(0), ...). Because ws.transfersAllowed is false, the function evaluates ws.isWhitelisted[address(0)] && ws.isWhitelisted[userA]. The first operand is always false, so the whole expression is false, the hook reverts, and the mint fails with TransferRestricted(). The same reasoning applies in reverse to a burn, where to is address(0).

Root cause

The restriction module applies a two-party whitelist rule to every call of isTransferAllowed without exempting the zero address. ERC20 treats address(0) as the source for minting and the destination for burning, so those two operations are indistinguishable from a transfer involving a non-whitelisted party under the current check. The contract's own defence, refusing to whitelist address(0), guarantees that the check can never pass for a mint or a burn.

Nothing in the module distinguishes supply-changing operations from ordinary transfers, so the existing whitelist logic does not stop the bug; it causes it. The report does not describe any other guard in ArcToken that would bypass the hook for mints and burns.

Impact

While transfer restrictions are active, mint() and burn() are unusable: every call reverts in _update. The report frames this as a permanent functional denial of service, because there is no way to mint or burn without disabling the restrictions entirely, which defeats the purpose of the module. In a production deployment this would disable operations that depend on changing the total supply, such as token sales, rewards distribution or deflationary mechanisms, and break the token's economic model.

The impact is conditional on the administrator enabling restrictions. The report classifies the finding as low severity.

Fix

The report does not propose a specific patch.

Variants to test

  • Any token that routes _update or _beforeTokenTransfer through an external restriction or compliance contract: enable the restriction and attempt a mint and a burn. A positive result is a revert on both operations while ordinary whitelisted transfers still succeed.
  • Restriction modules that check both parties against an allowlist, a blocklist or a country list: look for the same missing zero-address exemption. A positive result is a mint or burn that reverts with the restriction error.
  • Modules that reject address(0) when populating the list, as this one does: that design choice turns a missing exemption into a guaranteed failure rather than an edge case, so it is worth checking first.
  • Pause or freeze mechanisms layered on the same hook: confirm whether supply-changing operations are exempted there too, since the same reasoning applies to any check that inspects both sides of a transfer.

Hunting notes

This class of bug hides in peripheral modules that a token calls on every balance change: whitelists, sanctions lists, transfer hooks and compliance wrappers. During review, the signal is a validation function that takes from and to and applies a symmetric rule to both, with no branch for address(0). Cross-check it against the token's _update path and against any code that refuses to register the zero address in the list.

The impact argument that makes the finding credible is concrete: the report names the exact functions affected (mint() and burn()), the exact condition (restrictions enabled), and the operational consequences (token sales, rewards, deflationary mechanisms). A short Foundry test that enables the restriction and shows the mint reverting with the expected error is enough to demonstrate it without a live deployment.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

The report concerns a token contract, ArcToken.sol, in the Plume Network Attackathon repository. Tokens like this are usually built on a common blueprint called ERC20, which is a set of rules that every token follows so that wallets and exchanges know how to handle it. One of the rules in that blueprint is that new tokens are created by a special operation called a mint, and tokens are destroyed by another called a burn. Under the hood, both of these are written as if they were ordinary transfers: a mint is a transfer from a special empty address (the zero address), and a burn is a transfer to that same empty address.

The Plume token has an extra feature bolted on: a whitelist. A whitelist is simply a list of addresses that are allowed to do something. When the administrator switches the whitelist on, only addresses on the list should be able to send or receive tokens. The token itself does not do this check; it asks a separate helper contract, WhitelistRestrictions.sol, every time a balance is about to change.

The researcher, rajaroy43, found that this helper contract checks both sides of every transfer against the whitelist, including the empty zero address. But the zero address can never be on the whitelist, because the contract deliberately refuses to add it. So once the whitelist is switched on, every mint and every burn is rejected, because one side of the transfer is always the zero address. The token can no longer create or destroy tokens at all. The report calls this "permanent freezing of funds" and rates it low severity, because it only happens when the administrator turns the whitelist on.

This is a beginner-friendly walkthrough of that report. It explains every idea from scratch, then goes through the code the researcher looked at and the test they wrote to prove the problem.

The pieces involved

Before looking at the bug, it helps to know what each part of the system is.

  • A smart contract is a small program that lives on a blockchain. Once deployed, anyone can call its functions, and the code runs exactly as written. Think of it as a vending machine: you press a button, it does a fixed thing, and nobody can change the machine's behaviour afterwards.
  • A token contract is a smart contract that keeps a table of who owns how many tokens. ArcToken.sol is the token contract here.
  • ERC20 is the standard blueprint for such tokens. It defines functions like transfer, and the convention that the zero address (address(0)) stands for "nobody". Creating tokens is a transfer from nobody; destroying them is a transfer to nobody.
  • The zero address is the address made of all zeros. It is not a real wallet; nobody holds the private key for it. It is used purely as a placeholder.
  • A whitelist is a list of addresses that are allowed to do something. In this token, the whitelist decides who may move tokens when restrictions are on.
  • A restrictions module is a separate contract that the token asks for permission. WhitelistRestrictions.sol is that module.
  • A hook is a function the token calls automatically at a certain moment. ArcToken has an _update hook that runs on every balance change, and that hook is where the restrictions module gets consulted.
  • A revert is how a smart contract says "no". When a function reverts, the whole transaction is cancelled, no state changes, and any tokens sent along are returned. It is like a shop till refusing a card: nothing is charged.
  • Foundry is a toolkit for writing and running tests against smart contracts. Its tests are written in Solidity, the same language as the contracts, and it provides cheatcodes, special functions that let a test pretend to be a particular user or expect a particular failure.

The setup

The report does not describe a deployment, a toolchain or a test harness beyond the cheatcodes used in the proof of concept. The relevant actors are:

  • An admin, who can call setTransfersAllowed on the restrictions contract.
  • A user, userA, who receives minted tokens in the proof of concept.
  • The token contract, ArcToken, whose _update hook consults the restrictions contract on every balance change.

The only precondition for the bug is that transfer restrictions are enabled, that is, transfersAllowed == false in the whitelist storage. Note the slightly confusing naming: the flag is called transfersAllowed, and setting it to false means transfers are not allowed, which is the restricted mode.

Finding it

The researcher looked at the isTransferAllowed function in WhitelistRestrictions.sol. This is the function the token calls to ask "may this transfer happen?". When restrictions are active, it requires both the sender and the receiver to be whitelisted:

Solidity
function isTransferAllowed(address from, address to, uint256 /*amount*/ ) external view override returns (bool) {
    WhitelistStorage storage ws = _getWhitelistStorage();

    // If transfers are unrestricted, allow all transfers
    if (ws.transfersAllowed) {
        return true;
    }

    // Otherwise, only allow if both the sender and receiver are whitelisted
    return ws.isWhitelisted[from] && ws.isWhitelisted[to];
}

Line by line:

  1. function isTransferAllowed(address from, address to, uint256 /*amount*/ ) external view override returns (bool) { declares a function that takes the sender's address (from), the receiver's address (to) and an amount. The amount is commented out with /*amount*/, meaning it is accepted but not used. external means it can be called from outside the contract, view means it does not change any data, and returns (bool) means it answers with true or false.
  2. WhitelistStorage storage ws = _getWhitelistStorage(); fetches the contract's stored settings, the whitelist itself and the on/off flag, into a local variable called ws.
  3. if (ws.transfersAllowed) { checks the flag. If transfers are allowed (open mode), the next line runs.
  4. return true; says yes to everything in open mode.
  5. return ws.isWhitelisted[from] && ws.isWhitelisted[to]; is the restricted path. It looks up the sender in the whitelist and the receiver in the whitelist, and only answers true if both lookups are true. The && means "and": both sides must be true.

That logic is correct for ordinary transfers between two holders. But ERC20 defines two special cases where one side of the transfer is the zero address: a mint is a transfer from address(0), and a burn is a transfer to address(0). The restrictions contract also prevents address(0) from ever being added to the whitelist, so ws.isWhitelisted[address(0)] is always false. The "and" therefore always fails for mints and burns while restrictions are on.

A useful comparison: imagine a nightclub with a guest list. The rule "both the person leaving and the person entering must be on the list" works fine for normal guests. But the club also has a back door used by the brewery to deliver beer (a mint) and by the rubbish truck to take waste away (a burn). The brewery and the rubbish truck are not people and can never be on the guest list, so the bouncer turns them away, and the club slowly runs out of beer and fills up with rubbish.

Exploitation

The proof of concept is a three-step test showing that a mint reverts once restrictions are enabled. It is not an attack by an outsider; it is a demonstration that a normal, intended operation stops working.

Step 1: Enable transfer restrictions

The admin turns restrictions on:

Solidity
vm.prank(admin);
vulnerableRestrictions.setTransfersAllowed(false);

Line by line:

  1. Without it, the test itself would be the caller, and the contract might reject the call because the test address is not the admin.
  2. vulnerableRestrictions.setTransfersAllowed(false); calls the restrictions contract and sets the flag to false. Because the flag is named transfersAllowed, false means transfers are not allowed, which is the restricted mode. From this point every balance change goes through the whitelist check.

Why this step: the bug only exists in restricted mode, so the test must first put the contract into that mode.

Step 2: Expect revert on mint

The test declares that the mint call must fail with a specific error:

Solidity
vm.expectRevert("TransferRestricted()");

Line by line:

  1. If the next call succeeds, or fails with a different message, the test itself fails.

Why this step: it encodes the researcher's expectation that the failure comes from the restriction check, not from some unrelated problem such as a wrong address or insufficient balance. It pins down the cause.

Step 3: Attempt to mint

The mint itself:

Solidity
token.mint(userA, 100 ether);

Line by line:

  1. token.mint(userA, 100 ether); asks the token contract to create 100 new tokens and give them to userA. The ether suffix is a unit multiplier in Solidity; here it just scales the number, and the exact amount does not matter to the bug.

What happens inside: minting calls _mint, which routes through the token's _update hook. The hook calls isTransferAllowed(address(0), ...). Because ws.transfersAllowed is false, the function evaluates ws.isWhitelisted[address(0)] && ws.isWhitelisted[userA]. The first operand is always false, so the whole expression is false, the hook reverts, and the mint fails with TransferRestricted(). The same reasoning applies in reverse to a burn, where to is address(0).

Root cause

The restriction module applies a two-party whitelist rule to every call of isTransferAllowed without exempting the zero address. ERC20 treats address(0) as the source for minting and the destination for burning, so those two operations are indistinguishable from a transfer involving a non-whitelisted party under the current check. The contract's own defence, refusing to whitelist address(0), guarantees that the check can never pass for a mint or a burn.

Nothing in the module distinguishes supply-changing operations from ordinary transfers, so the existing whitelist logic does not stop the bug; it causes it. The report does not describe any other guard in ArcToken that would bypass the hook for mints and burns.

In plain terms: the bouncer was given one rule and applies it to everyone, including the brewery and the rubbish truck, and the club's own policy of never putting non-people on the guest list means the bouncer can never be satisfied.

Impact

While transfer restrictions are active, mint() and burn() are unusable: every call reverts in _update. The report frames this as a permanent functional denial of service, because there is no way to mint or burn without disabling the restrictions entirely, which defeats the purpose of the module. In a production deployment this would disable operations that depend on changing the total supply, such as token sales, rewards distribution or deflationary mechanisms, and break the token's economic model.

A denial of service, in security language, means making a service unavailable to its legitimate users. Here it is not an attacker flooding the system; it is the system's own rules making a feature impossible to use. The impact is conditional on the administrator enabling restrictions. The report classifies the finding as low severity.

Fix

The report does not propose a specific patch.

In the nightclub comparison: the bouncer should wave the brewery and the rubbish truck straight through, because they are not guests and the guest list was never meant for them.

Variants to test

These are the same kinds of places to look for the same mistake in other projects:

  • Any token that routes _update or _beforeTokenTransfer through an external restriction or compliance contract: enable the restriction and attempt a mint and a burn. A positive result is a revert on both operations while ordinary whitelisted transfers still succeed.
  • Restriction modules that check both parties against an allowlist, a blocklist or a country list: look for the same missing zero-address exemption. A positive result is a mint or burn that reverts with the restriction error.
  • Modules that reject address(0) when populating the list, as this one does: that design choice turns a missing exemption into a guaranteed failure rather than an edge case, so it is worth checking first.
  • Pause or freeze mechanisms layered on the same hook: confirm whether supply-changing operations are exempted there too, since the same reasoning applies to any check that inspects both sides of a transfer.

Hunting notes

This class of bug hides in peripheral modules that a token calls on every balance change: whitelists, sanctions lists, transfer hooks and compliance wrappers. During review, the signal is a validation function that takes from and to and applies a symmetric rule to both, with no branch for address(0). Cross-check it against the token's _update path and against any code that refuses to register the zero address in the list.

The impact argument that makes the finding credible is concrete: the report names the exact functions affected (mint() and burn()), the exact condition (restrictions enabled), and the operational consequences (token sales, rewards, deflationary mechanisms). A short Foundry test that enables the restriction and shows the mint reverting with the expected error is enough to demonstrate it without a live deployment.

Glossary

  • Address: a unique identifier for a wallet or contract on a blockchain, written as a long hexadecimal string.
  • Admin: the account with permission to change settings, here the one that can switch transfer restrictions on or off.
  • Blockchain: a shared, append-only record of transactions that many computers keep in sync.
  • Burn: destroying tokens, implemented in ERC20 as a transfer to the zero address.
  • Cheatcode: a special function in the Foundry test framework (prefixed vm.) that lets a test pretend to be a user or expect a failure.
  • Denial of service: making a service or feature unavailable to its legitimate users.
  • ERC20: the common standard that defines how fungible tokens behave, including the transfer function and the zero-address convention for minting and burning.
  • Foundry: a toolkit for writing and running tests against smart contracts, using Solidity and cheatcodes.
  • Hook: a function a contract calls automatically at a certain moment, such as on every balance change.
  • Mint: creating new tokens, implemented in ERC20 as a transfer from the zero address.
  • Revert: cancelling a transaction because a condition failed; no state changes and any sent value is returned.
  • Severity: a rating of how serious a finding is, here low.
  • Smart contract: a program deployed on a blockchain that runs exactly as written and can be called by anyone.
  • Solidity: the programming language used to write smart contracts on Ethereum-style blockchains.
  • Token: a digital asset managed by a smart contract, with a table of who owns how many.
  • Total supply: the total number of tokens in existence at a given moment.
  • Transfer restrictions: a mode in which only approved addresses may move tokens.
  • Whitelist: a list of addresses that are allowed to do something.
  • Zero address: the address made of all zeros, used as a placeholder for "nobody" in minting and burning.

More by rajaroy43

View all

1 more disclosed report, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.