Linked Questions

0
votes
1answer
488 views

Is it possible to create a smart contract that makes other smart contracts [duplicate]

I am wondering if I could make a smart contract that makes other smart contracts when prompted to. For example, I send a transaction to smart contract A telling it to make smart contract B. And smart ...
135
votes
2answers
28k views

Are there well-solved and simple storage patterns for Solidity?

Simple and appropriate data organization can challenge Solidity newcomers. It wants us to organize everything in ways many of us aren’t accustomed to. Are there well-solved general patterns for ...
15
votes
3answers
6k views

How to pass constructor parameters to a contract using Truffle?

I am using testrpc and truffle for deploying contracts.I want to pass constructor parameters while deploying. contract User { string public userName; function User(string ...
1
vote
2answers
2k views

Mapping to contract

Solidity documentation says it is possible to use anything as mapping value, which I assume includes a contract: _ValueType can actually be any type, including mappings. but I couldn't find an ...
2
votes
2answers
743 views

How to access Objects from different Contracts

Goal: I want to create a solidity programm that includes 3+ contracts. This means I have one contract (lets call it master for now) which aims at setting everything up. This means this contract has a ...
0
votes
2answers
1k views

Contract changing another contract's state

In my system, users can request to be verified by a trusted contract. When a user creates an account he deploys this contract (omitting non-related parts) pragma solidity ^0.4.11; contract User { ...
2
votes
2answers
747 views

Creating Contract instances from contract methods

I've been working on the concept of building a MUD type game using Blockchain as the data storage. Note - this is a private network - so ether cost is not really a huge issue for me. Given a contract ...
0
votes
3answers
633 views

Dynamically create smart contract structure based on user input

I would like to create a smart contract based on user input. User would provide some information/data from the UI, and based on the information provided my smart contract logic would get defined, and ...
3
votes
1answer
354 views

How to build an Ethereum hot wallet for an exchange

I’m developing an exchange. When a new user register on website we will create new eth wallet for them. When they deposit USDT on their wallet how can I transfer that USDT amount to another address (...
1
vote
1answer
795 views

How to generate new address for new contract created by constructor

I'm trying to resolve a problem and google is not useful this time. On my localhost truffle + testrpc I have a contract which returns a new instance of a new contract. import 'contracts/...
1
vote
1answer
418 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
380 views

Deploying contract template using web interface & Metamask

I have a contract template. The idea is to enable visitors to my website to customise and deploy the contract using Metamask by providing a set of constructor variables and outputting the resulting ...
1
vote
1answer
323 views

How exactly can we deploy a contract on a button click from a front end when we are using nodejs and running testrpc?

I want to deploy my contract by taking in parameters from the webpage and they serve as parameters for my contract's constructor and when I click on a button I should be able to deploy the contract on ...
0
votes
1answer
222 views

One smart contract deployed on 2 nodes will have same address?

Let's get creation of a smart contract address out of the way: The address for an Ethereum contract is deterministically computed from the address of its creator (sender) and how many transactions ...
0
votes
2answers
228 views

Capture events from a state variable which is a contract

I developed a contract which uses another contract in it state variable, but looks like the events from the contract in the state variable aren’t dispatched. contract A { event Hello(uint num); ...
1
vote
0answers
134 views

What is a common pattern to work with a large number of complex Things: make a Thing a contract, or a struct in a mapping?

In order to build a somewhat complex Dapp, I need to manage "Contributions". To do this, I roughly see two patterns: A Factory-pattern, in which each Contribution is it's own Contract/Instance. A ...
1
vote
1answer
125 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? ...
1
vote
1answer
91 views

Building a recursive smart contract — is it possible?

I would like to create a sort of tree type hierarchy of contracts. Think of it like a multi-level-marketing scheme -- the person at the top will receive X. For each of the k people he recruits he ...
1
vote
1answer
79 views

Is it possible to verify multiple accounts' attached main parent user?

[Q] Is there any unique ID for geth or parity usage, which might help use to detect multiple created accounts' main parent creator? (I assume all those multiple accounts are created by the same main ...