Comments (5)
Alright, back in action. Did a full reinstall of dapp/solc/nix. Proxy tests are working now.
Experiencing some lockups with hevm
, seems to be in instances where the call stack depth gets quite large - but this is probably a whole other issue - refactoring code has helped so far.
Thanks!
from dapptools.
This proxy does the delegatecall passing not(0)
as the gas available, which is the whole wordsize and seems like a hack. If you replace that with sub(gas, 703)
the test will pass, as this is the actual gas available minus the delegatecall overhead.
I'm not sure what the defined behaviour is here without looking at the yellow paper. Does it work with geth / parity?
from dapptools.
Thanks for the quick response @rainbreak! Good find on the assembly code. I'll paste a few reference links below regarding the origination of this contract code.
I've updated the code with your suggested change. The OutOfGas error is no more, but erroneous behavior still occurs.
Here is a gist to try with dapp test.
Here is a similar gist that can easily be tested against geth, remix, parity, etc. (I've tested functionality on Rinkeby, a local geth node, remix JS vm, and ganache with no errors).
Running 2 tests for src/ProxyTest.t.sol:ProxyTest
PASS testFooMaster() (gas: 3061)
FAIL testFooProxy()
Failure: testFooProxy
"Error: Wrong `uint' value"
Expected: 42
Actual: ~1.57294584e75
src/ProxyTest.t.sol:ProxyTest
├╴constructor
├╴initialize test
│ ├╴create Foo (src/ProxyTest.t.sol:58)
│ └╴create Proxy (src/ProxyTest.t.sol:59)
└╴testFooProxy()
├╴call Proxy::[unknown method](0x037a417c) (src/ProxyTest.t.sol:68)
│ ├╴call Foo::testFunc()() (src/ProxyTest.t.sol:34)
│ │ └╴← uint256 0x
│ └╴← 0x037a417c00000000000000000000000000000000000000000000000000000000
├╴log_bytes32("Error: Wrong `uint' value") (lib/ds-test/src/test.sol:112)
├╴log_named_uint(" Expected", 42) (lib/ds-test/src/test.sol:113)
└╴log_named_uint(" Actual", 1572945844198690166654652573502116276175073521308400342885302740072649457664) (lib/ds-test/src/test.sol:114)
Thanks!
PS - Origination of this contract started around here.
Proxy code from Gnosis repo.
In depth article on the contract above.
from dapptools.
@cmditch running the gist you provided with dapp test
has both tests succeeding:
$ dapp test
+ dapp clean
+ rm -rf out
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --abi --bin --bin-runtime = -o out/ src/ProxyTest.t.sol
src/ProxyTest.t.sol:47:3: Warning: Function state mutability can be restricted to pure
function testFunc() public view returns(uint) {
^ (Relevant source part starts here and spans across multiple lines).
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast = src/ProxyTest.t.sol
src/ProxyTest.t.sol:47:3: Warning: Function state mutability can be restricted to pure
function testFunc() public view returns(uint) {
^ (Relevant source part starts here and spans across multiple lines).
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --abi --bin --bin-runtime = -o out/ src/ProxyTest.sol
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast = src/ProxyTest.sol
Running 2 tests for src/ProxyTest.t.sol:ProxyTest
PASS testFooMaster() (gas: 3061)
PASS testFooProxy() (gas: 5266)
Are you sure everything is OK with your set up and you are testing the same source code? What is your version of dapp
? I have:
$ dapp --version
dapp 0.9.0
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++
from dapptools.
@livnev how odd. Mine is the same (barring clang/g++):
λ dapp --version
dapp 0.9.0
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Darwin.clang
also
λ ls $(which hevm)
lrwxr-xr-x 1 root wheel 62B Dec 31 1969 /Users/cmditch/.nix-profile/bin/hevm -> /nix/store/m01yj3cva83r3vmh72lq3fh58zifsnzv-hevm-0.15/bin/hevm
Update 2 - My coworker was able to get a pass too. Looking to wipe my env, and start fresh.
Update 1 - created a fresh folder. dapp init
. added contract. dapp test
. same error. :\
λ dapp test
+ dapp clean
+ rm -rf out
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --abi --bin --bin-runtime = -o out/ src/ProxyTest.t.sol
src/ProxyTest.t.sol:51:5: Warning: Function state mutability can be restricted to pure
function testFunc() public view returns(uint) {
^ (Relevant source part starts here and spans across multiple lines).
+ solc --overwrite ds-test/=lib/ds-test/src/ ds-test=lib/ds-test/src/index.sol --combined-json=abi,bin,bin-runtime,srcmap,srcmap-runtime,ast = src/ProxyTest.t.sol
src/ProxyTest.t.sol:51:5: Warning: Function state mutability can be restricted to pure
function testFunc() public view returns(uint) {
^ (Relevant source part starts here and spans across multiple lines).
Running 2 tests for src/ProxyTest.t.sol:ProxyTest
PASS testFooMaster() (gas: 3061)
FAIL testFooProxy()
Failure: testFooProxy
"Error: Wrong `uint' value"
Expected: 42
Actual: ~1.57294584e75
src/ProxyTest.t.sol:ProxyTest
├╴constructor
├╴initialize test
│ ├╴create Foo (src/ProxyTest.t.sol:62)
│ └╴create Proxy (src/ProxyTest.t.sol:63)
└╴testFooProxy()
├╴call Proxy::[unknown method](0x037a417c) (src/ProxyTest.t.sol:72)
│ ├╴call Foo::testFunc()() (src/ProxyTest.t.sol:38)
│ │ └╴← uint256 0x
│ └╴← 0x037a417c00000000000000000000000000000000000000000000000000000000
├╴log_bytes32("Error: Wrong `uint' value") (lib/ds-test/src/test.sol:112)
├╴log_named_uint(" Expected", 42) (lib/ds-test/src/test.sol:113)
└╴log_named_uint(" Actual", 1572945844198690166654652573502116276175073521308400342885302740072649457664) (lib/ds-test/src/test.sol:114)
from dapptools.
Related Issues (20)
- Development of HEVM will continue? HOT 3
- License seems very ambiguous. HOT 1
- hevm VMFailure when following dapp tutorial symbolic execution HOT 5
- seth output error HOT 5
- Ledger -- ethsign: failed to sign tx HOT 1
- contract not found HOT 1
- hevm: XXXX: openBinaryFile: does not exist (No such file or directory)
- Octo-dapp
- error: Please run this script as a regular user when installing in an Image via Dockerfile
- stuck installing "EVM.FeeSchedule" on OSX at 100% CPU HOT 3
- Slow symbolic execution of the first example for `PrimalityCheck` HOT 1
- ethsign import error HOT 1
- Dapptools on Raspberry Pi 4
- Incorrect logs emitted when downcasting to `bytes2` or `bytes1` HOT 1
- Can not install dapp by nix on mac HOT 1
- Is it possible to deploy a bin file directly and easily with dapptools?
- Insufficient funds for gas * price + value HOT 4
- No support for aarch64 darwin via flakes
- Getting `Internal Error` For Different Commands When Trying To Execute Symbolic On Live Contracts
- Where can I report a security vulnerability? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapptools.