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

How do I make a Digital ERC20 Tokens with a 10% reward payout to an external Metamask address account for marketing? With an automatic paysplitter

How do I make a Digital ERC20 Tokens with a 10% reward payout to an external Metamask address account for marketing? With an automatic paysplitter via pull-payment and using Reentrancy Guards as a way to send four different private developers a…
Gabrael EL
  • 21
  • 1
1
vote
1 answer

"false Transaction mined but execution failed" after trying to make a Transfer From using openzeppelin

After deploying and using the transferFrom function, it is giving the following error: "false Transaction mined but execution failed". This is the code: import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TransferToken { function…
1
vote
0 answers

What's the best practice for fixed point math in Solidity?

I'm reviewing some of the deployed smart contracts with fixed-point math operations, and I'm seeking to improve the code by importing a library or deployed contract standard that does fixed-point math functions. Something like Openzeppelin but for…
1
vote
1 answer

How to use ERC777 as a pay method

When a market transaction is happening, on the ERC20 token interface approve and transferFrom return true, so, after these two returns I know I can do some stuff like execute a NFT transfer. But on ERC777 send method dont return nothing. How could I…
1
vote
0 answers

MerkleProof Different hashes in Smart Contract and Javascript

I get different hashes for the MerkleProof in the Smart Contract and the Javascript (test) Smart Contract pragma solidity ^0.8.0; import "../node_modules/@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract Token { bytes32…
Homer
  • 239
  • 2
  • 11
1
vote
1 answer

Is there an ERC20 function to ensure payment if specific token?

is there a ERC/IERC20 function or util that ensures received payment is denominated in a specific token? receive() external payable virtual { IERC20 token = IERC20(address(0x123...789)); require( paymentToken == MYtoken, …
1
vote
1 answer

Function overriding in solidity, accessing internal function

I want to override transferOwnership from Ownable However, the internal function, _transferOwnership, is not being recognized. I either have to have a way to call this or to alter _transferOwnership directly. function transferOwnership(address…
daveaneo
  • 29
  • 3
1
vote
0 answers

Smart contract owner is 0x0 after the upgrade

I am using Hardhat and OpenZeppelin upgradeable contracts. So far, everything works correctly with deploying the V1 of the contract. However, when I'm upgrading to V2, the owner is set to address 0x0 for some reason. The expected behavior is that…
Ruham
  • 749
  • 10
  • 32
1
vote
1 answer

Remix IDE unable to load 3rd party library

While trying to import openZeppelin library in remix IDE (the online version), it always return this error Contract not found and this is how I tried to import it import "github/OpenZeppelin/openzeppelin-contracts/contracts/math/SafeMath.…
gbenga ogunbule
  • 589
  • 1
  • 6
  • 15
1
vote
1 answer

How to deploy a pre-compiled contract to hardhat node

I have a proxy contract and would like to replace the underlying implementation contract. I already have the abi & bytecode of a smart contract(retrieved from artifacts folder), so here is what I did: const NFTv2 = await…
johnhckuo
  • 279
  • 2
  • 16
1
vote
0 answers

The purpose of `__{ContractName}_init_unchained` from openzeppelin

I've been reading the openzeppelin document about upgradable contracts: https://docs.openzeppelin.com/contracts/4.x/upgradeable. It mentioned each __{ContractName}_init function embeds the linearized calls to all parent initializers. As a…
johnhckuo
  • 279
  • 2
  • 16
1
vote
1 answer

Not able to access ERC721 OpenZeppelin NFTs from separate contract that inherits NFT contract

I'm creating an NFT that inherits the openzeppelin ERC721 NFT smart contract. I have a contract, BookCreation, that inherits ERC721. This smart contract is where I mint the NFTs in the function mintBook(): function mintBook(uint256 _bookID,…
1
vote
2 answers

Erorr after truffle compile in Erc721 openzeppelin contract

im doing step by step of this article and i had a problem on truffle compile part. I've got this error in cmd: Error parsing @openzeppelin/contracts/token/ERC721/ERC721.sol: ParsedContract.sol:51:72: ParserError: Expected '{' but got reserved…
Matinshoon
  • 55
  • 7
1
vote
2 answers

OpenZeppelin ERC721Full Import

I'm trying to recreate a nft project, but the file ERC721Full.sol no longer exists in the current version of the OpenZeppelin Repo. I tried to import into my smart contract file all the files that ERC721Full imports, but my computer cannot seem to…
1
vote
1 answer

Tron Network with OpenZeppelin Contracts

The Tron Network uses Solidity and has a lot of similarities to Ethereum. I'm trying to use the OpenZeppelin contracts designed for Ethereum to run on the Tron Network. I've chosen Solidity version 0.6.x which is supported by the tronbox…
webish
  • 701
  • 2
  • 9
  • 17