Questions tagged [contract-development]

Questions regarding the development of smart contracts

554 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
1k views

Solidity: How could I decrease gas usage of complex structs?

Struct is very expensive as labelled here: It seems extremely expensive when storing struct type. https://www.cryptocompare.com/coins/guides/what-is-the-gas-in-ethereum/: sstore 100 Paid ...
4
votes
3answers
157 views

Can a contract control another address?

Say I have control of addresses A and B, and I am writing contract C. When I deploy C on the blockchain, it will have it's own address, that can send and receive ether. But I want to have a method on ...
4
votes
1answer
951 views

how to call smart contract function in C#.net core

protected async void Page_Load(object sender, EventArgs e) { var senderAddress = "0x605a1f8d368cbdd4d0a5cbad74f75c428660f17b"; var password = "zxcasdqwe123"; ...
4
votes
0answers
451 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
289 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
412 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
1answer
667 views

Sending string to deployed contract function

var source = fs.readFileSync("./vote.sol", "utf-8") var compiled = web3.eth.compile.solidity(source); var abi = compiled.identify.info.abiDefinition; var Vote = web3.eth.contract(abi); var ...
4
votes
1answer
135 views

How to work with inherited contracts in EthereumJ?

In EthereumJ, I have two contracts i deployed them individually,first one was deployed but for the second i got error as in that i was calling function of first one and example i have second is first ,...
3
votes
1answer
51 views

Matrix multiplication in solidity

I am trying to implement an algorithm requiring matrix multiplication. I know I can program this in the rudimentary way similar to doing the process by hand, but I am worried about the computational ...
3
votes
0answers
60 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
63 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 ...
3
votes
0answers
172 views

Questions on MinterRole contract in openzeppelin

I am using the openzeppelin for creating the ICO contract. I am concerned about the MinterRole here. After I develop Token contract, I added the sale contract as a minter using "addMinter" function. ...
3
votes
1answer
149 views

How to deploy existing DAPP to my private ethereum node?

I am looking to build a PoC around a trading platform on a block chain platform. I am trying to deploy the dapp available here to my local ethereum node. Package contains: a. HTML frontend part b. ...
3
votes
1answer
635 views

ERC223 Token Fallback Function Usage

I'm currently writing the "Trade" smart contract which is similar to "Crowdsale" smart contract. The only function that I want to add is "sell" function. In general Crowdsale smart contract is used ...
3
votes
0answers
93 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
69 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
733 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! ...
3
votes
0answers
214 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 ...
3
votes
0answers
153 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
500 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
139 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
2answers
748 views

Contract creation gas cost depends on code in library function?

I have a contract fooContract which is using a fooLib library, calling fooLib.foo(LibStruct storage param) The transaction cost to create fooContract seems to depend on the code in the fooLib.foo() ...
3
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 ...
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
455 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
311 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
96 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
1answer
270 views

importing a contract does not access to its modifiers

Contract A imports Contract B and Contract B contains a modifier that I want to use in contract A. Contract A is set to inherit from Contract B, however I get the following when I try to use the ...
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
124 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
131 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 {....} ...
3
votes
1answer
73 views

What is the maximum computation a query or constant function in solidity can perform?

Since query or constant functions are just executed on single node there is no dependency on gas or gas limit. I am performing Quicksort in query/constant method. EVM can sort an array of length up to ...
3
votes
1answer
529 views

How do I connect to the Remix JavaScript VM from my front end

I have been developing using Remix and Metamask but it's a slow progress when pushing to the test networks. I have switched to the JS VM in Remix but I am not sure about how to connect my frontend to ...
3
votes
1answer
2k views

What is the burn() and burnFrom() function in EThereum Token Creation contract?

Please find the below ethereum token creation contract. It has two burn functions. It is having redendent params also. Why it is placed, what is the importance of the functions. pragma solidity ^0.4....
2
votes
0answers
19 views

Name Styling Best Practices Internal/External variables/functions etc

The solidity docs clearly specify how to style function order, types etc. However, are there an appropriate way to also separate between internal/external variables, functions etc. I see some people ...
2
votes
1answer
30 views

Ethereum Blockchain Interoperability

I was reading through Vitalik's blockchain interoperability paper available here One thing he mentions is a company / project called EthereumLottery.io (currently not operating) which managed to ...
2
votes
2answers
49 views

To transfer tokens from owner address to an address, if latter address moves some other tokens to a given particular address

I am writing a contract for an ERC20 token (say ABC). Is it possible to airdrop some of these newly minted ABC tokens to those ERC20 addresses, every time, if they transfer a different token (named ...
2
votes
0answers
56 views

How the following pairing equality be verified in Etherum Smart contracts?

I have found available precompiled contracts in solidity. For example, this answer enter link description here points out a precompiled contract that can verify BLS signature. However, looking to the ...
2
votes
1answer
101 views

Metamask Error messages shows only revert

I have a little problem with the error messages I receive from MetaMask. In my dApp I have a modifiers which should throw an error with an error message. However, in MetaMask I only receive the RPC ...
2
votes
1answer
112 views

Contract that converts ERC20 token into a new ERC223 according to specific exchange rate

I did some research but I couldn't find anything so specific. I would like users that own a specific ERC20 token to be able to use it to buy an ERC223 token generated by a contract according to ...
2
votes
1answer
242 views

Is there any simple explanation to multisig wallets?

I read on ConsenSys and Ethereum MultiSigWallet. I got that "The purpose of multisig wallets is to increase security by requiring multiple parties to agree on transactions before execution. ...
2
votes
1answer
152 views

Call a payable contract's function from another contract via an interface

I have two contracts, they are connected via an interface. When user calls contract1 function, it uses an interface to call contract2 function which updates it's storage. My problem is that I can ...
2
votes
1answer
43 views

Ethereum Smart Contract deployed token not showing

pragma solidity ^0.4.24; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); ...
2
votes
2answers
468 views

How can I trigger a quorum private smart contract deployment from my js client app?

My question follows directly this answer to a similar question. I need for my client app users to be able to trigger private contract deployment. I've tried using privateFor with both the web3 and ...
2
votes
1answer
232 views

Remix: Gas required exceeds allowance or always failing transaction

I have a contract which has transferFrom function mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; mapping (address => bool) public ...
2
votes
0answers
138 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
31 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
64 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
55 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 ...