Skip to content

Conversation

@recmo
Copy link

@recmo recmo commented Oct 3, 2018

Continues from PR #7. I think the mint function has no further optimizations that are O(value), unless Solidity does some sub-optimal stack management.

There's another O(value) optimization possible with the trick in #6.

@recmo recmo force-pushed the optim/unroll-mint branch from 6a6dc99 to 3eef040 Compare October 3, 2018 20:47
makeChild();
assembly {
mstore(0, 0x756eb3f879cb30fe243b4dfee438691c043318585733ff6000526016600af300)
for {let i := shr(value, 5)} i {i := sub(i, 1)} {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shr requires Constantinople. It can be replaced by div(value, 32) for other EVM versions.

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

Successfully merging this pull request may close these issues.

1 participant