Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
47 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
92 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
110 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
48 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
66 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
150 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
68 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
34 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
86 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
25 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
62 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
41 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
103 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
33 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
152 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
52 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
27 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
384 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
20 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
100 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
96 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
28 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
44 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
86 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
102 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
41 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
311 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
94 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
114 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
65 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) ...
0
votes
1answer
71 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
23 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++){ ...
2
votes
0answers
40 views

How to get v,r,s parameters from transaction receipt in remix ide?

I am trying to get v,r,s parameters of a transaction so that I can use them to verify the signature. I am not sure but I think previously remix used to give these parameters in transaction receipt. I ...
0
votes
1answer
30 views

Gas displayed on “Remix”

Is Gas displayed on "Remix" at function execution the same as when executed on the main net? I'm using the Javascript VM as the environment.
0
votes
2answers
54 views

Unable to fetch output from a public function in solidity

I am writing a solidity public function that changes the value of state variable and then returns it. pragma solidity >=0.4.22 <0.6.0; contract white_label { uint currentId = 1; ...
0
votes
0answers
27 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
66 views

Remix vs Truffle project in VSCode [closed]

I do this post to ask your methodologies and customs when developing smart contracts. Between Remix + Ganache and Truffle Project + Ganache. What is more comfortable for you? Why is one better than ...
1
vote
1answer
278 views

How to import files into remix (ERC721 contract)?

I get this error - Unable to import "undefined": Not Found And this flashes onto the screen - Loading https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/introspection/...
0
votes
0answers
97 views

Running out of Gas while deploying contract via web3.js

// contract is storing ABI var instance = contract.new( "0x12", // bytes32 "0x12", // bytes32 [], // array of addresses 11, // uint 11, // uint "...
0
votes
1answer
56 views

I want to withdraw amount from Receiver Contract's tokenFallback() function in ERC223 how to implement this scenario?

I am using ERC223 standard token transfer contract and receiver contract which includes tokenFallback(). I've transferred tokens from my ERC223 contract to receiver's contract address, now I want to ...
0
votes
1answer
35 views

Who is “from” in case of inheritance in solidity?

I have the following code: // Test.sol pragma solidity ^0.5.2; import "./TestBase.sol"; contract Test is TestBase{ string[] name ; constructor() public payable { name.push("sheep"); ...
1
vote
2answers
141 views

Solidity public variable getter call doesn't return

I have deployed a very basic solidity contract (pragma solidity^0.4.0) to Rinkeby. When I call the getters on my state variables, nothing is returned and I do not understand why. To compile the ...
0
votes
1answer
54 views

Remix IDE: How can I open a file from GitHub repository ID

I want to compile and use a smart contract located in a GitHub repository on a specific branch or compile ID. I did it the same thing in the past but I've always used a URL which prompted the Git ID ...
0
votes
1answer
79 views

Get value by calling a function from External Smart contract

There are 2 smart contract contract A { function abc(string _a) public returns (address) { return new B(_a); } } contract B { function xyz(string _a) { A a = A(contact address); // ...
2
votes
1answer
182 views

What does the assert() indicate here?

Here is code snippet, function transfer(address _to, uint _value, bytes memory _data, string memory _custom_fallback) public returns (bool success) { if(isContract(_to)) { if (balanceOf(...
0
votes
1answer
104 views

How to pass arguments to token smart contract generator?

I'm trying to build a 'token generator' smart contract that accepts 3 arguments to then deploy a new token smart contract with those inputs ('strings' for symbol, name, 'address' for owner). I am a ...