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
31
votes
19 answers

File import callback not supported?

Tried to run: 1.) Dappuniversity project (dappuniversity/dbank) 2.) pet-shop-tutorial Truffle v5.3.3 (core: 5.3.3) Node v14.15.5 How can ser compile code @ the 0.8.4 to import OpenZeppelin’s ERC20.sol template, when Truffle requires it’s…
GoGetterMeme
  • 429
  • 1
  • 5
  • 5
27
votes
3 answers

No safeTransferFrom function in ethers.js contract instance?

I created a contract instance in hardhat console like so: const contract_fac = await ethers.getContractFactory("ContractName"); const contract = await contract_fac.attach("CONTRACTADDR..."); Contract object has all public/external functions except…
Lightstorm
  • 379
  • 4
  • 5
11
votes
6 answers

Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Reason: Fail - Unable to verify - with arguments

I am trying to verify my contract with arguments and I am getting this error: Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Reason: Fail - Unable to verify I am also importing Open Zeppelin contracts…
solidityguy
  • 199
  • 1
  • 3
  • 8
11
votes
8 answers

How to correctly import SafeMath.sol into contract

This has been a problem I've been dealing with for a while now. My temporary solution has been to create a SafeMath.sol file in my Contracts directory and directly import it from there. However, I've been looking for a 'clearer solution' to this...…
Brennan
  • 355
  • 1
  • 5
  • 10
10
votes
2 answers

why and when is setApprovalForAll called?

I'm having a hard time understanding why and when SetApprovalForAll is called on NFT generating contracts. Take Cool Cats, for example. And for convenience there's a screen shot of relevant transactions, below. I've noticed that for this contract…
Doug P
  • 361
  • 1
  • 4
  • 15
9
votes
4 answers

VScode Solidity extension - not finding openzepplin imports

I'm trying to get started with what should be a very simple Solidity contract but VSCode is giving me a hard time. I'm using Juan Blancos solidity plugin but VSCode cannot find openzepplin imports import…
parliament
  • 21,544
  • 38
  • 148
  • 238
8
votes
1 answer

Solidity: Testing reverted assertions with waffle + chai doesn't work

I'm testing a smart contract for an ERC721 token, that inherits from OpenZeppelin, using waffle and chai with NodeJS v14.18.0, but chai's reverted assertions don't seem to function as expected. Dependencies: "devDependencies": { …
Craigson
  • 131
  • 2
  • 8
8
votes
1 answer

_signTypedData method on ethers does not match with ERC712 solidity code

I've faced an ethers signature unmatched problem. Everything is normal. Already compared domainData, types, message variable in the js code with contract. Below is the JS Code to generate signature and call contract. const contractAddress =…
Kwang
  • 211
  • 1
  • 3
  • 7
8
votes
9 answers

Can't import openzeppelin node_modules: File import callback not supported

Whenever I try to compile my solidity contract, the error ParserError: Source \"@OpenZeppelin/contracts/math/SafeMath.sol\" not found: File import callback not supported gets thrown. pragma solidity ^0.7.0; import…
AlienLobster
  • 111
  • 1
  • 2
  • 5
7
votes
1 answer

DeclarationError: Undeclared identifier - although it's present in ERC721.sol

I am writing a contract on solidity 0.8.3 and I get this strange error for _setTokenURI() although the method is defined in OpenZeppelin 4.X. pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import…
Marcel
  • 1,537
  • 5
  • 19
  • 38
6
votes
8 answers

Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File import callback not supported

I've imported the Open Zeppelin ERC721 token standard into my VS Code with the Solidity extension, but see the following warnings on all my OZ import statements: Screenshot of error Why is this happening and what is the workaround for this…
jimmythecoder
  • 79
  • 1
  • 3
6
votes
3 answers

Difference between Openzeppelin SDK and Truffle?

For smart contract development, what is the difference between Openzeppelin SDK and Truffle? When should I use one or another, or both together?
tinker
  • 1,396
  • 11
  • 20
5
votes
1 answer

getting error when i deploy the NFT with ETH

I am new in NFT, i am trying to create test NFT, when i am trying to deploy that NFT, i am getting this error,insufficient funds for intrinsic transaction cost, even though in my account have 1 ETH balance here i have attached my whole code of it,…
Nikul Panchal
  • 1,542
  • 3
  • 35
  • 58
5
votes
3 answers

The requested contract was not found. Make sure the source code is available for compilation

I'm using '@openzeppelin/truffle-upgrades' plugin to create an upgradeable contract. First time doing this and going base off the websites article that they have on it. https://docs.openzeppelin.com/learn/upgrading-smart-contracts Everything…
Palm
  • 360
  • 2
  • 17
5
votes
1 answer

Why does the minting function of ERC721 have an access control?

Most of the ERC721 examples using Open Zeppelin I see require the mint function to have an access control where only the owner of the contract is allowed to call the function. For example, function mint(address to) public virtual { …
Kevvv
  • 3,655
  • 10
  • 44
  • 90
1
2 3
15 16