dapphub / dapptools Goto Github PK
View Code? Open in Web Editor NEWDapp, Seth, Hevm, and more
Home Page: https://dapp.tools
Dapp, Seth, Hevm, and more
Home Page: https://dapp.tools
Issue by rstormsf
Tuesday Jun 13, 2017 at 18:14 GMT
Originally opened as dapphub/dapp#31
Every *nix tool usually has --help
option to see how to use it without going into the internet.
Issue by MrChico
Tuesday May 15, 2018 at 09:40 GMT
Originally opened as dapphub/dapp#89
Would be a slick feature!
Issue by travs
Tuesday Sep 19, 2017 at 13:48 GMT
Originally opened as dapphub/dapp#55
Right now, libs need to be linked manually (i.e. with solc
).
One alternative would be to link automatically on solc build
unless some addresses are supplied (idea from @rainbreak)
SSCCE - https://gist.github.com/cmditch/91ec92296f90ef0c7c97d0432c95c20c
(Not DSProxy. This is a Proxy contract from Stefan @ Gnosis)
dapp test
results in.
FAIL testFoo()
Failure: testFoo
src/ProxyTest.t.sol:ProxyTest
├╴constructor
├╴initialize test
│ ├╴create Foo (src/ProxyTest.t.sol:18)
│ └╴create Proxy (src/ProxyTest.t.sol:19)
└╴testFoo()
├╴call Proxy::[unknown method](0x037a417c) (src/ProxyTest.t.sol:24)
│ └╴error OutOfGas 0xfbfffffff4c4 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff (src/Proxy.sol:32)
└╴error Revert <source not found>
Issue by mbrock
Thursday Sep 14, 2017 at 07:56 GMT
Originally opened as dapphub/hevm#12
Given that we don't have any blockhashes yet, I don't know if we need
to do anything.
Issue by dbrock
Monday Dec 11, 2017 at 08:32 GMT
Originally opened as dapphub/seth#22
Issue by dbrock
Monday Dec 11, 2017 at 09:18 GMT
Originally opened as dapphub/dapp#69
Instead of dapphub/dapp#64
Issue by kennyrowe
Saturday Feb 03, 2018 at 07:10 GMT
Originally opened as dapphub/dapp#76
add support for jsonrpc-addr for private testnet
kennyrowe included the following code: https://github.com/dapphub/dapp/pull/76/commits
Issue by travs
Monday Sep 04, 2017 at 15:27 GMT
Originally opened as dapphub/dapp#51
Recreate:
mkdir thing && cd thing
dapp init
make all
make deploy # just calls "dapp create Thing"
Output:
bash: warning: shell level (1000) too high, resetting to 1
(over and over)
Running:
linux 4.12.8-2-ARCH
zsh (inside tmux)
Issue by pospi
Friday Jan 19, 2018 at 05:10 GMT
Originally opened as dapphub/dapp#74
Hi all,
Are there any plans to support file watching and incremental compilation / testing for contracts during development? Or is the general opinion that hevm
is fast enough that an external tool should be used to trigger a rebuild & re-run?
Issue by wjmelements
Friday Feb 16, 2018 at 23:44 GMT
Originally opened as dapphub/hevm#33
This doesn't look helpful, but it's the only error message given.
FAIL test_transfer()
hevm: internal error: method type
CallStack (from HasCallStack):
error, called at src/EVM/Solidity.hs:214:22 in hevm-0.12.3-F2xYvHyywk1C4HRq6dL7d:EVM.Solidity
Issue by rolandkofler
Sunday Feb 04, 2018 at 12:05 GMT
Originally opened as dapphub/seth#33
if the default address export ETH_FROM=0x...
is not found seth ls (and many other cmds) simply stop working, and you have to ^C them.
if no valid default account is found an error msg should be thrown and the cmd should exit with an error code.
Issue by mbrock
Wednesday Sep 06, 2017 at 13:27 GMT
Originally opened as dapphub/hevm#7
Issue by mbrock
Thursday Sep 14, 2017 at 07:57 GMT
Originally opened as dapphub/hevm#14
Implement STATICCALL
.
Issue by nanexcool
Thursday Dec 14, 2017 at 15:36 GMT
Originally opened as dapphub/seth#23
Closes #20
nanexcool included the following code: https://github.com/dapphub/seth/pull/23/commits
Issue by fccoelho
Tuesday Dec 26, 2017 at 18:14 GMT
Originally opened as dapphub/dapp#70
My contract imports from Open Zeppelin's StandardToken.sol
I managed to install zeppelin-solidity with:
$ dapp install OpenZeppelin/zeppelin-solidity
I does create a git submodule under the lib
directory. But dapp test
fails:
dapp test
fatal: Cannot change to 'lib/zeppelin-solidity/src': No such file or directory
child_process.js:495
throw err;
^
Error: Command failed: git -C lib/zeppelin-solidity/src rev-parse HEAD
fatal: Cannot change to 'lib/zeppelin-solidity/src': No such file or directory
at checkExecSyncError (child_process.js:472:13)
at Object.execFileSync (child_process.js:492:13)
at run (/nix/store/5brad209b8d92y2cv32fy72pklx4q2qw-dapp-0.7.9/libexec/dapp/dapp-remappings:57:35)
at ls.forEach.name (/nix/store/5brad209b8d92y2cv32fy72pklx4q2qw-dapp-0.7.9/libexec/dapp/dapp-remappings:28:16)
at Array.forEach (native)
at findRemappings (/nix/store/5brad209b8d92y2cv32fy72pklx4q2qw-dapp-0.7.9/libexec/dapp/dapp-remappings:18:50)
at Object.<anonymous> (/nix/store/5brad209b8d92y2cv32fy72pklx4q2qw-dapp-0.7.9/libexec/dapp/dapp-remappings:5:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
I seems to expect a src
directory inside zeppelin-solidity
but it doesn't exist.
is there a way to make this work or do I have to go back to Truffle?
Issue by kennyrowe
Thursday Nov 16, 2017 at 20:52 GMT
Originally opened as dapphub/seth#20
Description:
Add a flag to seth to check the calldata of an onchain transaction.
Specification:
$ seth -verify <txHash> <bytes>
Example:
$ seth -verify 0x036ae8fa1a31e36787f524e3ac21ec2fa44d3b0ff9bcf3fdd3a7933498a18095 $(seth calldata 'transfer(address, uint256)' 1dacd2508778b5caebe71f86f646793acfe22b89 $(seth --to-uint256 1501933000000))
Issue by mbrock
Tuesday May 30, 2017 at 07:50 GMT
Originally opened as dapphub/hevm#4
Will need some crypto dependencies etc.
Issue by wjmelements
Friday Feb 16, 2018 at 12:54 GMT
Originally opened as dapphub/dapp#77
Ideally, the testing environment can let me set the current value of now, such as:
contract Test is DSTest {
function test_now() {
uint uptime = subject.getUptime();
now += 2000;
assertEq(uptime + 2000, subject.getUptime());
}
}
But critically, nothing time-related can be unit tested at the moment. Simply defaulting now to the current time instead of '0' or '1' would be a huge benefit for me.
Thanks
Issue by alext234
Wednesday Mar 14, 2018 at 09:11 GMT
Originally opened as dapphub/dapp#82
With the following simple test code:
//WithLib.sol
pragma solidity ^0.4.21;
library MyLib {
function libFunc(string s) public pure returns(uint) {
return uint(keccak256(s));
}
}
contract WithLib {
function myFunc(string s) public pure returns(uint) {
return MyLib.libFunc(s);
}
}
And
//WithLib.t.sol
pragma solidity ^0.4.21;
import "ds-test/test.sol";
import "./WithLib.sol";
contract WithLibTest is DSTest {
WithLib lib;
function setUp() public {
lib = new WithLib();
}
function test_myFunc() {
lib.myFunc('a1');
}
}
dapp test-ethrun
passes but dapp test-hevm
fails with out of gas (at the place when it calls the library)
Failure: test_myFunc
src/WithLib.t.sol:WithLibTest
├╴constructor
├╴initialize test
│ └╴create WithLib (src/WithLib.t.sol:11)
└╴test_myFunc()
├╴call WithLib::myFunc(string)("a1") (src/WithLib.t.sol:15)
│ └╴error OutOfGas 0xfbffffffefbd 0xfbfffffff279 (src/WithLib.sol:13)
└╴error Revert (src/WithLib.t.sol:15)
Issue by et
Friday Sep 22, 2017 at 04:48 GMT
Originally opened as dapphub/dapp#57
In the docs, it says to install dapp install apmilen/my-cool-package
. However, that repo does not exist.
Issue by nmushegian
Thursday Feb 16, 2017 at 19:01 GMT
Originally opened as dapphub/dapp#7
You can commit
your submodules and then git stash
, and you'll still be blocked due to untracked content:
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: lib/ds-auth (untracked content)
Seth doesn't encode single, big uints
seth calldata 'mint(uint256)' "10000000000"
Returns:
Cannot parse uint256
Caused by:
number too large to fit in target type
10000000000
obviously should fit into uint256 type.
On the other hand, encoding smaller uint works:
seth calldata 'mint(uint256)' "1000000"
0xa0712d6800000000000000000000000000000000000000000000000000000000000f4240
Issue by rainbreak
Wednesday Jun 28, 2017 at 12:26 GMT
Originally opened as dapphub/dapp#32
Compile all libs / sources into a single .sol file. Would be useful for e.g. etherscan verification and anything else that can't deal with multi-file sources.
Issue by ryepdx
Tuesday Jul 18, 2017 at 10:31 GMT
Originally opened as dapphub/dapp#36
With sai
, there's no difference when I run dapp test
and when I run dapp test -r testCascade
.
To prevent regression, there should probably be a test for this bug added to the selftest
.
Issue by retotrinkler
Sunday Jun 10, 2018 at 10:43 GMT
Originally opened as dapphub/dapp#91
Example Solidity
// Transfer to owner
owner.transfer(amount);
where owner == msg.sender
, dapp test sets msg.sender == 0
which then results in a failing test:
│ ├╴call HtlcTest::[fallback function](0x) (src/Htlc.sol:61)
│ │ └╴error Revert (src/Htlc.t.sol:6)
│ └╴error Revert <source not found>
└╴error Revert <source not found>
0.transfer(amount)
seems to trigger fallback function; to have a non-zero default for msg.sender could help
Issue by mbrock
Thursday Sep 14, 2017 at 07:55 GMT
Originally opened as dapphub/hevm#11
Implement the special logic for the null sender and also CREATE2
.
Issue by retotrinkler
Sunday Jun 10, 2018 at 10:39 GMT
Originally opened as dapphub/dapp#90
Example Solidity
function test_hashedSecret() public {
assertEq(sha256(secret), hashedSecret);
}
Returns
Failure: test_hashedSecret
src/Htlc.t.sol:HtlcTest
├╴constructor
├╴initialize test
│ └╴create Htlc (src/Htlc.t.sol:31)
└╴test_hashedSecret()
└╴error PrecompiledContractError 2 (src/Htlc.t.sol:44)
I'm trying to submit a transaction on kovan, but it has been stuck for several minutes now.
$ export SETH_CHAIN=kovan
$ export ETH_RPC_ACCOUNTS=true
$ export ETH_RPC_URL=http://kovan-parity:8545
$ export ETH_FROM=0x1b34baff11fc7a0934ff6e497233868493598ea8
$ seth send 0x2cb53ca7500d8d04888e0E348cB601CB9abe395D "gimme()"
seth-send: warning: `ETH_GAS' not set; using default gas amount
seth-send: Published transaction with 4 bytes of calldata.
seth-send: 0xd849a957f9a3abce1012cd146137530d3621e64c034df29d6ae196cbc088cb8a
seth-send: Waiting for transaction receipt.........................................................................................................................................................................
I was able to send with a different ETH_FROM earlier today: https://kovan.etherscan.io/tx/0x77386c25f4ad2f7290b378c06fccd2e9f224bc58804322135c16ab28eaa402c9
Is there somewhere with more helpful logs?
Issue by rainbreak
Monday May 28, 2018 at 12:45 GMT
Originally opened as dapphub/hevm#38
Needs to return data, similar to RETURN, but revert state changes.
Issue by mbrock
Friday Oct 20, 2017 at 18:42 GMT
Originally opened as dapphub/dapp#61
Sadly, Nix breaks the kernel on High Sierra, because of a bug Apple introduced and will hopefully fix.
This results in freezes and kernel panics when installing Nix packages!
The workaround is to use Nix in "single user mode" rather than using the Nix daemon.
Here's how to switch, after you've installed Nix:
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo launchctl stop org.nixos.nix-daemon
sudo chown -R $(whoami) /nix
sudo sed -i /build-users-group/d /etc/nix/nix.conf
echo "export NIX_REMOTE=" >> ~/.bashrc
After that, the Nix commands should work again.
Issue by ryepdx
Monday Aug 07, 2017 at 16:54 GMT
Originally opened as dapphub/dapp#45
Purposely writing failing event tests per the documentation and they're passing.
Issue by rainbreak
Thursday Apr 13, 2017 at 11:21 GMT
Originally opened as dapphub/dapp#18
Easy way to estimate gas costs in deploying a contract, ideally without actually deploying it.
Issue by warren-bank
Sunday May 14, 2017 at 08:28 GMT
Originally opened as dapphub/dapp#26
Hi all. Not sure if this would be of any interest to you..
Quick bit of context,
I've recently begun experimenting with the available tools for Dapp development.
Imho, when developing Solidity contracts.. the test harness in dapp
is absolutely the best tool to use.
There seemed (to me) to be a bit of a gap in the dapp
toolchain..
when one wants to move from developing Solidity contracts,
to using those compiled contracts to develop a frontend Dapp (ui).
I was playing around and experimenting over the past few days, and in doing so..
I kind of accidentally wrote 2 tools that compliment the dapp
toolchain quite nicely,
and help to bridge that gap.
Today, I released the code for both projects to both github and npm.
github:
npm:
I have no idea if either of these tools would be of any interest or benefit to anyone else.
But, I just wanted to quickly make you all aware of their existence.
Hope you like!
Issue by wjmelements
Friday Feb 16, 2018 at 23:12 GMT
Originally opened as dapphub/dapp#78
Previously: dapphub/ds-warp#4
Libraries seem to have a dependency on contract file directory that manifests during dapp test
.
Here is a minimum repro:
warptest.sol:
pragma solidity^0.4.18;
library Lib {
struct Storage {
}
function getLen(Storage storage self)
public view
returns (uint256) {
return 0;
}
}
contract Doppel {
using Lib for Lib.Storage;
Lib.Storage lib;
function getLen()
public view
returns (uint256) {
return lib.getLen();
}
}
contract Factory {
function create()
external {
new Doppel();
}
}
src/warptest.t.sol:
pragma solidity^0.4.18;
import "ds-test/test.sol";
import "ds-warp/warp.sol";
import "warptest.sol";
contract DSWarpTest is DSTest {
Factory factory;
DSWarp warp;
function setUp() public {
factory = new Factory();
warp = new DSWarp();
}
function testInit() public {
assertEq(warp.era(), now);
}
}
The following solutions all fix the immediate test failure:
So something's broken, but it's complicated.
Issue by MrChico
Thursday Mar 15, 2018 at 10:59 GMT
Originally opened as dapphub/dapp#84
Should probably be resolved before merging dapphub/dapp#83
Issue by ryepdx
Monday Aug 07, 2017 at 15:36 GMT
Originally opened as dapphub/dapp#43
Does not seem to work at present. Added a logging event per the documentation and am seeing nothing on the console.
@mbrock something I noticed using dapp testnet --save x --load x
... you have a
( set -x; kill -INT $gethpid; wait )
inside trap
to cleanly send a kill signal to geth so that it exits correctly. But it's not really working. When stopping dapp testnet --save x --load x
geth often does not write blocks and when you load you end up with an older blockchain. I've done some tests and noticed that:
geth \
2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \
--datadir "$chaindir" --networkid "$CHAINID" --port="$port" \
--mine --minerthreads=1 \
--rpc --rpcapi "web3,eth,net,debug" --rpccorsdomain '*' --nodiscover \
--rpcport="$RPC_PORT" --unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) &
If I remove this line 2> >(tee "$chaindir/geth.log" | grep --line-buffered Success | sed 's/^/geth: /' >&2) \
then when I Ctrl + C, or kill -INT $(pidof geth)
it exits gracefully and fully writes the blocks to disk.
I have no idea why redirecting the output from geth
makes it not exit gracefully. Maybe it's something else I'm missing.
Issue by NiklasKunkel
Tuesday Jul 18, 2017 at 06:46 GMT
Originally opened as dapphub/dapp#35
An event listener this is necessary for dapp to be "feature complete."
It would be nice to be able to do this from dapp rather than having to flip to a different cli window to run my own event listener.
Issue by mhhf
Thursday Apr 06, 2017 at 12:41 GMT
Originally opened as dapphub/dapp#14
I use this often in my workflow and it would be nice to have it in dapp as well:
http://dapple.readthedocs.io/en/latest/logging/
Issue by nanexcool
Monday Feb 26, 2018 at 18:54 GMT
Originally opened as dapphub/dapp#80
With this .gitattributes file, it gives a hint to Github so it correctly highlights Solidity syntax on its webpage.
nanexcool included the following code: https://github.com/dapphub/dapp/pull/80/commits
Issue by nanexcool
Thursday Mar 15, 2018 at 23:09 GMT
Originally opened as dapphub/dapp#86
dapp key --help
dapp key --keystore path
(will prompt for password)
dapp key --keystore path --password file
default keystore ~/.ethereum/keystore
can be used with ETH_KEYSTORE
and ETH_PASSWORD
for seth
compatibility
nanexcool included the following code: https://github.com/dapphub/dapp/pull/86/commits
Issue by lovebankcrypto
Tuesday Jan 30, 2018 at 11:07 GMT
Originally opened as dapphub/dapp#75
nothing happen after runing dapp init
not in dapp directory, not in new folder
Im I using it wrong?
(coin) DianadeMacBook-Air:dapp DianaYu$ sudo make link
Password:
rm -rf /usr/local/bin/dapp /usr/local/libexec/dapp
mkdir -p /usr/local/{bin,libexec}
for x in bin/dapp libexec/dapp; do
ln -spwd
/$x /usr/local/$x; done
(coin) DianadeMacBook-Air:dapp DianaYu$ dapp init
(coin) DianadeMacBook-Air:dapp DianaYu$ cd ..
(coin) DianadeMacBook-Air:token DianaYu$ cd new/
(coin) DianadeMacBook-Air:new DianaYu$ dapp init
(coin) DianadeMacBook-Air:new DianaYu$ sudo dapp init
Issue by mbrock
Thursday Sep 14, 2017 at 10:23 GMT
Originally opened as dapphub/hevm#15
https://github.com/paritytech/parity/pull/5307/files
https://hackage.haskell.org/package/mcl
seems pretty tricky to me
dapp test is freezing under certain conditions. Once again using the gnosis proxy contract, except this time we have a proxy with a function which creates a contract, which is itself a proxy.
See repo here where issue can be easily replicated.
See gist of contracts here, which can easily be popped into remix and tested on JS evm, geth, testnets, etc.
Using binaries:
/nix/store/wgx7xbv387yfljqwyz1sp5j7lv6f5p39-hevm-0.15/bin/hevm
/nix/store/snmiq60r066piwbg0gyv3iaslba66337-dapp-0.9.0/libexec/dapp/dapp
Issue by thapakazi
Wednesday May 16, 2018 at 13:17 GMT
Originally opened as dapphub/seth#36
Just thinking out loud, how safe is it to simply assume networkID and chainID same.
Stumbled upon here because I was using different chainID and netwworkID, and seth was just throwing out invalid sender
error.
Turns out we have been setting chain-id.
https://github.com/dapphub/seth/blob/aae347d3a5bba435b41b7fed7cc8116ab2bc4a81/libexec/seth/seth-mktx#L18
It would be better if we have a option to send the chain-id param explicitly and set rpc net_version
as default like:
--chain-id ${chain_id_from_option:-(seth rpc net_version)}
Thoughts ?
Issue by mbrock
Friday Sep 08, 2017 at 20:05 GMT
Originally opened as dapphub/dapp#54
This pretty much works fine! But we shouldn't merge it immediately,
there's some stuff to consider and some stuff to do.
I can run dapp in a clean Ubuntu Docker, and it will commence installing
Nix, setting up the DappHub Nix channel, and then reinstalling dapp
via Nix.
It's kind of weird though that you would first download the dapp source
code and install it, and then it would immediately reinstall itself in a
different place using Nix.
So I'm not sure, maybe there should be a separate easy install script,
instead of the check in the main dapp program.
Until this dapp version is actually in Nix, the dapp --use
won't work.
mbrock included the following code: https://github.com/dapphub/dapp/pull/54/commits
Issue by nanexcool
Wednesday Aug 30, 2017 at 03:30 GMT
Originally opened as dapphub/dapp#47
dapp clone
is only useful if you have an ssh key configured for github. Maybe a param to use https? or default to https if ssh fails?
Issue by alext234
Thursday Mar 15, 2018 at 19:50 GMT
Originally opened as dapphub/dapp#85
Probably inside dapp---testnet-launch
the geth option --rpcapi
should also include personal
.
This is useful for interacting with the testnet (e.g. via Mist).
Issue by HackFisher
Thursday Nov 16, 2017 at 08:22 GMT
Originally opened as dapphub/dapp#65
Following code is in the solidity contract, where the "_data" is type of bytes.
receiver.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _amount, _data);
Fail when running "dapp test" with tests run this code.
/Users/user/github.com/dapphub/dapp/libexec/dapp/node_modules/bn.js/lib/bn.js:6
if (!val) throw new Error(msg || 'Assertion failed');
^
Error: Number can only safely store up to 53 bits
at assert (/Users/user/github.com/dapphub/dapp/libexec/dapp/node_modules/bn.js/lib/bn.js:6:21)
at BN.toNumber (/Users/user/github.com/dapphub/dapp/libexec/dapp/node_modules/bn.js/lib/bn.js:506:7)
at decodeSingle (/Users/user/github.com/dapphub/dapp/libexec/dapp/node_modules/ethereumjs-abi/lib/index.js:250:54)
at Function.ABI.rawDecode (/Users/user/github.com/dapphub/dapp/libexec/dapp/node_modules/ethereumjs-abi/lib/index.js:367:14)
at formatMethodCall (/Users/user/github.com/dapphub/dapp/libexec/dapp/dapp-quicktest:277:44)
at formatTrace (/Users/user/github.com/dapphub/dapp/libexec/dapp/dapp-quicktest:292:152)
at Array.forEach (<anonymous>)
at failedTest.results.forEach.x (/Users/user/github.com/dapphub/dapp/libexec/dapp/dapp-quicktest:214:43)
at Array.forEach (<anonymous>)
at printFailure (/Users/user/github.com/dapphub/dapp/libexec/dapp/dapp-quicktest:214:22)
make: *** [test] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.