I'm late to the deadline but it's also not in the scope of the contest, so there are just a few suggestions for the greater good:
The throw_unless(error::invalid_c5, cs.slice_refs() == 0); (L88) is redundant and can be safely removed (the while loop condition already guarantees that the slice is empty, thus has zero refs).
L99 can be replaced with ifnot (cs~load_int(1)) {.
These 3 simple optimizations (mainly the third one due to FunC compiler stop emitting CONT<{...}> EXECUTE pattern) allow to decrease gas usage for single external transfer from 5049 to 4647 gas units (by 8%).
I'm late to the deadline but it's also not in the scope of the contest, so there are just a few suggestions for the greater good:
throw_unless(error::invalid_c5, cs.slice_refs() == 0);
(L88) is redundant and can be safely removed (the while loop condition already guarantees that the slice is empty, thus has zero refs).ifnot (cs~load_int(1)) {
.These 3 simple optimizations (mainly the third one due to FunC compiler stop emitting
CONT<{...}> EXECUTE
pattern) allow to decrease gas usage for single external transfer from 5049 to 4647 gas units (by 8%).