Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [contract-development]

Questions regarding the development of smart contracts

4
votes
0answers
188 views

Benefits of library versus a plain contract (upgradeability)

I'm trying to find what the benefit is of a library. I found the following statements. (Please correct me if i'm wrong) Cost less gas to deploy Uses the storage of the calling contract the library ...
4
votes
0answers
420 views

Managing multiple Ether addresses in one contract?

Although I have a background in Bitcoin (creating the WLOX exchange platform), I am completely new to Ethereum. I am trying to find a way to manage multiple accounts/addresses as a pool to (1) be ...
4
votes
0answers
268 views

Storing a truffle contract interface in version control

What I'm doing When I compile and deploy a contract using Truffle, I get a .json build artifact that contains information about where the contract is deployed on the network (its address). So far I ...
4
votes
0answers
401 views

Event and/or watch does not work

I have a contract for a simple bidding scenario as below: pragma solidity ^0.4.9; /* Contract accepting biddings during 30 minutes */ contract SimpleBidding { address contractOwnersAccount; ...
4
votes
0answers
454 views

Ethereum and child chains like NXT/Ardor?

Doing some research on how we can implement this type of system with ethereum smart contracts. Currently the upcoming Nxt/Ardor system implements a child chain system where the main chain deals with ...
3
votes
0answers
47 views

One-to-many mapping inside struct

I have two structs: struct A{ uint bid; mapping(uint => B[]) BMap; //bid - index for struct B } struct B{ uint cid; } mapping(uint => A[]) AMap; How can we push and fetch 'cid' ...
3
votes
0answers
85 views

How to parse through the logsBloom of a block or transaction using solidity

Currently trying to figure out how to parse through the logsBloom portion of block and transaction headers using solidity. I've researched the topic so far and have come to the understanding that RLP ...
3
votes
0answers
62 views

Methods and constants order in the contract ABI

Is it possible to annotate methods and constants order in the contract ABI before compilation?
3
votes
0answers
152 views

Smart contracts and ICO questions

I am trying to learn and understand how ICOs and the smart contracts used in them work and I am having a hard time understanding the following: Take for example ParagoinCoin, you can see here that it ...
3
votes
0answers
492 views

Smart Contract for accepting multiple ERC20 Tokens

If I wanted a smart contract to send tokens based on the exchange price of the ERC20 token received, or any agreed upon value in US dollars how would I do so? For example, If i wanted my tokens to ...
3
votes
0answers
136 views

Identity valuation using smart contracts

Hi I'm currently exploring whether it makes sense to build a platform which would use a blockchain to verify a user and the data that they would add to the platform. Very simple example would be ...
3
votes
0answers
33 views

Is there any way to generate cheap proofs of Ethereum's state?

A contract on the Ethereum network can interact with other contracts within it without requiring any proof, because the system itself defines methods for cross-contract communication (SEND, CALL). ...
3
votes
0answers
310 views

How to debug Bad jump destination error

I am trying to work through the https://ethereum.org/token#improved-coin tutorial. I deployed the contract to testnet. Initialized tokens, set the buy and sell price. Now, one of my accounts has 50 ...
3
votes
0answers
120 views

Is there any reference on writing contracts directly with the bytecode language?

It would be great to have a complete reference of all the opcodes available, their exact effects and costs, and an example "Hello World" in ethereum assembly. Edit: this question isn't a duplicate of ...
3
votes
0answers
94 views

Contribute function of crowdsale is not working

I am having a crowdsale contract. I am trying to run contribute function using command: contractInstance.contribute.sendTransaction(101,{from:eth.accounts[0],value:200, gas:4000000}). It is creating a ...
3
votes
0answers
123 views

How to enable autobuy of Ethers in exchange of my CryptoCurrency?

I'm referring this page : https://www.ethereum.org/token#automatic-selling-and-buying My question is that how is it possible to integrate third party in our Smart Contracts to be deployed on Ethereum ...
3
votes
0answers
122 views

Using Mix IDE on a private testnet?

Is it possible to run/debug contracts in mix-ide on a private test net?
3
votes
0answers
130 views

How to use an accessor for imbricated data types?

I'm looking at information about accessors in solidity/js for more complex data structures than just a public array/mapping. How can i access the array in that code for: struct AnotherStruct {....} ...
2
votes
0answers
42 views

Zero Knowledge Range Proofs

I am new to the world of Zero Knowledge Range Proofs. I read the following on GitHub: https://github.com/ing-bank/zkproofs The Zero Knowledge Range Proof allows the blockchain network to validate ...
2
votes
0answers
104 views

How to implement percentage deposit function to smart contract

I need to implement on the deposit function when the ownerAddress is doing a deposit a 10% to be freeze in the smart contract and and if the ownerAddress want's to call the returnDeposit function by ...
2
votes
0answers
28 views

Need Help With Setting Up Multisig Wallet Contract

I need help with setting up ETH multisig wallet contract. I used Mist and I think it's very newbie-friendly. However, there are 3 issues that I encountered: I cannot set up more than 7 owners of the ...
2
votes
0answers
56 views

Why is putting data to storage more expensive during the deployment of contract than storing the same data by a method?

I am working with truffle and solidity (v0.4.23) and found out that when I pass in an argument of constructor some bigger amount of data (16kB) that are saved to storage of a smart contract, it is ...
2
votes
0answers
43 views

A token transfer enable/disable function works fine in 0.10.0 but not working in Mist 0.11.1

So i have this contract where i have a function to enable/disable transfer of the contract's token. it works fine in Mist 0.10.0 but when i try to call the disable/enable function, it gives me the ...
2
votes
0answers
45 views

Interacting with a complex deployed contract from my other contract

For example, I want to call a create market function from augur in my contract. I'm using the recommended pattern, but there are additional contracts that this function brings in, ex ICash, IMarket ...
2
votes
0answers
33 views

How does createProxyImpl work in ProxyFactory Contract?

function createProxyImpl(address _target, bytes _data) internal returns (address proxyContract) { assembly { let contractCode := mload(0x40) // Find empty storage location using "...
2
votes
0answers
75 views

What is a cheap way to store mnemonic generator list of 1024 words in smart contract?

What is the cheapest way to store a list of 1024 words for a mnemonic generator, and why? These ideas had a gas cost of 165720 GAS for a string array, and 42300 GAS for storing all the words in a ...
2
votes
0answers
78 views

Can a token store funds like an escrow and still meet ERC standards?

In one of my contracts, a user creates an escrow that stores some important information. These escrows are bundled together and passed to another contract, which sends the user tokens. The tokens are ...
2
votes
0answers
147 views

Is there a comparison of Ethereum smart contracts to other platforms that also have smart contracts?

Doing some research in the smart contracts arena. But is there an in depth comparisons with the pros/cons of each implementation of smart contracts in other blockchains as compared to Ethereum smart ...
2
votes
0answers
19 views

completely disable contracts on a private network

I'm running a private network I've forked from Ethereum. I'm wondering if the code is so tightly coupled I won't be able to disable contracts or if I could possibly find a line or 2 of code to take ...
2
votes
0answers
231 views

withdraw eth from contract

I have contract and function which accepts ether. How can I transfer ether from contract to any other wallet? I'm using ganache-cli. Function work, and I spent 10 eth on contract(private network). ...
2
votes
0answers
622 views

contract.method.getData getData is undefined

When I use contract.method.getData(params) it throws an error getData is undefined. I searched on github and saw someone used request instead, and I used contract.method.request and it has successed! ...
2
votes
0answers
225 views

Create a child contract from parent contract via remix

I was trying to create a new contract from another one like this: pragma solidity ^0.4.8; contract Child { address public owner; function Child() public { owner = msg.sender; } }...
2
votes
0answers
358 views

Working with time in smart contracts

I know there have been quite a few questions surrounding time, and the use of block.timestamp. However, I still have a few questions design-wise. At what point exactly is it 'dangerous' to use block....
2
votes
0answers
40 views

Where does Ethereum Dapps go in known design paterns

I am doing a Dapp for a school project and I am supposed to choose a design pattern to work with. I want to know the possibilities for design patterns concerning the ethereum dapps, or if they have ...
2
votes
0answers
173 views

Arabic letters not read by web3.toUtf8

I am using arab letters in bytes32 data stored in a smart contract, when reading the data and converting to utf-8 with web3.toUtf8() i get errors like unknown utf character or Invalid continuation ...
2
votes
0answers
316 views

How to set dynamic buy and sell price for my token?

I have built a simple erc-20 token. I used the code given on ethereum.org code as a reference. There they have talked about setting the price of my token. But how do I set it dynamically, as in ...
2
votes
0answers
161 views

Alternative solution for loops in subscription smart contract design

I am a new developer, working on a smart contract mostly for my own learning. I am developing a Smart Contract to handle subscriptions. The contract has the below features. Subscribers can subscribe ...
2
votes
0answers
46 views

Why would a contract throw after it has executed the last line of code?

I'm debugging a contract function with Truffle. It always throws the following error: Error: VM Exception while processing transaction: revert However, I'm certain that the function has reached the ...
2
votes
0answers
148 views

Call several endpoints in an Oraclize nested query and return an array

I am trying to get an average of ETH/USD conversion rate through Oraclize. My query works well when calling one single HTTP endpoint but I would like to call several endpoints within the same query ...
2
votes
0answers
65 views

Is it possible for a mapping to run out of space?

Can storage mappings in a contract run out of space? Say that mapping was keyed to an address and the value as the following struct: User bytes32 name uint8 age Theoretically, if there was a ...
2
votes
0answers
52 views

Smart contract state storage under the hood and scalability

I know smart contract state is being added in block, Does this true always ? When I add or update an array of struct in contract what happens under the hood ? Is there any limit for such data ...
2
votes
0answers
347 views

Submarine sends and CREATE2

I've been reading about the problem of front-running, especially in the Bancor case (https://hackernoon.com/front-running-bancor-in-150-lines-of-python-with-ethereum-api-d5e2bfd0d798). One proposed ...
2
votes
0answers
237 views

Usage regarding for loop in solidity contract

I am trying to integrate for loop in my smartcontract for adding details to a struct. I have implemented for loop using frontend by calling the function in smartcontract one by one. struct details {...
2
votes
0answers
445 views

Do we have to have a fallback function in our smart contract?

I have a smart contract that has only one payable function and one that pays, as follows: contract DAO_Test{ // define something function buyToken() payable external returns(bool){ ...
2
votes
0answers
58 views

Contract Development Problem in Parity

I run Parity on the command line using: parity --chain dev I run this so I can develop and test smart contracts. The problem is, whenever I try to develop a Smart Contract by clicking Contract -> ...
2
votes
0answers
81 views

How does the increasing array size affect contract throughput?

I was working with arrays in my contract and I came across the fact that I'm deleting the middle element from an array and because I don't want to ruin the order I don't shift the last element to the ...
2
votes
0answers
225 views

Can successive confirmation length blockhashes be used to generate an effective random number?

I've been trying to make a random number generator that doesn't need to be outsourced like Oraclize or break down at scale like RanDAO where n deposits gives 2^n possible manipulations for the random ...
2
votes
0answers
81 views

Can a smart contract in Go language be deployed to azure ethereum consortium blockchain? If yes, how?

I have a smart contract(created in GO language) working for IBM bluemix blockchain. This work was done by a separate team.I need to create a replica of the same using a Azure Ethereum blockchain. I am ...
2
votes
0answers
94 views

How is Ethereum integrated into real world (situations)?

For example, there exists a smart contract for marriage, known as I want half. Does the corresponding property have to exist in Ethereum too? Where will the contract gain knowledge about the IRL ...
2
votes
0answers
1k views

How can we lock an ERC20 token in a contract and generate another ERC20 token proportionally over the locked duration?

"Gnosis tokens (GNO) are the generator for Wisdom token (WIZ) creation. WIZ can only be created via activating the utility of the Gnosis (GNO) tokens. This is done via a smart contract system. The ...