Skip to content

Instantly share code, notes, and snippets.

View cgewecke's full-sized avatar
🐢

cgewecke cgewecke

🐢
View GitHub Profile
Compiling ./contracts/Abstract.sol...
Compiling ./contracts/Example.sol...
Compiling ./contracts/ExampleAssert.sol...
Compiling ./contracts/ExampleRevert.sol...
Compiling ./contracts/Loops.sol...
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/RevertWithReason.sol...
Compiling ./contracts/UsesExample.sol...
Writing artifacts to ./build/contracts
Migrations dry-run (simulation)
===============================
> Network name: 'ropsten-fork'
> Network id: 3
1_initial_migration.js
======================
Deploying 'Migrations'
@cgewecke
cgewecke / npm-migration
Created July 5, 2018 00:14
Output from Alan Lu's NPM migrations tests
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/extralib2.sol...
Compiling ./contracts/extraotherlib2.sol...
Compiling @org/pkg/contracts/extralib.sol...
Compilation warnings encountered:
/private/var/folders/_p/1jdl7zfx1473cwzhqsz8gx4r0000gn/T/tmp-38517cujv2dLeNLkl/node_modules/dep2/contracts/Migrations.sol:11:3: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function Migrations() public {
^ (Relevant source part starts here and spans across multiple lines).
@cgewecke
cgewecke / npm-dry-run
Created July 5, 2018 00:18
Output from Alan Lu's npm migrations: dry-run test
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/extralib.sol...
Compilation warnings encountered:
/private/var/folders/_p/1jdl7zfx1473cwzhqsz8gx4r0000gn/T/tmp-38535ESsKAygkULcz/node_modules/@org/pkg/contracts/Migrations.sol:11:3: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function Migrations() public {
^ (Relevant source part starts here and spans across multiple lines).
Writing artifacts to ./build/contracts
Starting migrations...
======================
> Network name: 'development'
> Network id: 1337
> Block gas limit: 7000000
1_initial_migration.js
======================
> {

Deployments

Gas Diff Diff % Block % chf avg cost
ConvertLib 111,791 0 0 1.4 % 0.48
EtherRouter 278,020 0 0 3.5 % 1.20
Factory 324,331 passed -14,222 4% 4.1 % 1.40
MetaCoin 358,572 failed +73,534 26% 4.5 % 1.55
MultiContractFileA 90,745 0 0 1.1 % 0.39
MultiContractFileB 90,745 0 0 1.1 % 0.39
Resolver 430,580 0 0 5.4 % 1.86

Importing Truffle as a module

const truffle = require("truffle");

Beginning with v5.0.30, Truffle exports the methods listed in truffle-core/index.js. This means your plugin can consume the user's Truffle instance as a library and access a subset of its internal command APIs.

These are useful if you need to touch several Truffle commands in succession. For example, imagine a plugin that evaluated how a contract system performed at different levels of solc optimization. Its workflow might look like:

  TestMetaCoin
Error: TestMetaCoin contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of TestMetaCoin: ConvertLib
    at Function.checkLibraries (/Users/cgewecke/.nvm/versions/node/v10.15.3/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js?873b:199:1)
    at execute.prepareCall.then (/Users/cgewecke/.nvm/versions/node/v10.15.3/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/execute.js?5165:218:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: TestMetaCoin contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of TestMetaCoin: ConvertLib
    at Function.checkLibraries (/Users/cgewecke/.nvm/versions/node/v10.15.3/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js?873b:199:1)
    at execute.prepareCall.then (/Users/cgewecke/.nvm/versions/node/v10.15.3/lib/node_modules/truffle/build

Find below the list of issues we’ve collected, in order:

  • #1950 new Buffer is deprecated and unsafe
  • #1926 Cannot read property 'name' of undefined at Contract._generateEventOptions
  • #1952 new Buffer is deprecated and unsafe
  • #1085 Provider does not reconnect after failure
  • #1391 Question: Keepalive for ws subscriptions?
  • #1558 Reconnect on Websocket Drop
  • #1852 Reconnect feature is missing when websocket connection is closed.
  • #1933 Can't assign more than one handler to connection events
Client net_version eth_chainId
geth --dev "1337" "0x539"
parity --dev "17" "0x11"
ganache-cli "1570135120814" "0x539"