Closed magooster closed 6 years ago
110: var filling_id = sha256(token, denomination);
111: var ring_guid = m_filling[filling_id];
I am happy with these being var
as the compiler is making life a little easier.
The only uses of constant are:
pure
as the compiler complains about staticcall
, view
has slightly different semantics from constant
, would prefer pure
but can't.Uses of uint
are:
I'm not particularly concerned about the versions as there's no specific bugs where we need a compiler fix to work around them.
I thought a number of the functions in bn256g1.sol where using the constant modifier. I thought constant was reserved for state variables, and functions should use view instead (potentially can use pure if they don't read from state). constant should be an alias for view...
Ah, yup I missed all the functions in bn256g1.
They should all be pure
because they don't modify state.
However, solc
won't allow me to use pure
because I use staticcall
(and I use staticcall
rather than call
so I can use constant
or view
- but they really are pure functions)
Fixed in #47
As of solidity 0.4.17, the constant modifier for functions has been deprecated in favour of the pure or view modifiers. The contracts still contain a number of functions using the deprecated constant modifier.
Within some of the contracts I still see a mix of uint and uint256 being used (uint is an alias for uint256). IMHO best practice is to specify the size explicitly.
It might be worth fixing the version of solidity to ensure everyone is running the same tested bytecode. The current version pragma using the caret syntax allows for solidity versions >=0.4.18 <0.5.0.
In Mixer.sol the types of variables are not set explicitly (using var), lines 110,111,180.