Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure instead of constant in new abstract class for an existing deployed contract #3110

Closed
manosamy opened this issue Oct 19, 2017 · 2 comments

Comments

@manosamy
Copy link

An existing contract used solidity 0.4.4 and has a constant function that qualifies as pure based on current language standards.
If I build an abstract contract that will be used to access the previously deployed contract, should I specify it as public pure or just public view?

existing one deployed in mainnet before byzantium:
pragma solidity ^0.4.4;
function namehash(string name) public constant returns(bytes32) {
...
}

new abstract class to access that:
pragma solidity ^0.4.17;
function namehash(string name) public pure returns(bytes32);

Is that correct usage? Or, should I stick to public view?

@manosamy manosamy changed the title New abstract class for an existing deployed contract Pure instead of constant in new abstract class for an existing deployed contract Oct 19, 2017
@chriseth
Copy link
Contributor

@manosamy you can change the "pureness" - it has no effect on the bytecode, but you can also keep it as view. Whatever you do, if you use an interface and a derived contract, their pureness has to match.

@axic
Copy link
Member

axic commented Apr 17, 2018

The inheritance aspect of this is handled in #3729.

@axic axic closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants