aragonOS icon indicating copy to clipboard operation
aragonOS copied to clipboard

encodeParam and encodeParams functions

Open leftab opened this issue 5 years ago • 10 comments

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)

leftab avatar Nov 09 '18 20:11 leftab

Coverage Status

Coverage increased (+0.008%) to 99.548% when pulling 7366642805d08f8431ddfecfb465dc1867644669 on leftab:dev into 37f8eff828bc64e92597caa614edb086e4aedd3f on aragon:dev.

coveralls avatar Nov 09 '18 20:11 coveralls

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 avatar Nov 20 '18 15:11 leftab

@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 avatar Jan 11 '19 08:01 sohkai

@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.

leftab avatar Jan 21 '19 02:01 leftab

Currently looking into why one test is failing.

leftab avatar Feb 04 '19 03:02 leftab

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 avatar Feb 15 '19 05:02 leftab

@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).

sohkai avatar Feb 15 '19 11:02 sohkai

@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:

screen shot 2019-03-07 at 7 51 25 pm

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.

sohkai avatar Mar 07 '19 18:03 sohkai

@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 :).

sohkai avatar May 18 '19 10:05 sohkai

CLA assistant check
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.

CLAassistant avatar Aug 08 '19 12:08 CLAassistant