Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [contract-development]

Questions regarding the development of smart contracts

Filter by
Sorted by
Tagged with
0
votes
1answer
44 views

Multisig function calls

I am making a dapp in which ethereum user accounts that call certain functions are rewarded with an ERC20 token. All the dapp is based on functions using only one ethereum account as parameter. But if ...
0
votes
2answers
28 views

How to find out if a wallet (an address) contains a token from a contract using web3js?

Is this possible with and without knowing the private key of the wallet.
0
votes
1answer
18 views

Fallback function optimization: what better?

I have ERC20 contract with payable function. 1 function () external payable { uint256 amount = msg.value * unitsOneEthCanBuy / 1000000000000; balances[msg.sender] +=amount; balances[...
1
vote
1answer
164 views

How to check balance of a smart contract in Remix IDE Javascript VM?

I'm working on a smart contract that can hold some ETH. Currently, I'm unable to see what is its balance in the Remix IDE. I'm trying to use the console: I have access to web3 but how to check the ...
0
votes
0answers
36 views

MetaMask Calling Child Contract Methods?

I had created a contract(Organisation.sol) that create other contracts(Session.sol). When I call any method from(Organisation.sol) using web3js it work well. But If I ever tried to call any method ...
0
votes
1answer
29 views

How to deploy A contract created by another contract in the browser?

Hey I am making a smart contract that create another smart contracts. Organization.sol create Session.sol . When I create a session using createdSession function I got it's address and I already had ...
0
votes
0answers
43 views

Is Geth v1.8.27 incompatible with Solidity 0.5.0?

I set up a private chain using geth v1.8.27, then deployed an erc20 contract in solidity 0.5.0 complied using the 0.5.7+commit.6da8b019 version of compiler. After the transaction was mined, I tried to ...
0
votes
1answer
62 views

.transfer fails

Trying to call .transfer() within a function makes it fail. I am aware that the difference between .send() and .transfer() is that .send dont throw. The function works properly when using .send(), but ...
0
votes
1answer
38 views

Calculated Gas Costs of Contract execution

I have a smart contract that maps a string to a string value and stores it on the Blockchain. I want to analyse the Gas Used by Transaction. One time the execution consumes 92,843 Gas (https://rinkeby....
1
vote
2answers
43 views

How can we detect if tokens are transferred to our smart contract and avoid “allow”?

Imagine you have a smart contract that accepts all forms of ERC20s. You want users to call a function by which they will send you their ERC20s and in exchange receive a greeting. Technically we can ...
1
vote
0answers
124 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 ...
0
votes
1answer
41 views

When I create contract using another contract how could I access his methods in web3js?

Hey I have file 'contractFactory.sol' inside this file I have contract contractFactory{ event contractCreated(string name, address institution, address parent); function createContract( ...
0
votes
2answers
156 views

Calling a smart-contract fallback function from another contract

contract A { function one() public { //transfer to B to call its fallback function B(addressB).transfer(value); } contract B { function() external payable { someaddress....
0
votes
1answer
89 views

how to send transaction with web3.py

I'm trying to use web3.py with infura.io to interact with my smartcontract. here is my simple greeter contract code pragma solidity ^0.5.7; contract greeter{ string greeting; function greet(...
1
vote
1answer
67 views

How to pass account address to truffle deployer?

How do I pass my account address to the contract constructor while deploying with truffle migration? I want to pass address into MyAdress like below. deployer.deploy(MyContract, MyAddress) My ...
0
votes
1answer
21 views

Using geth Light Node to detect ERC-721 transactions

Is it possible to use a geth light node to detect incoming transactions executed via ERC-721 contracts? I have experienced being not able to get receipts using getTransactionReceipt in native and ...
0
votes
0answers
70 views

How to call A child Contract function in web3js?

Hey I am new at blockchain development and I need to make contract name organization that create sessions contracts. I had already implemented the solidity code but I have a problem in front-end ...
0
votes
1answer
86 views

What's the root cause “contract error - Gas estimation failed Gas estimation errored with the following message (see below)”?

Rest of the error: The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. I got that message on several cases, usually on different mistakes. What'...
1
vote
1answer
48 views

EVM bytecode debugging jumps

How can i determine forehand the destination of JUMP for which there is no PUSH instruction thst preceeds it and the entries in the code where they where set, when analysing the bytecode? I looked ...
0
votes
1answer
62 views

Is it possible to modify privateFor addreses in a private Smart Contract (Quorum)?

I know how a private smart contract works providing a list of accepted addreses to privateFor property, but what if I want to disable (or enable) any address visibility? Should I deploy a new Smart ...
2
votes
3answers
65 views

ERC721 Tokens - Hold ETH in the token?

Would it be possible to create a ERC721 Token for say a game item, but I want the Token to basically have ETH inside the token, so that a user could destroy the token to reclai
0
votes
1answer
28 views

Smart contract method relayer

I was wondering if there was a way, in theory, to call from a sc two functions from a secondary sc in which the result from the first function is a parameter of the second function so something like: ...
0
votes
1answer
27 views

Regarding interaction between smart contracts [closed]

If we have a case where we have Two smart contracts. Contract A passes value to Contract B. the address of contract A is also passed to contract B in the smart contract. while compiling the contract B ...
1
vote
0answers
105 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 ...
0
votes
0answers
11 views

How do i select a random number from a given range in my contract? [duplicate]

I am trying to create a simple gambling app in which the users are all assigned numbers when they enter the contest and i need to select a winner based on this number. Consider the numbers are 1-100 ...
1
vote
1answer
129 views

How to charge percentage of transaction cost?

Example: uint public createPostCost = 0.0003 ether; function createPost(bytes32 _post) public payable { require(msg.value >= createPostCost); Post memory newPost; ...
1
vote
2answers
73 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 ...
0
votes
2answers
41 views

Out of Gas Exception on Tobalaba

I deployed the same contract to Rinkeby, Ropsten and Tobalaba networks. Rinkeby and Ropsten work fine, but the contract execution on Tobalaba fails because of an out-of-gas exception: https://tobalaba....
0
votes
2answers
24 views

Check a user's address when accessing the agreement

I am developing a contract where a predetermined address can change a contract variable. The structure of my current contract is as follows: pragma solidity ^0.5.0; contract privacyPreferences { ...
0
votes
1answer
40 views

Deploy Contract Syntax Error

I am testing a contract, when I run the truffle migrate command, in my deplyment contract located in the migrations folder the following error appears: var HelloWorld=artifacts.require (“./HelloWorld....
0
votes
1answer
27 views

Contract change registry

If i have a smart contract stored on block 10, when i change the status of this contract, the altered contract will be stored on the next block or the status of the contract will be stored in block 10 ...
1
vote
1answer
36 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:...
0
votes
0answers
16 views

Function doesn't return any value but modify the data in the contract

I have a function that can retrive all data and one for retrive only not readed data. On Remix with JavaScrpit VM it's work, but on Remix with my private blockchain linked with web3 provider the ...
0
votes
1answer
146 views

CREATE / CREATE2 Verification

Where do I verify whether a contract has been created with CREATE or CREATE2, would I have to disassemble the contract and look for a CREATE2 opcode in the contract creation code?
0
votes
1answer
23 views

Retrieve the status of a contract by its creator

In a situation where there are multiple contracts stored in different blocks, is there any method to retrieve the status of a contract through its owner's address? (e.g. in my situation, each person ...
1
vote
1answer
20 views

reverse crowd sale possibility

Is it possible to do a reverse crowd sale? e.g. send tokens to a smart contract to get ether back. Or would this require to load the contract with WETH or something in advance?
4
votes
1answer
479 views

What is WETH and why can't we just use ETH?

can someone explain why we need WETH? what's the purpose of WETH, can't we just use plain ETH? it's not like it removes the tx fees or something. Hopefully someone can shed light on the concept.
1
vote
1answer
121 views

How to prevent selfdestruct from another contract

I have a contract A calling another contract B Contract A contract A { function sendValue(B _externalContract, uint _value) { _externalContract.acceptValue(_value); } } contract B { ...
1
vote
1answer
32 views

Listen smart contract event

I use parity --light geth --syncmode "light" I would like to listen smart contract Event. Do I need to download all blockchain on local PC or light mode will be enough?
1
vote
3answers
73 views

Decentralized Exchange on Ethereum?

Is a decentralized exchange basically a smart contract that includes all the exchange functionality? Where is the engine?
2
votes
1answer
26 views

Any other provider instead of Oraclize

Are there any other providers for calling external APIs in Solidity other than Oraclize?
1
vote
1answer
156 views

Using AbiEncoderV2 for encoding data in raw transactions

I've come across a use-case to need to pass a struct into a Solidity function. I know this can be done via tuples. However, I need to sign and send this transaction from my node.js back-end using ...
1
vote
1answer
328 views

Retrieving block hash of current block vs previous block

What is the formula for retrieving the blockhash of 1) previous block and of 2) current block?
0
votes
1answer
63 views

How to retrieve “contract creation transaction” info for a particular contract using Etherscan API?

Assume i have the address of a contract, and now i would like to retrieve the information for its creation transaction. I used getCode(), but return bytecode for the contract, which is different. If i ...
1
vote
2answers
25 views

Simple contract throws for no apparent reason

the thing is that i have a very simple contract code that I wrote as a kind of "Hello World!", but it doesn't seem to work properly, and I can't see any reason why it wouldn't work. The code I'm ...
0
votes
0answers
49 views

In Remix switching from “JavaScript VM” to “Injected web3”

have tested on "JavaScript VM"....all OK. Have switched to "Injected web 3" to see real chain behaviour. On "Deploy" I am getting Send Transaction failed: invalid address. if you use an injected ...
0
votes
1answer
56 views

Find word in string solidity

How is it possible to look for if a certain word is part of a string in solidity? let's say someone upload a string to a smart contract, this string must contain the word "solidity" to be accepted by ...
2
votes
1answer
105 views

Metamask Error messages shows only revert

I have a little problem with the error messages I receive from MetaMask. In my dApp I have a modifiers which should throw an error with an error message. However, in MetaMask I only receive the RPC ...
0
votes
2answers
46 views

Solidity how to check if user is already used another contract?

I am trying to figure out how to set up a simple communication between contracts. For example, we have a contract Passport, in which the user writes his data. After that, through the Election ...
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. ...