for high-level questions about the choices made during contract construction
Questions tagged [contract-design]
2078 questions
13
votes
4 answers
Can there only be one instance of a contract?
Say we have:
contract TestFooContract{
//bunch of stuff and state
}
Does this mean that there is only 1 "TestFooContract"?
Or can I instantiate 10 of them? What if I want multiple of these contracts?
In OOP terms, is a contract thought of as a…
zunior
- 1,312
- 13
- 18
11
votes
2 answers
Large contract (bytecode >= 45K) causes out-of-gas on deploy
I need some advice about handling a large contract. At a certain size it causes an out-of-gas error when I deploy to a local testrpc node. I experience this when the bytecode reaches approximately 45K. I have temporarily solved the issue by…
Raine Revere
- 3,600
- 2
- 23
- 34
9
votes
1 answer
Is there a planned Ethereum protocol change which deals with upgradeable contracts?
There are lots of questions asking how can you deal with contract versions with the current Ethereum protocol. Are there any plans of making protocol-level changes that are aimed to facilitate this process?
Fernando Tiberti
- 2,299
- 1
- 15
- 28
6
votes
4 answers
Can you copy or fork someone else's smart contract? Is it open source code?
Is it possible to just copy someone else's smart contract? Say if someone has a profitable smart contract, what stops someone from just copying it to get a piece of the profit pie?
Patoshi パトシ
- 4,800
- 7
- 45
- 93
6
votes
1 answer
How can I handle computationally expensive operations on the blockchain?
Sometimes a blockchain application needs to perform an operation, such as a scrypt verification, that is extremely computationally expensive. Are there any techniques that can help me design around this problem so that my application doesn't have…
Jeff Coleman
- 22,059
- 17
- 77
- 91
6
votes
3 answers
Proof of ownership and dividend in a company
I want to use the ethereum blockchain to prove ownership for example in a company (or even a hedge fund). How do I guarantee my investors (or buyers) that they bought a share of my company?
Anton Andreev
- 161
- 4
5
votes
4 answers
How to design a legal smart contract?
In Ethereum the terms "Contract" or "Smart Contract" are loosly used; "Smart Agent" might have been a better name [citation-needed]. Most smart contracts are certainly not legal contracts.
Now for a contract to be a legal contract there are certain…
J-B
- 8,941
- 16
- 46
- 77
5
votes
2 answers
Why doesn't ETH allow a contract to read another contract / account's state?
Been thinking about this for a while, and came on this question: Can a contract access another contract's storage?.
What is the design rationale behind NOT allowing these types of reads? It seems trivial to implement on ETH currently. Now if ETH…
reedvoid
- 317
- 1
- 7
5
votes
1 answer
Is there a way to lock my coins in an account for X days?
I would like to lock my ether in an account 90 days. Is there a way of doing this? How can it be done? Would it be a smart contract?
Patoshi パトシ
- 4,800
- 7
- 45
- 93
4
votes
0 answers
Ethereum Market Place Design
I want to model the following scenario - a small market place
I have 2 nodes in my network - the seller and the buyer.
I want to model the market place in that why - that the buyer node asks every seller node for their offer - the buyer node…
Wi1616
- 521
- 4
- 8
4
votes
2 answers
How to restrict a function in a contract so that it can only be called by a designated contract?
First, I'm aware of a similar question, but that answer is not sufficient.
Say I deployed an contract A, then I deploy another contract B some time later. I want to make sure that a function A.f1() in A can only be called from contract B. To do so,…
user3839198
- 43
- 3
4
votes
0 answers
What is the best way to implement the coin contract to get all coin transaction history?
What is the best way to implement the coin contract code to see all transaction history?
It's easy to get the transaction history of ether, but it's kind of difficult to get all sending and receiving history of coin contract.
Add event log in…
Satoshi Nakanishi
- 5,749
- 7
- 38
- 57
3
votes
1 answer
How do smart contracts get information about real world events?
How do smart contracts probe information about the real world?
A smart contract's execution can be contingent on real world events such as who will win a football match (this is a betting contract) or what the price of oil is in 90 days (a financial…
Patrick Conway
- 33
- 2
3
votes
1 answer
Is there any UTXO based coin contract?
I'd like to create an UTXO style coin contract to trace each coin movement. There are many account based coin contracts, but I couldn't find any UTXO coin contract. Are they any samples?
Satoshi Nakanishi
- 5,749
- 7
- 38
- 57
3
votes
3 answers
how to "lock" in place a certain amount of ETH
Newbie here, making my first steps in the smart contracts/dapps world;
let's assume a simple scenario, 2 people making a wager on a game outcome. They agree on the amount waged, and who ever wins is automatically credited with the waged amount. How…
sitocrypto
- 31
- 2