# Contracts

**URL:** https://forum.openzeppelin.com/c/support/contracts/18.md

[Latest](https://forum.openzeppelin.com/latest.md) · [Categories](https://forum.openzeppelin.com/categories.md) · [Tags](https://forum.openzeppelin.com/tags.md)

---

## [Review Request: AOXC Upgradeable Token with Inflation Control & Daily Limits](https://forum.openzeppelin.com/t/review-request-aoxc-upgradeable-token-with-inflation-control-daily-limits/45189)

<div class="topic-metadata">

**Author:** [@orcun](https://forum.openzeppelin.com/u/orcun)\
**Replies:** 0\
**Last updated:** [February 2, 2026, 9:47pm UTC](https://forum.openzeppelin.com/t/review-request-aoxc-upgradeable-token-with-inflation-control-daily-limits/45189 "2026-02-02T21:47:14Z")

</div>

\`\`\`solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.33; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contr…

---

## [Install @openzeppelin/community-contracts](https://forum.openzeppelin.com/t/install-openzeppelin-community-contracts/45130)

<div class="topic-metadata">

**Author:** [@AlirezaEthDev](https://forum.openzeppelin.com/u/AlirezaEthDev)\
**Replies:** 2\
**Last updated:** [January 4, 2026, 8:48am UTC](https://forum.openzeppelin.com/t/install-openzeppelin-community-contracts/45130 "2026-01-04T08:48:02Z")

</div>

I need to install @openzeppelin/community-contracts to try MultiSignerERC7913 contract: How can I install the package? I couldn't find it in npmjs.

---

## [Why was the Approval event removed from transferFrom](https://forum.openzeppelin.com/t/why-was-the-approval-event-removed-from-transferfrom/45079)

<div class="topic-metadata">

**Author:** [@andrewwahid](https://forum.openzeppelin.com/u/andrewwahid)\
**Replies:** 0\
**Last updated:** [November 23, 2025, 6:22pm UTC](https://forum.openzeppelin.com/t/why-was-the-approval-event-removed-from-transferfrom/45079 "2025-11-23T18:22:01Z")

</div>

The Approval event used to be emitted whenever an allowance was spent via transferFrom. But a past PR have removed the default behavior of Approval event emission, may I know the rationale behind this since now the allo…

---

## [safeApprove... forever loop with remix](https://forum.openzeppelin.com/t/safeapprove-forever-loop-with-remix/45051)

<div class="topic-metadata">

**Author:** [@EagleDriver](https://forum.openzeppelin.com/u/EagleDriver)\
**Replies:** 0\
**Last updated:** [November 2, 2025, 9:33pm UTC](https://forum.openzeppelin.com/t/safeapprove-forever-loop-with-remix/45051 "2025-11-02T21:33:13Z")

</div>

Smart Contract infinite loop due to safeApprove SafeERC20 I am attempting to fix code that worked under 0.6.6, but now fails under 0.8.30, and no matter what I do, I can't get past the safeApprove-ERC-SafeERC loop I am…

---

## [// The following functions are overrides required by Solidity](https://forum.openzeppelin.com/t/the-following-functions-are-overrides-required-by-solidity/20104)

<div class="topic-metadata">

**Author:** [@nm77](https://forum.openzeppelin.com/u/nm77)\
**Replies:** 4\
**Last updated:** [October 7, 2025, 7:39am UTC](https://forum.openzeppelin.com/t/the-following-functions-are-overrides-required-by-solidity/20104 "2025-10-07T07:39:08Z")

</div>

The contract wizard often creates the statement "// The following functions are overrides required by Solidity" followed by a series of overrides that appear trivial. Why is this done? What happens without these override…

---

## [ERC2771ContextUpgradeable implementation](https://forum.openzeppelin.com/t/erc2771contextupgradeable-implementation/42400)

<div class="topic-metadata">

**Author:** [@Cryptochain\_Italia](https://forum.openzeppelin.com/u/Cryptochain_Italia)\
**Replies:** 8\
**Last updated:** [August 21, 2025, 2:47pm UTC](https://forum.openzeppelin.com/t/erc2771contextupgradeable-implementation/42400 "2025-08-21T14:47:03Z")

</div>

Hello, I am currently working on an ERC721A implementation that utilizes ERC2771ContextUpgradeable for handling meta-transactions. I have a few questions regarding my approach and some related functionalities: Implem…

---

## [About governance contract in version 5.4.0](https://forum.openzeppelin.com/t/about-governance-contract-in-version-5-4-0/44801)

<div class="topic-metadata">

**Author:** [@zenhaditaka](https://forum.openzeppelin.com/u/zenhaditaka)\
**Replies:** 0\
**Last updated:** [August 14, 2025, 2:19pm UTC](https://forum.openzeppelin.com/t/about-governance-contract-in-version-5-4-0/44801 "2025-08-14T14:19:38Z")

</div>

I'm a newcomer in this smart contract world, I want to clarify that this snippet Governance contract need a separated Timelock Controller contract or not :1234: Code to reproduce // SPDX-License-Identifier: MIT // Comp…

---

## [Difference between initializer, reinitializer(1), and reinitializer(2) modifiers](https://forum.openzeppelin.com/t/difference-between-initializer-reinitializer-1-and-reinitializer-2-modifiers/39095)

<div class="topic-metadata">

**Author:** [@tibas](https://forum.openzeppelin.com/u/tibas)\
**Replies:** 8\
**Last updated:** [August 13, 2025, 10:47am UTC](https://forum.openzeppelin.com/t/difference-between-initializer-reinitializer-1-and-reinitializer-2-modifiers/39095 "2025-08-13T10:47:23Z")

</div>

What is the difference between initializer, reinitializer(1), and reinitializer(2) modifiers?

---

## [Creation of ERC20PresetMinterPauser on Remix errored: Cannot convert undefined or null to object](https://forum.openzeppelin.com/t/creation-of-erc20presetminterpauser-on-remix-errored-cannot-convert-undefined-or-null-to-object/4201)

<div class="topic-metadata">

**Author:** [@Triston\_Edwards](https://forum.openzeppelin.com/u/Triston_Edwards)\
**Replies:** 5\
**Last updated:** [August 10, 2025, 10:33pm UTC](https://forum.openzeppelin.com/t/creation-of-erc20presetminterpauser-on-remix-errored-cannot-convert-undefined-or-null-to-object/4201 "2025-08-10T22:33:39Z")

</div>

Hey abcoathup i thought i would try the remix way also (Create an ERC20 using Remix, without writing Solidity)!. :slight\_smile: i get to the 'Deploy the contract' and when i click deploy i get the below message? cre…

---

## [Web3js intagration in html + JS please help me it wont display the ABI array in the browser like I told it to!](https://forum.openzeppelin.com/t/web3js-intagration-in-html-js-please-help-me-it-wont-display-the-abi-array-in-the-browser-like-i-told-it-to/44670)

<div class="topic-metadata">

**Author:** [@Snowpiercer](https://forum.openzeppelin.com/u/Snowpiercer)\
**Replies:** 0\
**Last updated:** [July 28, 2025, 3:45am UTC](https://forum.openzeppelin.com/t/web3js-intagration-in-html-js-please-help-me-it-wont-display-the-abi-array-in-the-browser-like-i-told-it-to/44670 "2025-07-28T03:45:12Z")

</div>

Heres the code please help:

---

## [Plans for Generalization of ERC721](https://forum.openzeppelin.com/t/plans-for-generalization-of-erc721/44618)

<div class="topic-metadata">

**Author:** [@Sebasky](https://forum.openzeppelin.com/u/Sebasky)\
**Replies:** 0\
**Last updated:** [July 23, 2025, 2:58pm UTC](https://forum.openzeppelin.com/t/plans-for-generalization-of-erc721/44618 "2025-07-23T14:58:58Z")

</div>

Are there some plans about generalizing ERC721? Not using \_balances, \_owners directly in \_update would improve flexibility of OpenZeppelin ERC721. It could be used to write optimal code (bitfields/structs). Ideas for i…

---

## [Complex conditional logic for function access with AccessManaged](https://forum.openzeppelin.com/t/complex-conditional-logic-for-function-access-with-accessmanaged/44414)

<div class="topic-metadata">

**Author:** [@miguelmtzinf](https://forum.openzeppelin.com/u/miguelmtzinf)\
**Replies:** 2\
**Last updated:** [July 1, 2025, 9:48am UTC](https://forum.openzeppelin.com/t/complex-conditional-logic-for-function-access-with-accessmanaged/44414 "2025-07-01T09:48:19Z")

</div>

The current AccessManaged contract exposes only the restricted modifier to enforce access control on functions. However, this approach limits flexibility, as it doesn't allow for more complex conditional logic (e.g., "al…

---

## [Error on ERC1967Proxy verification on https://testnet.opbnbscan.com](https://forum.openzeppelin.com/t/error-on-erc1967proxy-verification-on-https-testnet-opbnbscan-com/44097)

<div class="topic-metadata">

**Author:** [@theonekeyg](https://forum.openzeppelin.com/u/theonekeyg)\
**Replies:** 3\
**Last updated:** [May 22, 2025, 11:33am UTC](https://forum.openzeppelin.com/t/error-on-erc1967proxy-verification-on-https-testnet-opbnbscan-com/44097 "2025-05-22T11:33:44Z")

</div>

Hi guys. I'm having issues with contract verification on NodeReal's explorer for opBNB testnet - https://testnet.opbnbscan.com. Error log suggests that the issue is with my configured solidity version (0.8.28) and incom…

---

## [Upgrading OpenZeppelin contracts-upgradeable from v5.x to v5.y](https://forum.openzeppelin.com/t/upgrading-openzeppelin-contracts-upgradeable-from-v5-x-to-v5-y/44068)

<div class="topic-metadata">

**Author:** [@aviggiano](https://forum.openzeppelin.com/u/aviggiano)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 3:00pm UTC](https://forum.openzeppelin.com/t/upgrading-openzeppelin-contracts-upgradeable-from-v5-x-to-v5-y/44068 "2025-05-16T15:00:28Z")

</div>

Hello, I am currently using contracts and contracts-upgradeable v5.0.2 and want to update to the latest v5.3.0 version in order to use EnumerableMap.Bytes32ToAddressMap from v5.1.0. What are the risks from this update? …

---

## [Governor too big?](https://forum.openzeppelin.com/t/governor-too-big/43810)

<div class="topic-metadata">

**Author:** [@kiko](https://forum.openzeppelin.com/u/kiko)\
**Replies:** 0\
**Last updated:** [April 12, 2025, 12:58am UTC](https://forum.openzeppelin.com/t/governor-too-big/43810 "2025-04-12T00:58:22Z")

</div>

Using the contracts wizard, the governor that was created was 31,276 bytes, which is above the ~25,000. Do we need to use via-ir, or is there osmething else I am doing wrong?

---

## [Cannot do ERC20Votes in ERC4626](https://forum.openzeppelin.com/t/cannot-do-erc20votes-in-erc4626/43789)

<div class="topic-metadata">

**Author:** [@kiko](https://forum.openzeppelin.com/u/kiko)\
**Replies:** 0\
**Last updated:** [April 9, 2025, 6:58pm UTC](https://forum.openzeppelin.com/t/cannot-do-erc20votes-in-erc4626/43789 "2025-04-09T18:58:28Z")

</div>

I think I originally posted this in the wrong place, as mainly what I need is some support advice. Here is the post: ERC4626Votes? I have a protocol requirement, and I am wondering if there are any existing solutions t…

---

## [Math.sol line 119 uses ^](https://forum.openzeppelin.com/t/math-sol-line-119-uses/43774)

<div class="topic-metadata">

**Author:** [@tomoglava](https://forum.openzeppelin.com/u/tomoglava)\
**Replies:** 0\
**Last updated:** [April 8, 2025, 11:36am UTC](https://forum.openzeppelin.com/t/math-sol-line-119-uses/43774 "2025-04-08T11:36:29Z")

</div>

Hello, I've been checking some code with slither and it has thrown me a red exploit, regarding openzeppelin Math.sol. I'm using v5.2.0 and this is the exploit: INFO:Detectors: Math.mulDiv(uint256,uint256,uint256) (lib/…

---

## [Differences between scheduled ops using TimelockController and AccessManager](https://forum.openzeppelin.com/t/differences-between-scheduled-ops-using-timelockcontroller-and-accessmanager/43764)

<div class="topic-metadata">

**Author:** [@gnarvaja](https://forum.openzeppelin.com/u/gnarvaja)\
**Replies:** 0\
**Last updated:** [April 7, 2025, 6:19pm UTC](https://forum.openzeppelin.com/t/differences-between-scheduled-ops-using-timelockcontroller-and-accessmanager/43764 "2025-04-07T18:19:38Z")

</div>

Is there a guide or article explaining the differences between using TimelockController and using the built-in support for scheduled operations in the AccessManager contract (OZ 5.x)? The documentation in https://docs.o…

---

## [Block number and timestamp with governor and ivotes](https://forum.openzeppelin.com/t/block-number-and-timestamp-with-governor-and-ivotes/43695)

<div class="topic-metadata">

**Author:** [@novaknole](https://forum.openzeppelin.com/u/novaknole)\
**Replies:** 1\
**Last updated:** [April 1, 2025, 1:02am UTC](https://forum.openzeppelin.com/t/block-number-and-timestamp-with-governor-and-ivotes/43695 "2025-04-01T01:02:46Z")

</div>

I am asking this question because OZ is always my first place to look into and I hope you guys have thought about it. Assume that Governor only works with timestamps, but the same Governor should be used with two IVotes…

---

## [TransparentUpgradeableProxy double admin source](https://forum.openzeppelin.com/t/transparentupgradeableproxy-double-admin-source/43701)

<div class="topic-metadata">

**Author:** [@matadorcro](https://forum.openzeppelin.com/u/matadorcro)\
**Replies:** 1\
**Last updated:** [April 1, 2025, 12:32am UTC](https://forum.openzeppelin.com/t/transparentupgradeableproxy-double-admin-source/43701 "2025-04-01T00:32:22Z")

</div>

Hi, I am researching TransparentUpgradeableProxy and I see it uses immutable variable which is being set to ProxyAdmin address and when upgrading to new implementation this variable is checked to ensure ProxyAdmin initia…

---

## [Best practice for editing Open Zeppelin Import](https://forum.openzeppelin.com/t/best-practice-for-editing-open-zeppelin-import/42687)

<div class="topic-metadata">

**Author:** [@Ish](https://forum.openzeppelin.com/u/Ish)\
**Replies:** 2\
**Last updated:** [March 26, 2025, 6:58pm UTC](https://forum.openzeppelin.com/t/best-practice-for-editing-open-zeppelin-import/42687 "2025-03-26T18:58:10Z")

</div>

Hi, I previously created this topic, but was pointed to the OZ telegram (which is no longer running from what I saw). I am wondering what the best practice is for editing Open Zeppelin imported files? For example, if I …

---

## [Using checkpoints](https://forum.openzeppelin.com/t/using-checkpoints/43607)

<div class="topic-metadata">

**Author:** [@novaknole](https://forum.openzeppelin.com/u/novaknole)\
**Replies:** 1\
**Last updated:** [March 19, 2025, 6:15pm UTC](https://forum.openzeppelin.com/t/using-checkpoints/43607 "2025-03-19T18:15:34Z")

</div>

I wanted to use the Checkpoints Problem is that upperLookUp doesn't return the blockNumber that it found the record with. It only returns value. When user passes \_blockNumber, upperLookUp searches so it finds the lates…

---

## [Is IERC20Upgradeable removed from contracts-upgradeable?](https://forum.openzeppelin.com/t/is-ierc20upgradeable-removed-from-contracts-upgradeable/38088)

<div class="topic-metadata">

**Author:** [@mtzrW3](https://forum.openzeppelin.com/u/mtzrW3)\
**Replies:** 3\
**Last updated:** [March 19, 2025, 6:04pm UTC](https://forum.openzeppelin.com/t/is-ierc20upgradeable-removed-from-contracts-upgradeable/38088 "2025-03-19T18:04:50Z")

</div>

Hi there, I'm working on an upgradeable contract and I just installed contracts 5.0 and contracts-upgradeable 5.0. I noticed that IERC20Upgradeable.sol is no longer in the library. Would the following code be considered…

---

## [Can I retrieve my tokens from this transaction](https://forum.openzeppelin.com/t/can-i-retrieve-my-tokens-from-this-transaction/43597)

<div class="topic-metadata">

**Author:** [@Gittalknayr](https://forum.openzeppelin.com/u/Gittalknayr)\
**Replies:** 11\
**Last updated:** [March 18, 2025, 12:51pm UTC](https://forum.openzeppelin.com/t/can-i-retrieve-my-tokens-from-this-transaction/43597 "2025-03-18T12:51:54Z")

</div>

I believe this it where my tokens went missing. I have no idea about any of this but I have learned a lot. PLEASE tell me that I ca. somehow make the transaction go through or have it returned to my wallet. I think this …

---

## [Difficulty Overriding safeTransferFrom in @openzeppelin/contracts-upgradeable@5.2.0](https://forum.openzeppelin.com/t/difficulty-overriding-safetransferfrom-in-openzeppelin-contracts-upgradeable-5-2-0/43536)

<div class="topic-metadata">

**Author:** [@spiritoftheoutlaw](https://forum.openzeppelin.com/u/spiritoftheoutlaw)\
**Replies:** 3\
**Last updated:** [March 16, 2025, 12:32am UTC](https://forum.openzeppelin.com/t/difficulty-overriding-safetransferfrom-in-openzeppelin-contracts-upgradeable-5-2-0/43536 "2025-03-16T00:32:44Z")

</div>

Dear OpenZeppelin Support Team, I am writing to request assistance regarding an issue I am experiencing while developing an upgradeable ERC721 token intended to be soulbound (i.e., non-transferrable except for burning).…

---

## [ReentrancyGuard vs ReentrancyGuardTransient gas saving](https://forum.openzeppelin.com/t/reentrancyguard-vs-reentrancyguardtransient-gas-saving/43320)

<div class="topic-metadata">

**Author:** [@gabkov](https://forum.openzeppelin.com/u/gabkov)\
**Replies:** 5\
**Last updated:** [February 28, 2025, 3:15pm UTC](https://forum.openzeppelin.com/t/reentrancyguard-vs-reentrancyguardtransient-gas-saving/43320 "2025-02-28T15:15:46Z")

</div>

So I tried to check how much gas I can save if I use ReentrancyGuardTransient instead of ReentrancyGuard and for most of the tests it seems like it's around ~2000 gas or less. Based on my understanding this should be a l…

---

## [Using ERC165 supportsInterface() causes MetaMask and Etherscan Warnings](https://forum.openzeppelin.com/t/using-erc165-supportsinterface-causes-metamask-and-etherscan-warnings/43317)

<div class="topic-metadata">

**Author:** [@NethDote](https://forum.openzeppelin.com/u/NethDote)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 11:19am UTC](https://forum.openzeppelin.com/t/using-erc165-supportsinterface-causes-metamask-and-etherscan-warnings/43317 "2025-02-26T11:19:22Z")

</div>

I have a contract that uses ERC165Checker. My goal is to have the user enter an address as a function parameter, and I want the contract code to determine if that address is ERC-721 or not. The issue (although this may b…

---

## [Should ReentrancyGuard be always initialized in an upgradable contract? Will the protection work when not initialized?](https://forum.openzeppelin.com/t/should-reentrancyguard-be-always-initialized-in-an-upgradable-contract-will-the-protection-work-when-not-initialized/43238)

<div class="topic-metadata">

**Author:** [@Sol\_Ch](https://forum.openzeppelin.com/u/Sol_Ch)\
**Replies:** 6\
**Last updated:** [February 14, 2025, 8:47am UTC](https://forum.openzeppelin.com/t/should-reentrancyguard-be-always-initialized-in-an-upgradable-contract-will-the-protection-work-when-not-initialized/43238 "2025-02-14T08:47:21Z")

</div>

Hello. Is reentancy attack possible if ReentrancyGuardUpgradeable is inherited in a contract but not intialized through including \_\_ReentrancyGuard\_init() into initialize()?

---

## [The identity precompile can be used to bypass ERC-1271 signature checks](https://forum.openzeppelin.com/t/the-identity-precompile-can-be-used-to-bypass-erc-1271-signature-checks/43133)

<div class="topic-metadata">

**Author:** [@karmacoma](https://forum.openzeppelin.com/u/karmacoma)\
**Replies:** 4\
**Last updated:** [February 13, 2025, 4:55pm UTC](https://forum.openzeppelin.com/t/the-identity-precompile-can-be-used-to-bypass-erc-1271-signature-checks/43133 "2025-02-13T16:55:59Z")

</div>

address(4) is the identity precompile, it returns whatever data it was called with. Calling isValidSignature(bytes32,bytes) on address(4) will return the selector of isValidSignature(bytes32,bytes) plus whatever argument…

---

## [ERC20Snapshot Alternative in new OZ Library](https://forum.openzeppelin.com/t/erc20snapshot-alternative-in-new-oz-library/38137)

<div class="topic-metadata">

**Author:** [@Recursive](https://forum.openzeppelin.com/u/Recursive)\
**Replies:** 22\
**Last updated:** [January 29, 2025, 5:58pm UTC](https://forum.openzeppelin.com/t/erc20snapshot-alternative-in-new-oz-library/38137 "2025-01-29T17:58:17Z")

</div>

Hi Everyone. In my smart contract, I want to take a snapshot time to time to save all the holders balances for future usage. I was aiming to use ERC20Snapshot but I can see that it has been removed. From my research, …

[Next page](https://forum.openzeppelin.com/c/support/contracts/18.md?page=1)
