question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Instrumentation appears to be breaking constants

See original GitHub issue

I have a library as follows

pragma solidity ^0.4.18;

import 'zeppelin-solidity/contracts/token/ERC20.sol';


library KeyUtils {
    address constant private KEY_ADDRESS = 0x0;

    function getKEY() internal pure returns (ERC20) {
        return ERC20(KEY_ADDRESS);
    }
}

and normal tests of this run fine.

But when I run with solidity-coverage I get this error

/Users/davesag/src/myawesomeproject/coverageEnv/contracts/utils/KeyUtils.sol:13:5: TypeError: Library cannot have non-constant state variables
    address private KEY_ADDRESS = 0x0;
    ^-------------------------------^
Compilation failed. See above.

Somehow the instrumentation process appears to have removed the constant keyword.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
cgeweckecommented, Nov 20, 2017

@davesag Thanks so much for reporting this and @area thank you for fixing. Please re-open there continue to be issues:

Published in 0.4.1

1reaction
cgeweckecommented, Nov 16, 2017

@area That’s looks great - does it work for the edge case elena raised here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Circuit Constants in Relation to Circuit Breaking - EEEGUIDE
It was noticed in practice a circuit breaker that would operate satisfactorily at one point on a system may not do so at...
Read more >
Chapter 8 - Flight Instruments - FAA
The reason for choosing the VSI as the instrument to break is that it is the least important static source instrument for flight....
Read more >
Double Instrumentation error on clover plugin - Stack Overflow
"Double instrumentation detected" means that your sources have been already instrumented by Clover and you're trying to instrument them once ...
Read more >
8 Common Reasons For Pressure Gauge Failure - WIKA Blog
Pressure gauge failure can be attributed to one or more of these eight reasons: mechanical vibration, pulsation, extreme temperature, ...
Read more >
LabVIEW Termination Characters - NI - National Instruments
When adding one of the termination character constants to a string, they appear to have the same result – a line break.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found