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

1
vote
1answer
74 views

In OpenZeppelin _deliverTokens() from CrowdSale contract is not called

I am using openZeppelin for creating the ICO contract. Could you please help me to understand the below behaviour ? Crowdsale The CrowdSale contract is having the function buyTokens(). It calls the ...
1
vote
2answers
80 views

Can't return an array of addresses

I'm trying to get all the products (their addresses) belonging to a specific Handler but can't get it to work... It compiles fine, returns the _name and _additionalInformation properly but not ...
1
vote
1answer
24 views

What is a suitable pattern for mobile/web apps that leverage ether?

Looking to understand how to build an app that leverages Ethereum - what suitable patterns are out there (ideally to go via some tutorials). I'd like to build a Hello World simple app (mobile and/or ...
0
votes
1answer
100 views

How to deploy contract with local private key?

I am trying to deploy my contract onto the blockchain in my private network with local private key (no wallet: I used web3.auto.w3.account.create()). I know how to send normal transaction with local ...
1
vote
1answer
29 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); ...
1
vote
1answer
37 views

Smart Contract To Send Multiple Outputs

I'm learning about smart contracts currently and a bit confused as to how they really work. My website allows users to send ETH from their wallet on site to another address off site. During which I'd ...
2
votes
2answers
229 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 ...
-1
votes
1answer
110 views

Trying to figure out this 2 ETH smart contract quiz

Does anyone know whether this smart contract can be broken? Is there some trick behind this? https://etherscan.io/address/0xfc62a32da21052fb3086e8f68ad10a7118a98606
2
votes
1answer
29 views

How to add more logic to a payable function?

How can I add to a payable function the possibility for the buyer (a company, in my case) to add some details about itself at the moment of performing the payment (e.g. registered number and company ...
1
vote
3answers
139 views

How can import one contract functions in solidity

Looking at the solidity documentation i don´t find a date type. Searching in the web I find a GitHub repo that appear one contract that give the posibility to work with date. https://github.com/...
1
vote
1answer
78 views

IPFS Versioning for dynamic content

is it possible to keep versioning in IPFS? Like im saving one row of record like pid:1, mid:3, status: started --> v1 pid:1, mid:3 status;completed --> v1.1 is there any way to implement ...
0
votes
1answer
76 views

Ethereum and traceability [closed]

I'm trying to understand Solidity language in deep. I'm thinking in a traceability test project. But before start the first question appear in my mind. If I want to attach the production flow of one ...
1
vote
1answer
91 views

How to implement Ethereum mixing (or coin tumbling) to preserve anonymity in smart contracts?

According to this answer: (https://ethereum.stackexchange.com/a/62694/23024) one of the approaches to anonymize users in smart contracts is: "writing a smart contract which accepts Ether ...
1
vote
1answer
45 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
30 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
119 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
63 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
22 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
66 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
29 views

Managing unforeseen changes in contract development

I'm reading here: Centralized Administrator All dapps are fully decentralized by default, but that doesn't mean they can't have some sort of central manager, if you want them to. Maybe you ...
0
votes
1answer
26 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
20 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
71 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
19 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
40 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
261 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 ...
1
vote
1answer
66 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
78 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
59 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
25 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
53 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
76 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
118 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
81 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
30 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
27 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
49 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
16 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
24 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
42 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
67 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
27 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
33 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
42 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
34 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
46 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
22 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
63 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?