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
vote
1answer
39 views

How to set limit on erc20 token

I want to set limit on erc20 token that owner will not transfer after the set limit. Lets totallSupply =1000 tokens But transfer function could not be able to transfer more than 500 tokens. Please ...
2
votes
0answers
27 views

Information/documentation about get data access from smart contract [closed]

I have been reading about giving data access from a smart contract, but I could not find good and precise documentation/information about that. I would like to make a smart contract where a user gives ...
1
vote
2answers
81 views

Efficient way of checking and inserting array address that is unqiue

I have a following requirement that need to be cater in dapp. Insert array of address The array need to be unique. If one of the array address already exists, reject and revert entire operation. ...
0
votes
1answer
44 views

How to refund a wallet address from a contract with solidity and web3

I am building an app where I'd like a purchaser to be able to seek a refund from the contract. Essentially I am trying to transfer eth from a contract to a wallet. When I get to the point of issuing a ...
1
vote
0answers
21 views

Challenges of Contract design [closed]

I am about to start designing a smart contract intended to be the backbone of a platform in the finance domain. My question is what are the challenges and problems that I may face or have to deal ...
0
votes
1answer
13 views

Gas deduction on contract creation inside a contract

I want to create a Contract (TokenTimelock from Open Zeppelin) inside of a registry contract. It seems as if my contract needs gas to do this. So I am wondering about using delegate call because I ...
0
votes
1answer
45 views

what is contract type in solidity and what is the use of it

contract DappToken { string public name = "MDV"; string public symbol = "$$$"; string public standard = "DApp Token v1.0"; uint256 public totalSupply; // ...
0
votes
1answer
25 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
15 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
37 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
18 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
38 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
141 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
23 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
1answer
29 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
40 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
22 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
38 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
52 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
81 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
56 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
29 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
21 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
25 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
15 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
23 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
40 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
46 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
23 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
30 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
51 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 ...
1
vote
3answers
38 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
24 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
27 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
20 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
34 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
61 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
65 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
25 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
14 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
39 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
38 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
47 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
35 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
53 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
28 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
1answer
33 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
20 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
21 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
71 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 (...