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

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

0
votes
0answers
10 views

Getting “Contract Compilation failed” error

I am trying to run my first contract and getting this error "Contract Compilation failed". pragma solidity >=0.4.0 <0.6.0; contract SimpleStorage { uint storedData; function set(uint x) ...
0
votes
0answers
10 views

Why is there a difference between bytecode size of same file but with different solidity compiler?

I am compiling following code using Remix IDE. contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; address delegate; } struct Proposal {...
0
votes
2answers
27 views

Getting below error in remix editor

Just starting with this code - pragma solidity ^0.4.17; contract test { uint public manager; }
0
votes
1answer
89 views

Remix issue - Uncaught JavaScript exception: abort("NO_DYNAMIC_EXECUTION was set, cannot eval

The remix browser was working before. I was getting "Origin http://localhost is not allowed by Access-Control-Allow-Origin.". SO, I added Allow-Control-Allow-Origin: * Chrome Extension. But the remix ...
0
votes
1answer
16 views

SafeMath .add() imposes infinite gas

When I use add() function from Solidity SafeMath library, I get infinite gas requirement in remix (and this reflects in transactions that wont go through). Simplified example: function someFunction()...
1
vote
1answer
20 views

How to make fair gas consumption of smart contract users

i have made a contract that 2 users participate in the smart contract, both users do the same steps however i notice it that user1 pay more gas ( transaction gas and execution gas ) than user 2 any ...
0
votes
0answers
44 views

Is that normal? [duplicate]

I deployed my contract to an actual blockchain, the contract is about a game that at the end there is a function called play where it states the winner (W: 0) means a tie, (W: 1) means player1 won, (W:...
-1
votes
1answer
21 views

How to diagnose “invalid opcode” when compiling?

I have a huge contract so isolating the cause will be very arduous manually. Is there any way to get an indication automatically of what might be causing an "invalid opcode" error?
0
votes
2answers
16 views

Self Destruct Transaction

how to make transaction like THIS TRANSACTION anyone can help me how to build it
0
votes
1answer
14 views

HOW TO CREATE SELF DESTRUCT CONTRACT [on hold]

I saw at etherscan this contract https://etherscan.io/address/0xe5d28d553774d87ffce96992edc3f97af7ec1dd8 anyone can tell me how to build it on https://remix.ethereum.org
0
votes
0answers
11 views

Can't make more than one call in oraclize (test contract deployed to local Ganache and connected via ethereum-bridge)

I am running a local instance of Ganache and I've connected my Metamask plugin in chrome to connect to the custom RPC at http://localhost:7545. I've deployed my contract onto my local test net via ...
0
votes
1answer
10 views

constructor should be payable if you want to use message sender

Hi There i was running this code on remix javascript vm. But this gave me error on buy function that constructor should be payable if you want to use message sender. I can't understand the mistake as ...
0
votes
2answers
36 views

Increment a uint variable results in unexpected value

I have the function resolveProject() in my contract, which iterates over a list of Task, let's say 2, both with status 3. function resolveProject() { // ... uint closedTask; uint ...
0
votes
0answers
7 views

Transaction initiation and response

When we initiates a transaction(let say by remix using injected web3), we will get response which includes hash of transaction as transaction id which helps to track the transaction. Before this, if ...
0
votes
1answer
14 views

Deploying contract via Remix costs less gas than deploying via javascript

When I launch my contract via remix, it launches with no issues. When I try to launch the contract via my javascript web3, using the same gas price and gas limit, it fails b/c it ran out of gas. This ...
0
votes
1answer
37 views

Connection from origin https://remix.ethereum.org rejected

I was trying to share my local folder of contracts to remix-ide using RemixD. I followed the tutorial here. I ran the code below which is how you setup the connection for remixd and remix-ide now. ...
1
vote
0answers
26 views

exception calling another contract method

I have tried this several ways. In the simpliest form, I put both contracts in the same file, and Im still getting an issue when I try and run this in the browser compiler remix. Also, I am using ...
0
votes
2answers
20 views

Tokens on a Contract

Want to get tokens amount sent to my contract address on chain, but don't know address of token. Can I get through any function ? Any possible way to so ?
0
votes
1answer
22 views

The constructor should be payable if you send value ? It seems no error on my code

I am a student who studies solidity now. I am following the tutorial now to study how to write solidity code on Remix. But I think below code does not have any problem, but it keeps making an error. ...
0
votes
0answers
17 views

Change Ethereum contract code [closed]

please re-code this contract for ^5 remix pragma solidity ^0.4.6; contract Order { address public owner; struct OrderStruct { address sender; uint amountReceived; } ...
2
votes
1answer
21 views

Remix: Gas required exceeds allowance or always failing transaction

I have a contract which has transferFrom function mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; mapping (address => bool) public ...
0
votes
1answer
13 views

How to handle created contract instance on Remix

I am writing some contract code by using Solidity on Remix. As you can see, TreasureBox contract creates Gold contract and it calls take() method on Gold contract. But I can check that TreasureBox ...
0
votes
1answer
18 views

Help a Noob Debug Some Code

Hello Eth Stack Exchange, I am practicing Solidity on Remix. This is actually the first language I have ever learned. In the contract below, I created a program to allow users to create dinosaurs and ...
0
votes
1answer
17 views

Infinite Gas Requirement: Compiling a simple contract on Remix

I am trying to compile a simple contract on Remix but I am getting following 3 warnings: Gas requirement of function Greeter.hello() high: infinite. If the gas requirement of a function is ...
0
votes
1answer
12 views

how to call function on Ropsten

I deployed a smart contract to Ropsten testnet I want to call its only public function to test it on the network. How can I do such a thing and where I will see the result? The TxHash is: ...
1
vote
0answers
19 views

Remix: Potentially should be constant but is not.

I am trying to execute a contract provided as a tutorial for Remix at the following link: https://gangachris.com/posts/a-look-into-remix-ide/ The contract is: pragma solidity ^0.4.20; contract Cars{...
3
votes
1answer
121 views

Why this transaction is revert?

I want to guarantee that user has enough Eth to execute back(). When you set little amount of eth in msg.value, there are no revert. However, if you set almost of all Eth you have, the revert is ...
1
vote
2answers
51 views

Rock scissors paper game in Solidity

For a homework problem, I need to write a contract for a rock-paper-scissors game for two players who would deposit the same amount of money then the winner will get both deposits. I am new to ...
0
votes
0answers
29 views

Deploying a contract from Remix IDE, using from Truffle

As I understand, if I compile a contract via truffle compile to have the Contract.json, and then deploy the contract from Remix IDE to, say, Ropsten, the dapp should work via MetaMask pointed to ...
0
votes
1answer
25 views

Uncaught error: VM Exception while processing transaction:out of gas

pragma solidity^0.4.18; contract project3{ address owner; struct Users{ string companyName; string role; string country; string city; uint phoneNo; string physicalAddress;} constructor (uint ...
1
vote
0answers
10 views

web3js send transaction failed when contract modify mapping data , but remix work

first, web3 version: 1.0.0-beta.36 the contract code is: pragma solidity ^0.4.25; contract Main { struct Model { uint256 key; uint64 createTime; } Model[] public models; mapping(...
0
votes
1answer
31 views

Mocking msg.sender during unit test [duplicate]

I am currently trying to push my unit testing far in order to achieve a complete coverage over my code. I am using Open Zepplin's Ownable.sol contract and I cannot find in the documentation something ...
0
votes
0answers
21 views

How to correctly input an array of addresses as constructor parameter in Remix IDE? For deploy to ethereum mainnet!

I have a smart contract where an array of addresses is the input parameter for the constructor. Deploying to Ropsten works with writing the array like ["0x97k...", "0x08et...", "0x094hg..."], but when ...
0
votes
1answer
16 views

Read List of Posts using struct

I tried to read a list of posts using the code below struct posts { bytes32 postTag; string post; address[] acceptedBy; uint8[] voteCount; } mapping(address => posts) totaluserPosts; ...
0
votes
1answer
23 views

Passing Parameters to Remix

I am trying to implement the contract below in REMIX. If I try to pass parameters to appendTags as "tag1", I get an error as Error: invalid bytes32 value (arg="", type="string", value="tag1") ...
0
votes
2answers
39 views

How to call a function of a smart contract [closed]

I'm totally new to solidity I have a contract that I have to compile and deploy. Now, I have to interact with it (specifically with one of its functions) but I don't know how to do that and I feel ...
0
votes
0answers
17 views

VM Exception whille calling smart contract function using ganache-cli and node on local machine

I am trying to create instance of a smart contract from another smart contract. The code for the same is: pragma solidity ^0.4.25; contract Certificate { string hash; ...
0
votes
0answers
13 views

Decentralized Exchanges on Ethtereum Testing Network for test

There are many exchanges available in market for token trading but found Kyber Network Proxy exchange on Ropsten also for testing trade function. And I can buy tokens through Ropsten Network. Any ...
0
votes
0answers
28 views

constructor is not getting initialized when deployed contract using truffle-hdwallet-provider on rinkeby test network

My contract is getting successfully deployed on the Rinkeby test network using truffle-hdwallet-provider but, the value I gave to the constructor (string a) while deployment is not getting initialized ...
0
votes
1answer
28 views

Writing contract for airdrop distribution

I have a problem. we have an ico. I would like to use the selfdrop method for airdrop distribution. While the superskynet's ico continued, they also wrote a selfdrop contract. can you tell me how I ...
0
votes
0answers
41 views

Remix error: the constructor should be payable if you send value

I have custom token code which extends the implementation of the standard ERC20 Token code. It has approveAndCall() function which sends token to another service contract code address. But I get the ...
1
vote
1answer
38 views

Error Ganache: Run out of gas - Works in Remix/Not from dApp

I am working on an application that stores and retrieves personal data on/from the ethereum blockchain. Just working on this to improve my Solidity and SC expertise and get comfortable with the ...
0
votes
1answer
56 views

Remix IDE + Ganache vs Truffle + Ganache

I have an issue migrating a smart contract from Truffle into Ganache. However, when I run the same smart contract from Remix IDE via MetaMask into Ganache, everything works fine. To bypass the ...
0
votes
0answers
15 views

Error out of gas when use remix + Ganache CLI v6.1.8 (ganache-core: 2.2.1)

contract Send { function Send() public payable{ } function () public payable{ } function getBalance() constant returns (uint balance){ balance = this.balance; return ...
0
votes
1answer
21 views

Sending real ETH to contract on Rinkeby

I have a contract deployed to the Rinkeby testnet. It includes the following function: function deposit(uint amount) payable public { require(msg.value == amount); } If I try to send ETH to this ...
0
votes
1answer
35 views

How to use Ganache, Remix IDE, MetaMask, and Web3js without Truffle

I am having an issue migrating a contract using Oraclize API to Ganache from Truffle. However, everything is working fine when running the contract from Remix IDE via MetaMask. As I want to write the ...
0
votes
0answers
13 views

Simulating similar website with remix but only interact with metamask with deployed contracts (web3Currentprovider)

I am creating a website which can interact with metamask (or mist). This website will be similar to remix. It can interact with contracts (these contracts have been deployed). Where should I start to ...
1
vote
0answers
19 views

SSL Certificate for remix-ide environment

I have installed remix-ide in my azure vm.Through http:/publicip:8080 i can able to access the remix-ide environment but i dont know how to make it as a https and where to mentioned the ssl ...
0
votes
0answers
14 views

what does memory[0x00:0x00] means?

I see a pseudocode : memory[temp3:temp3 + 0x00] = address(temp0).call.gas(!temp4 * 0x08fc).value(temp4)(memory[temp3:temp3 + 0x00]); what is the memory[temp3:temp3 + 0x00] means? I just know like ...
0
votes
2answers
21 views

solidity split each number

uint number = uint(keccak256(abi.encodePacked(now)) Split each number. For example, if the value of number is 1562, I need to be able to extract the result as: uint a = 1, uint b = 5 , uint c = 6, ...