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
14 views

Condition for changing a smart contract

I'm developing an application using smart contracts. I wonder if it is possible to establish different states for a contract, for example: User 1 determines a condition X, but also determines that ...
1
vote
2answers
42 views

Check if a variable exists in external contract

kinda new to the development side of Ethereum. Been searching around for days but can't seem to find an answer for my specific case. I'm trying this challenge here. The problem is that I can't seem ...
0
votes
1answer
13 views

tokens within tokens in ERC20

I want to make a token on ERC20 and that would be staked, and other token would be rewarded as on interest earn. After certain time, that earned token being staked, and third token will came out as on ...
0
votes
2answers
33 views

Blochchain Smart Contract App

Actually Im working on a blockchain application based on smart contracts that allows to buy/sell properties and paying in cryptocurrency using Ethereum and Bitcoin. I wonder I develop smart contract ...
1
vote
1answer
10 views

Is there a token standard that allows the owner of an address to move the tokens in any account under certain conditions?

I am wondering if there exists a token standard (much like ERC-20) that allows for the owner of an address to transfer the tokens out of any address when certain conditions are met? For example, ...
0
votes
1answer
27 views

Unable to connect to 'Web3 Provider' on Remix using http connection

I am using an http connection to connect to the Web3 Provider using Remix. The port 8454 is listening as expected. I am getting the following error: Not possible to connect to the Web3 provider. ...
0
votes
1answer
18 views

How to set token holder's address without duplication?

In following code I've implemented two functions to set and get Token holders. function setTokenHolders(address _to)internal returns(bool){ for(uint i = 0; i<= tokenHolders.length; i++){ ...
1
vote
1answer
30 views

What is the difference between these 2 smart contracts?

I noticed some smart contracts have there name,symbol, and supply set up like this example #1 and setup a defined constructor. Notice, they did not fill in the "string public symbol", "string public ...
1
vote
2answers
19 views

What is the difference?

I noticed some smart contracts have the wallet address of the creator in the smart contract to send the tokens to the wallet like example #1: Example #1: constructor() public { symbol = "...
1
vote
0answers
18 views

How to check ETH contract deposit?

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

How to accept tokens coming to my contract address and withdraw it on my Owner address in ERC223 token standard smart contract?

I want to withdraw tokens which are coming from different contract addresses, on my Owner address. I am working on ERC223 token standard and solidity version 0.5.1;
0
votes
1answer
21 views

Can smart contract reference its own state variables to make branching decisions?

I have to apologize for not being very familiar with solidity or the EVM ahead of time. Say that in the contract there are several state variables, a, b, c. It would seem like that if I wrote a ...
1
vote
1answer
34 views

Is there any simple explanation to multisig wallets?

I read on ConsenSys and Ethereum MultiSigWallet. I got that "The purpose of multisig wallets is to increase security by requiring multiple parties to agree on transactions before execution. ...
0
votes
1answer
15 views

How to prevent someone running a transaction before me?

Let's say I have the following in my smart contract: string passwordHash; uint money; function checkPassword(string cleanPassword, string newPasswordHash)[...] When running the function ...
1
vote
1answer
50 views

How to get require() to accept decimal value of ether in payable functions in Solidity?

On using, require(msg.value == registerFeeMap[msg.sender] /_currentRate) (fractional ETH value calculated) require(msg.value == registerFeeMap[msg.sender]*10**18/ _currentRate) (ETH converted to ...
0
votes
1answer
43 views

How to start auditing smart contract?

I want to become a smart contract auditor. I will report all the vulnerabilities which I have explored while auditing smart contracts. Is there any platform available to learn how to audit smart ...
0
votes
0answers
18 views

Myetherwallet Balances?

I was testing on (Ropsten) Myetherwallet, everything was fine yesterday morning, then that evening, my balances (Ropsten Ether and Tokens) would not show. I was getting "(error_21) Not a valid ERC-...
0
votes
1answer
17 views

Minted Crowdsale vs Non Minted Crowdsale

I am exploring openzeppelinr-solidity smart contracts for Initial Coin Offering(ICO). There are two options available for a token smart contract one is to have hardcoded total supply tokens or mint a ...
0
votes
2answers
51 views

Truffle console keep showing “undefined”. Solved by rolling back to v4 stable

I have updated my truffle version to the latest v5.0.3. By running truffle version, I can get the following version statements. Truffle v5.0.3 (core: 5.0.3) Solidity v0.5.0 (solc-js) Node v10.8.0 ...
1
vote
0answers
16 views

Secuirty Token Escrow setllement

Is Esrcow could be applied in ST 20 tokens ? If yes, please guide for the same.
0
votes
1answer
30 views

Multi-signature Ecrow time based?

I have a user A and a user B. They do not trust each other. So, they run the following smart contract: User A specify a time locked deposit of x coins to user B under a predefined condition( For ...
0
votes
1answer
54 views

Calling another contracts function -minimum info required

I understand how to call another contracts function. My question is, if I want to use an interface like in this question over call(): Call function on another contract contract Name { mapping(...
0
votes
1answer
28 views

ERC223 Token doesn't transfer while working with data field in transfer() function

Instead of showing tokens the output shows Internal transactions or just contract interactions. what changes are needed to transfer tokens to any other ERC223 receiver contract? function transfer(...
0
votes
1answer
21 views

Can I just change just 1 bit of data in a smart contract?

Can I just change 1 bit of data in a smart contract? More specifically would this allow me to make a smart contract where it is really cheap just to flip specific bits. This would be like setting ...
0
votes
0answers
20 views

Approve/TransferFrom Methods

During an Audit I got a warning for this code lines: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-...
1
vote
0answers
27 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; ...
0
votes
1answer
26 views

Execution gas cost

I use web3 and truffle to get info about my testnet transactions. There are few fields about gas used per transaction, such as: gasPrice, gas, gasUsed. But how to get field 'execution cost'?
0
votes
1answer
23 views

Remix uploading the wrong contract?

I have a contract called bridgeStacked that uses a library called BytesLib. When I have both loaded into Remix, I compile and deploy bridgeStacked from in Remix. First, I notice that in the log it ...
1
vote
0answers
16 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
113 views

How can i implement deadlines in smartContract?

Suppose I am running a gallery and ask participants to submit there paintings before a specific date. After passing that date participant should not be able to submit their entry. How can I implement ...
2
votes
1answer
28 views

ERC223 and ERC827 can receive erc20 tokens and call a function immediately?

As the title says, is that possible? For example on my ico contract, I accept USDT erc20 token and when I receive each transaction, call a function for that and send that address my tokens or eth.
1
vote
1answer
33 views

get bytecode in smartcontract ? possible?

is it possbile to get bytecode of already deployed contract on another contract? example : get bytecode of contract A using contract B (using solidity )
0
votes
1answer
17 views

Allow all ERC20?

So far a user can allow a smart contract or any address on Ethereum blockchain to spend their coins by calling the 'approve' function. If I want to allow address X to spend 250 of my FabulousCoins I ...
0
votes
2answers
30 views

Returning all struct data of msg.sender in solidity

here is my code: contract Notes { struct notes { string id; string content; address owner; bool isCreated; bool isDeleted; uint256 timestamp; } ...
1
vote
1answer
83 views

Converting an address type variable to payable address type throws me error [duplicate]

I am trying to convert an address to payable address but I'm not able to do it. please find my code below: address a = destinationAddress; address dest = address(uint160(a)); dest.transfer(amount);
0
votes
1answer
25 views

How to map one to many

I am working on rent agreement and I have a situation here One landlord can have multiple properties every property have different details (property details, values) now I want to link property ...
2
votes
0answers
25 views

Zero Knowledge Range Proofs

I am new to the world of Zero Knowledge Range Proofs. I read the following on GitHub: https://github.com/ing-bank/zkproofs The Zero Knowledge Range Proof allows the blockchain network to validate ...
0
votes
1answer
53 views

Solidity, how can I import struct mapping in contract A from contract B?

contract B { struct Player { uint id; } mapping (uint=> Player) Players; } contract A { constructor() public { B.Player storage p = B.Players[1]; } } Report err at B.Players[1]...
0
votes
1answer
24 views

Time-locked deposit protocol?

I am designing a protocol where a user A sends a time-locked deposit to user that if the user B within time t provide a proof that he exists in a location x (this may be obtained by third party like ...
0
votes
2answers
39 views

Including an owner address based automated routine execution in a React ethereum dapp?

As I understand, all the front-end components for a react based ethereum dapp are rendered from the point of view of the user's metamask default account. All the calls to constant functions in ...
1
vote
2answers
103 views

TypeError: Name has to refer to a struct, enum or contract when compiling a contract

I'm getting a weird error while compiling a contract in Solidity, I think it's because I'm using Solidity v0.5.0 and it was written with a previous version. Here's the code: pragma solidity ^0.4.2; ...
0
votes
1answer
15 views

i got error in if statement while i using the solidity version 0.5.0;

pragma solidity ^0.5.0; ... function SearchByTenderId(string memory a) public view returns(string){ string memory Id=a; if(keccak256(TenderId) == keccak256(Id)){ return "TenderId is ...
1
vote
2answers
27 views

Call to smartcontract without address

Lately I had a conversation with someone who says that it is possible to make a call to the smart contract without giving the address. He said it's possible to send certain parameters and by them the ...
-2
votes
1answer
44 views

ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){

browser/Logistics.sol:60:14: ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){ ^-------^ pragma solidity ^0.4....
0
votes
1answer
37 views

Hi ,am getting Parsing Error :Primary Expected Exception

Could you please help me in resolving the error "Parsing Error :Primary Expected Exception " below is very simple code contract TestString { function stringConcat(string a, string b) public ...
0
votes
0answers
36 views

Underflow attack, is it possible here?

Assume that you send X ERC20 SomeCoins and in exchange, you receive X/2 MyCoins. Both ERC20 have 4 decimals. My question is, if the user sends the minimum value or, a value that can't be divided by 2,...
-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
53 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
40 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 ...