aragonOS
aragonOS copied to clipboard
encodeParam and encodeParams functions
Fixes #427
Adds the following functions:
-
encodeParam(Param param) internal pure returns (uint256)
-
encodeParams(Param[] params) internal pure returns (uint256[])
I didn't add the encodeParam(uint8 id, uint8 op, uint240 value)
function since I think encodeParam(Param param)
covers pretty much the same use cases and is easier to use.
TODO:
- [x] Sanity check gas usage (these changes shouldn't cause any gas increases)
Coverage increased (+0.008%) to 99.548% when pulling 7366642805d08f8431ddfecfb465dc1867644669 on leftab:dev into 37f8eff828bc64e92597caa614edb086e4aedd3f on aragon:dev.
Thanks for the review @sohkai ! I applied the changes but somehow the Travis tests seems to fail now. I'm a bit perplexed since everything looks fine when I run the tests locally.
@leftab Sorry for the hiatus on this—will get back to looking at this shortly :).
I think the CI broken when there was a ganache bug with account values or gas used; if you merge with master it should be fixed now :).
@sohkai @bingen Sorry guys for the delay, we've been quite busy working on our demo for Aracon and the end of the Drive app milestone. I should be able to post an update this week.
Currently looking into why one test is failing.
As for the gas usage sanity check, since the new functions are not used in aragonOS and are internal
, there should be no impact on gas usage.
@leftab Will check the compiled bytecode of the ACL
. I don't see why it would change with this change, but need to be sure (don't want it to accidentally change from our initial deployment).
@leftab I've pushed a commit to split ACLHelpers
from ACLSyntaxSugar
and clean up some formatting.
Unfortunately though, it looks like the changes do cause a bytecode difference against the old contracts :(. Going between this PR and dev
, there's a bit of difference at the very end of the deployed bytecode:
Will have to investigate further to see what's exactly causing this, but it does mean it's a bigger change than expected. As far as I can tell it happens immediately as the struct and enum are moved out, which is quite odd behaviour for the compiler.
@leftab Because this wasn't pulled into some of the minor aragonOS 4.x releases, due to the incompatible bytecode (and because we didn't want to risk re-deploying the ACL for 0.7), we'll roll this into aragonOS 5 :).
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.
:white_check_mark: leftab
:white_check_mark: sohkai
:white_check_mark: usetech-llc
:x: a33bcn
You have signed the CLA already but the status is still pending? Let us recheck it.