You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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
@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.
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?
The text was updated successfully, but these errors were encountered: