Git Product home page Git Product logo

nomicfoundation / hardhat Goto Github PK

View Code? Open in Web Editor NEW
6.8K 75.0 1.3K 175.95 MB

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.

Home Page: https://hardhat.org

License: Other

JavaScript 0.46% TypeScript 89.92% Solidity 1.85% Shell 0.05% Vyper 0.01% Ruby 0.01% Rust 4.69% Jupyter Notebook 3.02%
ethereum smart-contracts blockchain dapps javascript tooling task-runner solidity typescript debugging

hardhat's People

Contributors

0xmarto avatar agostbiro avatar alcuadrado avatar antico5 avatar bencicandrej avatar cgewecke avatar christopherdedominici avatar dependabot[bot] avatar duckception avatar feugenea avatar freiremanuel91 avatar fvictorio avatar fzeoli avatar github-actions[bot] avatar itirabasso avatar kanej avatar marcocastignoli avatar nicosantangelo avatar ravenind avatar renansouza2 avatar schaable avatar scnale avatar sz-piotr avatar tmilar avatar usulpro avatar viarnes avatar victaphu avatar wodann avatar zemse avatar zoeytm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hardhat's Issues

> RuntimeError: VM Exception while processing transaction: out of gas

Hi! I was impressed with buidler while working on a side project, so I'm experimenting with switching OpenZeppelin.

Here's my in-progress branch: https://github.com/shrugs/openzeppelin-solidity/tree/feat/buidler

I'm running our test suite (which uses a custom test script scripts/test.sh to set account balances very high) and running into a large suite of out of gas errors. I expect it's due to the change in how buidler dynamically calculates gas usage, where truffle just does the dumb "max gas" thing).

You can see a minimally reproducible case by running

npm run test -- test/Bounty.test.js
  1) Bounty
       against secure contract
         with reward
           "before each" hook for "cannot claim reward":
     RuntimeError: VM Exception while processing transaction: out of gas
      at Function.RuntimeError.fromResults (node_modules/ganache-core/lib/utils/runtimeerror.js:74:13)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ganache-core/lib/blockchain_double.js:539:26
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/once.js:12:16
      at replenish (node_modules/async-eventemitter/node_modules/async/internal/eachOfLimit.js:61:25)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/eachOfLimit.js:71:9
      at eachLimit (node_modules/async-eventemitter/node_modules/async/eachLimit.js:43:36)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/doLimit.js:9:16
      at VM.AsyncEventEmitter.emit (node_modules/async-eventemitter/lib/AsyncEventEmitter.js:42:3)
      at afterBlock (node_modules/ethereumjs-vm/dist/runBlock.js:52:10)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/runBlock.js:174:9
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:110:7
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:473:16
      at replenish (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1006:25)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1016:9
      at eachLimit$1 (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:3196:24)
      at Object.<anonymous> (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1046:16)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:106:11
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:969:16
      at next (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:5225:18)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:103:7
      at next (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:5223:28)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:103:7

  2) Bounty
       against broken contract
         "before each" hook for "can claim reward":
     RuntimeError: VM Exception while processing transaction: out of gas
      at Function.RuntimeError.fromResults (node_modules/ganache-core/lib/utils/runtimeerror.js:74:13)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ganache-core/lib/blockchain_double.js:539:26
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/once.js:12:16
      at replenish (node_modules/async-eventemitter/node_modules/async/internal/eachOfLimit.js:61:25)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/eachOfLimit.js:71:9
      at eachLimit (node_modules/async-eventemitter/node_modules/async/eachLimit.js:43:36)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/async-eventemitter/node_modules/async/internal/doLimit.js:9:16
      at VM.AsyncEventEmitter.emit (node_modules/async-eventemitter/lib/AsyncEventEmitter.js:42:3)
      at afterBlock (node_modules/ethereumjs-vm/dist/runBlock.js:52:10)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/runBlock.js:174:9
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:110:7
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:473:16
      at replenish (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1006:25)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1016:9
      at eachLimit$1 (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:3196:24)
      at Object.<anonymous> (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:1046:16)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:106:11
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/node_modules/async/dist/async.js:969:16
      at next (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:5225:18)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:103:7
      at next (node_modules/ethereumjs-vm/node_modules/async/dist/async.js:5223:28)
      at /Users/matt/Projects/crypto/openzeppelin-solidity/node_modules/ethereumjs-vm/dist/cache.js:103:7

manually setting the gas for the failing transactions (namely https://github.com/Shrugs/zeppelin-solidity/blob/feat%2Fbuidler/test/Bounty.test.js#L34) makes that specific transaction succeed.

Cheers, this is a great project.

name is horrible

I am sorry but this is the worst name you could have chosen.
How do you think google will be able to find help sites, you would probably always end up on some construction sites or builder related stuff.
Horrible horrible choice.
Sorry for the lack of helpful code related content but I had to say it.

> contract binary not set. Can't deploy new instance.

Issue

I'v encountered this twice when trying to produce bytecode for certain contracts.

pragma solidity ^0.4.24;

import "zos-lib/contracts/upgradeability/AdminUpgradeabilityProxy.sol";


contract CustomAdminUpgradeabilityProxy is AdminUpgradeabilityProxy {
  bytes32 private constant ADMIN_SLOT = keccak256("org.zeppelinos.proxy.admin.custom");
}

this produces an artifact with valid abi, but an empty string bytecode property.

Expected Behavior

bytecode should be produced

Choose/create an artifacts format

We are currently generating a slightly modified subset of Truffle's artifacts. This is implemented this was because we are Truffle Contracts, but we will remove it asap.

We should choose another artifacts format if there's a good one, or design our own.

This issue is specially important, and we want to have as much feedback as possible.

At the very least artifacts should allow linking, deploying and using already-deployed contracts. But we may also want to provide some extra functionality.

Consider replacing web3 for ethers.js

Most of buidler's instability comes from using web3, and in particular web3-provider-engine.

We should consider using ethers.js instead. We could create an ethers-powered web3 shim if necessary.

I haven't had enough time to experiment on this yet, but I think it's a promising idea. Still, it would be a big change, so I'll like to get some feedback about it.

Using HDWalletProvider hangs the process

I'm creating this issue to document a known problem.

HDWalletProvider uses Web3ProviderEngine, which needs to be manually stopped. As a workaround you can call process.exit() at the end of your tasks/scripts.

If #5 is implemented Web3ProviderEngine won't be used anymore, avoiding this issue.

Truffle compatibility

We should decide which parts of buidler will be compatible with truffle, and why.

My current idea is that buidler should only be compatible enough to make migration from Truffle very easy. I think this is specially important for contracts' tests, which nobody will want to rewrite just to use another tool.

buidler test now runs truffle-compatible tests, but that ties us to Truffle-contracts, or at least to its APIs. We should consider making explicit what's truffle-compatibility and whats native in buidler, like making those tests runnable with buidler truffle-test, or even create a buidler-truffle plugin.

We also implemented their networks configuration system, which is very focused on web3. Specially the provider field is normally used along web3-provider-engine, which we want to avoid and may block #5.

Expose a minimal ethers API in BuidlerRuntimeEnvironment

This should expose:

  1. The provider.
  2. The accounts (connected to the provider). This should probably be an async function that returns it, as it's not possible to load the remote accounts synchronously and the Env is initialized in a sync fashion.

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.