Skip to main content

Questions tagged [factory]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

I am trying to make the fork of Pancakeswap and I am currently being stuck on generating my own token pairs address for my factory and init_hash_code

As the title said, I have my own implementations of cake token, factory and router. As far as I got it, the factory and init_code_hash are correct. The issue is that even after changing them in ...
Albert Lipaev's user avatar
0 votes
1 answer
57 views

How to call erc721 functions (approve, setApprovalForAll etc.) from another contract?

I have an erc721 NFT and a Main contract. The Main Contract is a factory contract. Which creates erc 721 contracts. I can create NFT contract from Main contract . But can't call the approve, ...
Asir Shahriar Roudra's user avatar
1 vote
0 answers
40 views

Gnosis safe: recurring transfers missing

I was checking the Reccuring Transfers Module from the safe modules repo and I saw an import called Module which is not actually present in the @gnosis.pm/safe-contracts npm package in the latest ...
Rich Wang's user avatar
2 votes
1 answer
409 views

How can I get all tokens listed on `Sushiswap`

How can I get all tokens listed on Sushiswap. For uniswap we can call factory.getTokenWithId(id) with the token id. But how can we do the same for Sushiswap ?
Saikat Karmakar's user avatar
1 vote
1 answer
306 views

How to get Factory address from the Router address? Web3.js

I'm trying to get a factory address for Uniswap on base network, unfortunately I'm not able to locate this address anywhere and I'm kind of desperate as without it I'm not able to try my code that ...
RasmonT's user avatar
  • 131
0 votes
3 answers
2k views

What is the UniswapV2Factory address on the Sepolia network

Does anyone know what's the factory address of UniswapV2 in sepolia? Thanks
Harsh Gupta's user avatar
1 vote
1 answer
41 views

Using inherited constructors with a proxy factory

I am attempting to use Chainlink VRF along with OpenZeppelin's upgradable contracts to generate a random number. In order to use VRF, I must inherit the constructor from VRFV2WrapperConsumerBase. ...
root's user avatar
  • 11
0 votes
2 answers
138 views

Using Smart Contract Clone Factory or having 1 smart contract storing all information

I am new to the smart contract world. I am tasked with the following situation: Building a multi-sig vault that different clients can use. I see 2 approaches Create 1 smart contract that stores all ...
pranp2001's user avatar
1 vote
2 answers
44 views

Can't find deployment bytecode for contract created from factory - How to retrieve it?

I have a factory contract that deploys child contracts, to complete a challenge on Ethernauts. I would like to retrieve the deployment bytecode for one of the child contracts, but I'm having trouble ...
Danny B's user avatar
  • 323
2 votes
0 answers
76 views

Strategy for choosing the number of optimizer runs for factory contracts

The number of optimizer runs in Solidity should normally be set to the expected number of times the contract will be called in its lifetime. To quote the Solidity docs: The number of runs (--...
Paul Razvan Berg's user avatar
4 votes
2 answers
2k views

What are the differences between create2 and create3?

Which strategies should we follow when using create2 and create3? I had seen that li.fi deployed the contracts using create3 factory contract. and i know some basics about create that we can find out ...
0xbeny's user avatar
  • 303
0 votes
1 answer
10 views

When publishing the first version of a plugin into the aragonOSx protocol, what should I put in the parameters?

What should I set as the maintainer? What should I set as the _releaseMetadata? What should I set as the _buildMetadata?
juliette_chevalier's user avatar
0 votes
1 answer
20 views

How could I turn an ERC20 token contract into a plugin in aragonOSx?

When I deploy the dao with the DaoFactory, my second plugin relies on the address of the first plugin... What do you recommend? Should I deploy the second plugin separately after or is there a way to ...
juliette_chevalier's user avatar
1 vote
0 answers
39 views

Complex factory optimization

After two and a half years of developing smart contracts on a non-EVM blockchain (Tezos), I started working on a few solidity projects, and I'm trying to understand some things. I built a factory ...
Aharon Lando's user avatar
1 vote
1 answer
64 views

How can I precompute the address of contract and use it for the deployment of a second contract?

When I deploy the dao with the DaoFactory, I also want a second second plugin installed, which relies on the address of the first plugin... What do you recommend? Should I deploy the second plugin ...
juliette_chevalier's user avatar
1 vote
2 answers
99 views

How to create a smart contract factory that inherits its token?

For example, here I have two contracts: The first one is the smart contract factory that also implements a token. The second one is the smart contract model that will be created by the smart contract ...
Julio Cajas's user avatar
1 vote
0 answers
28 views

ERC20 token fatcory issue

I have a issue with my token factory. I defined a custom Token : // SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable....
Bruno's user avatar
  • 23
0 votes
1 answer
283 views

How to transfer the ownership of a smart contract deployed using a proxy?

I have deployed a smart contract, with a proxy, using a factory. I want now to transfer the ownership of this smart contract every time an ERC721 gets transferred. For that, I am using ...
Falcon Stakepool's user avatar
1 vote
1 answer
343 views

Setting immutable variables using clones

I've created a factory where I can clone my smart contracts using the openzeppelin clones factory. The problem I'm facing is that my "child" or "initializable" contract needs to ...
gggggggggg's user avatar
0 votes
0 answers
553 views

How to setup a Factory for an upgradeable smart contract deployed with UUPS Proxy?

I am trying to create a Factory for the following smart contract: SmartWallet.sol // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; // ========== External imports ========== ...
Falcon Stakepool's user avatar
0 votes
0 answers
110 views

getting the wrong price with getReserves()

I'm attempting to make a function that can give back the price of a token in WETH. however, the price I get back is a massive number and can't be correct. i'm getting an output of ...
Patrick W. McMahon's user avatar
2 votes
4 answers
1k views

How can I create a Factory of TransparentUpgradeableProxy?

I have the following code for a Factory that creates instances of a contract that is Upgradeable. I understand that, in order to achieve this, one of the options I have is to use ...
Falcon Stakepool's user avatar
1 vote
0 answers
101 views

Transaction failed during the createPool UniswapV3 function execution on Goerli network

I'm trying to call CreatePool function from UniswapV3Factory on Goerli newtork using Infura node, so i passed two ERC20 tokens with 0.3 fee existed in the network as input parameters and that dosen't ...
Seif Khédija's user avatar
1 vote
1 answer
44 views

Whitelist implementation of Ownable.sol

I'm creating a Whitelist dapp. I want users to have the ability to submit a form onClick/submit which will store a new list and deploy a contract that they own. I've come to the conclusion that a ...
padst3r's user avatar
  • 13
0 votes
1 answer
115 views

What are the benefits of using Opensea's Creature Factory?

link : https://stonk.industries/how-to-create-your-own-nft-using-the-opensea-creatures-template/ To Factory or not to Factory that is the question This repo also includes a factory which is just ...
imelon2's user avatar
  • 570
1 vote
1 answer
72 views

Factory test - How to cast in TypeScript

I am new to solidity and am now facing a problem. I created a factory : pragma solidity ^0.8; import "./Offering.sol"; contract OfferFactory { Offering[] _offers; function ...
Bruno's user avatar
  • 23
0 votes
1 answer
231 views

Cloning ERC20/ERC721

I'm using a Clone Factory pattern to create new instances cheaper. I realized that every field, preset or set in constructor, has default value. Let's assume that I have this contract: contract ...
Cezar's user avatar
  • 111
1 vote
1 answer
284 views

How to use the factory pattern when the child is ownable?

I'm trying to reason how a factory can make calls to a child contract that is owned by an EOA. The goal of this project is to make a StoreFactory contract that allows anyone to deploy their own Store ...
soyboy's user avatar
  • 73
0 votes
1 answer
162 views

How do factory contracts work? trying to make a factory contract for NFTs

//SPDX-License-Identifier: MIT License pragma solidity ^0.8.15; import "./ERC721Creator.sol"; contract MockNFT is ERC721Creator { constructor() ERC721Creator("name", "...
eth_sign's user avatar
0 votes
1 answer
791 views

Call Revert Exception when trying to call contract made by a smart contract factory in Hardhat

This function deploys a new erc721 smart contract. It works because when i try to call the instance of the contract from within the function it works. But when I am writing my hardhat tests this is ...
Ebrahim Elbagory's user avatar
1 vote
2 answers
1k views

How can I verify a smart contract generated by another smart contract with some arguments?

I've created a contract factory smart contract and deployed + verified on Ropsten. How can I verify the child-contracts on etherscan? Parent contract: https://ropsten.etherscan.io/address/...
Zedkay22's user avatar
1 vote
0 answers
130 views

How do you find the child contract address when deployed from a factory?

I'm experimenting with the OpenZeppelin crowdsale contracts, using the MintedCrowdsale example. When this is deployed, hardhat logs out the contract address for MyCrowdsaleDeployer. Question: Where ...
Vinnie James's user avatar
1 vote
1 answer
293 views

CREATE2 opcode offset and size

This is the UniswapV2Factory contract createPair function. I know that create2 opcode takes 4 arguments (value, offset , size , salt) How add(bytecode,32) can give the offset ? How mload(bytecode) can ...
Mehmet Akifhan Ilgaz's user avatar
0 votes
1 answer
453 views

Only getting 'Promise { <pending> } when calling getPair on the Quickswap Factory contract with ethers.js?

I'm attempting to get the pair address of the WETH/DAI pair on Quickswap on the Mumbai test net. I have this quick script: const ethers = require('ethers'); const Big = require('big.js'); const PATH = ...
Pickinanameainteasy's user avatar
1 vote
1 answer
451 views

UniswapV3 PoolDepolyer (variables overriding throught slots)

I cant understand Pool deployment using variables transfering throught slots. How it works and why developers choosed that way of initialization(guess it's cheaper)? Pool contract snippet(simplified): ...
4rgon4ut's user avatar
0 votes
0 answers
415 views

Consequtive Cloning via Clone proxy of the OpenZeppelin

I have used the Clone proxy of the OpenZeppelin in my smart contract letting it somehow duplicate itself whenever running the clone function. However, by clicking my clone function I am given the ...
Sina Rahimi's user avatar
1 vote
0 answers
45 views

Ive sent BNB from my metamask BSC network to my gnosis safe contract ETH network version 1.1.1

Good evening guys i have a problem and i will try to explain it. BNB on my metamask wallet sent BNB from BSC network to my gnosis safe eth contract how can y replay the transaction if my error was ...
YODA's user avatar
  • 11
2 votes
0 answers
607 views

Is there a way to return all pools containing a token symbol in Uniswap v3?

I am trying to get a list of all pools containing a token symbol with Uniswap v3 for arbitrage opportunities. For example, if I want to find all pools containing "WETH". Using the subgraph, ...
ElHaix's user avatar
  • 187
1 vote
1 answer
421 views

smart contract how link libraries to child contract under factory pattern

I am trying to create a factory and I can not find a way to link libraries to the child contract. I am trying to create a contract factory that create child contracts. the problem is that the child ...
GrailsBeginner98's user avatar
0 votes
1 answer
70 views

Contract Factory only recreates itself, not the subcontracts

I'm pretty sure I'm missing something really basic here, but my contract will only create new instances of itself (the factory), rather than of its subcontracts. I've stripped the code down to the ...
James Hooper's user avatar
1 vote
1 answer
788 views

Pancake Swap Factory smart contract error

I am using web3js to call PancakeFactory v2 contract (bscscan): contract address: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73 Anytime I want to call any function present in the contract I end up with ...
mszopen's user avatar
  • 13
0 votes
1 answer
39 views

Transferring to contract from another contract - payable error when transferring

I have a contract (the factory) that deploys other contracts. These contracts behave like bonds where users can set an amount in the factory, deploy the bond and then others can subscribe to the bonds....
HarryMoy's user avatar
  • 101
1 vote
1 answer
1k views

Uniswap v2 running out of gas when deploying the Factory on ganache

I am trying to deploy the Uniswap v2 Factory contract on my ganache test network. I have compiled these contracts with my own compiler. But everything I attempt to deploy the Factory, I receive this ...
Cizia's user avatar
  • 263
0 votes
1 answer
979 views

Indexed events not returning values when decoded

I had asked this question but I omitted some info as I (wrongly) assumed that the omitted info was not part of my problem. When you emit an event like so: event ChildCreated(address indexed creator, ...
YulePale's user avatar
  • 1,853
0 votes
0 answers
108 views

Event not returning indexed parameters when decoded [duplicate]

EDIT: I had omitted some data from my code as I thought it was not the one causing the error turns out I was wrong. Here is the question with the appropriate data and solution. ..... Ignore the text ...
YulePale's user avatar
  • 1,853
1 vote
1 answer
107 views

Updating multiple cloned contracts

A quick question: if a contract factory has generated quite a bunch of contracts by cloning, and one parameter is desired to be updated across all such cloned contracts, what is the best approach for ...
Maxareo's user avatar
  • 673
0 votes
1 answer
65 views

The called function should be payable if you send value and the value you send should be less than your balance

This is one of my parent contract (child factory contract) functions that creates a child contract. The function should be provided with 3 arguments function breed(uint _number, uint _amount, ...
Sina Rahimi's user avatar
14 votes
2 answers
9k views

What is the benefit of using create2() to create a smart contract?

Why would someone use create2() inline assembly code to create a child contract in factory pattern as opposed to using newContract() to create an instance of "newContract"? What are the ...
YulePale's user avatar
  • 1,853
1 vote
2 answers
2k views

Calculate deterministic address with Create2 when cloning contract with Factory pattern

There is an existing unanswered question from another author with the same problem, I am creating a more detailed one with the hopes both can be closed. I have a solidity contract based on the ideas ...
Franco's user avatar
  • 155
3 votes
1 answer
3k views

Calculation of Uniswap Pair address

I want to know the address of an Uniswap pair contract with Solidity, even if the pair doesn't exist yet. I can't use the function getPair of the factory contract because it return 0 when the pair ...
Kioup's user avatar
  • 125