New answers tagged

1 vote
Accepted

ERC20 - Whats the difference between transfer vs transferFrom?

If you need to transfer tokens from your address to another, use transfer(), if you need to transfer tokens from an address (that is not you) to another use transferFrom. For example, if your function ...
user avatar
  • 1,328
2 votes
Accepted

Private variables with public view functions

The pattern you noticed is competing with the approach of using an internal storage variable. The general idea here is you can read the variables and not write. It allows the contract to make some ...
user avatar
0 votes

Creating a multi use Timelock Contract

This is one approach that I'm developing: // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/utils/TokenTimelock.sol) pragma solidity ^0.8.0; import "@...
user avatar
0 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

I can share my experience . I was also facing the same issue . Its really important to make sure that the name of the file in the artifact directory matches with your code . My observation is " ...
user avatar
0 votes

HardhatError: HH700: Artifact for contract "Greeter" not found - clarification [Hardhat, openzeppelin]

In my case the contract name was different than the actual file name. Thats why it was giving the error.
user avatar
0 votes
Accepted

Why should I create a fix supply/unlimited supply for my token

Do token value increase with the amount of supply I create, if yes how and if no how? Token value depends on what the market decides it's worth. If you have a lower supply of a high demand token, ...
user avatar
1 vote

openzeppelin dependencies pragma conflict

After doing some research I have found the answer myself: You can install specific versions of OpenZeppelin Contracts using the version tag. You should only use an official release.
user avatar
1 vote

Initializing the implementation contract when using UUPS to protect against attacks

A proxy works by borrowing mirroring all the execution logic of an implementation contract. The context of the proxy contract is kept, however (meaning the storage is read and written to in the proxy)....
user avatar
  • 1,229
1 vote
Accepted

_disableInitializers() vs initializer vs reinitializer(uint8 version) in Openzeppelin/contracts-upgradeable?

So I searched about it and tried these out. And it basically is something like reinitializer(1) = initializer. You need to use reinitializer() in subsequent upgrades. _disableInitializer() just max ...
user avatar
0 votes
Accepted

How can we assign owner's address in an OwnableUpgradeable contract?

Have you called the __Ownable_init() function (this sets the owner to the current caller)? This needs to be protected with the initializer modifier, so that it can only be called during an upgrade: ...
user avatar
  • 1,229

Top 50 recent answers are included