Questions tagged [contract-development]

Questions regarding the development of smart contracts

Filter by
Sorted by
Tagged with
0 votes
1 answer
6 views

Can an individual NFT that's not been minted yet have a whitelist?

As it's not been minted yet, it doesn't exist, right? However, what if I had an idea to create a future collection of 333 NFT. And I wanted to allow certain users to mint certain NFTs. Meaning, future ...
DankenN's user avatar
0 votes
1 answer
14 views

How to re-mint NFTs to the existing holders?

Suppose, I've created an NFT collection of V1, of ERC751 or ERC1155. After some time, I've discovered that I want to fix a bug or improve it in some way, and this will become V2. I'll then go ahead ...
DankenN's user avatar
0 votes
0 answers
10 views

so i'm trying to deploy a token on etherum mainnet, but im getting the following error:

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: {"jsonrpc":"2.0","...
medtiphanny's user avatar
0 votes
1 answer
14 views

How to embed information into an NFT of its type/class?

Let's say, I wanted to create an NFT collection such that there'll be 3 classes/types of NFTs: animals, humans and aliens. For this, will I then have to simply introduce a field for type in a contract ...
Nondi's user avatar
  • 23
-1 votes
0 answers
20 views

I am trying to deploy a token on Ethereum mainnet but i keep getting gas estimation error

// SPDX-License-Identifier: MIT pragma solidity >=0.8.7; import "./safemath.sol"; import"./Dividend.sol"; import"./IERC20.sol"; contract PrintFriends1 is IERC20, ...
Stephanie's user avatar
1 vote
2 answers
22 views

Does creating a new NFT collection require a contract for it?

To create my own NFT collection, will I have to create a smart contract for it too? Or could it be done without one?
Nondi's user avatar
  • 23
0 votes
1 answer
34 views

how to recover funds to creator account on this particular incomplete mev contract WETH

//SPDX-License-Identifier: MIT pragma solidity ^0.8; interface IUniswapV2Migrator { function migrate( address token, uint amountTokenMin, uint amountETHMin, ...
Pablo Francese's user avatar
0 votes
1 answer
18 views

Array of contracts stays empty

I am desperately trying to manage an array of contracts from a parent contract. Going back to basics, I have implemented the code coming from Pushing a contract to an array in another contract witch ...
eric's user avatar
  • 1
1 vote
1 answer
29 views

Contract analysis - owner spawned 1000 billion tokens ($20 bounty)

I am currently writing a contract analysis tool (something similar to Token Sniffer) and there's one malicious contract that caught my attention. After the token's launch, contract owner somehow ...
shlx's user avatar
  • 11
0 votes
0 answers
10 views

How to get list of all NFTs owned by a EOA in a specific collection

I want to get all the NFTs an EOA owns in a specific collection but I found that none of the SDKs like Alchemy, Infura, etc provides this feature. So how can I do that?
Rishabh Raghwendra's user avatar
0 votes
0 answers
14 views

ERC 20 Remix Gas Allowance ERROR

I have this basic contract made on Openzeppelin Wizard, but everytime I try to deploy it on Mainnet i get the same error " exceeds gas allowance". I succesfully deployed it on Goerli. I've ...
Paul Suciu's user avatar
0 votes
0 answers
20 views

calling function of a smart contract through another smart contract

i have 2 smart contracts: // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./../node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract HNFT is ERC721 { ...
Andrea Lorenzetti's user avatar
1 vote
1 answer
16 views

web3.js how to call receive() external payable?

firstly, I have a code in a contract as below: receive() external payable { // function enter() external payable { require(msg.value > 0.1 ether, "require minimum 0.1 ether!...
cyann's user avatar
  • 11
0 votes
1 answer
36 views

How to find owner of contract deployer on etherscan website

https://etherscan.io/address/0x6cfa7561bbf940ab4b5c0507d4c9e45c68552b1b On the Etherscan website, where or how do i navigate to the deployer wallet of this contract? Apparently if i look closely at ...
Jim41Mavs's user avatar
  • 103
0 votes
1 answer
25 views

Why doesn't this try/catch block catch the revert in `asset.symbol`?

I wrote this Solidity function: function getAssetSymbol(IERC20Metadata asset) internal view returns (string memory) { try asset.symbol() returns (string memory symbol) { return symbol; ...
Paul Razvan Berg's user avatar
0 votes
1 answer
18 views

Gas estimation failed for marketplace contract

i receive an error upon trying to interact with buy function in my contract below // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol&...
kaay's user avatar
  • 5
0 votes
0 answers
16 views

array of contracts and contructor with arguments

Strange behavior. I have the following pair of smart contracts: pragma solidity ^0.8.8; contract Zone { string public a; string public b; string public c; string public d; constructor(...
eric's user avatar
  • 1
0 votes
2 answers
20 views

How to fetch data from a website to a solidity smart contract?

So i have a website that generate five random numbers every 5 seconds. Here's the html code : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"&...
Simão Pinto's user avatar
2 votes
1 answer
23 views

Do immutable variables influence the contract bytecode?

Suppose you have a contract like this: pragma solidity >=0.8.19; contract Bar { uint256 public immutable value; constructor(uint256 value_) { value = value_; } } Will Bar ...
Paul Razvan Berg's user avatar
0 votes
0 answers
23 views

Does gas optimization only apply to leading zeros in contract addresses?

I couldn't find any solid information on this. From assembly perspective clearly PUSH2 0xC0FE for a two byte address 0xC0FE requires less memory than a full PUSH20, but I could swear I also read any ...
Tobias Kienzler's user avatar
0 votes
0 answers
49 views

SELF DESTRUCT and ReInit

Please, be kind, why some persons uses self destroy? Why are the addresses of the contract not changed when removed? Why is it initiate by a third-party contract? What does Contract ReInit mean for ...
civef777's user avatar
0 votes
1 answer
16 views

How to call a read function within "contract B1" when the function is defined in a higher contract that imports "contract B1" as an extension?

I want to use the totalSupply function within an extension contract, but the function is not declared within the contract and is added in from a different contract extension. Both extensions are ...
Nunber1's user avatar
0 votes
1 answer
29 views

Storage slot for contracts

How many slots does storing a contract take? Like for example: contract MyContract { MyContract2 x; //more code } contract MyContract2 { //some code } How many slots does "x" ...
dNyrM's user avatar
  • 605
0 votes
1 answer
15 views

How does the contact size influence it's execution costs?

According to this post The overall size of your contract will play a part in tx cost for all interactions with it. Is that correct, and if so why? Under that premise, is it really more efficient to ...
Tobias Kienzler's user avatar
0 votes
0 answers
14 views

Why deploy a contract again to get its address and abi?

I have a deploy script for my contract however, I also want to get the contract address and abi programmatically so I'm doing it like so: First I run the deploy script that deploys my contracts. Then ...
IBeFrogs's user avatar
0 votes
1 answer
15 views

How to set owner wallet into useState from router.query?

I'm trying to set the address of a connected wallet into useState as string so that another function can use it to run it's function. const router = useRouter(); const { walletAddress } = ...
Miles Donald's user avatar
0 votes
1 answer
24 views

Using connected wallet to fetch all NFTs using alchemy sdk

I'm trying to pass the user's connected wallet into getNftsForOwner function but am not sure how to do it. If I type out the address into the function like this: const NFTs = await alchemy.nft....
Miles Donald's user avatar
1 vote
1 answer
88 views

Renouncing ownership without implemented function

I already deployed a contract using openzepellin and since it is being used, is it possible to renounce the ownership ? I did forgot to add the renounceOwnership function or transferOwnership. Thank ...
Anas's user avatar
  • 11
0 votes
1 answer
11 views

Can a contract's receive function use part of the value as additional gas?

Since a contract's receive() can only rely on 2300 gas being available, is there any way to use part of the msg.value to top up the gas?
Tobias Kienzler's user avatar
1 vote
1 answer
56 views

onlyInitializing vs initializer in OpenZeppelin Upgradeable Contracts

I'm reading the OpenZeppelin documentation about upgradeable contracts, and I'm getting a bit confused with these modifiers: initializer onlyInitializing I think I understand how initializer works. ...
Alexander Herranz's user avatar
1 vote
1 answer
121 views

Restrict Uniswap Transactions to whitelisted Wallets

Is there anyway at all to be able to have a contract that would restrict a wallet from being able to use Uniswap for a token until the contract owner has set a value to allow public access? Every ...
mrbmz's user avatar
  • 11
1 vote
2 answers
35 views

Sent funds (USDT) to a smart contract to get the funds on an exchange. But sent on wrong network - are those funds lost, like the exchange tells me?

Some time ago I wanted to send some funds from my hotwallet (Metamask) to an exchange (Bitpanda). I sent 0,5 ETH and rd. 5.200,- USDT to the wallet on Bitpanda. Then figured out I sent on the wrong ...
Dagobert's user avatar
1 vote
1 answer
57 views

Smart Contract ownership change after a mistake

Big situation here. Please let me know if I was not clear enough. I mistakenly gave the wrong address to a company giving me ownership of a smart contract. It is an ownership on a collection on ...
TechyDude's user avatar
  • 113
1 vote
0 answers
19 views

Am i right on this? [closed]

Do I just need to deploy my contract on Base chain testnet to use its layer2 solution? Or there is other steps? It is too confusing for me, Please guide me on this.
Hacek 's user avatar
  • 615
1 vote
1 answer
45 views

how to check the memory a contract has been used in the EVM?

I am developing a storage contract using mapping to save data. At first the contract exceeds the contract size limit so I seperate my contract to fit it. After seperation, the main storage contract is ...
庞小博's user avatar
1 vote
1 answer
35 views

@openzeppelin/contracts import failed

The issue I am having is when I am trying to compile my contract, I am getting multiple errors for ERC721. As imported ERC721 is importing more contracts, as seen from the errors, the issue is that it ...
Hasbik645's user avatar
1 vote
2 answers
49 views

I did not understand why q96 used here in uniswapV3 development book

This code is from Uniswap v3 development book: sqrtp_low = price_to_sqrtp(4545) sqrtp_cur = price_to_sqrtp(5000) sqrtp_upp = price_to_sqrtp(5500) def liquidity0(amount, pa, pb): if pa > pb: ...
Hacek 's user avatar
  • 615
2 votes
1 answer
46 views

Is there any way to selectively include logic in a contract during its construction?

We have a contract that adheres to the ERC-3156 standard, which provides flash loan functionality. We intend to deploy this contract multiple times, and in certain cases, flash loan capabilities are ...
Paul Razvan Berg's user avatar
2 votes
1 answer
27 views

Getting successful and failed txs with the same code

// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract Shuffle { constructor() { ranking = [0,1,2,3,4,5,6,7]; currentSeason = SeasonType.Spring; } enum ...
East's user avatar
  • 21
2 votes
0 answers
33 views

upgradeProxy doesn’t works [closed]

I have a strange problem. When I want to upgrade my contract (OpenZeppelin upgradeable), I face this error "Ownable: the caller is not the owner", but the owner is the same as in my init ...
Fly Togoal's user avatar
1 vote
2 answers
40 views

Cannot get Chainlink Conversion ETH/USD Correct other than 0

I have followed both answers in the following similar question. I some how cannot seem to get a non-zero result. I tried several different ways to modify the below conversion function. Using ...
Stackaccount1's user avatar
2 votes
1 answer
28 views

Can not interact with the deployed contract

getting this error Error: Transaction reverted: function returned an unexpected amount of data at Proxy.getDecimals (contracts/proxy.sol:100) at processTicksAndRejections (node:internal/process/...
Cartman_bruh's user avatar
2 votes
2 answers
50 views

Best, free web3 tutorials? Basically how to learn building dapps

What are other resources ppl really like? Would love to learn what else is out there, particularly the free ones. [Edit] Adding a few of the most popular below: Ethereum.org's NFT series -- you'll ...
Alchemy Devs's user avatar
1 vote
1 answer
45 views

When would an ERC20 return false?

According to the ERC20: Token Standard: Callers MUST handle false from returns (bool success). Callers MUST NOT assume that false is never returned! In OpenZeppelin's ERC20 contract, running the ...
chriscrutt's user avatar
1 vote
3 answers
84 views

How to track scammers through etherscan? [duplicate]

I just came across this video here: https://www.youtube.com/watch?v=Vhkb9G2SyVw Wich have this code in the description: https://pastebin.com/raw/U8FQewES It seems quite attractive at first, but the ...
Davis97's user avatar
  • 11
0 votes
0 answers
11 views

How do I pass contructor arguments for my parent class whilst also using UUPS upgradeable?

I have a contract that looks like this: contract UpgradeableTimelock is Initializable, OwnableUpgradeable, UUPSUpgradeable, Timelock{ function initialize(address _admin, uint _delay, address ...
Barney Chambers's user avatar
0 votes
1 answer
19 views

I am facing issue while calling withdraw function from react

I have a withdraw function in solidity script: function withdraw() public onlyOwner { (bool sent, ) = owner.call{value: 0.00025 ether}(""); require(sent); } Technically ...
Hacek 's user avatar
  • 615
2 votes
2 answers
33 views

Why's it all being displayed as Big Number if I am using ethers.utils.parseEther? Is this normally how it displays in console?

In my hardhat test file I am converting ERC20 tokens transactions/balances with ethers.utils.parseEther like... const ONE_ETHER = ethers.utils.parseEther("1"); So if everything is being ...
Blockpain's user avatar
  • 133
1 vote
1 answer
49 views

Troubling shooting hardhat test failure - ERC20 approve & transferFrom issues

One of my hardhat tests is failing and I am hoping someone assist with. I have 2 smart contracts posted here and the test file I am running. My question is at the bottom. It's a bit lengthy to look ...
Blockpain's user avatar
  • 133
6 votes
1 answer
201 views

Why is it called tokenURI instead of tokenURL?

Seems tokenURI always returns a URL, so why the name choice?
Dimitri Borgers's user avatar

1
2 3 4 5
93