Questions tagged [factory]

The tag has no usage guidance.

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

Multiple Inheritance at particular contract address

I'm attempting to have 4 different contracts sharing the same data fields. The reasoning behind having 4 instead of 1, is that the different functionality can be broken down so that it is cleaner, ...
0
votes
1answer
17 views

Scaling a 'factory' design approach when listing contracts

I am building a smart contract that uses a factory contract to deploy a new sub-contract (example some campaign). This campaign has a boolean flag isActive. Every time the factory deploys a campaign, ...
0
votes
1answer
28 views

Contract [Contract's name] not found on network ID: 5777

I am using truffle with drizzle. In the contract folder I provide a file that includes two contracts A that is a factory contract and B that is created through one of A's functions After compiling ...
1
vote
1answer
19 views

Events in hub/factory contract

I have written a contract with the hub/factory pattern in which I need to capture the address of the contract that is being created, for this I am using events. Contract A Function A1 -- Call ...
0
votes
2answers
53 views

Deploying smart contract with undefined state variables

I have a factory contract (Factory.sol) that creates new contracts (YourContract.sol). The createNewContract function in the factory defines some state variables that the new contract picks up in its ...
0
votes
0answers
12 views

How to verify access of child contracts?

I am using a factory A to produce child contracts. Now I want to guarantee that only these child contracts have access to a different contract B. Using the factory as a proxy is somehow a detour as I ...
0
votes
0answers
75 views

truffle cant find function from contract made with address and abi

So I have a factory contract "RestaurantFactory" which i migrate, this contract creates another contract "Restaurant", after deploying the RestaurantFactory and calling createRestaurant() I receive an ...
0
votes
1answer
34 views

Can't create child contract in mainnet?

address[] child; function createChildContract() onlyOwner public{ address newChild = new Child(msg.sender); child.push(newChild); emit ChildCreated(newChild); } contract Child { ...
1
vote
1answer
42 views

Truffle - call migration file multiple times

I would like to execute migration file "6_deploy_and_register_group.js" every time when I need to create a new group. Is this a proper way to use migrations? If yes, how can I make it working? ...
0
votes
2answers
208 views

Self Destruct Transaction

how to make transaction like THIS TRANSACTION anyone can help me how to build it
1
vote
0answers
64 views

web3js get all properties of contract in one promise

I'm implementing an app with a Factory design pattern. My Factory is creating instances of myContract, that I load thanks to myContract.at(address) like below: this.myContract = TruffleContract(...
0
votes
1answer
43 views

Sending contract's source code to deployed contract in order to deploy it

I am writing a factory contract in solidity. I want to be able to add some more contracts to be deployed by the factory after it has been deployed. I thought sending the contract's source code to my ...
5
votes
1answer
460 views

Contract factory function running out of gas during Truffle test

Using openzeppelin library and truffle I am trying to make a Contract Factory that creates ERC20 tokens. I prefer to test it with Truffle using solidity and not javascript. Here is the code from the ...
1
vote
0answers
40 views

Can Factory Contract Be Used As Parent/Child Function?

I am attempting to modify the contract below; the way it is set up at the moment is so that the contract can be deployed, and then anytime a user wants to create a campaign, they can do so without ...
0
votes
0answers
80 views

When exactly do events fire

I have a web3J application that is supposed to deploy a contract (by calling a function on another contract) then listen for the contractCreatedEvent that is fired by the factoryContract and then call ...
2
votes
1answer
102 views

tx.origin for factory

I want to use a factory so that people can create a standardized contract. People should be able to transfer money directly by this creation which led me to the problem of the msg.sender during the ...
1
vote
0answers
149 views

Can't transfer balance from contract to parent contract

I'm having trouble transferring remaining funds from a Contract to it's controlling Contract Factory. I'm trying to do the following. Create a new Service with Factory->createService() Add funds to ...
3
votes
1answer
239 views

Remix and Contract Factories

I built out a fairly complex contract factory and I noticed the factory was only creating instances of itself, not the "child" contract. After observing this I figured I was doing something wrong so ...
0
votes
1answer
213 views

Factory Contract Not generating Tokens

Hi I am new to DApp development. I am using a Factory contract and that factory contract is creating multiple tokens contract. When I create a new token contract it generates the transaction but when ...
0
votes
1answer
528 views

web3: call function in contract that creates another contract and returns address [duplicate]

from what I (quickly) looked up, payable functions do not return values to the web3 API. In my particular use case, I have a 'Master' contract that serves as a factory for other contracts, and stores ...
1
vote
1answer
23 views

Endowing Contract Created via Factory with Specific Arguments

I'm trying to make a factory contract that accomplishes two things: Create contracts and endow them at creation with specific parameters Maintain a mapping of structs with info of all created ...
1
vote
1answer
349 views

How do I know which transaction generated a contract in Factory pattern?

By factory pattern I mean a contract able to deploy other contracts like in this question: simple bakery factory pattern Each time I trigger factoryInstance.newContract(args).then(promise); I get ...
0
votes
1answer
66 views

Is it possible to change the bytecode a factory is using to create child contracts?

Normally a factory includes the bytecode of any contract it creates. Now let's think about a scenario where there is an update of the child contract code necessary. I don't want to change existing ...