Linked Questions

136
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 ...
3
votes
1answer
366 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 (...
2
votes
2answers
747 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 ...
2
votes
2answers
749 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 ...
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 ...
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 ...
1
vote
1answer
93 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
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 ...
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 ...
1
vote
1answer
130 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
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
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/...
0
votes
1answer
232 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
3answers
637 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 ...

15 30 50 per page