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
4
votes
0 answers

How to implement multiple inheritance with OpenZeppelin upgradeable contracts?

I'm trying to convert an existing non-upgradeable contract that has multiple inheritance into an upgradeable one. I'm following the tutorial at https://docs.openzeppelin.com/contracts/4.x/upgradeable and the only thing I've found in docs is the…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
4
votes
1 answer

What is the benefit of using uncheked?

In OpenZeppelin ERC20 implementation, there is a _transfer method: function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); …
invisiblecat
  • 125
  • 1
  • 10
4
votes
3 answers

totalsupply() is not a function openzeppelin contracts

I'm trying to import some contract files from open zeppelin so my solidity smart contracts can inherit their functionality, when trying to write chai tests that run on my smart contracts at compile time I get an error in my chai test. 3 passing…
luther wardle
  • 439
  • 5
  • 17
4
votes
3 answers

Importing openzeppelin in hardhat contracts error

I am attempting to deploy a contract with some @openzeppelin/contracts imports. The Contract: pragma solidity ^0.8.0; import "../node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import…
YourNewEmpire
  • 153
  • 3
  • 9
3
votes
1 answer

erc20 claim token transfer function doesn't work

I have this contract and trying to call the claimFreeToken function. Contract already doesn't have enough tokens but the function doesn't return an error and also token doesn't receive. Where did I overlook it? // SPDX-License-Identifier: MIT pragma…
3
votes
1 answer

How to detect emit in a receiving contract using hardhat?

I'm trying to replicate expectEvent.inTransaction() from @openzeppelin/test-helpers for hardhat. The scenario: token is transfering from owner to receiverContract. I want to check that receiverContract emitted a Received event. The transaction looks…
wongz
  • 3,255
  • 2
  • 28
  • 55
3
votes
1 answer

Easy way to view a list of the tokens owned by a user?

I'm sure this could be done on the front end as well as from solidity. I saw a few posts that seemed inefficient, where they are creating a new mapping and storing unnecessary data to the blockchain when the ERC721 package already has the functions…
Matt Jaf
  • 339
  • 2
  • 8
3
votes
0 answers

Initialize a upgradeable contract through a contract

I want to make a factory contract that can deploy upgradeable children contracts. But then I am confused with who is the actual owner of the proxy contract when I want to upgrade the children contract later. So if the ownership of the children's…
Hoi Nam
  • 33
  • 2
3
votes
1 answer

Solidity: Is there a way to get VSCode Intellisense for imported contracts?

I'm a Solidity newbie getting his feet wet. I am following along with a YouTube ERC721 tutorial. The tutorial has me calling functions imported from "@openzeppelin". I was wondering if there is a way to get intellisense to show the interface of…
3
votes
2 answers

Error when trying to deploy standard OpenZeppelin ERC777 contract to ganache-cli using the brownie framework

I am familiarizing myself with smart contract development using the brownie framework and solidity. To start of I was using the brownie console to deploy some standard OpenZeppelin token contracts. I did this by copying the code right from their…
Andre
  • 41
  • 1
3
votes
0 answers

Solidity - Convert override method to payable with OpenZeppelin

I'm implementing the ERC721 Contract but i need the to add the payable keyword to safeTransferFrom but im getting this error : The ERC721 has by default the payable keyword but open zeppelin hasn't. // SPDX-License-Identifier: MIT pragma solidity…
smarinrojas
  • 101
  • 4
3
votes
1 answer

Returned error: The method web3_clientVersion does not exist/is not available

I've been trying to make an upgradeable smart contract using openzeppelin in Harmony blockchain which uses EVM and Solidity... It is deployable when not using openzeppelin, but when i do, it throws the above error... And one of my teammates was able…
3
votes
2 answers

How connect library to smart contract from external resources?

pragma solidity ^0.4.15; import './ERC20.sol'; import './SafeMath.sol'; How connect SafeMath.sol from external(non-local) resourses?
2
votes
1 answer

OpenZeppelin: TypeError: Function has override specified but does not override anything

After an update from @openzeppelin/contracts in Version 4.6 to 4.8, the solidity compiler complains about the _beforeTokenTransfer-function, that I had to override: TypeError: Function has override specified but does not override anything. )…
delete
  • 18,144
  • 15
  • 48
  • 79
2
votes
0 answers

consensys solidity supply chain exercise

i'm currently passing 22 of 23 @openzeppelin/test-helpers when i run $ truffle test on my clone of the consensys supply-chain-exercise why am i getting the following error and does it relate to the code below? Wrong kind of exception received +…
1
2
3
15 16