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 [remix]

Questions about Remix, an online browser compiler for Solidity, formerly called Browser Solidity.

0
votes
1answer
47 views

Can't return string when function not pure? [duplicate]

See the below contract function of which return the string (Tested in Remix.org): pragma solidity >=0.4.22 <0.6.0; contract HelloWorld { function get() pure public returns (string memory){ ...
0
votes
1answer
16 views

my smart contract always return empty when testing with rinkerby network

I am trying to implement the simple storage. When calling set function, the contract will append a new Log object to logs array, and also return the related index to the caller for reference data. ...
0
votes
1answer
74 views

Dapp on Ganache and Truffle but… what about Remix?

My dapp runs well with Ganache and Truffle but how to deploy with Remix and connect the contract to web GUI without abi? I mean, i created a Dapp that runs really good on Ganache and i run the web ...
1
vote
1answer
31 views

Oraclize can't compile Remix “undeclared identifier”

I was following this, I assume, very simple tutorial for generating a random number using oraclize: https://www.youtube.com/watch?v=J05DBPdkeAo But I end up getting this error and I dont understant ...
0
votes
1answer
41 views

TypeError: Member “owner” not found or not visible after argument-dependent lookup in uint256

I am very new to solidity programming, I have issue while running one solidity smart contract. pragma solidity >= 0.4 .22 < 0.6 .0; contract DocumentManager { mapping(uint => Document) ...
0
votes
0answers
56 views

How should I pass a nested struct as a function argument in Remix IDE?

Example contract: pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; contract someContract { struct structOne { uint a; } struct structTwo { uint b; ...
1
vote
1answer
25 views

Encoded input params

I created a simple test contract with a single method: pragma solidity ^0.4.24; contract SimpleTest { function testFunc(string name, bool isFirst) public { //do stuff } } I'm ...
1
vote
1answer
23 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 ...
0
votes
0answers
43 views

How dapp owners pay for their clients transcaction fees in the Ethereum Blockchain?

I am currently dealing with a problem in Ethereum Blockchain. I wrote a smart contract in Solidity Language, about a site that someone can make his Registration and after the transaction is completed ...
1
vote
1answer
24 views

Why is solidity throwing “Note: The constructor should be payable if you send value. ”, when clearly the issue is elsewhere?

I'm writing a contract on Remix that is able to deploy and track child contracts. Here are the 2 contracts: pragma solidity ^0.5.0; Contract Factory contract ContractFactory{ ChildContract[] ...
2
votes
1answer
14 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
152 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
2answers
326 views

TypeError: Data location must be “memory” for parameter in function, but none was given

Contract fail to compile in IDE Remix.due to the following error: TypeError: Data location must be "storage" or "memory" for parameter in function, but none was given. version:0.5.6+commit....
1
vote
2answers
197 views

what is the meaning of 0x0? say when variable gets assigned to it, example: keccak256(number) = 0x0;

Is 0x0 just zero? thanks keccak256(number) = 0x0; Or when not used as address I mean just to denote variable?
0
votes
1answer
13 views

error handling in sending custom token to multiple addresses in one transaction

i am trying to write a contract in which there is a function to divide the amount into equal parts and then deposit it into multiple accounts in one transaction. The problem is that, i want function ...
0
votes
1answer
31 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?
0
votes
0answers
42 views

transferFrom function works but approve does not

I'm building an escrow contract and using web3js to interact with it. Currently, I am trying to approve and send an amount of custom ERC20 token from a wallet to the escrow contract. The problem is, ...
1
vote
1answer
79 views

Can't call function from contract using web3.js due to gas issue

I'm building a smart contract and dapp using ganache and web3.js. In my smart contract I have a function (named "add_pilot") which gets 4 parameters and add them to a mapping. It looks like this: ...
0
votes
2answers
76 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
16 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 ...
0
votes
1answer
39 views

remix - gas limit exceeded, but contract is running on blockchain

i studying remix and ethereum, and create my local blockchain. and create contract with remix.the contract just print simple word. pragma solidity ^0.4.8; contract HelloWorld{ string public ...
2
votes
1answer
39 views

Error : - browser/Mycontract.sol:29:13: Error: Undeclared identifier. assert(value % 10 == 0) ; ^----^

pragma solidity ^0.4.7 ; contract MyContract { string sentence = "my first sentence" ; address owner ; function MyContract() { owner = msg.sender ; } function ...
0
votes
1answer
49 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....
1
vote
1answer
86 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
30 views

Solidity modifier with function call error

pragma solidity >=0.4.22 <0.6.0; contract Person { //owner address address private owner; //identity string private firstName; string private lastName; string private ...
1
vote
2answers
59 views

Smart Contract Working on Remix but not TestNet

This question has been asked before. however, those answers did not help me. (of course, I now can't find the "answer" atm) It said that Ropsten (what I was currently using) has fewer miners - or ...
0
votes
1answer
28 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
0answers
63 views

How does a message signed in Remix IDE?

What is signing method that is used in remix IDE and how is the hash value calculated from the message that is being signed?
0
votes
1answer
24 views

when i call balance function it shows 0 all the time ? I am deploying at remix - solidity

pragma solidity 0.4.19; contract blackeye { uint public max_amount = 1000000; uint public total_balance_bought = 0; mapping(address => uint) total_balance; address ...
1
vote
3answers
45 views

Schedule an execution of a function in Solidity [duplicate]

I am new to solidity and to smart contracts, i couldn't find a great resource describing how the execution of a function in the future really work behind the scenes and how to implement it. I'd ...
0
votes
0answers
36 views

could n't find ABI constructor in my input data

I have developed the solidity code and need to verify the smart contract but I could not find Constructor Arguments ABI-encoded check the screenshots, i have developed in testnet
0
votes
1answer
89 views

NOOB Error : Transaction mined but execution failed

i´m learning Solidity now, and i saw this code on web but when i try to use the method "Deposito" i receive a error. Someone knows what's that ? (PS.: I try to put the value but every time i chose ...
0
votes
1answer
29 views

how can we set auto transfer of my tokens to the wallet which transferred me ethers

Okay so I have deployed my contract to network, and my wallet or account via which I deployed it contains all my tokens of the newly created contract. I dont want to list my token anywhere since since ...
0
votes
2answers
115 views

Stack too deep, try using fewer variables [duplicate]

Seems like I'm passing a lot of arguments in a struct creation, this message error showed up "stack too deep , try using fewer variables" I tried to get rid of it by using bytes32 instead of string, ...
0
votes
1answer
48 views

How to split bytes32 into multiples of 8 in solidity

I want to split bytes32 into multiples of 8 (in assembly). I have the following code(After referring here): function testAssembly(bytes32 _msg) public pure returns (bytes8 i, bytes8 j, bytes8 k, ...
0
votes
0answers
22 views

How to create multi forwarder address (contract)?

How to create multi forwarder address (contract)? my code https://pastebin.com/raw/ADwPtz8q error InternalCompilerError: Compiled contract not found. pragma solidity 0.4.25; contract Factory { ...
3
votes
3answers
291 views

web3.eth.Contract(abi, address) doesn't return contract instance

i'am trying to make a instance of my contract in js using web3, but when I use the function web3.eth.Contract(abi, address) the result is not the expected(I take the ABI from remix). this is the code:...
0
votes
1answer
18 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 &...
0
votes
1answer
72 views

How to set default gas limit for my custom private network?

I've connected to my custom private ethereum network in remix with web3 provider. Everything was fine, account balance, and address was retrieved successfully. But I don't know why, but I could not ...
0
votes
1answer
65 views

ParserError: Expected primary expression

Following is my code: pragma solidity >=0.4.17; contract Lottery { address public manager; address[] public players; constructor () public { manager = msg.sender; } ...
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 = ...
0
votes
1answer
27 views

Is a function prone to re-entrancy attack even if I set balance to zero within the same function (example included)

Such as in this scenario, is the hackable via re-entrancy? thanks... function withdraw(uint256 money) public { if(money <= balance[msg.sender]) { (bool success, ) = msg.sender.call....
0
votes
1answer
35 views

solidity code warning in remix IDE

I am trying to create a smart contract using the but it is showing warning message in a string "Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. ...
0
votes
1answer
65 views

VM error: invalid opcode while trying to execute buy function on Remix IDE

I am using following code for custom token on ethereum. pragma solidity >=0.4.22 <0.6.0; contract owned { address public owner; constructor() public { owner = msg.sender; }...
0
votes
1answer
66 views

How to use 2 different constructors with open-zeppelin

I don't understand well how to implement an smart contract to create a capped Token. If I want to follow the example of a simple token is easy: https://github.com/OpenZeppelin/openzeppelin-solidity/...
2
votes
0answers
38 views

Why I can't use two functions with same name, but different parameters

I have a function which returns address but it gives me error if I try to read it. I'll explain by a quick example: Solidity: contract TestOneReturn { mapping(uint => uint) m_Data; ...
1
vote
0answers
279 views

web3.eth.getAccounts() : Cannot read property 'map' of undefined

const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const provider = new HDWalletProvider( 'passphrase', 'rinkeby.infura.io/v3/mytoken' ); const web3 = new ...
1
vote
0answers
78 views

Infinite gas cost when trying to use transfer()

I tested the contract using Remix Javascript VM, Injected Web3(Ropsten) and in-built Ganache client from Embark Framework(4.0). Always getting infinite gas usage. Can someone please help me? This is ...
0
votes
0answers
72 views

Is there a way to download Remix IDE locally and access it from the Terminal (Linux)?

Is there a way to download Remix IDE locally and access it from the Terminal (Linux)? Hi, I think I have read that it should be possible to download Remix IDE and use it offline. In the latest ...
0
votes
1answer
56 views

Transaction pending

If I call this function the transaction get pending and never finish. Any idea? pragma solidity ^0.4.24; contract test { uint[] values = [1,2,3,4,5,6]; function removeValueFromArray(uint _num) ...