Questions tagged [openzeppelin-contracts]

OpenZeppelin Contracts is a library for secure smart contract development. It provides implementations of standards like ERC20 and ERC721 which you can deploy as-is or extend to suit your needs, as well as Solidity components to build custom contracts and more complex decentralized systems.

Filter by
Sorted by
Tagged with
0 votes
0 answers
50 views

Anti Sniper / anti Snipe Bot for newly listed token on pancakeswap

Can Somebody explain how to have Bot Protection enabled against sniper bot for a token contract which is going to launch on pancakeswap or on any other decentralised exchange. do we have to create ...
Bhushan Dhiware's user avatar
1 vote
1 answer
45 views

OZ transparent upgradeable proxy admin reverts when trying upgrade an implementation

I have this transparent upgradeable proxy deployed on sepolia - 0x2dFC2A866eac363cAFF516b5ce7aCd6bae1F21C1 This is the admin contract - 0x6d429719f78b146892403d06df677afa6f968d91 When I try to call ...
Zartaj Afser's user avatar
  • 2,230
1 vote
0 answers
23 views

Handling Conflicting @openzeppelin/contracts Versions in Hardhat Project

I am currently working on a Hardhat project that requires the integration of two custom dependencies, namely custom-dep-a and custom-dep-b. Unfortunately, these two dependencies rely on different ...
MShakeG's user avatar
  • 1,443
0 votes
0 answers
14 views

Issues in the ERC20 token Contract burn

I was just going through this contract and that the _balances[account] is being deducted before the require statement. Is this still correct? also there was no else and seemed like it will be ...
Priyanshu Dwivedi's user avatar
0 votes
1 answer
29 views

Problem with "Openzeppelin ERC20Votes delegate function"

I hope you're doing great. I have been tinkering with ERC20Votes and creating a DAO for my Vendor contract. The issue I'm facing is that whenever I try to delegate my GovernanceToken contract to the ...
Hassan Ahmad's user avatar
0 votes
1 answer
9 views

new release of ERC1155SupplyUpgradeale has compilation issues

The new contracts lib from OZ, specifically ERC1155UspplyUpgradeable has compilation issues before even inheriting it in any child contract (check screenshot below) any idea why? or how to fix it? ...
sasha's user avatar
  • 41
0 votes
0 answers
8 views

Construction of OpenZeppelin voting contract with ٍERC777 token

I managed to easily create governor and implement voting with erc20 token, but now I have erc777 token that I need to do this with, please guide me how I can I have to do this because when I introduce ...
Mehran Ra's user avatar
  • 491
0 votes
1 answer
31 views

OpenZeppelin: Update UUPS proxy contract

I have such proxy: import { upgrades } from "hardhat"; proxy = await upgrades.deployProxy( Contract, [ address, flags, ], { initializer: "...
Meldum's user avatar
  • 173
0 votes
1 answer
27 views

Does the OpenZeppelin nonReentrant modifier block calling all functions that have the modifier on them, or it keeps a separate state for each function

Would the nonReentrant modifier from the OpenZeppelin ReentrancyGuard library prevent the user from calling stake() when the unstake() function hasn't yet been fully processed (in the example below)? ...
Mila A's user avatar
  • 264
1 vote
0 answers
63 views

Create3 deployment with proxy contract ownership?

I have deployed an upgradable proxy contract with create3factory from solmate. In my contract i transfer ownership to an address. But still the owner ship is not on that address. Its a differant ...
Furkan Sezal's user avatar
0 votes
0 answers
24 views

Ethernaut Challenge: GateKeeper Three | Is it possible to solve this challenge using proxy?

I read online and understand the solution to this challenge. I decided to experiment and solve this challenge using a proxy instead. As per my understanding of proxies and delegate call, the following ...
Shubham Sharma's user avatar
0 votes
0 answers
18 views

Reverted with reason string 'Governor: unknown proposal id

I using Governor contract from Openzeppelin. I have create the proposal and voted on the proposal. The state of proposal is succeeded. When I am trying to queue the proposal I am getting error ...
Sagar Atalatti's user avatar
0 votes
0 answers
17 views

How can one OZ Transparent Proxy access data from another OZ Transparent proxy?

Scenario: I have two proxies: Root Proxy, this is created during deployment Secondary proxies, this is created at start of each transaction, and is initialized with the context of the transaction ...
Somjit's user avatar
  • 265
1 vote
1 answer
62 views

Property 'PROPOSER_ROLE' does not exist on type 'BaseContract'

TimeLock contract extends from TimelockController from OpenZeppelin Contracts. contract TimeLock is TimelockController { constructor( uint256 minDelay, address[] memory proposers, ...
Sagar Atalatti's user avatar
1 vote
1 answer
396 views

Property 'address' does not exist on type 'BaseContract'

I have TimeLock contract that extends TimelockController from OpenZeppelin contracts: contract TimeLock is TimelockController { constructor( uint256 minDelay, address[] memory proposers, ...
Sagar Atalatti's user avatar
0 votes
1 answer
25 views

Issue with DynamicSvgNft Contract: getHighSVG() and getLowSVG() Functions Returning Incorrect Values

Hello Stack Exchange community! I am currently working on a project that involves an NFT contract called DynamicSvgNft. The contract is designed to change the SVG image URI of the NFT based on a ...
Web3Phoenix's user avatar
0 votes
1 answer
18 views

1155URIStorage not available in npm package but is available on OpenZeppelin Github

I can import import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol"; on Remix. But it throws an error in Hardhat. I have attached a picture of node_modules and it ...
Pankaj Jagtap's user avatar
0 votes
0 answers
13 views

Doubt on upgradeable contract in Ethereum

I am testing upgradeable contract using foundry. The code is: //SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import 'forge-std/Test.sol'; import '../src/A.sol'; import '../src/B.sol'; import ...
Hacek 's user avatar
  • 665
0 votes
2 answers
62 views

UUPS proxy and file level constants, enums and structs compatibility

If i use UUPS upgradeable pattern and i define a couple of constants, enums and structs at the contract level, will those values still be available after an upgrade? I have 3 contracts and all 3 are ...
gabkov's user avatar
  • 103
0 votes
1 answer
20 views

How to limit canceller role in OpenZeppelin governance?

In openzeppelin governance contracts, a proposal can be cancelled by a wallet that has the canceller role. As the deployer of the DAO, I want to ensure the security of my DAO, hence I want to be able ...
MehmedB's user avatar
  • 253
2 votes
1 answer
277 views

Do we need OpenZeppelin's Counter with Solidiity 8 any more?

According to Solidity documentation: Prior to Solidity 0.8.0, arithmetic operations would always wrap in case of under- or overflow leading to widespread use of libraries that introduce additional ...
Alexander Herranz's user avatar
1 vote
1 answer
68 views

Is there still any reason to use SafeERC20Upgradeable with the ERC20Upgradeable?

From the ERC20Upgradeable docs: "We have followed general OpenZeppelin Contracts guidelines: functions revert instead returning false on failure. This behavior is nonetheless conventional and ...
noncy 's user avatar
  • 11
0 votes
0 answers
25 views

Openzeppalin Governance wizard reuturns "ProviderError: max code size exceeded"

openzeppalin wizard Governance error i am using the copy and pasted code from openzeppalin for there governance smartcontract but returns error smart contract // SPDX-License-Identifier: MIT pragma ...
jia-ayo's user avatar
0 votes
0 answers
16 views

How to know if it is the correct address and calldata when holders call the propose function?

The propose function in the governance contract from OZ can receive any random address and calldata. When the proposal is executed with the execution function in timeLockcontroller from OZ, the ...
DHC's user avatar
  • 313
0 votes
0 answers
36 views

What are the pros and cons of using OpenZeppelin ERC20Votes?

I want to use this extension for an ERC20 token. What are the pros and cons (if any) of adding this to it?
Falcon Stakepool's user avatar
0 votes
0 answers
251 views

Different address using Create2 due to difference in byteCode(type(ERC1967Proxy).creationCode and ethers.getContractFactory("ERC1967Proxy").bytecode

I am currently facing an issue while trying to calculate the address of a SimpleAccount contract using getCreate2Address() from ethers.utils in JavaScript. I noticed that the address I receive is ...
kannu's user avatar
  • 11
0 votes
1 answer
248 views

How can i pass constructor args to test solidity contracts in Hardhat?

I am using openzepplin with role based access control to create erc-20 token constructor(address minter, address burner) ERC20("ArtPlace Token", "ARTP") { _mint(msg.sender, ...
Ri dev's user avatar
  • 1
0 votes
0 answers
25 views

how to clone (minimal proxy pattern) a governance contract from OpenZeppelin

I am trying to clone oz's governance contract. However, it looks very complicated. Many contracts are inherited, and there are some values are set up in their constructors. In this case, how am I ...
DHC's user avatar
  • 313
0 votes
0 answers
18 views

How can I make my solidity skill too strong?

I am solidity developer and have been coding in solidity for 6 months. I have made 6-7 projects with solidity. I want to make my solidity skill very strong. Give me some tips how can I do it?
Hacek 's user avatar
  • 665
1 vote
1 answer
48 views

Help me to make my idea clean on initializer, reinitializer and disableinitializer

Openzeppelin has a solidity script initializable.sol which has some modifiers and internal functions. I wanna clear my idea on these. I am describing what i know about it, correct me if i am wrong. ...
Hacek 's user avatar
  • 665
0 votes
1 answer
253 views

Derived contract must override function "supportsInterface". Two or more base classes define function with same name and parameter types

TypeError: Derived contract must override function "supportsInterface". Two or more base classes define function with same name and parameter types. --> royalty.sol:9:1: | 9 | contract ...
soumyadeep.eth's user avatar
0 votes
1 answer
36 views

how to receive values from openzeppelin royaltyInfo function

trying to implement like this uint[2] memory royalty = royaltyInfo(_tokenId, price); payable(royalty[0]).transfer(royalty[1]); but getting error TypeError: Different number of components on the left ...
soumyadeep.eth's user avatar
0 votes
0 answers
17 views

how to use onlyGovernance modifier?

I want to use onlyGovernance modifier in my contracts. I have a governance contract but I want to use this modifier that is not a governance contract. I want to use it so I can restrict some of my ...
MehmedB's user avatar
  • 253
1 vote
1 answer
252 views

onlyInitializing vs initializer in OpenZeppelin Upgradeable Contracts

I'm reading the OpenZeppelin documentation about upgradeable contracts, and I'm getting a bit confused with these modifiers: initializer onlyInitializing I think I understand how initializer works. ...
Alexander Herranz's user avatar
0 votes
1 answer
246 views

When should I use ReentrancyGuard in a smart contract?

I am looking at the ReentrancyGuard smart contract from Open Zeppelin and I don't understand when I have to use it. Is it necessary in all my smart contracts or do I only have to add it in some ...
Falcon Stakepool's user avatar
1 vote
1 answer
30 views

Can a diamond Contract be cloned?

Error: invalid address or ENS name (argument="name", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.7.0) So this is the error that occured. I am trying to implement diamond ...
Prajan Bhattarai's user avatar
1 vote
1 answer
43 views

@openzeppelin/contracts import failed

The issue I am having is when I am trying to compile my contract, I am getting multiple errors for ERC721. As imported ERC721 is importing more contracts, as seen from the errors, the issue is that it ...
Hasbik645's user avatar
3 votes
1 answer
395 views

How many storage gaps to add at the end of Base Upgradeable Contracts?

I have read about adding Storage gaps at the end of Base Upgradeable Contracts for reserving storage slots. More detailed explaination in Openzeppelin Docs here. But what is the exact amount of ...
Pankaj Jagtap's user avatar
3 votes
1 answer
471 views

What are Hooks and How are they used? Went thorough the explanation on the topic but can't wrap my head around it

So in the ERC720 contract there is a _transfer function which is calling a hook named _beforeTokenTransfer(). As we see in the image _beforeTokenTransfer is called and I understand it may be calling ...
Pratik Jussal's user avatar
3 votes
2 answers
85 views

Is there anything called conditional access control in solidity?

So here is my problem . I have 2 users of my DApp : Admin and User Admin is the contract owner and can access admin panel of my DApp . User is a normal user having something like a conditional access ....
Gaurav Pant's user avatar
2 votes
1 answer
157 views

Can I change Openzeppelin access control without having the right permissions?

If you check this link: openzeppelin github access control you will notice they use 2 function for granting a role: function grantRole(bytes32 role, address account) public virtual override onlyRole(...
Crypto Man's user avatar
2 votes
2 answers
668 views

Expected string literal (path), "*" or alias list

// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol&...
nacerme's user avatar
  • 23
0 votes
1 answer
78 views

Why the default mint() signatures in OpenZeppelin's ERC1155 wizard use "onlyOwner" modifier?

If you visit OpenZeppelin's ERC1155 wizard (https://wizard.openzeppelin.com/#erc1155) and check the "Mintable" checkbox, two functions will be created in the contract: function mint(address ...
errata's user avatar
  • 139
2 votes
1 answer
2k views

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/utils' is not defined by "exports" in node_modules\ethers\package.json

Hello everyone I am trying to deploy my ERC721Upgradeable NFT Marketplace Smart Contracts in the local hardhat network but I am getting a error regarding it. I am using Openzeppelin's Upgradeable ...
Nirban Chakraborty's user avatar
0 votes
0 answers
38 views

To hash or not to hash strings for bytes32 AccessControl roles

Is there a preferred/safest way to declare roles for Openzeppelin's AccessControl.sol? I would imagine a straight assignment of a bytes32 from a string would be sufficient for role creation as long as ...
JasonGarcia.eth's user avatar
0 votes
1 answer
95 views

Getting error while making ERC721 soul bound

I am making a soul-bound NFT using openzeppelin and foundry in solidity ^0.8.13 And for that, I am overriding the _beforeTokenTransfer but on that function, I am getting an error. Function has ...
Mohit's user avatar
  • 124
1 vote
1 answer
57 views

Read value from DelegateCall

I would like to implement a whitelist using AccessControl of openzeppelin. Let's say I have the following setup: Contract A: It's doing some stuff but only for users that are whitelisted. // SPDX-...
alex's user avatar
  • 11
1 vote
1 answer
114 views

How to permission the initialize function in upgradeable contracts?

From what I understand, for UUPS proxies: the proxy contract is ERC1967Proxy.sol from OpenZeppelin Contracts and the implementation contract should inherit from UUPSUpgradeable.sol in OpenZeppelin ...
Ryan Sea's user avatar
  • 608
0 votes
1 answer
163 views

how to implement a crowdsale using the current version of openzeppelin 4.X

I develop smart contracts and I really like to use openzeppelin libraries for this, I know how to implement ICO using Crowdsale.sol contract from openzeppelin, but there is no such contract in the ...
Lll Cilician's user avatar
0 votes
0 answers
74 views

Generate EDSCA recoverable signature for use with OpenZeppelin EDSCA contract (Embedded/C/C++ Hardware wallet)

I'd like to sign a message on an Arduino-compatible microcontroller, and create a recoverable signature which can be used with EIP-191 and Ethereum's erecover / OpenZeppelin's ECDSA smart contracts to ...
xtools's user avatar
  • 101

1
2 3 4 5
7