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
votes
1answer
53 views

Getting error as Member “balance” not found or not visible after argument-dependent lookup in contract Lottery

I am trying one Lottery contract in that I am using one function which give me error. function pickAWinner() public restricted { require(this.balance >= 10 ether); uint index = random() % ...
0
votes
1answer
55 views

Getting TypeError: Operator == not compatible with types int_const 1000000000000000000 and address payable

I am trying to use external modifier however I getting error as below code. { require(block.timestamp < start + buyPeriod); require(1 ether == msg.sender);<--- error got here ...
0
votes
0answers
23 views

getting error error TypeError: Member “isContract” not found or not visible after argument-dependent lookup in address payable

Using Solidity 0.4.17, I have defined a simple library at ./Addresses.sol function isContract(address _base) external pure returns(bool) { assembly { _r := gt(extcodesize(_base), 0) ...
0
votes
0answers
41 views

getting error solidity-member-transfer-not-found-or-not-visible-after-argument-dependent

I am trying to create one contract for Lottary app however I am getting error as " browser/test.sol:103:9: TypeError: Member "transfer" not found or not visible after argument-dependent lookup in ...
1
vote
1answer
31 views

Using smart contracts for delivering encrypted data [closed]

How can I utilise (perhaps automate) a smart contract to deliver some encrypted data from A to B, based on the pre-requisite that A fulfills B's requirements. Would I need an oracle for this type of ...
1
vote
2answers
71 views

ERC721 - Create 1000 tokens in one function call

I have implemented a contract where a set of ERC721 tokens should be generated with a function call in private net. Code as follows : function mint( address _owner, uint256[] _id ) ...
2
votes
1answer
21 views

UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently

I received the error message UnimplementedFeatureError: Only byte arrays can be encoded from calldata currently from the compiler, but without any reference to a file or line. In a big project, and ...
0
votes
1answer
29 views

Calling a contract's function with input parameters and passing ether from Geth/Web3

I have deployed a smart contract which basically splits the incoming funds to the specified addresses based on the entered ratio parameter. Please find the code below: pragma solidity ^0.4.23; ...
0
votes
3answers
42 views

Owner is returned as 0x0000 … , what should I do?

I am a japanese student. I am studying ethereum. pragma solidity ^ 0.4.18; contract Owned { address public owner; // contract owner // / modifier for access check modifier onlyOwner () { ...
4
votes
3answers
56 views

Can a “forward” smart contract forward the received ether to another “forward” smart contract which forwards it to an address?

I am pretty new to solidity. I am trying to create a smart contract which deploys another smart contract and transfers ether to the newly created contract when a payment greater than 0.01 ether is ...
0
votes
0answers
21 views

How to call a function automatically when some condition gets false?

I am having a bidding session where every time a person Bids on some product it checks the condition if the bidding session is valid or not, I want to trigger a finalize bid function which will ...
1
vote
2answers
27 views

ERC20 is it possible create them for private users?

I created my erc20 and i would like no one, except me and those people to whom I send them, to generate my tokens. Is it possible to generate all the tokens and send them to one wallet during the ...
0
votes
1answer
26 views

Out of gas exception when calling contract function

I am calling the contract function below however I get an error: "VM Exception while processing transaction: out of gas". To test I have simplified the function so it only saves a user's name however ...
1
vote
1answer
23 views

How to burn non burnable ERC20?

Suppose you received 250 HELLOCoins and you want to burn them. Unfortunately, HELLOCoins uses OpenZeppelin ERC20 which implements the following function: function _transfer(address from, address to,...
0
votes
2answers
32 views

Which ERC standard is suitable for an ICO token to have types?

There will be ICO with multiple cycles... Here, investors can purchase tokens and after a fixed window of 270 days, they can redeem it back. But within this window period, they can transfer tokens to ...
0
votes
1answer
33 views

POA chain: intrinsic gas too low, contract deployment

I'm trying to deploy my smart contract to a private proof of authority chain with geth, but i always get the following error message intrinsic gas too low This is the JSON RPC request i'm sending. ...
1
vote
1answer
15 views

How to improve web3 when importing and stop doing the same task over and over again?

When using web3js, you will automatically have to make file to create an instance of that contract which you will use in your main project to interact with. For example, smartContract.js import ...
1
vote
1answer
24 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 ...
0
votes
0answers
52 views

Transferring ether balance from contract balance to winner,not working

here is my Solidity snippet: function deliverPrizes(address payable winner) public onlyOwner{ winner.transfer(address(this).balance); } This is what I wrote on truffle console: dCoders....
0
votes
3answers
58 views

Use function return variable of smart contract in web3.py

since im new to solidity programming i have some problem with executing my Contract. My Contract looks like this: # Solidity source code contract_source_code = ''' pragma solidity ^0.4.1; contract ...
0
votes
1answer
136 views

TypeError: Return argument type bytes32 is not implicitly convertible to expected type (type of first return variable)

I have one issue while deploying the below contract.could anyone help me to find the issue as unable to find issue. pragma solidity >=0.4.22 <0.6.0; contract Lottery { address payable[] ...
0
votes
1answer
22 views

Interacting with Already deployed Ethereum Contract and recording response

I understand this topic has been discussed before, but my question is specific to web3.py. How can I interact with function of already deployed ethereum contracts on Ropsten TestNet. my code runs with ...
0
votes
1answer
28 views

How to configure APIs to run with Ropsten addresses

I have my contracts deployed on Ropsten network. I deployed those contracts from my local machine using Truffle migrate. Then I set up an AWS EC2 Ubuntu server to host my RESTful APIs. I installed ...
-1
votes
2answers
33 views

Expected import directive or contract definition… going crazy. same code different result [closed]

i am learning from a video course but the teacher doesnt have got the error i got. so we have the same code but different result (error on mine and all ok on his) here my code. pragma solidity ^0....
1
vote
1answer
37 views

ERC721 Default Implementation

I’m working on a card game. Right now it is really simple. There are orcs and cards. Both should be implemented as ERC 721. What would be the most natural way to make the orc an ERC-721 token? ...
0
votes
2answers
20 views

Optimization Exception Remix Editor

I am trying to compile my solidity code in remix editor. I keep getting this error "Optimization exception during compilation". I was using solidity version 0.5.2 till day before yesterday. Now, It is ...
0
votes
2answers
35 views

Can smart contract send tokens/eth if it doesn't have a send function?

Let's assume you just created 1,000 tokens at address 0x012345. You, the owner of 0x012345 sent by mistake all tokens and 1ETH to a smart contract with address 0x987654. This smart contract doesn't ...
1
vote
1answer
27 views

Processing gas cost on a sidechain

I am developing a sidechain that will store data and I want to evaluate the processing of this data in the ethereum network to get the cost in gas. I'm going to develop a smart contract that will ...
1
vote
0answers
31 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 ...
0
votes
1answer
23 views

contract reference another contract, what ABI information needed?

To reference another contract, the ABI is easily included like this. What information needs to be there? The function name, I guess, what about accessability such as public/private/internal/external/...
0
votes
0answers
24 views

My smart contract doesn't accept ERC20

NOTICE: The below implementation works. It assumes that the calling addresse has approved both the spender and the contract to carry the transaction. Because they were not approved it was not working. ...
0
votes
1answer
23 views

find the bytecode of a contract during compilation

Is there a solution to recover the complete bytecode (init + runtime) of a contract imported in solidity. For example "bytes code = getBytecode (Escrow.sol)" and this would be replaced by bytecode ...
0
votes
1answer
12 views

How do I get product/parcelID from particular Assigned address using struct and mapping?

struct Sellers{ address sellerAddress; uint parcelId; uint parcelPrice; } In this struct I've entered multiple parcel Ids to sellerAddress and I've retreived them using _sellerAddress. ...
1
vote
2answers
81 views

OpenZeppelin Starting Balance

I believe that the openzeppelin project have updated their StandardToken smart contract which is now called ERC20.sol. One issue that I have is that the new smart contract has some missing ...
0
votes
2answers
24 views

smart contracts and ICO: how to begin with when low speed connexion, old computer, low code understanding?

Question: having read https://www.ethereum.org/ and documentation regarding a) designing a token and b) kickstart a project, I wander what is the best way for a beginner like me to run a project ...
0
votes
1answer
17 views

Struct and Mapping input value error of Invalid Opcode while calling setSeller() to store multiple seller's addresses

What dose the -1 means? Or why we should use -1 while pushing one element in array. What should I enter in sellerAccounts: field as input? pragma solidity ^0.5.1; contract Seller{ struct ...
1
vote
1answer
53 views

How do you apply an interest rate on an ERC20 token without making new transactions?

I'm trying to develop an ERC20 token that mints new tokens to holders over time, however I would like to do this in a way that does not require me to make new transactions each time a users balance ...
0
votes
1answer
22 views

How to make transaction of some ether in Buyer Seller type of contract?

In this I have set modifier (msg.sender == sellerAddress) which is not valid. But in this scenario, I want to allow only and only sellerAddress to take ether from my contract. How can I allow only ...
0
votes
1answer
43 views

How does Ethereum Smart Contract work on Mobile Client

I want to deploy a smart contract on server and interact with it using mobile client. I'm not familiar with how does that work but after some research, I found something like below: If we compare ...
0
votes
1answer
45 views

How to convert plain text string variable to bytes32 variable? And how to store bytes32 in one variable after converting? [duplicate]

pragma solidity ^0.4.25; contract Purchase { address public sellerAddress; constructor (address _sellerAddress) { sellerAddress = _sellerAddress; } } contract Buyer is Purchase {...
1
vote
0answers
22 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 ...
0
votes
1answer
25 views

When does a Smart contract get executed/called

I'm fairly new to Ethereum and Smart Contracts. After i publish a Smart Contract on the Chain, on what ways or how will it be executed? Who can call my Smart Contract? And under what conditions? I'm ...
3
votes
3answers
502 views

Converting from bytes in 0.5.x?

I'd like to convert bytes into any other type. I.e. "0x57D80C61128d608857d5310BB514223Bb6011CAB" into the address 0x57D80C61128d608857d5310BB514223Bb6011CAB, "5" into the uint256 5 and so on. I have ...
0
votes
1answer
96 views

How to use Role-Based Access Control via Proxy?

I have a PermissionsManager contract that uses OpenZeppelin's Role-Based Access Control (RBAC) template as a base. Currently function modifiers in my app call PermissionsManager directly to check for ...
3
votes
1answer
24 views

Do contract calls atomically modify contract contents?

Suppose a contract has the following: uint[] arr; function func(int a, int b) { arr.push(a); arr.push(b); } If two clients call func at essentially the same time with (1, 2) and (3, 4), are ...
1
vote
1answer
31 views

For Recipient how do I store Sender's account address and Password of Recipient's own account in hashed from?

How to check following things using Solidity: Password matching (hash formed) if password matches then transfer take place
1
vote
0answers
41 views

How does a real estate property contract work under smart contracts?

I am relatively new to concept of smart contracts. I am reading Nick Zabo's Smart Contracts: Building Blocks for Digital Markets, under the Smart Property section it is mentioned: Smart property ...
0
votes
1answer
32 views

constructor followed by three modifier / instantiation?

I saw this code snippet on openzeppelin, contract DoggoToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable { constructor( string name, string symbol, uint8 decimals, address[...
1
vote
2answers
29 views

What is the main use of approveAndCall() function and _extraData?

function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); if(!...
0
votes
1answer
23 views

Unable to transfer from a contract to another contract

I was trying to learn how smart contract interaction by implementing a bank contract and a client contract. The end user create a Client contract. Then, he use the Client contract to deposit or ...