Questions tagged [openzeppelin]

OpenZeppelin provides tools to write, deploy and operate decentralized applications. It also protects leading organizations by performing security audits on their systems and products.

OpenZeppelin provides tools to write, deploy and operate decentralized applications.

It also protects leading organizations by performing security audits on their systems and products.

237 questions
0
votes
1 answer

In solidity, what's the need of verifying 'address(this)' is a contract?

In openzeppelin's Initializable.sol library(v4.7.0), there is a modifier initializer() that checks if a function has already been initialized. In the require statement, it checks the value of _initialized which I understand. But in addition, it also…
0
votes
1 answer

OpenZeppelin onlyOwner modifier doesn't work properly

In the Remix, getICOMembers function works appropriately and returns all members of a specific ICO type after they are added to the icoMembers mapping. mapping(uint256 => address[]) private icoMembers; function getICOMembers(uint256 _icoType)…
0
votes
0 answers

Why should I inherit a interface instead of inheriting its contract in solidity?

I'm learning the usage of interface in solidity, and I think its most usage is to provide a API for other contract or Dapp to call. I also notice a lot of contract inherit the interface. I wonder what is the advantage for a contract to inherit the…
0
votes
1 answer

When calling a smart contract function, do the params record on blockchain?

I want to build a smart contract function, which use caller's password as params. I have no knowledge about blockchain security, so I ask the following question: When calling a smart contract function, do the params record on blockchain? Further…
0
votes
1 answer

How to call the function of another smart contract in Solidity? With an example of OpenZeppelin transferOwnership function

When I'm learning OpenZeppelin, I found its Ownable library has a function transferOwnership, which can give the owner of current contract to an address. I can understand change owner to an account address of someone, however, it can also change…
Huowuge
  • 41
  • 5
0
votes
1 answer

Solidity, Can Attacker bypass a internal functions?

I'm thinking about my smart contract and want to have a secure contract. But I really don't know that internal functions are safe or not. This is a very BASIC contract that uses OpenZeppelin contracts: contract MyContract is ERC20 { constructor…
Milad Jafari
  • 1,135
  • 1
  • 11
  • 28
0
votes
1 answer

OpenZeppelin ERC721URIStorage _setTokenURI

i'm trying to create a smart contract for minting NFT's. When i try to import and use _setTokenUri from OpenZeppelin, there is an error accours in Remix ide says that "Undeclared identifier". I wonder why, so here is my code ; pragma solidity…
evilmerto
  • 36
  • 5
0
votes
0 answers

Solve the 'max size limit exceeded' warning for openzeppelin's governor contract wizard

I generated a contract for governance based on the wizard provided by openzeppelin here: https://wizard.openzeppelin.com/#governor I didn't change any values in the fields and tried compiling the contract in hardhat. But it throws the below…
0
votes
1 answer

Linearization of inheritance graph impossible

// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import…
S M
  • 5
  • 2
0
votes
1 answer

cannot import ERC1155Burnable from openzeppelin library

// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import…
S M
  • 5
  • 2
0
votes
1 answer

how can I solve library @openzeppelin/contracts, imported from contracts/VotingContract.sol, is not installed

i run this command "npx hardhat run scripts/deploy.js --network localhost"get this error Error HH411: The library @openzeppelin/contracts, imported from contracts/VotingContract.sol, is not installed. Try installing it using npm. I have install…
0
votes
0 answers

Override `_authorizeUpgrade` when composing two upgradeable solidity contracts

I am missing something conceptually about override the _authorizeUpgrade function when composing two contracts. The setting is that I have two contracts, both upgradeable, as follows: contract ERC721UpgradeableV1 is Initializable, ERC721Upgradeable,…
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
0
votes
0 answers

Is there any way of load a json file with metadata from different elements in a smart contract?

I am trying to create a smart contract following the erc721 standard. I have a json file with different tokens metadata and I need to load this tokens in the smart contract. The owner should be the user that load the file and this way I should be…
P00
  • 11
  • 4
0
votes
2 answers

Installing Solidity Dependencies with Foundry

I can't build my smart contract using Foundry because my dependency isn't recognized. According to the documentation I have run the command forge install openzeppelin/openzeppelin-contracts Then I added the following line in the remapping.txt…
Mabel Oza
  • 557
  • 8
  • 22
0
votes
1 answer

Restricting the release() function in OpenZeppelin PaymentSplitter, Solidity

The OpenZeppelin PaymentSplitter contract has a release() function that sends ETH out to account holders. It's a public virtual function. But, if I go to override it, it won't compile b/c it's got private vars inside. My ultimate goal is to restrict…
Jim Dee
  • 51
  • 7