Stack Exchange Network

Stack Exchange network consists of 174 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 about Remix, an online browser compiler for Solidity, formerly called Browser Solidity.

0
votes
1answer
13 views

what are the diffrences between <address>.call and <address>.<function name>?

contract GatekeeperOne { address public entrant; modifier gateOne() { require(msg.sender != tx.origin); _; } modifier gateTwo() { require(msg.gas % 8191 == 0); _; } ...
-1
votes
0answers
20 views

Remix Solidity Stopped Working / CRASH

I'm trying different random algorithms on smart contracts. I have an array where I can push accounts, then I use the random algorithm to select one. When I have ~ 20-50 entries everything works fine ...
0
votes
1answer
15 views

Calling a function of one Contract inside another Contract not workig correctly?

I have a problem like this. I am very new to solidity. I have tried an example that I was found by a Google Search in the remix editor. But I was unable to get any output like in the example.This is ...
2
votes
1answer
10 views

Why won't remix finish launching all of my libraries?

I've run into an issue. I have a contract with a hierarchy of libraries (some lower level libraries import higher level libraries). All libraries are ultimately imported by our main contract. ...
-3
votes
0answers
32 views

Beloved newbie, why don’t you try yourself first? Just a bit, please! [on hold]

Beloved Newbie, Why do you ask us information you can find easily? Why do not try to understand by yourself? How can you come here saying us why your code do not work where a missing semicolon is the ...
2
votes
2answers
14 views

Stopping Raffle Smart Contract

A smart contract has an enter() function where participants can send 1 Ethereum to enter a raffle. Is there an easy way to stop allowing the others calling this function while the winner is picked?
1
vote
1answer
17 views

What is the maximum value an int and uint can store

I am new to solidity. I need to understand the couple of things maximum value an int and unit can store ? does maximum values stored in int and uint are same ?
0
votes
2answers
21 views

Calling external contract running out of gas?

hope you can assist. I have this very basic template setup, where contract TokenVote should simply store some data on the SimpleStore contract (Sort of eternal storage) Yet my code always runs out ...
1
vote
1answer
15 views

How to hide an inherited function?

I checked this but it does not help me. I am writing an inherited contract and I would like to hide the CheckValue function from the console. How do I go about this? I wish to check if the value I am ...
1
vote
0answers
47 views

Contract too large

I am sure this has already been answered but I could not find a clear answer. I get the following error: Contract creation initialization returns data with length of more than 24576 bytes. The ...
0
votes
1answer
8 views

SyntaxError: invalid syntax on web.py with contract ABI

everybody, I'm stuck with a SyntaxError: invalid syntax every time I try running this script on the contract_abi variable that I got from the Remix IDE. I'm currently trying to connect with a smart ...
0
votes
1answer
18 views

Why is gasestimate coming as “infinite” when I'm trying to return a dynamic array in solidity?

I understand, that as the list grows it is going to cost infinite gas. I'm making a temp array in memory of size of our dynamic array at present size and then returning that array. But does that make ...
0
votes
1answer
18 views

The difference between msg.sender.balance and owner[msg.sender]

Hello everyone i have a code like: mapping(address => uint)owner; function show() view public returns(uint) { return owner[msg.sender]; //return msg.sender.balance; } in slodity and ...
0
votes
1answer
26 views

Out of gas in web3 but not Remix?

I have a test function: function test(uint[400] subscriptions, uint[400] subscriptionIndexes) public view returns (uint[4000], uint[4000], uint[400]) { uint[4000] memory postSenders; ...
0
votes
2answers
36 views

Set public function to private?

Let's say I have any function in my smart contract and for a small period of time I want that function to not be PUBLIC but PRIVATE. Is it possible in Solidity? If not, could this be solved with a ...
2
votes
2answers
24 views

Multiplication and iteration in solidity

Iteration uses a lot of gas. I was thinking at different options I could minimise the costs. I must understand why one thing doesn't work: Why can't I push into an array using multiplication rather ...
0
votes
0answers
22 views

How to build a reward system contract? [on hold]

So I have a lock on a site that once opened will enable users to claim tokens, 50 to be exact. I have gone about by creating a mint function that will mint tokens and then send it to the user, I was ...
0
votes
1answer
11 views

Account used to Deploy not same as account associated with contract

So I am testing out a new contract I have been working on in Remix. I expected that the Account I selected would be the one associated with the actual contract, but it is not. In fact, I tried it a ...
1
vote
1answer
36 views

TypeError: This type is only supported in the new experimental ABI encoder

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma ...
0
votes
1answer
30 views

How do i get a smart contract to interact with a website?

I have a site, let's say a user solves a game, i want that user to be stored in a database that represents users who solved the game, users stored in this database will then be able to redeem tokens. ...
0
votes
0answers
13 views

BurnFrom Function Error, reverted too original State? // Also how do i add to my contracts balance? [closed]

//Contract TOKENERC20 interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 is owned { // Public ...
0
votes
1answer
31 views

How send transaction with msg.data in Remix?

The fallback function may receive additional data (exposed in msg.data). How can I send a transaction with additional data in Remix?
2
votes
1answer
314 views

Understanding how a simple contract breaks into bytecode

I'm trying to understand how contracts look in terms of bytecode and struggling to do that just based on the yellow paper. In particular, consider the following empty contract: pragma solidity ^0.4....
1
vote
1answer
34 views

How to map Array of Structs in Solidity [duplicate]

Need this architecture { address1 => [struct1, struct2], address2 => [struct1, struct2, struct3,], address3 => [struct1, struct2, struct3, struct4, struct5], ......
0
votes
1answer
23 views

How can Remix Ethereum decode output address of smart contract is created from another smart contract

I have seen that when I create a new smart contract from another smart contract Remix Ethereum return to me the address of smart contract. But When I do it with web3js the callback function just ...
1
vote
1answer
13 views

The transaction has been reverted to the initial state. Note: The constructor should be payable if you send value

pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); ...
0
votes
1answer
13 views

How do I solve/get around this 'Gas estimation failed' error in my smart contract?

It appears after I compile, deploy the contract on remix (using Rinkeby test network), and call the JoinDXCon( ) method using any string "foo". Here's the error: And here's the smart contract: ...
0
votes
0answers
16 views

Using Remix.Ethereum, keep receiving error “ Socket not ready. state:0 ” can anyone tell me what this means?

I have tested this throughout remix with a deployed contract and the error will still arrive, meaning i have written code, ran it, perfect, i go and add more code and receive an error so i erase the ...
1
vote
1answer
35 views

Verifying Signed Data

I am busy trying to get my head around recovery of an address using ecrecover(). The I'm having trouble recovering the correct address when providing signed data to the contract. The contract that I'...
1
vote
1answer
51 views

Oraclize handling long response from cryptocompare

I have very custom task and I need to make sure what are limits of each technology. I haven't found nothing similair in this forum yet. I am using Oraclize to get response from this url: https://...
1
vote
1answer
38 views

Unable to test Solidity Remix

I am writing my own smart contract in Solidity and trying to test in Remix. The main Remix site appears to be down (https://remix.ethereum.org/). I found another site: https://ethereum.github.io/...
2
votes
1answer
13 views

Contract - Demo - Identifier - Only 3 Lines for my contract to work - ¿does somebody know how to fix this?

pragma solidity ^0.4.23; contract Owned { address owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); ...
1
vote
0answers
24 views

Why does gas rise when the require will fail?

Here is the contract, function being called is voteForCharacter: pragma solidity ^0.4.19; contract CharacterEveryDay { event CharacterSelected(uint8 _character, uint64[256] characterVotes, uint64 ...
0
votes
1answer
31 views

Remix warning - Is constant but potentially should not be.

I am getting the warning on the code shown below. Could you please assist me know to resolve this warning ? warning message - "Is constant but potentially should not be"
0
votes
1answer
26 views

Transfer half of balance?

I have a smart contract which balance is very dynamic. Is there a way to transfer just half of the balance? I tried: account[4].transfer(this.balance / 2); I think it's not the greatest idea ...
4
votes
1answer
34 views

this.balance VS address(this).balance

What is the difference between this.balance VS address(this).balance in solidity contracts?
0
votes
0answers
15 views

Error when running Truffle Test in Terminal

I am trying to use truffle to test my smart contracts and have written some test files. I am getting an error on the terminal trying to run the test and am unsure what the reason is. I access my ...
1
vote
0answers
19 views

I cannot verify contract on etherscan

I cannot deploy my contract so I test with simplestorage but I cannot verify it either. pragma solidity ^0.4.24; contract SimpleStorage { uint storedData; function set(uint x) public { ...
2
votes
2answers
26 views

send() or transfer() functions always fail

I created a few code below pragma solidity ^0.4.19; contract SendAndTransferExample { function SimpleSendToAccount() public returns(bool) { return msg.sender.send(10000000000000000000); ...
2
votes
1answer
28 views

Contract working on Javascript VM and not Web3 Provider, why?

Here is the code: Calling contract: pragma solidity ^0.4.24; contract Caller { address public called_address; constructor() public payable { } function set_address(address _addy)...
1
vote
0answers
9 views

What happens to the missing coins in this transaction? Copy paste this code into remix to reproduce my original bug. Thank you

pragma solidity ^0.4.24; contract TheCaseOfTHeMissingCoins{ string public name; string public symbol; uint8 public decimals = 18; address public owner; mapping (address => ...
1
vote
0answers
31 views

Gas requirement of function client.<function_name>() high: infinite

I've tried fix that problem. but still i don't know what was wrong If someone can fix this problem, please save me. I'm still trying this. below sample code contract HelloWorld { uint private ...
2
votes
1answer
29 views

msg.sender is Null in Base Constructor

When I create the child class object and try to access value of msg.sender from parent class it always comes 0. Can anyone please help me in this? Below is the sample code: contract Test1 is Test2 { ...
1
vote
0answers
10 views

Can't deploy contract in Mist

I'm trying to deploy contract using Mist on Mac OS X. It worked fine on testnet but when I try to do it on main net the transaction just hangs on "Couldn't estimate gas, restoring to default ...
0
votes
1answer
24 views

Transaction reverting when it hits Require statement in function

I have below contract. I deploy my contract in remix and put 1 ether in value but when I execute enter() function I get an error. This is the contract: pragma solidity ^0.4.17; contract Lottery{ ...
1
vote
2answers
49 views

Smart contract interaction (with another contract) example for solidity version 0.4.24 that works on Remix

I was going through this code and I decided to test it on RemixIDE... Creating a function that calls another contract I kept getting "VM Exception while processing transaction: revert" when I ran a ...
2
votes
0answers
25 views

Estimated gas is always low

web3.eth.estimateGas is always calculating low gas for the transaction. Here is a reference to a trasaction in ropsten. https://ropsten.etherscan.io/tx/...
1
vote
0answers
18 views

Getting Json file from remix

I have been deploying contracts on rinkeby but we are almost done to go to mainnet. I have been comparing deployments with truffle and remix and there is a huge difference in gas uses, so I would ...
1
vote
1answer
237 views

hacked contract

Unfortunately, the contract we created with great hopes last night was hacklendi. we still do not understand how it is, the owner's address is changed. we are trying to figure this out because we want ...
2
votes
1answer
27 views

How Do I take a Snapshot and Migrate Token Holders to a new ERC20 Contract?

I want to Migrate my ERC20 Contract to a new Address, How do I do this ?