Code Monkey home page Code Monkey logo

ethereum / remix-project Goto Github PK

View Code? Open in Web Editor NEW
2.4K 65.0 903.0 226.38 MB

Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.

Home Page: https://remix-ide.readthedocs.io

License: MIT License

JavaScript 21.83% Shell 0.12% CSS 16.73% HTML 0.10% TypeScript 58.83% Dockerfile 0.01% Solidity 1.13% Handlebars 0.02% Circom 0.09% EJS 1.11% SCSS 0.04%
remix remix-ide solidity smart-contracts evm vyper blockchain ethereum hacktoberfest

remix-project's Issues

Support finding the origins of values in the stack

In the state view of remix, it would be nice if we can click on a stack element and jump to the instruction where the element is produced.

Alternatively, moving the mouse cursor on to a stack element can change the color of the instruction that produces/consumes the stack element.

mappings in memory

Structs containing mappings in memory are not handled properly. The mapping has to be completely ignored (i.e. it occupies zero space) when the struct is used in memory.

contract c {
    struct X {
        uint a;
        mapping(uint => uint) b;
        uint c;
    }
    X x;
    function f() constant returns (uint) {
        x.a  = 1;
        x.b[2]=3;
        x.c = 4;
        X memory y = x;
        y.c = 9;
    }
}

"Loaded address" does not always follow inter-contract calls

If a contract calls another, the "loaded address" in the "Step Details" tab shows the current loaded contract, at least most of the time.
Example:
http://etherscan.io/remix?txhash=0xea9332a2d33b659e1520c3927741bdc1d15bcd13601c413220bc8de9c271d917
Location 4019
VM trace Step 699
Execution step 259

There is a call to 0xbd5af6f705e4582c3f2b368ccf278ce39c3cfc17 but the "loaded address" doesn't keep track of this.

Rationale: I use the remix debugger to quickly fly over the instructions (with the slider) to see which internal calls happen. If loaded address doesn't change correctly, you have to manually click through every step.

Consider using a newer version of ACE

There were perhaps a lot of improvements in the last 8 months.

  • require newer version of ACE in package.json
  • regenerate mode-solidity using the new version
  • merge mode-solidity with upstream (long term)

Display storage variables even if source does not match perfectly

For debugging existing contracts compiled with old compiler versions, it might make sense to use a given source code, even though the bytecode on chain does not match perfectly. This could be very useful to at least display storage variables correctly (local variables and source references will not work).

Gas for Execution Cost doesn't add up

Considering the following contract:

pragma solidity ^0.4.19;
contract A {
    
    function testme() public{
        
    }
}

It uses gas for input (transaction cost): 4*68 = 272 + 21000 = 21272 - this is correct in Remix. But I cannot verify the execution cost:

It uses the following instructions according to the debugger:

Gas Instruction
3 000 PUSH1 60
3 002 PUSH1 40
3 004 MSTORE
3 005 PUSH1 04
2 007 CALLDATASIZE
3 008 LT
3 009 PUSH1 3f
10 011 JUMPI
3 012 PUSH1 00
3 014 CALLDATALOAD
3 015 PUSH29 0100000000000000000000000000000000000000000000000000000000
3 045 SWAP1
5 046 DIV
3 047 PUSH4 ffffffff
3 052 AND
3 053 DUP1
3 054 PUSH4 7fdcf8c4
3 059 EQ
3 060 PUSH1 44
10 062 JUMPI
1 068 JUMPDEST
2 069 CALLVALUE
3 070 ISZERO
3 071 PUSH1 4e
10 073 JUMPI
1 078 JUMPDEST
3 079 PUSH1 54
3 081 PUSH1 56
8 083 JUMP
1 086 JUMPDEST
8 087 JUMP
1 084 JUMPDEST
0 085 STOP

Which is in sum 119 gas, but the instruction details in the Remix logger shows 128.

status 0x1 Transaction mined and execution succeed
from 0xca35b7d915458ef540ade6068dfe2f44e8fa733c
to A.testme() 0x692a70d2e424a56d2c6c27aa97d1a86395877b3a
gas 3000000 gas
transaction cost 21400 gas
execution cost 128 gas
hash 0xccca4e36cc65d4856f556ad56414848b82d6eccd9ea7a66dfa76e194042e555c
input 0x7fdcf8c4
decoded input {}
decoded output {}
logs []
value 0 wei

The instruction cost is the same as shown in Appendix G in the Yellowpaper, this is something I could verify. But I cannot verify where the 9 gas are coming from.

Add a warning if referencce slot not resolvable

We should add a warning for this cause the bytecode of lib will contains a slot for its self reference.

library lib {
function create () returns (address)
{
child k = new child();
return address(k);
}
function getFromLib() returns (uint) {
    return 45;
}
}
contract child {
function get () returns (uint) {
return lib.getFromLib();
}
}

Different variable highlight depending on storage type

Different colours for storage, memory and stack variables
The fact whether a variable is a value-type, stored in storage or memory often makes a huge difference. Similar to how other IDEs highlight variables depending on whether they are local variables or class members, Mix could make that distinction clear to the programmer.
Credit for the idea goes to @LianaHus

Add toolbar for creating Solidity packed hashes

Perhaps use the solidityPack from ethereumjs-abi:

var abi = require('ethereumjs-abi')
var BN = require('bn.js')

abi.soliditySHA3(
    [ "address", "address", "uint", "uint" ],
    [ new BN("43989fb883ba8111221e89123897538475893837", 16), 0, 10000, 1448075779 ]
).toString('hex')

Add a TODO list

Helpful for larger contracts > 700 lines.
List all "// TODO ..." and make it "clickable" with jump-to-line action

Support EditorConfig

EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. The EditorConfig project consists of a file format for defining coding styles

More: http://editorconfig.org

(It also has a javascript implementation)

display storage keys

Display key, value instead of a complex hashedjey, key; value if all the keys are known.

Insert code snippet

Include easy way to use code snippet, code pattern.
could be a list of solidity code snippet that user would drag and drop to the editor.
There were post in reddit of a github repo that contain only solidity common pattern

Remix doesn't recognize auto generated functions as a valid abstract interface implementation

Hey,

In the following example -

contract AbstractToken {
    function totalSupply() external constant returns (uint256 totalSupply);
}

contract Token is AbstractToken {
    uint256 public totalSupply = 0;
}

Remix won't allow the user to create an instance of Token ("This contract does not implement all functions and thus cannot be created"), even though the auto generated compiler function for totalSupply matches the abstract interface signature.

Was tested on solidity 0.4.11

Note that solc actually compiles Token with no error.

See ethereum/solidity#2254

Edit: the issue is also valid when the abstract parent is an interface instead of a contract.

Update deprecated babel-preset-es2015

remix$ npm install
npm WARN deprecated [email protected]: We're super ๐Ÿ˜ธ excited that you're trying to use ES2015 syntax, but instead of making more yearly presets ๐Ÿ˜ญ , Babel now has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. preset-env without options will compile ES2015+ down to ES5 just like using all the presets together and thus is more future proof. It also allows you to target specific browsers so that Babel can do less work and you can ship native ES2015+ to user ๐Ÿ˜Ž ! We are also in the process of releasing v7, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and help test it out in beta! Thanks so much for using Babel ๐Ÿ™, please give us a follow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/development and help support the project at opencollective.com/babel

Support more types in request inputs

I think it would be the best to follow Solidity as closely as possible:

  • "string" - string literal
  • hex"0011ff" - bytes literal
  • 0x1234 / 123 - numbers

Static analysis: Improve gas checker

Suggestions by https://www.reddit.com/user/ItsAConspiracy :

Seems that top warning [fallback function] isn't quite right, since the contract can receive ether from user accounts or from contracts using call.value.

I think there are times when it's worthwhile to use >2300 gas in the fallback: specifically, when you prefer to throw rather than accepting the ether without crediting the sender. If your only options are to either throw or update storage, you might as well try to update storage, since it'll throw anyway if it runs out of gas.

Suppress the warning if the fallback is not marked payable.

Unit testing for applications

Browser-Solidity should support unit tests for contracts written in javascript using the web3 framework.
This requires several changes:

  • allow files to be non-solidity (i.e. javascript)
  • allow javascript files to be run against the current web3 object
  • potentially integrate a test-runner to render test results nicely

Check chrome extension

comment from gitter
@yann300 @chriseth I'm running Remix as a Chrome extension but I'm getting destructive behaviour often when it starts up... It asks to overwrite local files with files from 'the cloud'. As an extension I have no idea what it thinks 'the cloud' is or where it stores these often older versions of my files but it does keep a set in local storage also. Regardless, I'm never sure which set are current and have on numerous occasions had days worth of work reverted by some older set of the same files.... Any ideas?

show nested contracts in contracts tab

When creating an instance of c1 with the following code, the constructor automatically creates an instance of c2. For debugging purposes it would be extremely helpful if this nested instance myC2 would be shown in the contracts tab and I could, e.g. see its address and call its functions:

contract c1 {
    c2 myC2;
    function c1() {
        myC2 = new c2();
    }
    
    function getC1() constant returns (uint) {
        return 1;
    }
}

contract c2 {
    function getC2() constant returns (uint) {
        return 2;
    }
}

Assess performance

Assess the performance of both the UI and the trace retrieval / reformatting / data enrichment functions.

Contract properties should live update

When deploying & interacting with a contract, and setting a value, it's confusing when that value does not update in response.

It would be nice if the contract values updated when a new block had a new value associated.

Maybe this would require polling, and would be a performance concern?

Allow to manually set gas price

Please provide a way to change the gas price per transaction.
The current default makes it very easy to work with libraries and proxy contracts.

save to swarm

In a similar way to https://github.com/ethereum/browser-solidity/issues/153 we could auto-save and synchronize files / projects to swarm.

This will be much more crude than github because swarm does not have version tracking. Can we use mango?

A very simple version of this would automatically publish all files in a project and display (and update) the root hash for the project.

A still quite simple version would connect this via ENS and display (and update) a name that links to the root hash for the project. If there are conflicts, you only have the option to ignore local or ignore remote changes.

Deploy ABI to reverse record in ENS

@Arachnid just made me aware of "reverse ens records" and the fact that you can store contract ABI there. The deployed contract has to register its reverse record as part of its constructor (or at any time, but the registrar has to be called from that contract).
Since this process is similar to the "publish to swarm" process, we could add a button next to that button "publish ABI to ENS" or something like that.

Clicking the button would check that

  1. we are connected to a node,
  2. some contract we deployed in the past has a reverse record (and some of the accounts we control is registered as the controller),
  3. we still know the ABI to that contract

We can iterate over all contracts we deployed in the past, potentially offer a drop-down selector and also display error messages if none matched.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.