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
1
vote
0 answers

Mock smart contract solidity - can't deploy mock smart contract - TypeError: Contract "mockMyToken" should be marked as abstract

I wrote a smart contract that uses openzepplin ERC20 standard. I am able to deploy it using truffle and my tests work as expected. I am now trying to test part of the code that is dependent on time (block.number) For the purpose of allowing the user…
1
vote
1 answer

Solidity, Unreachable code at ReentrancyGuard.sol:61:9 by OpenZeppelin

I'm using Solc 0.8.4 and received this warning, do I need to worry about it?
Mehdikovic
  • 51
  • 5
1
vote
1 answer

Hardhat Compiling Error (_safeMint 'Undeclared identifier')

hello I'm writing a contract and got this error in my function. function mintCardNFT(uint _cardIndex) external { uint256 newItemId = _tokenIds.current(); _safeMint(msg.sender, newItemId); nftHolderAttributes[newItemId] = CardAttributes({ …
plastik
  • 23
  • 1
  • 6
1
vote
0 answers

change owner ship of smart contract (upgradable)

I'm using openzeppelin to build an upgradable smart contract but when I deploy the contract the owner of the contract is transferring automatically to the admin proxy and I want to interact with the smart contract he says that I'm not the owner but…
wael hasnaoui
  • 31
  • 1
  • 3
1
vote
0 answers

create ERC1155 token - seems to be metadata problem on opensea

Im trying to create standard ERC1155 contract like the follow: contract Bbum is ERC1155, Ownable { uint256 public constant GOLD = 0; uint256 public constant THORS_HAMMER = 1; uint256 tokenCounter = 0; mapping(uint256 => string)…
OmerS
  • 153
  • 2
  • 9
1
vote
0 answers

Deployed contract different from local packaged contracts (openzeppelin and GSN)

This is directly related to my previous issue, although now I have more specifics and therefore I'm writing a new question! I was handed a project, and I've installed all the dependencies with npm ci, which should coincide exactly with what the…
Cookie
  • 364
  • 1
  • 2
  • 12
1
vote
2 answers

ERC777 Deployment with Transaction Reverted Error

I'm working to deploy an ERC777 token using hardhat, ethers in typescript. My deployment script is as follows import { MarketSvc, ProductSvc } from '../libs/deployment-service/src'; import hre from 'hardhat'; async function main() { const…
Trae Moore
  • 1,759
  • 3
  • 17
  • 32
1
vote
1 answer

execution reverted: ERC721PresetMinterPauserAutoId: must have minter role to mint

I'm trying to create an end point to mint a NFT using Nestjs, Binance Testnet, Metamask, truffle hdwallet-provider and openzeppelin as below. Smart contract creation process is working without any issue, but when invoke the mint function getting…
Ajantha Bandara
  • 1,473
  • 15
  • 36
1
vote
1 answer

brownie : File outside of allowed directories

i'm following Patrick Collins tutorial to create NFTs and here is my problem: i'm trying to import this: pragma solidity 0.6.6; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import…
1
vote
1 answer

Solidity: Can’t set the allowance to use transferFrom

here's my method to allow the user to sell "FRKC" ERC20 tokens to get ETH in return from my smart contract When I log the allowance variable it stays at 0 On Remix I get the error: "Check the token allowance." I made sure my user had enough tokens…
fbenfraj
  • 11
  • 2
1
vote
2 answers

Solidity - Balance is zero for the deployed ERC20 contract

I'm trying to create an ERC20 token using truffle and upgradable openzeppelin contracts. The problem is that the token balance is zero when I add the contract address into the Metamask extension. When I use remix, Everything is Ok and I can see the…
Milad Jafari
  • 1,135
  • 1
  • 11
  • 28
1
vote
1 answer

Solidity - Check balance of a user address using openzeppelin

I'm using Truffle and upgradable Openzeppelin contracts. I have two contracts. Token.sol: // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import…
Milad Jafari
  • 1,135
  • 1
  • 11
  • 28
1
vote
0 answers

Calling the function of an other contract in Solidity

Do you know if is it possible to call the function of an other contract in Solidity used in Substrate based chain and compiled with solang ? At first glance it seems impossible but I doubt it. As a basic example I'm trying to get a "incrementor"…
1
vote
1 answer

How to receive funds during minting to a specific address in solidity (Openzeppeling)?

I am trying to receive the funds into a specific address during mint process. This is my code: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "https://github.com/OpenZeppelin/openzeppelin-…
Pro Girl
  • 762
  • 7
  • 21
1
vote
1 answer

How to properly test a revert for 'onlyOwner' modifier?

In my Solidity contract that inherits from OpenZeppelin's Ownable and AccessControl I have a function that the contract owner can call to give an account the ADMIN role. It looks like this: function addAdmin(address account) public virtual onlyOwner…
blundin
  • 1,603
  • 3
  • 14
  • 29