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

OpenZeppelin Context.sol smart contract is abstract, why?

I was digging into this OZ smart contract: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol As you may see, it has only two functions to deal with metatxs. I can't figure out why this contract is defined…
0
votes
1 answer

How to send ETH directly from ERC721 (OpenZeppelin) contract to the PaymentSplitter contract?

I have an openZeppelin ERC721 NFT contract (MyNFTPrice.sol) and also a separate PaymentSplitter contract. My understanding is that these two contract need to be deployed separately. My question is, how do I send the price of minting from my NFT…
johnDoe
  • 709
  • 11
  • 29
0
votes
3 answers

What happens when multiple call asking for the current counter in solidity gets the same value?

I was learning to create NFT markertplace (openZeppelin-ERC721) and got stuck in counter. I wander what happen when this code below is executed. pragma solidity ^0.8.0; library Counters { struct Counter { uint256 _value; } function…
0
votes
1 answer

Is any version of `@openzeppelin/contracts` for `erc1155` use sol 0.5.0

I installed npm install @openzeppelin/contracts --save-dev to use token erc1155, my project is running on 0.5.0 version for all smart contracts and erc1155 is using 0.8.0 and I got this error Error: Truffle is currently using solc 0.5.16, but one or…
Chíp Thảo
  • 122
  • 6
0
votes
3 answers

Parsing Error when importing OpenZeppelin's ERC721Full.sol Library

When I try to compile my smart contract using truffle, it comes up with this error: Error parsing @openzeppelin/contracts/token/ERC721/ERC721.sol: ParsedContract.sol:51:72: ParserError: Expected '{' but got reserved keyword 'override'. My Smart…
0
votes
1 answer

How to interact with the deployed ERC20(openzeppelin ERC20 contract) token and transfer token from user address X to address Y?

I've created a simple Contract extending openzeppelin ERC20. I'm trying to transfer token from one address to another. Contract code is as below: File name: Token.sol pragma solidity ^0.7.0; import…
Paritosh
  • 51
  • 10
0
votes
0 answers

When deploying a smart contract, isn't the "owner" of the contract (by default) the one who deploys it?

I am trying to use a function in a flashloan contract that uses the onlyOwner modifier. When I send the flashloan transaction, I get returned the error: "caller is not the owner". I am using the same account that I used to create the contract when…
nKc
  • 185
  • 1
  • 2
  • 11
0
votes
1 answer

Solidity ERC20 Contract with UTF-8 Decoded Characters

I need to write a contract that uses verbiage from a latin based language. Which takes special characters such as é, ç, ã, ô etc.... I'm using Hard hat to write it. I've found an example here, also using open Zeppelin: Example that works When…
Null isTrue
  • 1,882
  • 6
  • 26
  • 46
0
votes
1 answer

I get a ParserError when I try to import Openzeppelin contracts in vscode

Here are my import statements pragma solidity ^0.4.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; And this is the error I keep getting: ParserError: Source…
AlienLobster
  • 111
  • 1
  • 2
  • 5
0
votes
1 answer

Not sure about nonReentrant guard

Is only modifier nonReentrant enought to protect against reetrancy or we still need to check success inside function function withdraw() external nonReentrant { 5 uint256 amount = balanceOf[msg.sender]; 6 balanceOf[msg.sender] = 0; …
kasper
  • 161
  • 1
  • 3
  • 14
0
votes
1 answer

Apache Zeppelin how to have interpreter configuration saved per user

I am using zeppelin, and mostly my focus of exploration is on JDBC interpreter. We want to provide a web interface for accessing the DB. Intend is each user would login to Zeppelin, create its own credentials that should pass to jdbc interpreter. So…
JDev
  • 1,662
  • 4
  • 25
  • 55
0
votes
0 answers

ERC20: transfer amount exceeds allowance

I have two smart contract MLM and Token. After registration in MLM smart contract, I have to transfer token from Token smart contract. For that I have used contract address of Token and transferFrom method in MLM smart contract. Here is my MLM smart…
sel
  • 169
  • 5
  • 13
0
votes
1 answer

Solidity | Proper use of "using a for b" statement in derived contracts

I have a contract using Open-Zeppelin SafeMath, but that declaration is not recognized by derived contracts. Base.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.4; import…
drab
  • 426
  • 3
  • 15
0
votes
2 answers

This contract matches the deployed ByteCode of the Source Code for Contract on EtherScan

Using Openzeppelin CLI I created Upgradable Smart contract and Deployed it on my rinkeby Testnetwork thats all working fine.but after the deployment i check the source code of my contract on https://rinkeby.etherscan.io/ it shows my contract is…
0
votes
1 answer

Which version of safeMath to import from openZeppelin contracts on github.com?

There are more than one version of safeMath on openZeppelin. On master branch, the URL is: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol Besides master branch, there are quite a few other version…
user938363
  • 9,990
  • 38
  • 137
  • 303