Questions tagged [contract-development]

Questions regarding the development of smart contracts

Filter by
Sorted by
Tagged with
0
votes
3answers
237 views

how can I deploy two contracts

for example, contract A{ } contract B{ } but here contract B will call contract A, I use solidity to compile and get two source code, how can I deployed it? deploy two times on myetherwallet ...
0
votes
0answers
46 views
+50

Linked contracts not running on go-ethereum

A very simple linked contracts example where A contract has a variable and B contract queries the A contract's variable is running ok on Ropsten+myetherwallet and Remix sandbox, but it fails when ...
0
votes
1answer
137 views

read error unexpected EOF

I'm working a evidence application with quorum.I want to store the entire contents of a file on my private blockchain. Although it's not recommended. At first I use a linux command 'split' cut a big ...
0
votes
0answers
14 views

Can a factory-contract access/read/modify variables in generated child-contracts?

at the moment I am experimenting with the factory/child-logic in solidity. With my factory contract I am able to create child contracts in which an auction is executed. Now I want to return a variable ...
0
votes
1answer
27 views

Solidity - Creating child contract

Recent code: pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; contract Master { address Pi_C_Owner; address payable public NewAuctionPayable; //Hilfsvariable um ...
0
votes
2answers
152 views

Cryptocurrency Tutorial: how to transfer on the geth console?

I build, compiled and deployed (to Testrpc) the token contract from the cryptocurrency tutorial. The token offers the transfer(addres _to, uint256 value) method, which I would like to call from ...
0
votes
1answer
6 views

How estimate GAS from a contract call with Web3j

I'm trying to estimate gas cost of a contract call, i need to send a string to a contract, but i need to see if i overtook the GAS limit. I'm trying like this: Transaction t = Transaction....
0
votes
1answer
16 views

Does etherum support smart contrast that has many subcontracts that can be executed once they are called by others

Can I have a main smart contrast that has many subcontracts that can be executed once they are called by other people? And the subcontracts can update the status of the main one if some conditions are ...
4
votes
2answers
2k views

Is a smart contract analogous to an OOP class?

Can I think of a smart contract as being analogous to a Class in an object-oriented programming language (e.g., Java)? Each transaction that uses the contract essentially instantiates an object of ...
0
votes
1answer
22 views

How to match the data in the struct?

If the Set function receives two inputs 1.["0xca35b7d915458ef540ade6068dfe2f44e8fa733c",50,"ROC","park"] 2.["0x14723a09acff6d2a60dcdf7aa4aff308fddc160c",60,"AU","school"] How can I return all the ...
0
votes
3answers
49 views

Alphanumeric ranking of adresses

How is it possible in an ethereum contract to sort the public adresses of senders of eth in the contract in the alphanumeric order ?
0
votes
1answer
20 views

Could I implement a kill switch in my solidity program?

I was wondering if there was a way to put a killswitch into my solidity code? I am using v0.4.21+commit.dfe3193c Thanks a bunch!
2
votes
2answers
100 views

Solidity modifiers: good or bad?

I've heard arguments both for and against Solidity modifiers. On the one hand, they make the code very readable, and the intents behind the calls are very clear. On the other, they increase the ...
0
votes
2answers
92 views

Are there any code quality certifications or standards for smart contracts

In light of recent statistics on # of bugs in smart contracts and the DAO heists I like to know if there are any kind of smart contract quality certification framework , smart contract standards or ...
1
vote
3answers
396 views

How to transfer token to an address?

Im using truffle and openzeppelin for issuing my ERC20 token. I already can add and buying the token, but still cannot transfer the token to another. when i console.log the contract, it show me: and ...
1
vote
1answer
138 views

Can a mapping or array within struct made public?

contract CrowdFunding { struct Funder { address addr; uint amount; } struct Campaign { address beneficiary; uint fundingGoal; uint numFunders; uint amount; mapping (uint =...
0
votes
2answers
136 views

Problem with decimals when setting price for ico

/// @notice Constructor of the contract function startToken() { IcoIsRunning = true; minimalGoalReached = false; icoIsClosed = false; tokenBalanceOf[this] += _totalSupply; allowed[...
0
votes
1answer
155 views

Freeze account for a limited time after transaction

Is it possible ina contract to freeze an account for a specific period of time, 1 month in example, after a transaction, let say the user sends 1 ETH to my contract and he can't do another transaction ...
2
votes
1answer
968 views

token transfer fails in crowdsale contract

I have a token contract and a crowdsale contract. When I try to send ether to the crowdsale contract from accounts[3] (or any other really), I get an opcode error: Error: VM Exception while ...
0
votes
1answer
256 views

The use of ERC20 tokens in a private ethereum network

I am being told to use a private blockchain instead of the public one in attempt to cut gas cost. But I was hit with the problem of the value of ether and tokens in this private blockchain. I am ...
0
votes
1answer
41 views

Solidity smart contract function in function [on hold]

I tried to write a smart contract like the following. There are two function of a contract: the first function makes confirmation of a condition, the second function makes a new contract, if all ...
26
votes
4answers
12k views

How can I represent decimal values in Solidity?

I just started writing some solidity and I noticed that there are no decimal values such as double or float. What do you guys do when you need to return send to a wallet let's say 1.57 ether? Or when ...
0
votes
1answer
131 views

Are there any security issues to send token in fallback function?

I want to have a contract that releases an erc-20 token as soon as someone pays ether to contract. Let's call this contract Bid Contract. The abstract code goes like: function askForTokens() public ...
0
votes
1answer
20 views

Is there any chance to retrieve data on a database(sql) to a smart contract [duplicate]

I want to write a smart contract that gets id numbers as inputs and then retrieve data that are recorded in a database.Is there any specific database for that process.
0
votes
2answers
21 views

How can I add mint and burn function to my erc20 contract code? [on hold]

How can I add mint and burn function to my erc20 contract code? This code is working properly but I couldn't add mint and burn function that work. Is there anyone who will help me about fixing this ...
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. ...
0
votes
1answer
128 views

Callback error when contract is mined successfully

I am getting an error today, when tried to mine a contract to ethereum testnet. Even after the transaction is mined successfully (I can check that in the Testnet), the call back is executing the code ...
1
vote
2answers
296 views

Invalid Op Code - passing bytes32 array to a contract method called from another method of another contract

I've been banging my head on this one for some hours, I'd appreciate any help :) This is a final edit to clearly state the issue: Is there a proper way to pass a bytes32 array to a method on contract ...
1
vote
2answers
162 views

function approveAndCall error

I creat token contract using remix. The function approveAndCall code is following. function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { ...
0
votes
3answers
456 views

How to pass the external account address to the contract function when calling another contract

If we deploy the contract B, and pass the contract B address to the contract A. When call the contract B function from the contract A, inside the contract B function, the msg.sender is the "address ...
1
vote
1answer
124 views

Is there an explorer like Etherscan for Remix JS VM sandbox blockchain

I created a contract and did some transactions. I would like to explore the transactions in the sandbox blockchain in my brower (Chrome). But the tx hash is not found in the REMIX VM Debugger http://...
0
votes
0answers
19 views

Failed to compile <modul not found>

please help me Module not found: Can't resolve 'web3' in 'C:\Users\block\src\components' i don'k know why .. my app.js import React, { Component } from 'react'; import logo from './logo.svg'; ...
1
vote
2answers
125 views

How to use a date time from an API to prevent contract interactions if the date is a string?

I want an to use an oracle to prevent contract interaction after certain time cutoffs This is the APIs format: "event":"event2","timezone":"UTC+1","datetime":"2018-06-07 01:00:00" I think doing all ...
4
votes
3answers
159 views

how do you sign transactions programatically?

imagine there's a dapp you're building and on your website users type the receiver address, the value and what you do is send from that user's address to the receiver's address the value ether. My ...
0
votes
1answer
672 views

Uncaught Error: Cannot find module 'web3-eth-personal'

I have these two lines of code to unlock the default account, But i keep on getting error , tough the require path points to proper directory of web3-eth-personal, var personal = require('./...
0
votes
1answer
142 views

How to set ${CMAKE_INSTALL_PREFIX}/bin in the path?

I want to develop smart contracts and started from scratch and i couldn't find a solution to set my CMAKE_INSTALL_PREFIX/bin environment path!
4
votes
3answers
158 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 ...
0
votes
1answer
29 views

Setting methods permissions a quorum network

I have 3 solidity smart contracts that run in a quorum network with 7 nodes. At the moment i use the constructor to set the owner of the smart contract, that is the node that deployed it. ...
0
votes
1answer
132 views

Is it possible for a ERC20 token to be associated with an application account after the fact?

Say you want to create a new utility token offering, and owning that token will be useful in an application still in development. You don't want to dissuade people from purchasing by requiring a lot ...
0
votes
2answers
18 views

Check if contract exists in list

I've got a contract which creates another contracts and stores them in a list. How can I check that contract with specific index already exists? import "./User.sol"; contract Main is Ownable { ...
0
votes
1answer
36 views

Must consider things for every smart contract

When creating smart contract from scratch, what kind of things you should consider? For example: 1.Certain functions should be accessible only by creator/specific addresses 2.Fallback function Is ...
2
votes
3answers
3k views

How to do an air drop to all ETH token holders?

Say I have an ERC20 token and I want to distribute it 1:1 to all ETH token holders at a given block. Is there a straight forward way to make a smart contract that anyone could call in order to receive ...
9
votes
1answer
76 views

What will happen to legacy smart contracts when Ethereum 2.0 is released?

Most importantly, ERC20 and ERC721 tokens. Will they be migrated to the new chain? Will migration only be optionally possible for contracts with an owner? What about contracts which rely on proof of ...
0
votes
1answer
17 views

i got error in if statement while i using the solidity version 0.5.0;

pragma solidity ^0.5.0; ... function SearchByTenderId(string memory a) public view returns(string){ string memory Id=a; if(keccak256(TenderId) == keccak256(Id)){ return "TenderId is ...
0
votes
2answers
152 views

Create Tokens Pegged to Ether

I would like to create tokens where its price is pegged to the price of Ethereum (i.e. Ether price goes up, my token price goes up). Regardless of number tokens been sold or changed hands.Is it ...
0
votes
1answer
21 views

Keeping a finite set of addresses (Solidity)

struct Data { ... } contract Court { mapping(address => Data) subcourts; } I want to keep track of a small finite set (which can be added or removed) of all keys of this mapping. What is the ...
0
votes
1answer
519 views

Input data on Solidity

I'm trying to do something simple like Hello World that shows on a webpage. I've written a smart contract like this: pragma solidity ^0.4.18; contract HelloContract { string word = "Hello World!"...
1
vote
1answer
223 views

smart contract and private blockchain

I have some IoT(Internet of things) nodes sharing the received data from sensors with each others. I partitioned them to 2 private(permissioned) networks: Network 1 includes: X,Y,Z nodes trusting ...
0
votes
1answer
138 views

reconciliation and approval using smart contract

Has anyone attempt to build smart contracts for reconciliation and approval workflows/process? E.g., if fields match, update the string variable and evoke another contract to request for approval ...
0
votes
0answers
10 views

Auction Contract with “Right to Bid”

I build a basic reverse auction you see here using Solidity and the ethereum remix IDE. In addition to the functionalities already implemented I would like to add a "SafetyLimit" amounting to half the ...