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

0
votes
1answer
17 views

Delay a transaction

Is it possible to delay a transaction in one contract? let's say Alice wants to send a product to Bob and Bob has to transfer, for example, 2 Ethers to Alice for buying that product. How can I do ...
1
vote
1answer
15 views

Create Contract Solidity 0.5

My code works with compiler 0.4.25 but not with the latest version. I want to keep track of every "Contract 2" that "Contract 1" create. Contract 1 uint public countContract; address[] public ...
1
vote
1answer
27 views

Drizzle CacheCall always returns null

I have set up drizzle to be able to connect to my smart contract from my react-application. After some fiddling, I decided to make this function in my smart contract: /*** test ***/ uint numberFive = ...
0
votes
0answers
16 views

How to flush token to another contract from token holder's token balance from ERC-20 contract?

I have to implement the following scenario: - One ERC-20 token contract. - Another contract which will flush tokens of ERC-20 tokens. - Add these tokens to one, defined Admin address. Note: All ...
1
vote
2answers
24 views

On-chain settlement based on off-chain activity

I'm build a DApp where the end-user should be able to attach a proof (could be information, data, attachment, whatever). Now, if the DApp accepts this proof as being legit off-chain, then I want the ...
0
votes
1answer
20 views

How to integrate Drizzle with react

I have currently set up a truffle project with react, redux and react-router. I just finished writing my first implementation of the smart contract, and now want redux to connect with the smart ...
0
votes
1answer
19 views

How to return values from dynamic array push function?

How to fetch value from dynamic array push function? Below is the code of pushing function, but how will I fetching that array values? contract PushStruct { struct MyStruct { uint field1; ...
1
vote
1answer
14 views

onERC721Recieved implementation

As per the ERC721 requirements, I have to implement onERC721Recieved. This is how I did it: function onERC721Received( address _operator, address _from, uint256 _tokenId, ...
0
votes
0answers
21 views

Uncaught (in promise) TypeError: rentalInstance.carsCount is not a function

I am beginner in writing Dapp. I am writing with truffle and solidity. Rental.sol pragma solidity ^0.5.0; contract Rental { // address[16] public rentals; // address public owner; ...
3
votes
2answers
46 views

Can we do ethereum transaction for free on private blockchain

I am very new to ethereum Blockchain. Please give some suggestion regarding one query regarding gas fee. Can we do ethereum transaction and smart contract deployment for free on private blockchain ...
0
votes
0answers
17 views

The transaction block is getting added to the block chain But transaction is getting failed to execute. @lauri Peltonen [on hold]

After update, we are trying to send eth/erc20 token from main wallet to other wallet The transaction block is getting added to the block chain But transaction is getting failed to execute. I am ...
0
votes
1answer
20 views

How to set up Quorum Blockchain?

I have read a lot about Quorum blockchain. My goal is to run and test it. I have found many articles. Could anyone suggest me good start-up articles for setting-up the Quorum on a number of nodes and ...
2
votes
1answer
13 views

What is the alternative to using **label** in solidity inline assembly code?

What is the alternative to using label in Solidity inline assembly code? Label is deprecated in new version.
2
votes
1answer
17 views

Invalid implicit conversion from uint256 to bytes memory requested

I am trying to create a simple random function but it gives me an error. I can't figure out what I do wrong. Solidity 0.5.0; function random() private view returns(uint){ uint source = ...
0
votes
1answer
23 views

What DSAuthority(0) and eos.owner() means and does?

In ERC20 EOS crowdsale contract, what these three lines(469-471) does? function initialize(DSToken eos) auth { assert(address(EOS) == address(0)); //[Someone explained this line here][...
0
votes
1answer
39 views

How can I decode transaction input to know what method was called and what arguments were passed in (and arguments types)?

following to the approach explained here to use etherscan api from Python to get transactions info such as input How to retrieve transactions' info such as gaslimit and gasprice from Etherscan? ...
0
votes
1answer
27 views

Two smart contracts interacting, should they know each other?

This may sound like a very naïve question. It's the first time I'm making interact two smart contracts (in general, I'm not very proficient with blockchain development). I have these two smart ...
0
votes
1answer
23 views

How to get total values in mapping and details of each transaction

I am trying to write a simple contract contract students{ uint public totalTokens; constructor() public { totalTokens = 800; } struct Students{ uint amount; string givenFor; } mapping (...
1
vote
0answers
13 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: ...
0
votes
1answer
20 views

how to get contract creation code (bytecode) from etherscan api?

I tried etherscan api to get the contract creation code (bytecode for depolying contracts). I tried both getContractABI and getSourceCode, but the return values are not what i am expecting. I need ...
0
votes
1answer
18 views

Replacing a requirement for TRC10 token with TRC20 on a TRX contract

I have a contract that allows users to buy a token and pay with a TRC10 token deployed on Tron. Is it possible to replace the token ID with a TRC20 address instead? And if so, how do I implement it? ...
-1
votes
0answers
8 views

Last step of sending MultiSig transaction on Gnosis Safe

I have prepared multisig wallet using Gnosis Safe. There are 3 assigned addresses, which are required to sign every transaction. Everything look perfect and it should work out, but when I'm ...
0
votes
0answers
26 views

Issue calling one contract from another using Quorum

I'm using truffle and running locally with 4 quorum nodes, trying to call another contract's function, but keep getting 0 in return instead of the expected value the I get once calling the contract ...
0
votes
1answer
25 views

Gas specification for function call

Is it possible to specify gas cost for a particular function call? E.g. Let's say I want a transfer() function to cost 50000000 gas, would I be able to hardcode this into the function?
7
votes
1answer
86 views

Why does adding a view function make write functions cost more gas?

When I add a view or pure function to a contract, it sometimes impacts the gas costs for unrelated write functions in the same contract - requiring another 22 gas. pragma solidity ^0.5.0; contract ...
0
votes
1answer
24 views

2FA / Authentication Through Smart Contract

How can I generate something similar to 2FA on-chain? Could the private key or public key be used somehow in secrecy to compute a value or something? I need a way to authenticate a smart contract user ...
0
votes
0answers
21 views

Multisignature wallet for ERC20 tokens

I am developing my own multi sig wallet, however I am new here, so I don't have good understanding of how does the exchange ERC20 <=> ETH work 1. How to get BNB coins? As I understand, for ...
0
votes
0answers
12 views

ethereum smart cotract ioT implementation

For the preparation of a project in my thesis, I need to implement ethereum blockchain to control the access of the IoT using smart contract. Can you recommend me a tutorial to prepare this without ...
-3
votes
0answers
21 views

Error! Unable to generate Contract ByteCode and ABI .help ME

pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'UBL' token contract // // Deployed to : 0xA6959d1c11D4D1ec009FeF38a7a93bDEb76f1429 // ...
1
vote
1answer
23 views

Is it possible to get a function's original returndata if it is wrapped in an interface that doesn't return anything?

Will a function's returndata persist through a wrapper, even if the wrapper does not support a return value? An example would be as follows: contract OriginalContract { function originalFunction()...
0
votes
1answer
77 views

I need help to understand why a function call reverted without any reason

I have a Registry contract, which holds addresses of different smart contracts. The registry has getter for every contract address it holds. In other contract at some point I need to retrieve one of ...
0
votes
2answers
46 views

Transfer ERC20 Token feeless

Is there an existing Smart Contract implementation, which can public signed transactions of ERC20 Token transfers? I like to give the users of a ERC20 token the ability to pay the transaction fees in ...
1
vote
1answer
19 views

Where is the position of each paramter in a smart contract function when encoded as inputdata in a transaction

When I reviewed the BEC attack, I found the position of each parameters value in real transaction was not corresponding in to definition of function in smart contract. The exploit transaction is at: ...
0
votes
1answer
20 views

problem calling balanceOf from another contract

I try to learn solidity and i have a problem. I've created a base token and i want to call the balanceof method from this token in another contract. In Solidity Remix i get : call to BaseTokenBet....
0
votes
1answer
21 views

ERC721 Contract vs. Auction Contract - Architectural Approach [duplicate]

I'm working on a new ERC721 Crypto-Collectible project, which also means creating an Auction and Marketplace functionalities into the whole thing. Should I just start with a basic ERC721 Contract - ...
1
vote
1answer
32 views

Debugging a failed transaction

I have a smart contract deployed to mainnet. A user has executed a transaction that resulted in a revert failure. How can I debug this transaction to determine what exactly happened that resulted in ...
0
votes
1answer
19 views

how to change approveAndCall() function for upgraded compiler version of solidity 0.5.1 from 0.4.6?

Here is the code snipped which is used when I'am working with compiler version 0.4.6 : function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) ...
0
votes
1answer
11 views

Error when checking the value in a mapping

I am trying to keep track of the number of bidders in my contract. function bid() public payable an_ongoing_auction returns (bool){ uint oldval = bids[msg.sender]; require(msg.value+oldval &...
1
vote
1answer
41 views

Contract that converts ERC20 token into a new ERC223 according to specific exchange rate

I did some research but I couldn't find anything so specific. I would like users that own a specific ERC20 token to be able to use it to buy an ERC223 token generated by a contract according to ...
0
votes
0answers
14 views

What does endCliff and endVesting time means in PolyMath contract?

What does vesting and cliff exactly means in smart contract and blockchain terms. Here I've added code snippet: if (_supply == AllocationType.PRESALE) { AVAILABLE_PRESALE_SUPPLY = ...
1
vote
2answers
33 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
1answer
12 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 ...
0
votes
1answer
33 views

Is it okay to define the following smart contract that a accepts funds from two parties?

I want to deploy a smart contract that receive funds from two parties. The contract is initialized with some ethers from person (call it revealer), and another Recipient (name it fineRecipient) who ...
0
votes
1answer
41 views

Buy/Sell Smart Contract - how to start?

I have a dapp that allows you to upload pictures into blockchain using IPFS and I would like to implement a buy/sell smart contract that will allow users to buy the pictures or to setup terms to sell ...
0
votes
1answer
20 views

I am following Ethereum Book, but I am getting errors in the Terminal

I am learning Ethereum Development from the Ethereum Book by Andreas. I have stumbled on the first error trying to do $ cargo install . I will post the instructions as an image and the errors I got. ...
0
votes
1answer
23 views

web3 reading memory string gives error

i have declared a string variable in struct like struct test{ string testString; } I have written a function to access the variable like function getteststring(uint256 index)public ...
0
votes
1answer
15 views

Can be fix our token price to a stock?

For example can we create a pepsi token which is fix to pepsi stocks? Do you think that is useful?
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 ...
0
votes
0answers
23 views

Web3 vs. web3.js

Experienced iOS developer here - but very new to Ethereum Smart Contract development. I'm trying to figure out why the web3 version that gets loaded by MetaMask into my browsers when I run my app (...
0
votes
1answer
23 views

Pushing constructor result to contract member array

I'm trying to do the following operation in Solidity: BetCampaign memory newCampaign = BetCampaign(id, new Bet[](0), betEndTime, false); betCampaigns.push(newCampaign); With the following member ...