# Contracts

**URL:** https://forum.openzeppelin.com/c/support/contracts/18.md?page=1

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

**Page:** 2

---

## [How to handle conflicting @openzeppelin/contracts versions originating from npm packages](https://forum.openzeppelin.com/t/how-to-handle-conflicting-openzeppelin-contracts-versions-originating-from-npm-packages/40999)

<div class="topic-metadata">

**Author:** [@andrewwahid](https://forum.openzeppelin.com/u/andrewwahid)\
**Replies:** 4\
**Last updated:** [January 20, 2025, 3:24pm UTC](https://forum.openzeppelin.com/t/how-to-handle-conflicting-openzeppelin-contracts-versions-originating-from-npm-packages/40999 "2025-01-20T15:24:01Z")

</div>

I currently import both @account-abstraction v0.6 and v0.7 in my hardhat project, using the following: "@account-abstraction-06": "git+https://github.com/eth-infinitism/account-abstraction.git#v0.6.0", "@account-abstrac…

---

## [ERC721Consecutive - Change tokenId](https://forum.openzeppelin.com/t/erc721consecutive-change-tokenid/34700)

<div class="topic-metadata">

**Author:** [@aisyahis](https://forum.openzeppelin.com/u/aisyahis)\
**Replies:** 4\
**Last updated:** [December 13, 2024, 9:28am UTC](https://forum.openzeppelin.com/t/erc721consecutive-change-tokenid/34700 "2024-12-13T09:28:18Z")

</div>

Is it possible to change the tokenId to begin at 1 instead of 0 when using ERC721Consecutive?

---

## [Convention for Proxy specific methods](https://forum.openzeppelin.com/t/convention-for-proxy-specific-methods/42443)

<div class="topic-metadata">

**Author:** [@gnarvaja](https://forum.openzeppelin.com/u/gnarvaja)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 7:43pm UTC](https://forum.openzeppelin.com/t/convention-for-proxy-specific-methods/42443 "2024-12-05T19:43:00Z")

</div>

I'm working on a custom proxy, that inherits from ERC-1967 Proxy contract. In this custom proxy, I need to define some external methods. If the name of those methods is the same as the methods of the implementation cont…

---

## [Clarification on override Keyword Usage in ERC20 Functions (name, symbol, decimals)](https://forum.openzeppelin.com/t/clarification-on-override-keyword-usage-in-erc20-functions-name-symbol-decimals/42427)

<div class="topic-metadata">

**Author:** [@armgit5](https://forum.openzeppelin.com/u/armgit5)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 9:21am UTC](https://forum.openzeppelin.com/t/clarification-on-override-keyword-usage-in-erc20-functions-name-symbol-decimals/42427 "2024-12-05T09:21:22Z")

</div>

I have encountered a potential concern regarding the use of the override keyword in the name, symbol, and decimals functions of the ERC20 contract. According to best practices, the override keyword should be used to ensu…

---

## [5.1 AccessManager / onlyAuthorized modifier](https://forum.openzeppelin.com/t/5-1-accessmanager-onlyauthorized-modifier/42050)

<div class="topic-metadata">

**Author:** [@p0pps](https://forum.openzeppelin.com/u/p0pps)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 4:28pm UTC](https://forum.openzeppelin.com/t/5-1-accessmanager-onlyauthorized-modifier/42050 "2024-12-04T16:28:37Z")

</div>

I have extended the 5.0 accessManager and want to set permissions on new functions to control with roles from the AccessManager itself. I came up with the following modifer... modifier selfGuarded() { (boo…

---

## [FailedInnerCall issue](https://forum.openzeppelin.com/t/failedinnercall-issue/41468)

<div class="topic-metadata">

**Author:** [@Praveen\_A\_maticz](https://forum.openzeppelin.com/u/Praveen_A_maticz)\
**Replies:** 1\
**Last updated:** [November 29, 2024, 5:53pm UTC](https://forum.openzeppelin.com/t/failedinnercall-issue/41468 "2024-11-29T17:53:57Z")

</div>

Hi, i am using ERC2771 for gasless transaction. When the transactions being queued transactions is getting error like this how to fix this @team

---

## [Cant find \`Math\` library in openzeppelin/contracts-upgradeable/contracts/utils/math](https://forum.openzeppelin.com/t/cant-find-math-library-in-openzeppelin-contracts-upgradeable-contracts-utils-math/38732)

<div class="topic-metadata">

**Author:** [@Abelaby](https://forum.openzeppelin.com/u/Abelaby)\
**Replies:** 7\
**Last updated:** [November 29, 2024, 5:53pm UTC](https://forum.openzeppelin.com/t/cant-find-math-library-in-openzeppelin-contracts-upgradeable-contracts-utils-math/38732 "2024-11-29T17:53:18Z")

</div>

I wanted to use the math library for upgradeable contracts but I cant seem to find it in the repo, interestingly the readme talks about the library in utils but the math folder itself is not visible. I cant find the mat…

---

## [Why OZ uses safecast for block.timestamp?](https://forum.openzeppelin.com/t/why-oz-uses-safecast-for-block-timestamp/42330)

<div class="topic-metadata">

**Author:** [@Giorgi\_Lagidze](https://forum.openzeppelin.com/u/Giorgi_Lagidze)\
**Replies:** 1\
**Last updated:** [November 29, 2024, 5:50pm UTC](https://forum.openzeppelin.com/t/why-oz-uses-safecast-for-block-timestamp/42330 "2024-11-29T17:50:34Z")

</div>

In OpenZeppelin's code, we read: SafeCast.toUint48(block.timestamp) I wonder what's the reason of using safecast and why would it be wrong to write: uint48(block.timestamp). I understand that if block.timestamp for …

---

## [Governor not emits the sender](https://forum.openzeppelin.com/t/governor-not-emits-the-sender/42314)

<div class="topic-metadata">

**Author:** [@Giorgi\_Lagidze](https://forum.openzeppelin.com/u/Giorgi_Lagidze)\
**Replies:** 1\
**Last updated:** [November 26, 2024, 11:22am UTC](https://forum.openzeppelin.com/t/governor-not-emits-the-sender/42314 "2024-11-26T11:22:42Z")

</div>

Looking at the Governor, I realize that ProposalCanceled and ProposalQueued doesn't emit the sender. Using the ethers's transaction.from in js gives the address that initiated the tx from the beginning - meaning that if…

---

## [ERC20PresetMinterPauser is no longer available?](https://forum.openzeppelin.com/t/erc20presetminterpauser-is-no-longer-available/42239)

<div class="topic-metadata">

**Author:** [@jmartinez34](https://forum.openzeppelin.com/u/jmartinez34)\
**Replies:** 1\
**Last updated:** [November 21, 2024, 12:58am UTC](https://forum.openzeppelin.com/t/erc20presetminterpauser-is-no-longer-available/42239 "2024-11-21T00:58:36Z")

</div>

I am following the OpenZeppelin documentation and I found that ERC20 contract had a preset called ERC20PresetMinterPauser but when I try to work with it importing it like: import "@openzeppelin/contracts/token/ERC20/pres…

---

## [Cairo ERC20 contract not being read by browser wallet on Sepolia](https://forum.openzeppelin.com/t/cairo-erc20-contract-not-being-read-by-browser-wallet-on-sepolia/41905)

<div class="topic-metadata">

**Author:** [@z\_attax](https://forum.openzeppelin.com/u/z_attax)\
**Replies:** 2\
**Last updated:** [October 28, 2024, 5:08pm UTC](https://forum.openzeppelin.com/t/cairo-erc20-contract-not-being-read-by-browser-wallet-on-sepolia/41905 "2024-10-28T17:08:00Z")

</div>

I'm using an open zepplin ERC20 cairo contract component but my browser wallet(braavos and argent) isn't reading the values when I use a byte array for the name and symbol or the balance\_of when it's a u256. I've change…

---

## [Upgrade (layout) compatibility between OZ 4.x and 5.x](https://forum.openzeppelin.com/t/upgrade-layout-compatibility-between-oz-4-x-and-5-x/41915)

<div class="topic-metadata">

**Author:** [@gnarvaja](https://forum.openzeppelin.com/u/gnarvaja)\
**Replies:** 2\
**Last updated:** [October 26, 2024, 4:42am UTC](https://forum.openzeppelin.com/t/upgrade-layout-compatibility-between-oz-4-x-and-5-x/41915 "2024-10-26T04:42:02Z")

</div>

I wanted to check if there's upgrade compatibility between OZ Contracts 4.x and 5.x, or in which contracts the compatibility was preserved and which is wasn't. I want to migrate some contracts that use ERC4626 and Acces…

---

## [ERC4626 share inflation when removing assets](https://forum.openzeppelin.com/t/erc4626-share-inflation-when-removing-assets/41780)

<div class="topic-metadata">

**Author:** [@Anelito](https://forum.openzeppelin.com/u/Anelito)\
**Replies:** 5\
**Last updated:** [October 8, 2024, 11:30am UTC](https://forum.openzeppelin.com/t/erc4626-share-inflation-when-removing-assets/41780 "2024-10-08T11:30:33Z")

</div>

I noticed a problem with ERC4626 shares when removing assets without adjusting the total number of minted shares (bad debt socialisation). Imagine a single-token share vault following the ERC4626 standard. The share pri…

---

## [P256 release date?](https://forum.openzeppelin.com/t/p256-release-date/41136)

<div class="topic-metadata">

**Author:** [@TtheBC01](https://forum.openzeppelin.com/u/TtheBC01)\
**Replies:** 3\
**Last updated:** [October 3, 2024, 3:38pm UTC](https://forum.openzeppelin.com/t/p256-release-date/41136 "2024-10-03T15:38:36Z")

</div>

I was going to try out the new P256.sol implementation that recently got merged into the OZ master branch. However, it does not appear to be in the npmjs package yet. Anyone know when it might make it into a package r…

---

## [DEFAULT\_ADMIN\_ROLE functionality in Cairo](https://forum.openzeppelin.com/t/default-admin-role-functionality-in-cairo/41695)

<div class="topic-metadata">

**Author:** [@Fernando\_Velazquez](https://forum.openzeppelin.com/u/Fernando_Velazquez)\
**Replies:** 2\
**Last updated:** [October 3, 2024, 11:26am UTC](https://forum.openzeppelin.com/t/default-admin-role-functionality-in-cairo/41695 "2024-10-03T11:26:39Z")

</div>

Hello dear all, In the Cairo documentation related to Access Control https://docs.openzeppelin.com/contracts-cairo/0.15.0/access it states that the DEFAULT\_ADMIN\_ROLE acts as the default admin role for all roles. An acc…

---

## [I'm Receiving a warning compiler messages](https://forum.openzeppelin.com/t/im-receiving-a-warning-compiler-messages/14343)

<div class="topic-metadata">

**Author:** [@CarlosVFA](https://forum.openzeppelin.com/u/CarlosVFA)\
**Replies:** 2\
**Last updated:** [September 30, 2024, 5:58pm UTC](https://forum.openzeppelin.com/t/im-receiving-a-warning-compiler-messages/14343 "2024-09-30T17:58:24Z")

</div>

I'm new to all of this, and have no clue about what to do. Compiler specific version warnings: my contract: 0x56d515dd97F7913C935905e25A96b8504697bb93

---

## [How to verify UUPSUpgradeable proxy on BSC mainnet](https://forum.openzeppelin.com/t/how-to-verify-uupsupgradeable-proxy-on-bsc-mainnet/11892)

<div class="topic-metadata">

**Author:** [@wang\_longhong](https://forum.openzeppelin.com/u/wang_longhong)\
**Replies:** 8\
**Last updated:** [September 29, 2024, 10:27pm UTC](https://forum.openzeppelin.com/t/how-to-verify-uupsupgradeable-proxy-on-bsc-mainnet/11892 "2024-09-29T22:27:06Z")

</div>

:1234: Code to reproduce https://bscscan.com/address/0xe29f0b490f0d89ca7acac1c7bed2e07ecad65201 I have deployed uupsupgradeable proxy on bsc mainnet. but i am not sure how i can verify proxy contract. Anyone plese hel…

---

## [How to: ERC-1155 ID Substitution for Token URI](https://forum.openzeppelin.com/t/how-to-erc-1155-id-substitution-for-token-uri/3312)

<div class="topic-metadata">

**Author:** [@Jshanks21](https://forum.openzeppelin.com/u/Jshanks21)\
**Replies:** 25\
**Last updated:** [September 29, 2024, 10:33am UTC](https://forum.openzeppelin.com/t/how-to-erc-1155-id-substitution-for-token-uri/3312 "2024-09-29T10:33:34Z")

</div>

I haven’t encountered any issues yet. But I’m not sure I understand how to implement ID substitution for this token standard. If I understand correctly, the metadata URI within the 1155 contract could be a string like "…

---

## [PaymentSplitter Contract with existing NFT's](https://forum.openzeppelin.com/t/paymentsplitter-contract-with-existing-nfts/17502)

<div class="topic-metadata">

**Author:** [@scoot556](https://forum.openzeppelin.com/u/scoot556)\
**Replies:** 5\
**Last updated:** [September 25, 2024, 11:51am UTC](https://forum.openzeppelin.com/t/paymentsplitter-contract-with-existing-nfts/17502 "2024-09-25T11:51:57Z")

</div>

Hi all, Currently I'm picking up a project which is just a basic NFT marketplace. The current implementation has payment splitting through two-three web3.send functions (depending on the split) and I want to make use of…

---

## [USDT locked in a contract that has a withdraw token function](https://forum.openzeppelin.com/t/usdt-locked-in-a-contract-that-has-a-withdraw-token-function/32154)

<div class="topic-metadata">

**Author:** [@George\_George](https://forum.openzeppelin.com/u/George_George)\
**Replies:** 6\
**Last updated:** [September 22, 2024, 1:05am UTC](https://forum.openzeppelin.com/t/usdt-locked-in-a-contract-that-has-a-withdraw-token-function/32154 "2024-09-22T01:05:34Z")

</div>

i've had some usdt locked in a contract, and i'm not able to withdraw them even though i've added a safe withdraw function here's the tx function: and here's the withdraw function inside the contract function with…

---

## [Can I set a switch for the 721 contract to only allow minting but not trading?](https://forum.openzeppelin.com/t/can-i-set-a-switch-for-the-721-contract-to-only-allow-minting-but-not-trading/41591)

<div class="topic-metadata">

**Author:** [@li\_chad](https://forum.openzeppelin.com/u/li_chad)\
**Replies:** 1\
**Last updated:** [September 20, 2024, 12:28am UTC](https://forum.openzeppelin.com/t/can-i-set-a-switch-for-the-721-contract-to-only-allow-minting-but-not-trading/41591 "2024-09-20T00:28:10Z")

</div>

I want to make a 721 contract, which can be minted at the specified time, but cannot be traded during the minting time. Is there any simple way to achieve this?

---

## [Shall I include \`initialize/initializeVx\` selectors in the supportsInterface?](https://forum.openzeppelin.com/t/shall-i-include-initialize-initializevx-selectors-in-the-supportsinterface/41449)

<div class="topic-metadata">

**Author:** [@Giorgi\_Lagidze](https://forum.openzeppelin.com/u/Giorgi_Lagidze)\
**Replies:** 1\
**Last updated:** [September 17, 2024, 1:32pm UTC](https://forum.openzeppelin.com/t/shall-i-include-initialize-initializevx-selectors-in-the-supportsinterface/41449 "2024-09-17T13:32:29Z")

</div>

Hi Team, I was wondering if you could give your advice about Upgradeable Contracts. We're heavily using OZ. As you know, OZ's abstract contracts have functions such as \_\_init... for example: function \_\_ERC20\_init(strin…

---

## [ERC20Wrapper Tutorial Error "Identifier not found or not unique."](https://forum.openzeppelin.com/t/erc20wrapper-tutorial-error-identifier-not-found-or-not-unique/41552)

<div class="topic-metadata">

**Author:** [@Ali\_Ercan\_Ozgokce](https://forum.openzeppelin.com/u/Ali_Ercan_Ozgokce)\
**Replies:** 2\
**Last updated:** [September 7, 2024, 2:59pm UTC](https://forum.openzeppelin.com/t/erc20wrapper-tutorial-error-identifier-not-found-or-not-unique/41552 "2024-09-07T14:59:47Z")

</div>

Getting error on ERC20Wrapper tutorial My Contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Wrapper.sol"; import "@openzeppelin/contracts/to…

---

## [Cannot find ReentrancyGuard in @openzeppelin/contracts/security](https://forum.openzeppelin.com/t/cannot-find-reentrancyguard-in-openzeppelin-contracts-security/38710)

<div class="topic-metadata">

**Author:** [@Gord\_Mead](https://forum.openzeppelin.com/u/Gord_Mead)\
**Replies:** 3\
**Last updated:** [August 30, 2024, 7:23pm UTC](https://forum.openzeppelin.com/t/cannot-find-reentrancyguard-in-openzeppelin-contracts-security/38710 "2024-08-30T19:23:30Z")

</div>

I am working with hardhat and ihave installed both @openzeppelin/hardhat-updates and @openzeppelin/contracts. However when try to run npm hardhat test i get an error because @openzeppelin/contracts/security/Reentrancy…

---

## [Setup Counter to start at 1](https://forum.openzeppelin.com/t/setup-counter-to-start-at-1/13457)

<div class="topic-metadata">

**Author:** [@gorrita](https://forum.openzeppelin.com/u/gorrita)\
**Replies:** 5\
**Last updated:** [August 24, 2024, 10:23am UTC](https://forum.openzeppelin.com/t/setup-counter-to-start-at-1/13457 "2024-08-24T10:23:51Z")

</div>

Hello guys, I need my NFT collection start with token number 1. Sorry if it's something to simple, I'm just starting with code. // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/t…

---

## [How \_setRoleAdmin works?](https://forum.openzeppelin.com/t/how-setroleadmin-works/41397)

<div class="topic-metadata">

**Author:** [@eeshenggoh](https://forum.openzeppelin.com/u/eeshenggoh)\
**Replies:** 0\
**Last updated:** [August 20, 2024, 2:47pm UTC](https://forum.openzeppelin.com/t/how-setroleadmin-works/41397 "2024-08-20T14:47:15Z")

</div>

I'm confused with this post, gonna leave here fore future reference: AccessControl Role-Based Control, unable to grant desired role? From these codes, please clarify my understanding. function \_setupRoles(address a…

---

## [【Wanted Help・ ERC2771 Forwarder】 write code Metatrasactions'S test code](https://forum.openzeppelin.com/t/wanted-help-erc2771-forwarder-write-code-metatrasactionss-test-code/39469)

<div class="topic-metadata">

**Author:** [@HarukiKondo](https://forum.openzeppelin.com/u/HarukiKondo)\
**Replies:** 8\
**Last updated:** [August 21, 2024, 2:25pm UTC](https://forum.openzeppelin.com/t/wanted-help-erc2771-forwarder-write-code-metatrasactionss-test-code/39469 "2024-08-21T14:25:46Z")

</div>

I would like to prepare a test code for a smart contract using @openzeppelin/contracts/metatx/ERC2771Forwarder.sol. I have created a test code referring to the file under the test folder, but an error occurs in the veri…

---

## [AccessControl Role-Based Control, unable to grant desired role?](https://forum.openzeppelin.com/t/accesscontrol-role-based-control-unable-to-grant-desired-role/9311)

<div class="topic-metadata">

**Author:** [@GenerallySpeaking](https://forum.openzeppelin.com/u/GenerallySpeaking)\
**Replies:** 6\
**Last updated:** [August 20, 2024, 2:54pm UTC](https://forum.openzeppelin.com/t/accesscontrol-role-based-control-unable-to-grant-desired-role/9311 "2024-08-20T14:54:39Z")

</div>

Hi everyone, I’m very new to learning Ethereum and employing Smart Contract and I am facing an issue regarding AccessControl that is not able to grant a role to other blocks, despite having an admin role. From the Docs: …

---

## [Help with verify and publish code on bscan](https://forum.openzeppelin.com/t/help-with-verify-and-publish-code-on-bscan/40865)

<div class="topic-metadata">

**Author:** [@ArakelTheDragon](https://forum.openzeppelin.com/u/ArakelTheDragon)\
**Replies:** 7\
**Last updated:** [August 18, 2024, 9:23am UTC](https://forum.openzeppelin.com/t/help-with-verify-and-publish-code-on-bscan/40865 "2024-08-18T09:23:18Z")

</div>

Hi! I hope this is the correct place to post my question. I tried this post, but couldn't get the verification to work: I made an ERC20 token with the OZ wizard(permit is not included), 100 000 000 tokens preminted, se…

---

## [UUPSUpgradeable and AccessManaged](https://forum.openzeppelin.com/t/uupsupgradeable-and-accessmanaged/41142)

<div class="topic-metadata">

**Author:** [@rjn3t](https://forum.openzeppelin.com/u/rjn3t)\
**Replies:** 2\
**Last updated:** [August 13, 2024, 5:08am UTC](https://forum.openzeppelin.com/t/uupsupgradeable-and-accessmanaged/41142 "2024-08-13T05:08:48Z")

</div>

I am developing a contract that extends both UUPSUpgradeable and AccessManaged. I would like to restrict access to the upgrade function by overriding \_authorizeUpgrade like so: function \_authorizeUpgrade(address) in…

[Previous page](https://forum.openzeppelin.com/c/support/contracts/18.md)

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