Skip to content

Commit

Permalink
Added array_sum yul
Browse files Browse the repository at this point in the history
  • Loading branch information
Julek committed Mar 30, 2024
1 parent 53993df commit 2ac080b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions array_sum.yul
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Optimized IR:
/// @use-src 1:"a.sol"
object "ArraySum_0" {
code {
}
/// @use-src 1:"a.sol"
object "ArraySum_0_deployed" {
code {
{
///
}
function ArraySum(x, i) -> y
{
y := 0
for {} 1 {i := sub(i, 1)} {
if eq(i, 0)
{
break
}
res := mload(x)
y := add(y, res)
x := add(x, 1)
}
}
}
data ".metadata" hex"a264697066735822122067106f228801aa898d329c27cddd7517e178492c852b664d920e4c3c137b297464736f6c63430008130033"
}
}

0 comments on commit 2ac080b

Please sign in to comment.