Stack Exchange Network

Stack Exchange network consists of 174 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

-1
votes
0answers
24 views

Contract Creator has been HACKED, How to recover my token [on hold]

I made a token with solidity as below: pragma solidity ^0.4.22; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || ...
0
votes
0answers
8 views

How to pass arguments inside Oraclize API URL?

I am trying to call Oraclize API URL. I saw many codes related to the same. One of the example I explained below. function update(){ oraclize_query(60, "URL", "json(http://api.fixer.io/latest?...
0
votes
1answer
9 views

how to pass value to contract via php (no java script)?

I wrote a contract that get a unit and do something My question : How to pass a value to this contract function via PHP? (not js,py,MetaMask, ... . just in php) For example, I use this and install ...
1
vote
1answer
9 views

Ethereum Node I want to export transactions from a token

I have an Ethereum node running and I am wanting to export transaction history for a specific ERC20 token to a local database every 10 minutes. Does anyone have any suggestions on how they would do ...
-2
votes
1answer
16 views

What other function calls can freeze a smart contract like the pause() function?

I'm learning to audit Ethereum smart contract code for clues if a smart contract can be frozen or not. Many smart contract creators claim their contracts are "unstoppable", but I'd like to know if ...
0
votes
1answer
14 views

Error: The contract code couldn't be stored, please check your gas amount. Modified truffle.js not solving the problem

My smart contract could not deploy successfully, it contain 400 line. My truffle.js was configure to module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> ...
0
votes
2answers
30 views

web3 returns 0x0000000000000000000000000000000000000001 as an address

I'm trying to create an asset in a smart contract using MetaMask and web3.js: contract AssetTracker { struct Asset { string name; string description; string manufacturer; ...
0
votes
1answer
31 views

Time Lock and vesting smart contract

I would like to create a smart contract that will take care of locking and/or vesting funds to several beneficiaries (inputted by the owner of the smart contract). The funds that it will vest and lock ...
0
votes
1answer
7 views

Mycontract.deploy().send() does not work

I am trying to deploy a contract with web3 1.0.0 like: myContract.deploy({}) .send({ from: '0x1234567890123456789012345678901234567891', gas: 1500000,z gasPrice: '20000000000000' }, ...
0
votes
0answers
11 views

Where Does Streamr Market Place Stores Data of Seller [on hold]

In the Streamr Application When a seller creates a product and publish it. What happens next? Where the information about product is stored and when the seller uploads the data stream what happens ...
0
votes
0answers
9 views

Building Data Stream Market Place on Ethereum

I want to build a Data Stream Market Place based on Ethereum Like Streamr. There will be two kind of users, Sellers who can upload their Data Streams through API and Buyers who can purchase the ...
0
votes
1answer
8 views

Create a child contract from a parent contract and forward the sender amount to it?

I want to spawn a child contract from a parent/owner contract. I would like the caller of the creating function on the parent contract to pay for gas and fee and also pass on the sent value (payable ...
2
votes
1answer
26 views

Handling the String msg returned from revert() in solidity

This is my sample contract.. pragma solidity ^ 0.4.15; contract Sample{ struct Info { address pubKey; //key bytes32 Id; } mapping(address => Info) public userMap; // ...
0
votes
1answer
14 views

Creation of duplicate contract in solidity

I have a contract A and values stored in it. Now, if I want to create a contract B, which uses all the values stored in contract A and do some manipulations over there, how can I implement it? i.e., ...
0
votes
1answer
26 views

Is there a way to get the deployed contract from a contract ABI?

Found an implementation of a dapp that uses a solidity contract but what's only available is the contract ABI from their project and not the solidity file. Just wanna ask if this is possible.
2
votes
1answer
21 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 ...
0
votes
2answers
56 views

What is the best practice for a tax payment Smart Contract?

I have just been introduced to Ethereum Smart Contracts and I have a faculty-related project that implies the usage of them. The idea is to create a DApp which allows clients (persons) pay taxes (in ...
2
votes
0answers
27 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 ...
0
votes
1answer
22 views

Can storage be referenced without being copied?

With for example struct Foo { mapping(address => uint) b; } Foo[] foo; if a function only deals with foo[4], can it reference it from storage without copying it? is that what function c() { ...
0
votes
1answer
12 views

Does function inherit variables from modifier?

In a contract where a modifier like this would be reused a lot, is ID inherited by the function that uses the modifier? If not, this check would need to be in the function. If yes, is there any ...
0
votes
1answer
10 views

Use same argument name in modifier and function

If I have a function function b(address _foo) verifySomeClause { } and a modifier that can take different addresses as an argument, so that msg.sender can be one of those, modifier c(address _foo) {...
0
votes
1answer
14 views

Is it possible for a contract to update the amount of tokens owned by an address, according to a parameter called with Oraclize?

I am trying to figure out if a contract can change the amount of tokens owned by an address according to certain parameters. I couldn't find anything.
0
votes
1answer
22 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
2answers
36 views

Ethereum solution for shopping website

I have a shopping website and I decide to use Ethereum Do u have any solution for this conditions? we have 2 kinds of users we have 2 products with non-content price (price change randomly) we don'...
0
votes
2answers
30 views

avoid replay attacks on signing on smart contracts

the scenario: a user has a privatekey and wants to sign something to send to the contract ex: the user send his (message,signature,publickey) to the contract and the contract can verify it with the ...
2
votes
0answers
18 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 ...
0
votes
1answer
23 views

How to cearte a contract with sub contracts

I want to use Ethereum in donate part of my website I need unique payment address for each user As I search I find out that I need a contract that each time called, generate a new contract and so I ...
0
votes
1answer
44 views

Sending ether between contracts that does not know each other

I want to create a call from a smart contract A to a smart contract B. Premisses: I have enough ether balance in A I do not know what is the name of B's function to be called B's function is payable ...
0
votes
2answers
27 views

updating variable inside and outside struct, different results, why?

With this, bool p does not update, contract b { bool p; mapping(uint => bool) public t; function setValue() { bool b = t[1]; b = true; } function ...
0
votes
1answer
15 views

Gas cost for keep the contract

In Ethereum yellowpaper the gas cost to create a contract is equal 32000. But what is the cost to validate and keep the contract operating until it is executed? Edit: Imagine the following situation:...
1
vote
1answer
16 views

Send eth from one account to another using transfer() function

I am trying to write a smart contract that will send eth from one account to another account : Contract Send { event Sent(address from, address to, uint amount ); function send(address _receiver,...
0
votes
2answers
16 views

Are there a standard for generating a unique thing to send to the smart contract?

Are there anything that is unique maybe combine with time, user address or something else, and send it to the smart contract, and the contract can know that it is indeed the unique thing that user ...
0
votes
1answer
16 views

Ethereum Sidechains can run it own smart contracts

When I use a sidechain to store certain information, are smart contracts made in Ethereum's main blockchain or can I have smart contracts inside my sidechain not using Ethereum main chain?
0
votes
2answers
29 views

Ethereum verify transaction using ecrecover returns incorrect address

** STILL NOT SOLVED ** I'm trying to verify a message, however the ecrecover function is returning the incorrect address: 0x828c50fDeE9160C76EE160C9d8e9D4bc4Cc3D591 function verify(bytes32 message, ...
0
votes
1answer
20 views

Avoiding for loop and making function call only once by any user

pragma solidity ^0.4.17; // I want to write a code for loyalty points when user pays contract GiveRefreceId { struct referenceids { uint256 rid ; address addressrid; } ...
1
vote
1answer
12 views

Contract Inheritence

Let's suppose we created two contracts: Contract A and Contract B. Contract A is inherit by Zeppelin's standard token ERC20 where as Contract B is inherit by contract A. Will contract B be ...
0
votes
1answer
13 views

how to fix a fact that the recipient received the file so that the recipient could not dispute it?

how to fix a fact that the recipient received the file so that the recipient could not dispute it? How to do this by a smart contract? thanks in advance.
0
votes
2answers
28 views

Can I make recursive calls using Ethereum Alarm Clock Scheduler?

Answer given here does not provide full solution. Can some one please suggest me if it is practically feasible to execute a method in my smart contract every 24 hours using Ethereum Alarm Clock? You ...
1
vote
1answer
33 views

Why is delete on arrays implemented in an energy and gas wasting way?

If I delete the whole array (static/dynamic), then all elements of an array are set to default value. So, it means that if an array has a million elements, then I have to pay gas for setting up of ...
2
votes
0answers
40 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 ...
0
votes
1answer
33 views

What are good ways to randomize a million people into pairs?

I came up with this, each person invokes the function that randomizes them into a pair, it generates a random pair, and if that pair is full, the function scans through pairs until it finds a vacant ...
0
votes
1answer
28 views

Altering / overriding the method from main contract

I am using openzeppelin to create a ICO as a CappedCrowdsale and TimedCrowdsale as mentioned in the example mentioned in the below link. Reference : https://github.com/buddies2705/Solidity-Tutorial/...
-1
votes
1answer
21 views

Understand inter-operation between typical DApp and its underlying smart contracts

I am a newbie to Ethereum and start to study some typical implementations of commonly-used DApp. So basically for the popular dapp on this list (https://www.stateofthedapps.com/rankings/platform/...
0
votes
0answers
18 views

How to execute a method in smart contract automatically after a certain period of time? [duplicate]

I want to execute mint() method in an ERC20 smart contract automatically each year. How can I achieve the above?
0
votes
1answer
22 views

Type Error memory is not converted into struct storage

pragma solidity ^0.4.17; contract hoteltranscation { struct hotel{ string HotelName; uint256 BookingNumber; } function HotelBooking(string _HotelName,uint256 _BookingNumber ) public ...
1
vote
1answer
9 views

How to build a contact that allow rating?

If I have a contract that has a list of sellers, how would I code a simple contract that if some condition applies, the contract in an automatic way will increase the reputation/rating of the sender ??...
0
votes
1answer
19 views

How to prevent a token from being exchanged freely

Let's say that I have created a token and this is distributed through a smart contract. Let's assume that this token is not on any exchange and whenever a transaction is executed using this token a ...
0
votes
1answer
37 views

How can I make a database and smart contract interact?

I started to code a smart contract which was supposed to store some datas from corporations. These datas (mostly names and dates) were organized like that : ├── Client1(Contract) │ ├── Year2018 (...
0
votes
0answers
31 views

smart contract and 2 permissioned blockchain networks

I have two permissioned networks and each network has its own nodes(for example, Net1: Nodes X,Y,Z and Net2: M,N,O) where each node get the data of its own sensors and store in blockchain and then ...
1
vote
2answers
32 views

Estimate Gas Price (not Gas) using Web3

Using Web3, we are able to estimate the amount of gas needed for a transaction let estimatedGas = web3.eth.estimateGas({ to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", data: "...