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
2
votes
1 answer

Mint new ERC20 token from other smart contract

Recently I am facing an issue while working on a smart contract that has staking functionality. Through the IERC20 interface, I manage to interact with Erc20 token from another contract but there is still one confusion left. I am working on a smart…
2
votes
2 answers

Error Verifying smart contract on EtherScan using Hardhat

Below is my smart contract (already deployed). When i try and verify it to submit the code to Etherscan I am getting the error below and I really don't know why. Please can someone advise? npx hardhat verify --network ropsten…
johnDoe
  • 709
  • 11
  • 29
2
votes
0 answers

Crowd Sale Contract Issue while minting token

I am currently working on a crowd sale contract, But I am having an issue with a function as the list of the error and the code of the function is attached, I need someone to tell me that what is happening in the code and how can i resolve the error…
2
votes
2 answers

Compile of openzeppelin ERC721 with tron and tronbox failing

I am hoping someone can help with this. I have been trying to learn smart contracts on Tron with Solidity and tronbox, but I am running into issues when trying to create an ERC721 token. I have created very simple ERC20.sol contracts using the…
Dale Rodel
  • 21
  • 4
2
votes
1 answer

Identifier already declared for Context.sol in Openzeppelin

I am working on an NFT project. I have my NFT file in my contract folder which is to import from the openzeppelin files in nodemodules. However, the compiler seem to suggest Context.sol is already declared in my file. I checked the Context.sol file…
Bonsu
  • 67
  • 1
  • 5
2
votes
1 answer

ERC20Capped: Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor OpenZeppelin 4

When I try to mint inside of constructor using ERC20Capped from OpenZeppelin 4 like contract SomeERC20 is ERC20Capped { constructor ( string memory name, string memory symbol, uint256 cap, uint256 initialBalance …
Pavlo Ostasha
  • 14,527
  • 11
  • 35
2
votes
0 answers

My is metamask returning RPC Error: Error: [ethjs-rpc] rpc error with payload, metamask shows failed [object, object]

My metamask shows ALERT: Transaction Error. Exception thrown in contract code. When I am about to transfer using truffle, open zeppelin and ganache on localhost:7545 after confirming the transaction it shows inpage.js:1 MetaMask - RPC Error: Error:…
DonkyKong123
  • 31
  • 1
  • 4
2
votes
3 answers

How does a User account own an ERC20 Token

This question is a little conceptual, so hopefully this picture will help clear up my misunderstanding. Image there is a crowdsale smart contract deployed on address 0x2. A User at address 0x01 buys a token. Here is my understanding of what…
Test1 Test2
  • 327
  • 2
  • 9
1
vote
1 answer

Inheritance in Solidity

contract MyToken is ERC20, ERC20Permit, ERC20Votes { constructor() ERC20("MyToken", "MTK") ERC20Permit("MyToken") {} // The following functions are overrides required by Solidity. function _afterTokenTransfer(address from, address to,…
1
vote
0 answers

Receiving a DeclarationError: Identifier not found or not unique while using counters using Remix

I am trying to run the code which is generating an error stating that DeclarationError: Identifier not found or not unique. The smart contract NFTCollection is a solidity code which enables me to mint a specific number of ERC721 Tokens and to count…
1
vote
1 answer

i am trying to install a package in my terminal and they give an error message that said

up to date, audited 704 packages in 2s 121 packages are looking for funding run npm fund for details 8 vulnerabilities (5 high, 3 critical) To address all issues (including breaking changes), run: npm audit fix --force Run npm audit for details. I…
1
vote
0 answers

How to make a Factory Contract which deploys a UUPS Proxy?

I have UUPS erc721 contract. I have deployed them. Now I have a proxy contract and a logic contract. Lets say logic contract has address 0x1234 I want a factory contract to deploy multiple upgradeable proxies by copying a already deployed proxy from…
1
vote
1 answer

Get previously deployed proxy contract in a seperate deployment file using hardhat-upgrades

I have deployed a token like so using hardhat const { getNamedAccounts, deployments, network } = hre const { deploy, log, get } = deployments const { deployer } = await…
Ritzy Dev
  • 387
  • 3
  • 10
1
vote
1 answer

Opensea not picking up metadata for ERC-1155 contract

I have an ERC-1155 smart contract deployed to the Goerli testnet. My contract inherits from the OpenZeppelin ERC1155 contract and uses its uri function. The URI I initiated the contract with is of the format https://token-cdn-domain/{id}.json as…
0xED0
  • 53
  • 5
1
vote
1 answer

Why Openzeppelin ERC721 defines two 'safeTransferFrom'?

Source code: /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId,…
Ray
  • 333
  • 4
  • 11