New answers tagged

1

Ensure you have installed openzeppelin-solidity in your project npm install openzeppelin-solidity Your imports are then as follows: pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; contract DemirelToken is ERC20, ERC20Detailed { constructor(...


1

The error is Undeclared identifier: browser/NFT.sol:39:21: DeclarationError: Undeclared identifier. require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); ^-------^ In the contract as shown there isn't an implementation for the balanceOf function, so I assume that your contract is missing some code. I suggest ...


0

It appears you have a typo, a comma should be a full stop. Your Truffle config truffle-config.js has require("dotenv"),config(); when it should be require('dotenv').config();


1

You need to fix the path in the imports: pragma solidity ^0.5.0; import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; contract DemirelToken is ERC20, ERC20Detailed { constructor(uint256 initialSupply) ERC20Detailed("Gold", "GLD", 18) ...


0

hey guys I solve this problem here's the code : pragma solidity >=0.4.0 <0.7.0; contract NewHello{ address owner; address newOwner; constructor()public{ owner = msg.sender; } modifier onlyOwner (){ if(msg.sender != owner){ require(msg.sender == newOwner); } else{ require(msg.sender == owner); _; } } struct ...


1

You will see the same warning in Remix if you look at the compiler page. The warning is quite clear: you have a variable which is not used anywhere in the function logic. It's not an error but the compiler is trying to help you to save gas and to make the function cleaner by removing the unneeded parameter. If you want you can just ignore the warning. ...


Top 50 recent answers are included