Questions tagged [contract-development]

Questions regarding the development of smart contracts

578 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
76 views

how can we get ledger way of Debits/Credits happened on blockchain

i am using geth and want to have a list of all the transactions (debits/credits) happened on my privatenet. like the way ledger is being used. is there any way to do this? and how to get all the ...
2
votes
0answers
109 views

Minimal contract testing setup using truffle

This question is a follow up onto this one. I have tried following the suggestion in the answer of adding a done() method that fires when an error occurs (an exception is raised) but it doesn't when I ...
2
votes
0answers
261 views

Unit testing compiled Contracts with Pudding and Mocha + NodeJS constructor not being invoked

I just starting out looking at Ethereum and am trying to test a Contract (using the simple cryptocurrency contract as an example) using Mocha, so I can take advantage of things like chai and sinon, ...
2
votes
0answers
663 views

Tracking contracts and transactions associated with an account address

The base set up is a geth based private test-net and a mist wallet is interfacing the node on a local host machine. A few contracts have been deployed through the wallet from 2 different accounts on ...
2
votes
0answers
579 views

Cannot send ether to contract

I've made the follwoing contract on my private node. > contract { address: "0x27f8df7f80ff48431594ef062ba80b2ad491d27b", transactionHash: "...
2
votes
0answers
419 views

Contract storage not being updated after sendTransaction

First of all, sorry about the code written in Portuguese. I have the following contract: contract GerenciadorBoletos { struct Boleto { uint codigoBarra; uint ...
1
vote
0answers
20 views

exponential function with fractional numbers

With solidity, we cannot directly calculate 0.1 or 0.001. We usually use decimal multiplier and divisor integer to calculate those numbers like this 0.01 = 1 / 100 When the number is more than 1, it ...
1
vote
2answers
99 views

How to withdraw DAI from DSR (Oasis Saving Dapp / MakerDao) using the contract only, not the Dapp frontend?

I am currently testing the Oasis Saving Dapp by MakerDao (https://oasis.app/save). After converting some DAI to DSR, users can earn savings and whenever they want, withdraw their funds (convert back ...
1
vote
0answers
26 views

Exiting out of a smart contract early?

Basically i want to have a smart contract that can allow users to exit early under specific conditions. Does anyone have any resources for this or know whether its possible?
1
vote
0answers
11 views

Geth's golang contract bindings need “RPC subscription features that are still under review” to process event logs. What are those features?

The documentation for Geth's golang contract bindings start out with Please note, events are not yet implemented as they need some RPC subscription features that are still under review. What ...
1
vote
0answers
28 views

Is there a way to deploy a contract using bytecode only (to Ropsten …)?

One solution on medium.com describes how to do that via myetherwallet but it's the old verion of myetherwallet where you can switch between ropsten/mainnet - right now I can't find how to switch to ...
1
vote
0answers
17 views

How dangerous is this: number of contracts contain a function like “approveandcall” which lets anyone call any contract (some thoughts?)

The most common implementation is as follows: function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(...
1
vote
0answers
11 views

Is there a standard for modelling smart contracts such as ERM for databases?

I want to document my Dapp including the "data structure" (i.e. the relationship between different contracts). Is there a good way of modelling smart contracts that anyone has used successfully?
1
vote
0answers
87 views

Error: Cross origin null forbidden : ---Problem in downloading Open source contracts from Etherscan.io

UPDATED: I am trying to download source code of open source verified contract from Etherscan.io. Here is my procedure as directed by Ann. 1. Download CSV file of captioned contracts. 2. Write ...
1
vote
0answers
11 views

Any idea how to add new contracts into drizzle react app using the address?

I have a react app which creates new contracts. lets say A creates B. I have the addresses of the newly created contracts of B. How do i add the newly created contracts of B using its address to ...
1
vote
1answer
22 views

Automatically extracting functions names and parameters from ABI JSON file

I have done some work on captioned subject. For example, I can extract all getter functions (and some constructors as well) of all given smart contracts (in abi json file format). Then i can call (...
1
vote
1answer
29 views

How to search value in data field transaction

I need to look for a value in the data field of a transaction and to know which transactions contain the desired value. Let me explain with an example. In the data field of a transaction there is for ...
1
vote
1answer
26 views

Risk of Messages Not Having a Signature

As per my understanding transactions are signed before sending to Ethereum. Else, no transfer of Ether will happen. However, messages sent to Smart Contracts (SC) aren't signed (e.g., using methods....
1
vote
1answer
39 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 ...
1
vote
0answers
51 views

Cannot execute contract in non-intaractive scripts

I want to deploy and to execute ERC-20 contract on geth with non-interactive scripts. But, it seems that non-interactive scripts and console shows different results. Enviroment ubuntu 18.04(docker ...
1
vote
2answers
193 views

How to get transaction status (programatically, not etherscan)?

I have a problem when I interact with an Smart Contract, from a javascript webapp. I can execute the transaction correctly when the status is confirmed, but I cannot get any error response when it ...
1
vote
1answer
32 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
1
vote
1answer
104 views

How to call a contract function that alters blockchain state on geth console

It should be easy, but I'm having a hard time using a simple smart contract described in the Solidity language reference called SimpleStorage. It only as one attribute, a setter and a getter, and I'm ...
1
vote
2answers
62 views

Storage/Retrieval of mapped structure data

I want to store the structure data in a mapping i.e. if I have a student structure as described below, then I should be able to have a myriad of students and distinguish between them using wallet ...
1
vote
1answer
34 views

Update Private Ethereum node

Now suppose I created my private blockchain using ethereum over any cloud, created dapps over it and created my own crypto over that. Now if ethereum update consensus to POS from POW I want my private ...
1
vote
1answer
26 views

Return fees - is it save?

I would like to return partially fees to users of my dApp. Once they have reached X amount in fees, I want to make a function that will pay them ethereum automatically. Now my question: Is that secure?...
1
vote
0answers
209 views

AttributeError: 'list' object has no attribute 'buildTransaction'

Im trying to send a transaction to contract function with web3.py on ropsten testnet. while doing so, Im getting this error. AttributeError: 'list' object has no attribute 'buildTransaction' here ...
1
vote
0answers
143 views

supply chain contract

As per this contract can some explain about the what input the user will provide and explain about the transporter type when he select option 1 then what input should we give. please explain about the ...
1
vote
2answers
75 views

Inconsistent Result for Web3 Constant Method Call

Deployed a local private Ethereum environment. While trying to invoke a constant method of a solidity contract getting inconsistent results. Sometimes the result is returned and mostly not. When I ...
1
vote
1answer
40 views

During gas-free transaction get an error “No relay responded! 4 attempted, 4 pinged”

I did all modification related to this instruction https://github.com/tabookey/tabookey-gasless However, when I'm trying to write some tests it fails and provides me the following error Error:...
1
vote
0answers
26 views

How to use the Ethereum Natural Specification Format?

I would like to make use of the Ethereum Natural Specification Format (https://github.com/ethereumproject/wiki/wiki/Ethereum-Natural-Specification-Format) but I do not understand how to implement it. ...
1
vote
1answer
100 views

overflow/underflow issues?

pragma solidity 0.5.1; contract basics{ using SafeMath for *; uint time; address payable sender; uint amount; event moneySent(address s,uint a); mapping(address=>person) ...
1
vote
1answer
350 views

Smart contract method error: 'abi: unmarshalling empty output'

I had a working Solidity contract, made a change to its function signature (to take in an array of addresses, instead of a single address), I compiled it, ran abigen and generated Go bindings. Below ...
1
vote
0answers
87 views

Solidity: Creating contracts with contracts by “new” operator

I'm creating "Trade" contract inside "Token" contract. I used an array to store each "Trade" contracts. Used web3, truffle. Token.sol: mapping (address => Trade[]) private _Trade; event tradeMade(...
1
vote
1answer
79 views

How do I send multiple transactions from one wallet in Nodejs?

Hi I've been reading around and I came across Web3.js It's not apparent to me how I can send Ether from one wallet to multiple recipients other than in a batch-style request (which inevitably takes a ...
1
vote
1answer
60 views

Ethereum node vs Ethereum accounts

From my understanding, one Ethereum node can have many accounts and only one of the account can perform mining in each node. So, my question will be what are the usage of other accounts in the node ...
1
vote
0answers
65 views

Can I extend the interface of a contract without redeploying it?

The case I'm dealing with is a contract which should serve as a Data Abstraction Layer. So ideally, it should provide only getter functions and setter functions. For example, my interface is: ...
1
vote
0answers
26 views

How to check ETH contract deposit?

I want to check an ETH contract deposit. This ETH contract deposit: { "blockHash": "0x065e3b474eb1b099a462e5043b906130bf27ed487cc0177a7571b1c059f0bf62", "blockNumber": "0x6db0a6", "from": "...
1
vote
0answers
13 views

How the following scenario be achieved using smart contracts?

Assuming we have two parties (A & B). How the following scenario be achieved using smart contracts? User A will deposit some funds (x coins). user A can receive penalty funds from user B, So user ...
1
vote
0answers
17 views

Secuirty Token Escrow setllement

Is Esrcow could be applied in ST 20 tokens ? If yes, please guide for the same.
1
vote
0answers
37 views

Hardcoded Address

I did an audit on a smart contract and it says it has a hardcoded address. constructor() public { symbol = "0PUCKS"; name = "0 Pucks Token"; decimals = 18; ...
1
vote
0answers
24 views

Ethereum based settlement engine

What do you meant by settlement engine in ethereum? I need a payment settlement engine that to be based on ethereum for cryptos and security tokens. Is the same as escrow ? Any open source link for ...
1
vote
1answer
27 views

looking for ethereum account easy management process

Suppose I want users to answer surveys and that each response are hashed and sent to ethereum. My issue is the user experience of creating an account and login without metamask which is not user ...
1
vote
0answers
34 views

blockhash refactoring, if hashes are relative to latest block, are all stored in contract?

The blockhash refactoring EIP included in Constantinople expands the range of blocks that can be accessed with blockhash(). Besides the last 256 blocks, 256 multiples of 256^1, and 256 multiples of ...
1
vote
0answers
54 views

state channel between smart contracts

In my scenario, there are data sellers and data buyers which might be persons or organizations. I would like to create a smart contract for data seller and another smart contract for data buyer where ...
1
vote
2answers
1k views

Returning Struct Array in solidity

contract TripHistory { struct Trip { string lat; string lon; } mapping(string => Trip[]) trips; function getTrip(string _trip_id) public view ...
1
vote
0answers
91 views

Where is the bytecode of smart contract stored ? And how to get it executed?

Well, my question is terse but to the point: Where's the bytecode of smart contract stored? And how to get it executed ? From the image and Ethereum Yellow Paper we can see there is codeHash in ...
1
vote
0answers
40 views

How to run smart contract using go-ethereum source code?

mycontract.sol pragma solidity ^0.5.0; contract HelloWorld { uint256 counter = 100; function add() public { counter++; } function subtract() public { counter--; } ...
1
vote
0answers
49 views

Possible ERC-20 improvement: Token-specific ENS equivalent

With ENS still providing quite a difficult user experience for the average user, I'm wondering why standards like ERC-20 don't implement a simple mapping allowing people to set names equivalent to ...
1
vote
0answers
137 views

Modifier to only allow access via staticcall

I'm trying to create a modifier that only allows a function to be called using staticcall. Using the view declaration in Solidity 0.5.0 guarantees that a function won't change state, but it still ...

1 2 3 4 5 12